nfets 0.0.114 → 0.0.115

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.
@@ -12,7 +12,7 @@ import{a as Iy,b as EV,c as wV,d as mI}from"../chunk-24AGSZQQ.mjs";import{a as u
12
12
  `,t};uD.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 o={type:a,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Jy.util.decode64(i[3])};if(e.push(o),!!i[2]){for(var l=i[2].split(s),c=0;i&&c<l.length;){for(var f=l[c].replace(/\s+$/,""),p=c+1;p<l.length;++p){var d=l[p];if(!/\s/.test(d[0]))break;f+=d,c=p}if(i=f.match(n),i){for(var g={name:i[1],values:[]},m=i[2].split(","),v=0;v<m.length;++v)g.values.push(I6(m[v]));if(o.procType)if(!o.contentDomain&&g.name==="Content-Domain")o.contentDomain=m[0]||"";else if(!o.dekInfo&&g.name==="DEK-Info"){if(g.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:m[0],parameters:m[1]||null}}else o.headers.push(g);else{if(g.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(g.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:m[0],type:m[1]}}}++c}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(e.length===0)throw new Error("Invalid PEM formatted message.");return e};function zy(r){for(var e=r.name+": ",t=[],n=u(function(l,c){return" "+c},"insertSpace"),s=0;s<r.values.length;++s)t.push(r.values[s].replace(/^(\S+\r\n)/,n));e+=t.join(",")+`\r
13
13
  `;for(var i=0,a=-1,s=0;s<e.length;++s,++i)if(i>65&&a!==-1){var o=e[a];o===","?(++a,e=e.substr(0,a)+`\r
14
14
  `+e.substr(a)):e=e.substr(0,a)+`\r
15
- `+o+e.substr(a+1),i=s-a-1,a=-1,++s}else(e[s]===" "||e[s]===" "||e[s]===",")&&(a=s);return e}u(zy,"foldHeader");function I6(r){return r.replace(/^\s+/,"")}u(I6,"ltrim")});var rd=ue((dee,fD)=>{"use strict";var wr=bt();jy();bA();jt();fD.exports=wr.des=wr.des||{};wr.des.startEncrypting=function(r,e,t,n){var s=Yy({key:r,output:t,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};wr.des.createEncryptionCipher=function(r,e){return Yy({key:r,output:null,decrypt:!1,mode:e})};wr.des.startDecrypting=function(r,e,t,n){var s=Yy({key:r,output:t,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};wr.des.createDecryptionCipher=function(r,e){return Yy({key:r,output:null,decrypt:!0,mode:e})};wr.des.Algorithm=function(r,e){var t=this;t.name=r,t.mode=new e({blockSize:8,cipher:{encrypt:u(function(n,s){return cD(t._keys,n,s,!1)},"encrypt"),decrypt:u(function(n,s){return cD(t._keys,n,s,!0)},"decrypt")}}),t._init=!1};wr.des.Algorithm.prototype.initialize=function(r){if(!this._init){var e=wr.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=V6(e),this._init=!0}};Ei("DES-ECB",wr.cipher.modes.ecb);Ei("DES-CBC",wr.cipher.modes.cbc);Ei("DES-CFB",wr.cipher.modes.cfb);Ei("DES-OFB",wr.cipher.modes.ofb);Ei("DES-CTR",wr.cipher.modes.ctr);Ei("3DES-ECB",wr.cipher.modes.ecb);Ei("3DES-CBC",wr.cipher.modes.cbc);Ei("3DES-CFB",wr.cipher.modes.cfb);Ei("3DES-OFB",wr.cipher.modes.ofb);Ei("3DES-CTR",wr.cipher.modes.ctr);function Ei(r,e){var t=u(function(){return new wr.des.Algorithm(r,e)},"factory");wr.cipher.registerAlgorithm(r,t)}u(Ei,"registerAlgorithm");var D6=[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],B6=[-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],R6=[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],O6=[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],_6=[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],P6=[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],k6=[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],L6=[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 V6(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],o=[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],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=r.length()>8?3:1,y=[],S=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,w,E=0;E<v;E++){var A=r.getInt32(),b=r.getInt32();w=(A>>>4^b)&252645135,b^=w,A^=w<<4,w=(b>>>-16^A)&65535,A^=w,b^=w<<-16,w=(A>>>2^b)&858993459,b^=w,A^=w<<2,w=(b>>>-16^A)&65535,A^=w,b^=w<<-16,w=(A>>>1^b)&1431655765,b^=w,A^=w<<1,w=(b>>>8^A)&16711935,A^=w,b^=w<<8,w=(A>>>1^b)&1431655765,b^=w,A^=w<<1,w=A<<8|b>>>20&240,A=b<<24|b<<8&16711680|b>>>8&65280|b>>>24&240,b=w;for(var V=0;V<S.length;++V){S[V]?(A=A<<2|A>>>26,b=b<<2|b>>>26):(A=A<<1|A>>>27,b=b<<1|b>>>27),A&=-15,b&=-15;var I=e[A>>>28]|t[A>>>24&15]|n[A>>>20&15]|s[A>>>16&15]|i[A>>>12&15]|a[A>>>8&15]|o[A>>>4&15],D=l[b>>>28]|c[b>>>24&15]|f[b>>>20&15]|p[b>>>16&15]|d[b>>>12&15]|g[b>>>8&15]|m[b>>>4&15];w=(D>>>16^I)&65535,y[C++]=I^w,y[C++]=D^w<<16}}return y}u(V6,"_createKeys");function cD(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,o=e[0],l=e[1];a=(o>>>4^l)&252645135,l^=a,o^=a<<4,a=(o>>>16^l)&65535,l^=a,o^=a<<16,a=(l>>>2^o)&858993459,o^=a,l^=a<<2,a=(l>>>8^o)&16711935,o^=a,l^=a<<8,a=(o>>>1^l)&1431655765,l^=a,o^=a<<1,o=o<<1|o>>>31,l=l<<1|l>>>31;for(var c=0;c<s;c+=3){for(var f=i[c+1],p=i[c+2],d=i[c];d!=f;d+=p){var g=l^r[d],m=(l>>>4|l<<28)^r[d+1];a=o,o=l,l=a^(B6[g>>>24&63]|O6[g>>>16&63]|P6[g>>>8&63]|L6[g&63]|D6[m>>>24&63]|R6[m>>>16&63]|_6[m>>>8&63]|k6[m&63])}a=o,o=l,l=a}o=o>>>1|o<<31,l=l>>>1|l<<31,a=(o>>>1^l)&1431655765,l^=a,o^=a<<1,a=(l>>>8^o)&16711935,o^=a,l^=a<<8,a=(l>>>2^o)&858993459,o^=a,l^=a<<2,a=(o>>>16^l)&65535,l^=a,o^=a<<16,a=(o>>>4^l)&252645135,l^=a,o^=a<<4,t[0]=o,t[1]=l}u(cD,"_updateBlock");function Yy(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="DES-"+e,n;r.decrypt?n=wr.cipher.createDecipher(t,r.key):n=wr.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var o=null;a instanceof wr.util.ByteBuffer&&(o=a,a={}),a=a||{},a.output=o,a.iv=i,s.call(n,a)},n}u(Yy,"_createCipher")});var Qy=ue((gee,hD)=>{"use strict";var _n=bt();gf();yi();jt();var F6=_n.pkcs5=_n.pkcs5||{},sa;_n.util.isNodejs&&!_n.options.usePureJavaScript&&(sa=st("crypto"));hD.exports=_n.pbkdf2=F6.pbkdf2=function(r,e,t,n,s,i){if(typeof s=="function"&&(i=s,s=null),_n.util.isNodejs&&!_n.options.usePureJavaScript&&sa.pbkdf2&&(s===null||typeof s!="object")&&(sa.pbkdf2Sync.length>4||!s||s==="sha1"))return typeof s!="string"&&(s="sha1"),r=Buffer.from(r,"binary"),e=Buffer.from(e,"binary"),i?sa.pbkdf2Sync.length===4?sa.pbkdf2(r,e,t,n,function(w,E){if(w)return i(w);i(null,E.toString("binary"))}):sa.pbkdf2(r,e,t,n,s,function(w,E){if(w)return i(w);i(null,E.toString("binary"))}):sa.pbkdf2Sync.length===4?sa.pbkdf2Sync(r,e,t,n).toString("binary"):sa.pbkdf2Sync(r,e,t,n,s).toString("binary");if((typeof s>"u"||s===null)&&(s="sha1"),typeof s=="string"){if(!(s in _n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=_n.md[s].create()}var a=s.digestLength;if(n>4294967295*a){var o=new Error("Derived key is too long.");if(i)return i(o);throw o}var l=Math.ceil(n/a),c=n-(l-1)*a,f=_n.hmac.create();f.start(s,r);var p="",d,g,m;if(!i){for(var v=1;v<=l;++v){f.start(null,null),f.update(e),f.update(_n.util.int32ToBytes(v)),d=m=f.digest().getBytes();for(var y=2;y<=t;++y)f.start(null,null),f.update(m),g=f.digest().getBytes(),d=_n.util.xorBytes(d,g,a),m=g;p+=v<l?d:d.substr(0,c)}return p}var v=1,y;function S(){if(v>l)return i(null,p);f.start(null,null),f.update(e),f.update(_n.util.int32ToBytes(v)),d=m=f.digest().getBytes(),y=2,C()}u(S,"outer");function C(){if(y<=t)return f.start(null,null),f.update(m),g=f.digest().getBytes(),d=_n.util.xorBytes(d,g,a),m=g,++y,_n.util.setImmediate(C);p+=v<l?d:d.substr(0,c),++v,S()}u(C,"inner"),S()}});var OA=ue((vee,yD)=>{"use strict";var wi=bt();yi();jt();var dD=yD.exports=wi.sha256=wi.sha256||{};wi.md.sha256=wi.md.algorithms.sha256=dD;dD.create=function(){mD||U6();var r=null,e=wi.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=wi.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=wi.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),pD(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=wi.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(RA.substr(0,n.blockLength-a));for(var o,l,c=n.fullMessageLength[0]*8,f=0;f<n.fullMessageLength.length-1;++f)o=n.fullMessageLength[f+1]*8,l=o/4294967296>>>0,c+=l,s.putInt32(c>>>0),c=o>>>0;s.putInt32(c);var p={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4,h5:r.h5,h6:r.h6,h7:r.h7};pD(p,t,s);var d=wi.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d.putInt32(p.h5),d.putInt32(p.h6),d.putInt32(p.h7),d},n};var RA=null,mD=!1,gD=null;function U6(){RA="\x80",RA+=wi.util.fillString("\0",64),gD=[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],mD=!0}u(U6,"_init");function pD(r,e,t){for(var n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C=t.length();C>=64;){for(c=0;c<16;++c)e[c]=t.getInt32();for(;c<64;++c)n=e[c-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,s=e[c-15],s=(s>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,e[c]=n+e[c-7]+s+e[c-16]|0;for(f=r.h0,p=r.h1,d=r.h2,g=r.h3,m=r.h4,v=r.h5,y=r.h6,S=r.h7,c=0;c<64;++c)a=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),o=y^m&(v^y),i=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),l=f&p|d&(f^p),n=S+a+o+gD[c]+e[c],s=i+l,S=y,y=v,v=m,m=g+n>>>0,g=d,d=p,p=f,f=n+s>>>0;r.h0=r.h0+f|0,r.h1=r.h1+p|0,r.h2=r.h2+d|0,r.h3=r.h3+g|0,r.h4=r.h4+m|0,r.h5=r.h5+v|0,r.h6=r.h6+y|0,r.h7=r.h7+S|0,C-=64}}u(pD,"_update")});var _A=ue((wee,vD)=>{"use strict";var Si=bt();jt();var Zy=null;Si.util.isNodejs&&!Si.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Zy=st("crypto"));var M6=vD.exports=Si.prng=Si.prng||{};M6.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(c,f){if(!f)return e.generateSync(c);var p=e.plugin.cipher,d=e.plugin.increment,g=e.plugin.formatKey,m=e.plugin.formatSeed,v=Si.util.createBuffer();e.key=null,y();function y(S){if(S)return f(S);if(v.length()>=c)return f(null,v.getBytes(c));if(e.generated>1048575&&(e.key=null),e.key===null)return Si.util.nextTick(function(){i(y)});var C=p(e.key,e.seed);e.generated+=C.length,v.putBytes(C),e.key=g(p(e.key,d(e.seed))),e.seed=m(p(e.key,e.seed)),Si.util.setImmediate(y)}u(y,"generate")},e.generateSync=function(c){var f=e.plugin.cipher,p=e.plugin.increment,d=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var m=Si.util.createBuffer();m.length()<c;){e.generated>1048575&&(e.key=null),e.key===null&&a();var v=f(e.key,e.seed);e.generated+=v.length,m.putBytes(v),e.key=d(f(e.key,p(e.seed))),e.seed=g(f(e.key,e.seed))}return m.getBytes(c)};function i(c){if(e.pools[0].messageLength>=32)return o(),c();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(p,d){if(p)return c(p);e.collect(d),o(),c()})}u(i,"_reseed");function a(){if(e.pools[0].messageLength>=32)return o();var c=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(c)),o()}u(a,"_reseedSync");function o(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var c=e.plugin.md.create();c.update(e.keyBytes);for(var f=1,p=0;p<32;++p)e.reseeds%f===0&&(c.update(e.pools[p].digest().getBytes()),e.pools[p].start()),f=f<<1;e.keyBytes=c.digest().getBytes(),c.start(),c.update(e.keyBytes);var d=c.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(d),e.generated=0}u(o,"_seed");function l(c){var f=null,p=Si.util.globalScope,d=p.crypto||p.msCrypto;d&&d.getRandomValues&&(f=u(function(A){return d.getRandomValues(A)},"getRandomValues"));var g=Si.util.createBuffer();if(f)for(;g.length()<c;){var m=Math.max(1,Math.min(c-g.length(),65536)/4),v=new Uint32Array(Math.floor(m));try{f(v);for(var y=0;y<v.length;++y)g.putInt32(v[y])}catch(A){if(!(typeof QuotaExceededError<"u"&&A instanceof QuotaExceededError))throw A}}if(g.length()<c)for(var S,C,w,E=Math.floor(Math.random()*65536);g.length()<c;){C=16807*(E&65535),S=16807*(E>>16),C+=(S&32767)<<16,C+=S>>15,C=(C&2147483647)+(C>>31),E=C&4294967295;for(var y=0;y<3;++y)w=E>>>(y<<3),w^=Math.floor(Math.random()*256),g.putByte(w&255)}return g.getBytes(c)}return u(l,"defaultSeedFile"),Zy?(e.seedFile=function(c,f){Zy.randomBytes(c,function(p,d){if(p)return f(p);f(null,d.toString())})},e.seedFileSync=function(c){return Zy.randomBytes(c).toString()}):(e.seedFile=function(c,f){try{f(null,l(c))}catch(p){f(p)}},e.seedFileSync=l),e.collect=function(c){for(var f=c.length,p=0;p<f;++p)e.pools[e.pool].update(c.substr(p,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(c,f){for(var p="",d=0;d<f;d+=8)p+=String.fromCharCode(c>>d&255);e.collect(p)},e.registerWorker=function(c){if(c===self)e.seedFile=function(p,d){function g(m){var v=m.data;v.forge&&v.forge.prng&&(self.removeEventListener("message",g),d(v.forge.prng.err,v.forge.prng.bytes))}u(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:p}}})};else{var f=u(function(p){var d=p.data;d.forge&&d.forge.prng&&e.seedFile(d.forge.prng.needed,function(g,m){c.postMessage({forge:{prng:{err:g,bytes:m}}})})},"listener");c.addEventListener("message",f)}},e}});var Es=ue((Aee,PA)=>{"use strict";var en=bt();oo();OA();_A();jt();(function(){if(en.random&&en.random.getBytes){PA.exports=en.random;return}(function(r){var e={},t=new Array(4),n=en.util.createBuffer();e.formatKey=function(p){var d=en.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),en.aes._expandKey(p,!1)},e.formatSeed=function(p){var d=en.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),p},e.cipher=function(p,d){return en.aes._updateBlock(p,d,t,!1),n.putInt32(t[0]),n.putInt32(t[1]),n.putInt32(t[2]),n.putInt32(t[3]),n.getBytes()},e.increment=function(p){return++p[3],p},e.md=en.md.sha256;function s(){var p=en.prng.create(e);return p.getBytes=function(d,g){return p.generate(d,g)},p.getBytesSync=function(d){return p.generate(d)},p}u(s,"spawnPrng");var i=s(),a=null,o=en.util.globalScope,l=o.crypto||o.msCrypto;if(l&&l.getRandomValues&&(a=u(function(p){return l.getRandomValues(p)},"getRandomValues")),en.options.usePureJavaScript||!en.util.isNodejs&&!a){if(typeof window>"u"||window.document,i.collectInt(+new Date,32),typeof navigator<"u"){var c="";for(var f in navigator)try{typeof navigator[f]=="string"&&(c+=navigator[f])}catch{}i.collect(c),c=null}r&&(r().mousemove(function(p){i.collectInt(p.clientX,16),i.collectInt(p.clientY,16)}),r().keypress(function(p){i.collectInt(p.charCode,8)}))}if(!en.random)en.random=i;else for(var f in i)en.random[f]=i[f];en.random.createInstance=s,PA.exports=en.random})(typeof jQuery<"u"?jQuery:null)})()});var LA=ue((xee,SD)=>{"use strict";var qn=bt();jt();var kA=[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],ED=[1,2,3,5],j6=u(function(r,e){return r<<e&65535|(r&65535)>>16-e},"rol"),q6=u(function(r,e){return(r&65535)>>e|r<<16-e&65535},"ror");SD.exports=qn.rc2=qn.rc2||{};qn.rc2.expandKey=function(r,e){typeof r=="string"&&(r=qn.util.createBuffer(r)),e=e||128;var t=r,n=r.length(),s=e,i=Math.ceil(s/8),a=255>>(s&7),o;for(o=n;o<128;o++)t.putByte(kA[t.at(o-1)+t.at(o-n)&255]);for(t.setAt(128-i,kA[t.at(128-i)&a]),o=127-i;o>=0;o--)t.setAt(o,kA[t.at(o+1)^t.at(o+i)]);return t};var wD=u(function(r,e,t){var n=!1,s=null,i=null,a=null,o,l,c,f,p=[];for(r=qn.rc2.expandKey(r,e),c=0;c<64;c++)p.push(r.getInt16Le());t?(o=u(function(m){for(c=0;c<4;c++)m[c]+=p[f]+(m[(c+3)%4]&m[(c+2)%4])+(~m[(c+3)%4]&m[(c+1)%4]),m[c]=j6(m[c],ED[c]),f++},"mixRound"),l=u(function(m){for(c=0;c<4;c++)m[c]+=p[m[(c+3)%4]&63]},"mashRound")):(o=u(function(m){for(c=3;c>=0;c--)m[c]=q6(m[c],ED[c]),m[c]-=p[f]+(m[(c+3)%4]&m[(c+2)%4])+(~m[(c+3)%4]&m[(c+1)%4]),f--},"mixRound"),l=u(function(m){for(c=3;c>=0;c--)m[c]-=p[m[(c+3)%4]&63]},"mashRound"));var d=u(function(m){var v=[];for(c=0;c<4;c++){var y=s.getInt16Le();a!==null&&(t?y^=a.getInt16Le():a.putInt16Le(y)),v.push(y&65535)}f=t?0:63;for(var S=0;S<m.length;S++)for(var C=0;C<m[S][0];C++)m[S][1](v);for(c=0;c<4;c++)a!==null&&(t?a.putInt16Le(v[c]):v[c]^=a.getInt16Le()),i.putInt16Le(v[c])},"runPlan"),g=null;return g={start:u(function(m,v){m&&typeof m=="string"&&(m=qn.util.createBuffer(m)),n=!1,s=qn.util.createBuffer(),i=v||new qn.util.createBuffer,a=m,g.output=i},"start"),update:u(function(m){for(n||s.putBuffer(m);s.length()>=8;)d([[5,o],[1,l],[6,o],[1,l],[5,o]])},"update"),finish:u(function(m){var v=!0;if(t)if(m)v=m(8,s,!t);else{var y=s.length()===8?8:8-s.length();s.fillWithByte(y,y)}if(v&&(n=!0,g.update()),!t&&(v=s.length()===0,v))if(m)v=m(8,i,!t);else{var S=i.length(),C=i.at(S-1);C>S?v=!1:i.truncate(C)}return v},"finish")},g},"createCipher");qn.rc2.startEncrypting=function(r,e,t){var n=qn.rc2.createEncryptionCipher(r,128);return n.start(e,t),n};qn.rc2.createEncryptionCipher=function(r,e){return wD(r,e,!0)};qn.rc2.startDecrypting=function(r,e,t){var n=qn.rc2.createDecryptionCipher(r,128);return n.start(e,t),n};qn.rc2.createDecryptionCipher=function(r,e){return wD(r,e,!1)}});var sd=ue((Nee,DD)=>{"use strict";var VA=bt();DD.exports=VA.jsbn=VA.jsbn||{};var ia,H6=0xdeadbeefcafe,AD=(H6&16777215)==15715070;function Ae(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))}u(Ae,"BigInteger");VA.jsbn.BigInteger=Ae;function kt(){return new Ae(null)}u(kt,"nbi");function K6(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}u(K6,"am1");function X6(r,e,t,n,s,i){for(var a=e&32767,o=e>>15;--i>=0;){var l=this.data[r]&32767,c=this.data[r++]>>15,f=o*l+c*a;l=a*l+((f&32767)<<15)+t.data[n]+(s&1073741823),s=(l>>>30)+(f>>>15)+o*c+(s>>>30),t.data[n++]=l&1073741823}return s}u(X6,"am2");function CD(r,e,t,n,s,i){for(var a=e&16383,o=e>>14;--i>=0;){var l=this.data[r]&16383,c=this.data[r++]>>14,f=o*l+c*a;l=a*l+((f&16383)<<14)+t.data[n]+s,s=(l>>28)+(f>>14)+o*c,t.data[n++]=l&268435455}return s}u(CD,"am3");typeof navigator>"u"?(Ae.prototype.am=CD,ia=28):AD&&navigator.appName=="Microsoft Internet Explorer"?(Ae.prototype.am=X6,ia=30):AD&&navigator.appName!="Netscape"?(Ae.prototype.am=K6,ia=26):(Ae.prototype.am=CD,ia=28);Ae.prototype.DB=ia;Ae.prototype.DM=(1<<ia)-1;Ae.prototype.DV=1<<ia;var FA=52;Ae.prototype.FV=Math.pow(2,FA);Ae.prototype.F1=FA-ia;Ae.prototype.F2=2*ia-FA;var G6="0123456789abcdefghijklmnopqrstuvwxyz",ev=new Array,vf,ws;vf=48;for(ws=0;ws<=9;++ws)ev[vf++]=ws;vf=97;for(ws=10;ws<36;++ws)ev[vf++]=ws;vf=65;for(ws=10;ws<36;++ws)ev[vf++]=ws;function xD(r){return G6.charAt(r)}u(xD,"int2char");function bD(r,e){var t=ev[r.charCodeAt(e)];return t??-1}u(bD,"intAt");function $6(r){for(var e=this.t-1;e>=0;--e)r.data[e]=this.data[e];r.t=this.t,r.s=this.s}u($6,"bnpCopyTo");function W6(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}u(W6,"bnpFromInt");function lo(r){var e=kt();return e.fromInt(r),e}u(lo,"nbv");function z6(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:bD(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&&Ae.ZERO.subTo(this,this)}u(z6,"bnpFromString");function J6(){for(var r=this.s&this.DM;this.t>0&&this.data[this.t-1]==r;)--this.t}u(J6,"bnpClamp");function Y6(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,o=this.DB-a*this.DB%e;if(a-- >0)for(o<this.DB&&(n=this.data[a]>>o)>0&&(s=!0,i=xD(n));a>=0;)o<e?(n=(this.data[a]&(1<<o)-1)<<e-o,n|=this.data[--a]>>(o+=this.DB-e)):(n=this.data[a]>>(o-=e)&t,o<=0&&(o+=this.DB,--a)),n>0&&(s=!0),s&&(i+=xD(n));return s?i:"0"}u(Y6,"bnToString");function Q6(){var r=kt();return Ae.ZERO.subTo(this,r),r}u(Q6,"bnNegate");function Z6(){return this.s<0?this.negate():this}u(Z6,"bnAbs");function eF(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}u(eF,"bnCompareTo");function tv(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}u(tv,"nbits");function tF(){return this.t<=0?0:this.DB*(this.t-1)+tv(this.data[this.t-1]^this.s&this.DM)}u(tF,"bnBitLength");function rF(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}u(rF,"bnpDLShiftTo");function nF(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}u(nF,"bnpDRShiftTo");function sF(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,o;for(o=this.t-1;o>=0;--o)e.data[o+i+1]=this.data[o]>>n|a,a=(this.data[o]&s)<<t;for(o=i-1;o>=0;--o)e.data[o]=0;e.data[i]=a,e.t=this.t+i+1,e.s=this.s,e.clamp()}u(sF,"bnpLShiftTo");function iF(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()}u(iF,"bnpRShiftTo");function aF(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()}u(aF,"bnpSubTo");function oF(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&&Ae.ZERO.subTo(e,e)}u(oF,"bnpMultiplyTo");function uF(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()}u(uF,"bnpSquareTo");function lF(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=kt());var i=kt(),a=this.s,o=r.s,l=this.DB-tv(n.data[n.t-1]);l>0?(n.lShiftTo(l,i),s.lShiftTo(l,t)):(n.copyTo(i),s.copyTo(t));var c=i.t,f=i.data[c-1];if(f!=0){var p=f*(1<<this.F1)+(c>1?i.data[c-2]>>this.F2:0),d=this.FV/p,g=(1<<this.F1)/p,m=1<<this.F2,v=t.t,y=v-c,S=e??kt();for(i.dlShiftTo(y,S),t.compareTo(S)>=0&&(t.data[t.t++]=1,t.subTo(S,t)),Ae.ONE.dlShiftTo(c,S),S.subTo(i,i);i.t<c;)i.data[i.t++]=0;for(;--y>=0;){var C=t.data[--v]==f?this.DM:Math.floor(t.data[v]*d+(t.data[v-1]+m)*g);if((t.data[v]+=i.am(0,C,t,y,0,c))<C)for(i.dlShiftTo(y,S),t.subTo(S,t);t.data[v]<--C;)t.subTo(S,t)}e!=null&&(t.drShiftTo(c,e),a!=o&&Ae.ZERO.subTo(e,e)),t.t=c,t.clamp(),l>0&&t.rShiftTo(l,t),a<0&&Ae.ZERO.subTo(t,t)}}}u(lF,"bnpDivRemTo");function cF(r){var e=kt();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(Ae.ZERO)>0&&r.subTo(e,e),e}u(cF,"bnMod");function Ju(r){this.m=r}u(Ju,"Classic");function fF(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}u(fF,"cConvert");function hF(r){return r}u(hF,"cRevert");function pF(r){r.divRemTo(this.m,null,r)}u(pF,"cReduce");function dF(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(dF,"cMulTo");function mF(r,e){r.squareTo(e),this.reduce(e)}u(mF,"cSqrTo");Ju.prototype.convert=fF;Ju.prototype.revert=hF;Ju.prototype.reduce=pF;Ju.prototype.mulTo=dF;Ju.prototype.sqrTo=mF;function gF(){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}u(gF,"bnpInvDigit");function Yu(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}u(Yu,"Montgomery");function yF(r){var e=kt();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(Ae.ZERO)>0&&this.m.subTo(e,e),e}u(yF,"montConvert");function vF(r){var e=kt();return r.copyTo(e),this.reduce(e),e}u(vF,"montRevert");function EF(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)}u(EF,"montReduce");function wF(r,e){r.squareTo(e),this.reduce(e)}u(wF,"montSqrTo");function SF(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(SF,"montMulTo");Yu.prototype.convert=yF;Yu.prototype.revert=vF;Yu.prototype.reduce=EF;Yu.prototype.mulTo=SF;Yu.prototype.sqrTo=wF;function AF(){return(this.t>0?this.data[0]&1:this.s)==0}u(AF,"bnpIsEven");function CF(r,e){if(r>4294967295||r<1)return Ae.ONE;var t=kt(),n=kt(),s=e.convert(this),i=tv(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)}u(CF,"bnpExp");function xF(r,e){var t;return r<256||e.isEven()?t=new Ju(e):t=new Yu(e),this.exp(r,t)}u(xF,"bnModPowInt");Ae.prototype.copyTo=$6;Ae.prototype.fromInt=W6;Ae.prototype.fromString=z6;Ae.prototype.clamp=J6;Ae.prototype.dlShiftTo=rF;Ae.prototype.drShiftTo=nF;Ae.prototype.lShiftTo=sF;Ae.prototype.rShiftTo=iF;Ae.prototype.subTo=aF;Ae.prototype.multiplyTo=oF;Ae.prototype.squareTo=uF;Ae.prototype.divRemTo=lF;Ae.prototype.invDigit=gF;Ae.prototype.isEven=AF;Ae.prototype.exp=CF;Ae.prototype.toString=Y6;Ae.prototype.negate=Q6;Ae.prototype.abs=Z6;Ae.prototype.compareTo=eF;Ae.prototype.bitLength=tF;Ae.prototype.mod=cF;Ae.prototype.modPowInt=xF;Ae.ZERO=lo(0);Ae.ONE=lo(1);function bF(){var r=kt();return this.copyTo(r),r}u(bF,"bnClone");function NF(){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]}u(NF,"bnIntValue");function TF(){return this.t==0?this.s:this.data[0]<<24>>24}u(TF,"bnByteValue");function IF(){return this.t==0?this.s:this.data[0]<<16>>16}u(IF,"bnShortValue");function DF(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}u(DF,"bnpChunkSize");function BF(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}u(BF,"bnSigNum");function RF(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=lo(t),s=kt(),i=kt(),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}u(RF,"bnpToRadix");function OF(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,o=0;o<r.length;++o){var l=bD(r,o);if(l<0){r.charAt(o)=="-"&&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&&Ae.ZERO.subTo(this,this)}u(OF,"bnpFromRadix");function _F(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(Ae.ONE.shiftLeft(r-1),UA,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(Ae.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)}}u(_F,"bnpFromNumber");function PF(){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}u(PF,"bnToByteArray");function kF(r){return this.compareTo(r)==0}u(kF,"bnEquals");function LF(r){return this.compareTo(r)<0?this:r}u(LF,"bnMin");function VF(r){return this.compareTo(r)>0?this:r}u(VF,"bnMax");function FF(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()}u(FF,"bnpBitwiseTo");function UF(r,e){return r&e}u(UF,"op_and");function MF(r){var e=kt();return this.bitwiseTo(r,UF,e),e}u(MF,"bnAnd");function UA(r,e){return r|e}u(UA,"op_or");function jF(r){var e=kt();return this.bitwiseTo(r,UA,e),e}u(jF,"bnOr");function ND(r,e){return r^e}u(ND,"op_xor");function qF(r){var e=kt();return this.bitwiseTo(r,ND,e),e}u(qF,"bnXor");function TD(r,e){return r&~e}u(TD,"op_andnot");function HF(r){var e=kt();return this.bitwiseTo(r,TD,e),e}u(HF,"bnAndNot");function KF(){for(var r=kt(),e=0;e<this.t;++e)r.data[e]=this.DM&~this.data[e];return r.t=this.t,r.s=~this.s,r}u(KF,"bnNot");function XF(r){var e=kt();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}u(XF,"bnShiftLeft");function GF(r){var e=kt();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}u(GF,"bnShiftRight");function $F(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}u($F,"lbit");function WF(){for(var r=0;r<this.t;++r)if(this.data[r]!=0)return r*this.DB+$F(this.data[r]);return this.s<0?this.t*this.DB:-1}u(WF,"bnGetLowestSetBit");function zF(r){for(var e=0;r!=0;)r&=r-1,++e;return e}u(zF,"cbit");function JF(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=zF(this.data[t]^e);return r}u(JF,"bnBitCount");function YF(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<r%this.DB)!=0}u(YF,"bnTestBit");function QF(r,e){var t=Ae.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}u(QF,"bnpChangeBit");function ZF(r){return this.changeBit(r,UA)}u(ZF,"bnSetBit");function eU(r){return this.changeBit(r,TD)}u(eU,"bnClearBit");function tU(r){return this.changeBit(r,ND)}u(tU,"bnFlipBit");function rU(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()}u(rU,"bnpAddTo");function nU(r){var e=kt();return this.addTo(r,e),e}u(nU,"bnAdd");function sU(r){var e=kt();return this.subTo(r,e),e}u(sU,"bnSubtract");function iU(r){var e=kt();return this.multiplyTo(r,e),e}u(iU,"bnMultiply");function aU(){var r=kt();return this.squareTo(r),r}u(aU,"bnSquare");function oU(r){var e=kt();return this.divRemTo(r,e,null),e}u(oU,"bnDivide");function uU(r){var e=kt();return this.divRemTo(r,null,e),e}u(uU,"bnRemainder");function lU(r){var e=kt(),t=kt();return this.divRemTo(r,e,t),new Array(e,t)}u(lU,"bnDivideAndRemainder");function cU(r){this.data[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}u(cU,"bnpDMultiply");function fU(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]}}u(fU,"bnpDAddOffset");function nd(){}u(nd,"NullExp");function ID(r){return r}u(ID,"nNop");function hU(r,e,t){r.multiplyTo(e,t)}u(hU,"nMulTo");function pU(r,e){r.squareTo(e)}u(pU,"nSqrTo");nd.prototype.convert=ID;nd.prototype.revert=ID;nd.prototype.mulTo=hU;nd.prototype.sqrTo=pU;function dU(r){return this.exp(r,new nd)}u(dU,"bnPow");function mU(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()}u(mU,"bnpMultiplyLowerTo");function gU(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)}u(gU,"bnpMultiplyUpperTo");function Ef(r){this.r2=kt(),this.q3=kt(),Ae.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}u(Ef,"Barrett");function yU(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=kt();return r.copyTo(e),this.reduce(e),e}u(yU,"barrettConvert");function vU(r){return r}u(vU,"barrettRevert");function EU(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)}u(EU,"barrettReduce");function wU(r,e){r.squareTo(e),this.reduce(e)}u(wU,"barrettSqrTo");function SU(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(SU,"barrettMulTo");Ef.prototype.convert=yU;Ef.prototype.revert=vU;Ef.prototype.reduce=EU;Ef.prototype.mulTo=SU;Ef.prototype.sqrTo=wU;function AU(r,e){var t=r.bitLength(),n,s=lo(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 Ju(e):e.isEven()?i=new Ef(e):i=new Yu(e);var a=new Array,o=3,l=n-1,c=(1<<n)-1;if(a[1]=i.convert(this),n>1){var f=kt();for(i.sqrTo(a[1],f);o<=c;)a[o]=kt(),i.mulTo(f,a[o-2],a[o]),o+=2}var p=r.t-1,d,g=!0,m=kt(),v;for(t=tv(r.data[p])-1;p>=0;){for(t>=l?d=r.data[p]>>t-l&c:(d=(r.data[p]&(1<<t+1)-1)<<l-t,p>0&&(d|=r.data[p-1]>>this.DB+t-l)),o=n;(d&1)==0;)d>>=1,--o;if((t-=o)<0&&(t+=this.DB,--p),g)a[d].copyTo(s),g=!1;else{for(;o>1;)i.sqrTo(s,m),i.sqrTo(m,s),o-=2;o>0?i.sqrTo(s,m):(v=s,s=m,m=v),i.mulTo(m,a[d],s)}for(;p>=0&&(r.data[p]&1<<t)==0;)i.sqrTo(s,m),v=s,s=m,m=v,--t<0&&(t=this.DB-1,--p)}return i.revert(s)}u(AU,"bnModPow");function CU(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}u(CU,"bnGCD");function xU(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}u(xU,"bnpModInt");function bU(r){if(this.signum()==0)return Ae.ZERO;var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return Ae.ZERO;for(var t=r.clone(),n=this.clone(),s=lo(1),i=lo(0),a=lo(0),o=lo(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()||!o.isEven())&&(a.addTo(this,a),o.subTo(r,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(r,o),o.rShiftTo(1,o);t.compareTo(n)>=0?(t.subTo(n,t),e&&s.subTo(a,s),i.subTo(o,i)):(n.subTo(t,n),e&&a.subTo(s,a),o.subTo(i,o))}if(n.compareTo(Ae.ONE)!=0)return Ae.ZERO;if(o.compareTo(r)>=0)return o.subtract(r);if(o.signum()<0)o.addTo(r,o);else return o;return o.signum()<0?o.add(r):o}u(bU,"bnModInverse");var Ys=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],NU=(1<<26)/Ys[Ys.length-1];function TU(r){var e,t=this.abs();if(t.t==1&&t.data[0]<=Ys[Ys.length-1]){for(e=0;e<Ys.length;++e)if(t.data[0]==Ys[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<Ys.length;){for(var n=Ys[e],s=e+1;s<Ys.length&&n<NU;)n*=Ys[s++];for(n=t.modInt(n);e<s;)if(n%Ys[e++]==0)return!1}return t.millerRabin(r)}u(TU,"bnIsProbablePrime");function IU(r){var e=this.subtract(Ae.ONE),t=e.getLowestSetBit();if(t<=0)return!1;for(var n=e.shiftRight(t),s=DU(),i,a=0;a<r;++a){do i=new Ae(this.bitLength(),s);while(i.compareTo(Ae.ONE)<=0||i.compareTo(e)>=0);var o=i.modPow(n,this);if(o.compareTo(Ae.ONE)!=0&&o.compareTo(e)!=0){for(var l=1;l++<t&&o.compareTo(e)!=0;)if(o=o.modPowInt(2,this),o.compareTo(Ae.ONE)==0)return!1;if(o.compareTo(e)!=0)return!1}}return!0}u(IU,"bnpMillerRabin");function DU(){return{nextBytes:u(function(r){for(var e=0;e<r.length;++e)r[e]=Math.floor(Math.random()*256)},"nextBytes")}}u(DU,"bnGetPrng");Ae.prototype.chunkSize=DF;Ae.prototype.toRadix=RF;Ae.prototype.fromRadix=OF;Ae.prototype.fromNumber=_F;Ae.prototype.bitwiseTo=FF;Ae.prototype.changeBit=QF;Ae.prototype.addTo=rU;Ae.prototype.dMultiply=cU;Ae.prototype.dAddOffset=fU;Ae.prototype.multiplyLowerTo=mU;Ae.prototype.multiplyUpperTo=gU;Ae.prototype.modInt=xU;Ae.prototype.millerRabin=IU;Ae.prototype.clone=bF;Ae.prototype.intValue=NF;Ae.prototype.byteValue=TF;Ae.prototype.shortValue=IF;Ae.prototype.signum=BF;Ae.prototype.toByteArray=PF;Ae.prototype.equals=kF;Ae.prototype.min=LF;Ae.prototype.max=VF;Ae.prototype.and=MF;Ae.prototype.or=jF;Ae.prototype.xor=qF;Ae.prototype.andNot=HF;Ae.prototype.not=KF;Ae.prototype.shiftLeft=XF;Ae.prototype.shiftRight=GF;Ae.prototype.getLowestSetBit=WF;Ae.prototype.bitCount=JF;Ae.prototype.testBit=YF;Ae.prototype.setBit=ZF;Ae.prototype.clearBit=eU;Ae.prototype.flipBit=tU;Ae.prototype.add=nU;Ae.prototype.subtract=sU;Ae.prototype.multiply=iU;Ae.prototype.divide=oU;Ae.prototype.remainder=uU;Ae.prototype.divideAndRemainder=lU;Ae.prototype.modPow=AU;Ae.prototype.modInverse=bU;Ae.prototype.pow=dU;Ae.prototype.gcd=CU;Ae.prototype.isProbablePrime=TU;Ae.prototype.square=aU});var wf=ue((Iee,_D)=>{"use strict";var Ai=bt();yi();jt();var RD=_D.exports=Ai.sha1=Ai.sha1||{};Ai.md.sha1=Ai.md.algorithms.sha1=RD;RD.create=function(){OD||BU();var r=null,e=Ai.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=Ai.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=Ai.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),BD(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=Ai.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(MA.substr(0,n.blockLength-a));for(var o,l,c=n.fullMessageLength[0]*8,f=0;f<n.fullMessageLength.length-1;++f)o=n.fullMessageLength[f+1]*8,l=o/4294967296>>>0,c+=l,s.putInt32(c>>>0),c=o>>>0;s.putInt32(c);var p={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4};BD(p,t,s);var d=Ai.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d},n};var MA=null,OD=!1;function BU(){MA="\x80",MA+=Ai.util.fillString("\0",64),OD=!0}u(BU,"_init");function BD(r,e,t){for(var n,s,i,a,o,l,c,f,p=t.length();p>=64;){for(s=r.h0,i=r.h1,a=r.h2,o=r.h3,l=r.h4,f=0;f<16;++f)n=t.getInt32(),e[f]=n,c=o^i&(a^o),n=(s<<5|s>>>27)+c+l+1518500249+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,c=o^i&(a^o),n=(s<<5|s>>>27)+c+l+1518500249+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+1859775393+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+1859775393+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i&a|o&(i^a),n=(s<<5|s>>>27)+c+l+2400959708+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+3395469782+n,l=o,o=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+o|0,r.h4=r.h4+l|0,p-=64}}u(BD,"_update")});var jA=ue((Bee,kD)=>{"use strict";var Ci=bt();jt();Es();wf();var PD=kD.exports=Ci.pkcs1=Ci.pkcs1||{};PD.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=Ci.md.sha1.create(),a||(a=i);var o=Math.ceil(r.n.bitLength()/8),l=o-2*i.digestLength-2;if(e.length>l){var c=new Error("RSAES-OAEP input message length is too long.");throw c.length=e.length,c.maxLength=l,c}n||(n=""),i.update(n,"raw");for(var f=i.digest(),p="",d=l-e.length,g=0;g<d;g++)p+="\0";var m=f.getBytes()+p+""+e;if(!s)s=Ci.random.getBytes(i.digestLength);else if(s.length!==i.digestLength){var c=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw c.seedLength=s.length,c.digestLength=i.digestLength,c}var v=rv(s,o-i.digestLength-1,a),y=Ci.util.xorBytes(m,v,m.length),S=rv(y,i.digestLength,a),C=Ci.util.xorBytes(s,S,s.length);return"\0"+C+y};PD.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 y=new Error("RSAES-OAEP encoded message length is invalid.");throw y.length=e.length,y.expectedLength=a,y}if(s===void 0?s=Ci.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 o=s.digest().getBytes(),l=e.charAt(0),c=e.substring(1,s.digestLength+1),f=e.substring(1+s.digestLength),p=rv(f,s.digestLength,i),d=Ci.util.xorBytes(c,p,c.length),g=rv(d,a-s.digestLength-1,i),m=Ci.util.xorBytes(f,g,f.length),v=m.substring(0,s.digestLength),y=l!=="\0",S=0;S<s.digestLength;++S)y|=o.charAt(S)!==v.charAt(S);for(var C=1,w=s.digestLength,E=s.digestLength;E<m.length;E++){var A=m.charCodeAt(E),b=A&1^1,V=C?65534:0;y|=A&V,C=C&b,w+=C}if(y||m.charCodeAt(w)!==1)throw new Error("Invalid RSAES-OAEP padding.");return m.substring(w+1)};function rv(r,e,t){t||(t=Ci.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)}u(rv,"rsa_mgf1")});var HA=ue((Oee,qA)=>{"use strict";var co=bt();jt();sd();Es();(function(){if(co.prime){qA.exports=co.prime;return}var r=qA.exports=co.prime=co.prime||{},e=co.jsbn.BigInteger,t=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var s=u(function(p,d){return p|d},"op_or");r.generateProbablePrime=function(p,d,g){typeof d=="function"&&(g=d,d={}),d=d||{};var m=d.algorithm||"PRIMEINC";typeof m=="string"&&(m={name:m}),m.options=m.options||{};var v=d.prng||co.random,y={nextBytes:u(function(S){for(var C=v.getBytesSync(S.length),w=0;w<S.length;++w)S[w]=C.charCodeAt(w)},"nextBytes")};if(m.name==="PRIMEINC")return i(p,y,m.options,g);throw new Error("Invalid prime generation algorithm: "+m.name)};function i(p,d,g,m){return"workers"in g?l(p,d,g,m):a(p,d,g,m)}u(i,"primeincFindPrime");function a(p,d,g,m){var v=c(p,d),y=0,S=f(v.bitLength());"millerRabinTests"in g&&(S=g.millerRabinTests);var C=10;"maxBlockTime"in g&&(C=g.maxBlockTime),o(v,p,d,y,S,C,m)}u(a,"primeincFindPrimeWithoutWorkers");function o(p,d,g,m,v,y,S){var C=+new Date;do{if(p.bitLength()>d&&(p=c(d,g)),p.isProbablePrime(v))return S(null,p);p.dAddOffset(t[m++%8],0)}while(y<0||+new Date-C<y);co.util.setImmediate(function(){o(p,d,g,m,v,y,S)})}u(o,"_primeinc");function l(p,d,g,m){if(typeof Worker>"u")return a(p,d,g,m);var v=c(p,d),y=g.workers,S=g.workLoad||100,C=S*30/8,w=g.workerScript||"forge/prime.worker.js";if(y===-1)return co.util.estimateCores(function(A,b){A&&(b=2),y=b-1,E()});E();function E(){y=Math.max(1,y);for(var A=[],b=0;b<y;++b)A[b]=new Worker(w);for(var V=y,b=0;b<y;++b)A[b].addEventListener("message",D);var I=!1;function D(U){if(!I){--V;var F=U.data;if(F.found){for(var M=0;M<A.length;++M)A[M].terminate();return I=!0,m(null,new e(F.prime,16))}v.bitLength()>p&&(v=c(p,d));var se=v.toString(16);U.target.postMessage({hex:se,workLoad:S}),v.dAddOffset(C,0)}}u(D,"workerMessage")}u(E,"generate")}u(l,"primeincFindPrimeWithWorkers");function c(p,d){var g=new e(p,d),m=p-1;return g.testBit(m)||g.bitwiseTo(e.ONE.shiftLeft(m),s,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}u(c,"generateRandom");function f(p){return p<=100?27:p<=150?18:p<=200?15:p<=250?12:p<=300?9:p<=350?8:p<=400?7:p<=500?6:p<=600?5:p<=800?4:p<=1250?3:2}u(f,"getMillerRabinTests")})()});var id=ue((Pee,qD)=>{"use strict";var tt=bt();Js();sd();uo();jA();HA();Es();jt();typeof Lt>"u"&&(Lt=tt.jsbn.BigInteger);var Lt,KA=tt.util.isNodejs?st("crypto"):null,ae=tt.asn1,Ss=tt.util;tt.pki=tt.pki||{};qD.exports=tt.pki.rsa=tt.rsa=tt.rsa||{};var mt=tt.pki,RU=[6,4,2,4,2,4,6,2],OU={name:"PrivateKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},_U={name:"RSAPrivateKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},PU={name:"RSAPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},kU=tt.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},LU={name:"DigestInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:ae.Class.UNIVERSAL,type:ae.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},VU=u(function(r){var e;if(r.algorithm in mt.oids)e=mt.oids[r.algorithm];else{var t=new Error("Unknown message digest algorithm.");throw t.algorithm=r.algorithm,t}var n=ae.oidToDer(e).getBytes(),s=ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[]),i=ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[]);i.value.push(ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,n)),i.value.push(ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,""));var a=ae.create(ae.Class.UNIVERSAL,ae.Type.OCTETSTRING,!1,r.digest().getBytes());return s.value.push(i),s.value.push(a),ae.toDer(s).getBytes()},"emsaPkcs1v15encode"),MD=u(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(Lt.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Lt.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Lt(tt.util.bytesToHex(tt.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Lt.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");mt.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=jD(r,e,t)):(s=tt.util.createBuffer(),s.putBytes(r));for(var a=new Lt(s.toHex(),16),o=MD(a,e,n),l=o.toString(16),c=tt.util.createBuffer(),f=i-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(tt.util.hexToBytes(l)),c.getBytes()};mt.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 Lt(tt.util.createBuffer(r).toHex(),16);if(a.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=MD(a,e,t),l=o.toString(16),c=tt.util.createBuffer(),f=s-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(tt.util.hexToBytes(l)),n!==!1?nv(c.getBytes(),e,t):c.getBytes()};mt.rsa.createKeyPairGenerationState=function(r,e,t){typeof r=="string"&&(r=parseInt(r,10)),r=r||2048,t=t||{};var n=t.prng||tt.random,s={nextBytes:u(function(o){for(var l=n.getBytesSync(o.length),c=0;c<o.length;++c)o[c]=l.charCodeAt(c)},"nextBytes")},i=t.algorithm||"PRIMEINC",a;if(i==="PRIMEINC")a={algorithm:i,state:0,bits:r,rng:s,eInt:e||65537,e:new Lt(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};mt.rsa.stepKeyPairGenerationState=function(r,e){"algorithm"in r||(r.algorithm="PRIMEINC");var t=new Lt(null);t.fromInt(30);for(var n=0,s=u(function(p,d){return p|d},"op_or"),i=+new Date,a,o=0;r.keys===null&&(e<=0||o<e);){if(r.state===0){var l=r.p===null?r.pBits:r.qBits,c=l-1;r.pqState===0?(r.num=new Lt(l,r.rng),r.num.testBit(c)||r.num.bitwiseTo(Lt.ONE.shiftLeft(c),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(UU(r.num.bitLength()))?++r.pqState:r.num.dAddOffset(RU[n++%8],0):r.pqState===2?r.pqState=r.num.subtract(Lt.ONE).gcd(r.e).compareTo(Lt.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(Lt.ONE),r.q1=r.q.subtract(Lt.ONE),r.phi=r.p1.multiply(r.q1),++r.state;else if(r.state===3)r.phi.gcd(r.e).compareTo(Lt.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 f=r.e.modInverse(r.phi);r.keys={privateKey:mt.rsa.setPrivateKey(r.n,r.e,f,r.p,r.q,f.mod(r.p1),f.mod(r.q1),r.q.modInverse(r.p)),publicKey:mt.rsa.setPublicKey(r.n,r.e)}}a=+new Date,o+=a-i,i=a}return r.keys!==null};mt.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),!tt.options.usePureJavaScript&&!t.prng&&r>=256&&r<=16384&&(e===65537||e===3)){if(n){if(LD("generateKeyPair"))return KA.generateKeyPair("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,l,c){if(o)return n(o);n(null,{privateKey:mt.privateKeyFromPem(c),publicKey:mt.publicKeyFromPem(l)})});if(VD("generateKey")&&VD("exportKey"))return Ss.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:UD(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return Ss.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){n(o)}).then(function(o){if(o){var l=mt.privateKeyFromAsn1(ae.fromDer(tt.util.createBuffer(o)));n(null,{privateKey:l,publicKey:mt.setRsaPublicKey(l.n,l.e)})}});if(FD("generateKey")&&FD("exportKey")){var s=Ss.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:UD(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);s.oncomplete=function(o){var l=o.target.result,c=Ss.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);c.oncomplete=function(f){var p=f.target.result,d=mt.privateKeyFromAsn1(ae.fromDer(tt.util.createBuffer(p)));n(null,{privateKey:d,publicKey:mt.setRsaPublicKey(d.n,d.e)})},c.onerror=function(f){n(f)}},s.onerror=function(o){n(o)};return}}else if(LD("generateKeyPairSync")){var i=KA.generateKeyPairSync("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:mt.privateKeyFromPem(i.privateKey),publicKey:mt.publicKeyFromPem(i.publicKey)}}}var a=mt.rsa.createKeyPairGenerationState(r,e,t);if(!n)return mt.rsa.stepKeyPairGenerationState(a,0),a.keys;FU(a,t,n)};mt.setRsaPublicKey=mt.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:u(function(o,l,c){return jD(o,l,2).getBytes()},"encode")};else if(s==="RSA-OAEP"||s==="RSAES-OAEP")s={encode:u(function(o,l){return tt.pkcs1.encode_rsa_oaep(l,o,i)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(s)!==-1)s={encode:u(function(o){return o},"encode")};else if(typeof s=="string")throw new Error('Unsupported encryption scheme: "'+s+'".');var a=s.encode(n,t,!0);return mt.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,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),"_skipPaddingChecks"in a||(a._skipPaddingChecks=!1),i==="RSASSA-PKCS1-V1_5"?i={verify:u(function(l,c){c=nv(c,t,!0,void 0,a);var f=ae.fromDer(c,{parseAllBytes:a._parseAllDigestBytes}),p={},d=[];if(!ae.validate(f,LU,p,d)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=d,g}var m=ae.derToOid(p.algorithmIdentifier);if(!(m===tt.oids.md2||m===tt.oids.md5||m===tt.oids.sha1||m===tt.oids.sha224||m===tt.oids.sha256||m===tt.oids.sha384||m===tt.oids.sha512||m===tt.oids["sha512-224"]||m===tt.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=m,g}if((m===tt.oids.md2||m===tt.oids.md5)&&!("parameters"in p))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return l===p.digest},"verify")}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:u(function(l,c){return c=nv(c,t,!0,void 0,a),l===c},"verify")});var o=mt.rsa.decrypt(s,t,!0,!1);return i.verify(n,o,t.n.bitLength())},t};mt.setRsaPrivateKey=mt.rsa.setPrivateKey=function(r,e,t,n,s,i,a,o){var l={n:r,e,d:t,p:n,q:s,dP:i,dQ:a,qInv:o};return l.decrypt=function(c,f,p){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var d=mt.rsa.decrypt(c,l,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:nv};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:u(function(g,m){return tt.pkcs1.decode_rsa_oaep(m,g,p)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:u(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(d,l,!1)},l.sign=function(c,f){var p=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:VU},p=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:u(function(){return c},"encode")},p=1);var d=f.encode(c,l.n.bitLength());return mt.rsa.encrypt(d,l,p)},l};mt.wrapRsaPrivateKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,ae.integerToDer(0).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,ae.oidToDer(mt.oids.rsaEncryption).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,"")]),ae.create(ae.Class.UNIVERSAL,ae.Type.OCTETSTRING,!1,ae.toDer(r).getBytes())])};mt.privateKeyFromAsn1=function(r){var e={},t=[];if(ae.validate(r,OU,e,t)&&(r=ae.fromDer(tt.util.createBuffer(e.privateKey))),e={},t=[],!ae.validate(r,_U,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,o,l,c,f,p;return s=tt.util.createBuffer(e.privateKeyModulus).toHex(),i=tt.util.createBuffer(e.privateKeyPublicExponent).toHex(),a=tt.util.createBuffer(e.privateKeyPrivateExponent).toHex(),o=tt.util.createBuffer(e.privateKeyPrime1).toHex(),l=tt.util.createBuffer(e.privateKeyPrime2).toHex(),c=tt.util.createBuffer(e.privateKeyExponent1).toHex(),f=tt.util.createBuffer(e.privateKeyExponent2).toHex(),p=tt.util.createBuffer(e.privateKeyCoefficient).toHex(),mt.setRsaPrivateKey(new Lt(s,16),new Lt(i,16),new Lt(a,16),new Lt(o,16),new Lt(l,16),new Lt(c,16),new Lt(f,16),new Lt(p,16))};mt.privateKeyToAsn1=mt.privateKeyToRSAPrivateKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,ae.integerToDer(0).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.n)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.e)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.d)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.p)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.q)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.dP)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.dQ)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.qInv))])};mt.publicKeyFromAsn1=function(r){var e={},t=[];if(ae.validate(r,kU,e,t)){var n=ae.derToOid(e.publicKeyOid);if(n!==mt.oids.rsaEncryption){var s=new Error("Cannot read public key. Unknown OID.");throw s.oid=n,s}r=e.rsaPublicKey}if(t=[],!ae.validate(r,PU,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=tt.util.createBuffer(e.publicKeyModulus).toHex(),a=tt.util.createBuffer(e.publicKeyExponent).toHex();return mt.setRsaPublicKey(new Lt(i,16),new Lt(a,16))};mt.publicKeyToAsn1=mt.publicKeyToSubjectPublicKeyInfo=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,ae.oidToDer(mt.oids.rsaEncryption).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,"")]),ae.create(ae.Class.UNIVERSAL,ae.Type.BITSTRING,!1,[mt.publicKeyToRSAPublicKey(r)])])};mt.publicKeyToRSAPublicKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.n)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.e))])};function jD(r,e,t){var n=tt.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,o;if(t===0||t===1){o=t===0?0:255;for(var l=0;l<a;++l)n.putByte(o)}else for(;a>0;){for(var c=0,f=tt.random.getBytes(a),l=0;l<a;++l)o=f.charCodeAt(l),o===0?++c:n.putByte(o);a=c}return n.putByte(0),n.putBytes(r),n}u(jD,"_encodePkcs1_v1_5");function nv(r,e,t,n,s){var i=Math.ceil(e.n.bitLength()/8),a=tt.util.createBuffer(r),o=a.getByte(),l=a.getByte();if(o!==0||t&&l!==0&&l!==1||!t&&l!==2||t&&l===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var c=0;if(l===0){c=i-3-n;for(var f=0;f<c;++f)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(l===1){for(c=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++c}if(c<8&&!(s&&s._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(l===2){for(c=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++c}if(c<8&&!(s&&s._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var p=a.getByte();if(p!==0||c!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}u(nv,"_decodePkcs1_v1_5");function FU(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(o,l){if(o)return t(o);if(r.p=l,r.q!==null)return a(o,r.q);i(r.qBits,a)})}u(s,"generate");function i(o,l){tt.prime.generateProbablePrime(o,n,l)}u(i,"getPrime");function a(o,l){if(o)return t(o);if(r.q=l,r.p.compareTo(r.q)<0){var c=r.p;r.p=r.q,r.q=c}if(r.p.subtract(Lt.ONE).gcd(r.e).compareTo(Lt.ONE)!==0){r.p=null,s();return}if(r.q.subtract(Lt.ONE).gcd(r.e).compareTo(Lt.ONE)!==0){r.q=null,i(r.qBits,a);return}if(r.p1=r.p.subtract(Lt.ONE),r.q1=r.q.subtract(Lt.ONE),r.phi=r.p1.multiply(r.q1),r.phi.gcd(r.e).compareTo(Lt.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 f=r.e.modInverse(r.phi);r.keys={privateKey:mt.rsa.setPrivateKey(r.n,r.e,f,r.p,r.q,f.mod(r.p1),f.mod(r.q1),r.q.modInverse(r.p)),publicKey:mt.rsa.setPublicKey(r.n,r.e)},t(null,r.keys)}u(a,"finish")}u(FU,"_generateKeyPair");function xi(r){var e=r.toString(16);e[0]>="8"&&(e="00"+e);var t=tt.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}u(xi,"_bnToBytes");function UU(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}u(UU,"_getMillerRabinTests");function LD(r){return tt.util.isNodejs&&typeof KA[r]=="function"}u(LD,"_detectNodeCrypto");function VD(r){return typeof Ss.globalScope<"u"&&typeof Ss.globalScope.crypto=="object"&&typeof Ss.globalScope.crypto.subtle=="object"&&typeof Ss.globalScope.crypto.subtle[r]=="function"}u(VD,"_detectSubtleCrypto");function FD(r){return typeof Ss.globalScope<"u"&&typeof Ss.globalScope.msCrypto=="object"&&typeof Ss.globalScope.msCrypto.subtle=="object"&&typeof Ss.globalScope.msCrypto.subtle[r]=="function"}u(FD,"_detectSubtleMsCrypto");function UD(r){for(var e=tt.util.hexToBytes(r.toString(16)),t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}u(UD,"_intToUint8Array")});var XA=ue((Lee,$D)=>{"use strict";var Ke=bt();oo();Js();rd();yi();uo();Qy();zu();Es();LA();id();jt();typeof HD>"u"&&(HD=Ke.jsbn.BigInteger);var HD,de=Ke.asn1,St=Ke.pki=Ke.pki||{};$D.exports=St.pbe=Ke.pbe=Ke.pbe||{};var Qu=St.oids,MU={name:"EncryptedPrivateKeyInfo",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},jU={name:"PBES2Algorithms",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},qU={name:"pkcs-12PbeParams",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,capture:"iterations"}]};St.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=Ke.random.getBytesSync(t.saltSize),s=t.count,i=de.integerToDer(s),a,o,l;if(t.algorithm.indexOf("aes")===0||t.algorithm==="des"){var c,f,p;switch(t.algorithm){case"aes128":a=16,c=16,f=Qu["aes128-CBC"],p=Ke.aes.createEncryptionCipher;break;case"aes192":a=24,c=16,f=Qu["aes192-CBC"],p=Ke.aes.createEncryptionCipher;break;case"aes256":a=32,c=16,f=Qu["aes256-CBC"],p=Ke.aes.createEncryptionCipher;break;case"des":a=8,c=8,f=Qu.desCBC,p=Ke.des.createEncryptionCipher;break;default:var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=t.algorithm,d}var g="hmacWith"+t.prfAlgorithm.toUpperCase(),m=GD(g),v=Ke.pkcs5.pbkdf2(e,n,s,a,m),y=Ke.random.getBytesSync(c),S=p(v);S.start(y),S.update(de.toDer(r)),S.finish(),l=S.output.getBytes();var C=HU(n,i,a,g);o=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu.pkcs5PBES2).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu.pkcs5PBKDF2).getBytes()),C]),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(f).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,y)])])])}else if(t.algorithm==="3des"){a=24;var w=new Ke.util.ByteBuffer(n),v=St.pbe.generatePkcs12Key(e,w,1,s,a),y=St.pbe.generatePkcs12Key(e,w,2,s,a),S=Ke.des.createEncryptionCipher(v);S.start(y),S.update(de.toDer(r)),S.finish(),l=S.output.getBytes(),o=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,n),de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,i.getBytes())])])}else{var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=t.algorithm,d}var E=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[o,de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,l)]);return E};St.decryptPrivateKeyInfo=function(r,e){var t=null,n={},s=[];if(!de.validate(r,MU,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=de.derToOid(n.encryptionOid),o=St.pbe.getCipher(a,n.encryptionParams,e),l=Ke.util.createBuffer(n.encryptedData);return o.update(l),o.finish()&&(t=de.fromDer(o.output)),t};St.encryptedPrivateKeyToPem=function(r,e){var t={type:"ENCRYPTED PRIVATE KEY",body:de.toDer(r).getBytes()};return Ke.pem.encode(t,{maxline:e})};St.encryptedPrivateKeyFromPem=function(r){var e=Ke.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 de.fromDer(e.body)};St.encryptRsaPrivateKey=function(r,e,t){if(t=t||{},!t.legacy){var n=St.wrapRsaPrivateKey(St.privateKeyToAsn1(r));return n=St.encryptPrivateKeyInfo(n,e,t),St.encryptedPrivateKeyToPem(n)}var s,i,a,o;switch(t.algorithm){case"aes128":s="AES-128-CBC",a=16,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",a=24,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",a=32,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",a=24,i=Ke.random.getBytesSync(8),o=Ke.des.createEncryptionCipher;break;case"des":s="DES-CBC",a=8,i=Ke.random.getBytesSync(8),o=Ke.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 c=Ke.pbe.opensslDeriveBytes(e,i.substr(0,8),a),f=o(c);f.start(i),f.update(de.toDer(St.privateKeyToAsn1(r))),f.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:Ke.util.bytesToHex(i).toUpperCase()},body:f.output.getBytes()};return Ke.pem.encode(p)};St.decryptRsaPrivateKey=function(r,e){var t=null,n=Ke.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=Ke.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=Ke.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=Ke.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=Ke.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=Ke.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,40)},"cipherFn");break;case"RC2-64-CBC":i=8,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,64)},"cipherFn");break;case"RC2-128-CBC":i=16,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,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 o=Ke.util.hexToBytes(n.dekInfo.parameters),l=Ke.pbe.opensslDeriveBytes(e,o.substr(0,8),i),c=a(l);if(c.start(o),c.update(Ke.util.createBuffer(n.body)),c.finish())t=c.output.getBytes();else return t}else t=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?t=St.decryptPrivateKeyInfo(de.fromDer(t),e):t=de.fromDer(t),t!==null&&(t=St.privateKeyFromAsn1(t)),t};St.pbe.generatePkcs12Key=function(r,e,t,n,s,i){var a,o;if(typeof i>"u"||i===null){if(!("sha1"in Ke.md))throw new Error('"sha1" hash algorithm unavailable.');i=Ke.md.sha1.create()}var l=i.digestLength,c=i.blockLength,f=new Ke.util.ByteBuffer,p=new Ke.util.ByteBuffer;if(r!=null){for(o=0;o<r.length;o++)p.putInt16(r.charCodeAt(o));p.putInt16(0)}var d=p.length(),g=e.length(),m=new Ke.util.ByteBuffer;m.fillWithByte(t,c);var v=c*Math.ceil(g/c),y=new Ke.util.ByteBuffer;for(o=0;o<v;o++)y.putByte(e.at(o%g));var S=c*Math.ceil(d/c),C=new Ke.util.ByteBuffer;for(o=0;o<S;o++)C.putByte(p.at(o%d));var w=y;w.putBuffer(C);for(var E=Math.ceil(s/l),A=1;A<=E;A++){var b=new Ke.util.ByteBuffer;b.putBytes(m.bytes()),b.putBytes(w.bytes());for(var V=0;V<n;V++)i.start(),i.update(b.getBytes()),b=i.digest();var I=new Ke.util.ByteBuffer;for(o=0;o<c;o++)I.putByte(b.at(o%l));var D=Math.ceil(g/c)+Math.ceil(d/c),U=new Ke.util.ByteBuffer;for(a=0;a<D;a++){var F=new Ke.util.ByteBuffer(w.getBytes(c)),M=511;for(o=I.length()-1;o>=0;o--)M=M>>8,M+=I.at(o)+F.at(o),F.setAt(o,M&255);U.putBuffer(F)}w=U,f.putBuffer(b)}return f.truncate(f.length()-s),f};St.pbe.getCipher=function(r,e,t){switch(r){case St.oids.pkcs5PBES2:return St.pbe.getCipherForPBES2(r,e,t);case St.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case St.oids["pbewithSHAAnd40BitRC2-CBC"]:return St.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}};St.pbe.getCipherForPBES2=function(r,e,t){var n={},s=[];if(!de.validate(e,jU,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=de.derToOid(n.kdfOid),r!==St.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=de.derToOid(n.encOid),r!==St.oids["aes128-CBC"]&&r!==St.oids["aes192-CBC"]&&r!==St.oids["aes256-CBC"]&&r!==St.oids["des-EDE3-CBC"]&&r!==St.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,o=Ke.util.createBuffer(n.kdfIterationCount);o=o.getInt(o.length()<<3);var l,c;switch(St.oids[r]){case"aes128-CBC":l=16,c=Ke.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,c=Ke.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,c=Ke.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,c=Ke.des.createDecryptionCipher;break;case"desCBC":l=8,c=Ke.des.createDecryptionCipher;break}var f=XD(n.prfOid),p=Ke.pkcs5.pbkdf2(t,a,o,l,f),d=n.encIv,g=c(p);return g.start(d),g};St.pbe.getCipherForPKCS12PBE=function(r,e,t){var n={},s=[];if(!de.validate(e,qU,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=Ke.util.createBuffer(n.salt),o=Ke.util.createBuffer(n.iterations);o=o.getInt(o.length()<<3);var l,c,f;switch(r){case St.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,c=8,f=Ke.des.startDecrypting;break;case St.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,c=8,f=u(function(v,y){var S=Ke.rc2.createDecryptionCipher(v,40);return S.start(y,null),S},"cipherFn");break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=r,i}var p=XD(n.prfOid),d=St.pbe.generatePkcs12Key(t,a,1,o,l,p);p.start();var g=St.pbe.generatePkcs12Key(t,a,2,o,c,p);return f(d,g)};St.pbe.opensslDeriveBytes=function(r,e,t,n){if(typeof n>"u"||n===null){if(!("md5"in Ke.md))throw new Error('"md5" hash algorithm unavailable.');n=Ke.md.md5.create()}e===null&&(e="");for(var s=[KD(n,r+e)],i=16,a=1;i<t;++a,i+=16)s.push(KD(n,s[a-1]+r+e));return s.join("").substr(0,t)};function KD(r,e){return r.start().update(e).digest().getBytes()}u(KD,"hash");function XD(r){var e;if(!r)e="hmacWithSHA1";else if(e=St.oids[de.derToOid(r)],!e){var t=new Error("Unsupported PRF OID.");throw t.oid=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}return GD(e)}u(XD,"prfOidToMessageDigest");function GD(r){var e=Ke.md;switch(r){case"hmacWithSHA224":e=Ke.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()}u(GD,"prfAlgorithmToMessageDigest");function HU(r,e,t,n){var s=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,r),de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&s.value.push(de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,Ke.util.hexToBytes(t.toString(16))),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(St.oids[n]).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.NULL,!1,"")])),s}u(HU,"createPbkdf2Params")});var GA=ue((Fee,JD)=>{"use strict";var Sf=bt();Js();jt();var Me=Sf.asn1,Af=JD.exports=Sf.pkcs7asn1=Sf.pkcs7asn1||{};Sf.pkcs7=Sf.pkcs7||{};Sf.pkcs7.asn1=Af;var WD={name:"ContentInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Af.contentInfoValidator=WD;var zD={name:"EncryptedContentInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Af.envelopedDataValidator={name:"EnvelopedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(zD)};Af.encryptedDataValidator={name:"EncryptedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"}].concat(zD)};var KU={name:"SignerInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:Me.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Af.signedDataValidator={name:"SignedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},WD,{name:"SignedData.Certificates",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:Me.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,capture:"signerInfos",optional:!0,value:[KU]}]};Af.recipientInfoValidator={name:"RecipientInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var $A=ue((Uee,YD)=>{"use strict";var Zu=bt();jt();Zu.mgf=Zu.mgf||{};var XU=YD.exports=Zu.mgf.mgf1=Zu.mgf1=Zu.mgf1||{};XU.create=function(r){var e={generate:u(function(t,n){for(var s=new Zu.util.ByteBuffer,i=Math.ceil(n/r.digestLength),a=0;a<i;a++){var o=new Zu.util.ByteBuffer;o.putInt32(a),r.start(),r.update(t+o.getBytes()),s.putBuffer(r.digest())}return s.truncate(s.length()-n),s.getBytes()},"generate")};return e}});var ZD=ue((jee,QD)=>{"use strict";var sv=bt();$A();QD.exports=sv.mgf=sv.mgf||{};sv.mgf.mgf1=sv.mgf1});var iv=ue((qee,eB)=>{"use strict";var el=bt();Es();jt();var GU=eB.exports=el.pss=el.pss||{};GU.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=el.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||el.random,o={};return o.encode=function(l,c){var f,p=c-1,d=Math.ceil(p/8),g=l.digest().getBytes();if(d<n+i+2)throw new Error("Message is too long to encrypt.");var m;s===null?m=a.getBytesSync(i):m=s.bytes();var v=new el.util.ByteBuffer;v.fillWithByte(0,8),v.putBytes(g),v.putBytes(m),e.start(),e.update(v.getBytes());var y=e.digest().getBytes(),S=new el.util.ByteBuffer;S.fillWithByte(0,d-i-n-2),S.putByte(1),S.putBytes(m);var C=S.getBytes(),w=d-n-1,E=t.generate(y,w),A="";for(f=0;f<w;f++)A+=String.fromCharCode(C.charCodeAt(f)^E.charCodeAt(f));var b=65280>>8*d-p&255;return A=String.fromCharCode(A.charCodeAt(0)&~b)+A.substr(1),A+y+"\xBC"},o.verify=function(l,c,f){var p,d=f-1,g=Math.ceil(d/8);if(c=c.substr(-g),g<n+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(c.charCodeAt(g-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var m=g-n-1,v=c.substr(0,m),y=c.substr(m,n),S=65280>>8*g-d&255;if((v.charCodeAt(0)&S)!==0)throw new Error("Bits beyond keysize not zero as expected.");var C=t.generate(y,m),w="";for(p=0;p<m;p++)w+=String.fromCharCode(v.charCodeAt(p)^C.charCodeAt(p));w=String.fromCharCode(w.charCodeAt(0)&~S)+w.substr(1);var E=g-n-i-2;for(p=0;p<E;p++)if(w.charCodeAt(p)!==0)throw new Error("Leftmost octets not zero as expected");if(w.charCodeAt(E)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var A=w.substr(-i),b=new el.util.ByteBuffer;b.fillWithByte(0,8),b.putBytes(l),b.putBytes(A),e.start(),e.update(b.getBytes());var V=e.digest().getBytes();return y===V},o}});var uv=ue((Hee,iB)=>{"use strict";var rt=bt();oo();Js();rd();yi();ZD();uo();zu();iv();id();jt();var _=rt.asn1,ke=iB.exports=rt.pki=rt.pki||{},Vt=ke.oids,Dr={};Dr.CN=Vt.commonName;Dr.commonName="CN";Dr.C=Vt.countryName;Dr.countryName="C";Dr.L=Vt.localityName;Dr.localityName="L";Dr.ST=Vt.stateOrProvinceName;Dr.stateOrProvinceName="ST";Dr.O=Vt.organizationName;Dr.organizationName="O";Dr.OU=Vt.organizationalUnitName;Dr.organizationalUnitName="OU";Dr.E=Vt.emailAddress;Dr.emailAddress="E";var rB=rt.pki.rsa.publicKeyValidator,$U={name:"Certificate",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:_.Class.UNIVERSAL,type:_.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:_.Class.UNIVERSAL,type:_.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:_.Class.UNIVERSAL,type:_.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:_.Class.UNIVERSAL,type:_.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},rB,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:_.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:_.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:_.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},WU={name:"rsapss",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:_.Class.UNIVERSAL,type:_.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:_.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:_.Class.UNIVERSAL,type:_.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:_.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:_.Class.UNIVERSAL,type:_.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:_.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:_.Class.UNIVERSAL,type:_.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},zU={name:"CertificationRequestInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},rB,{name:"CertificationRequestInfo.attributes",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:_.Class.UNIVERSAL,type:_.Type.SET,constructed:!0}]}]}]},JU={name:"CertificationRequest",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[zU,{name:"CertificationRequest.signatureAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};ke.RDNAttributesAsArray=function(r,e){for(var t=[],n,s,i,a=0;a<r.value.length;++a){n=r.value[a];for(var o=0;o<n.value.length;++o)i={},s=n.value[o],i.type=_.derToOid(s.value[0].value),i.value=s.value[1].value,i.valueTagClass=s.value[1].type,i.type in Vt&&(i.name=Vt[i.type],i.name in Dr&&(i.shortName=Dr[i.name])),e&&(e.update(i.type),e.update(i.value)),t.push(i)}return t};ke.CRIAttributesAsArray=function(r){for(var e=[],t=0;t<r.length;++t)for(var n=r[t],s=_.derToOid(n.value[0].value),i=n.value[1].value,a=0;a<i.length;++a){var o={};if(o.type=s,o.value=i[a].value,o.valueTagClass=i[a].type,o.type in Vt&&(o.name=Vt[o.type],o.name in Dr&&(o.shortName=Dr[o.name])),o.type===Vt.extensionRequest){o.extensions=[];for(var l=0;l<o.value.length;++l)o.extensions.push(ke.certificateExtensionFromAsn1(o.value[l]))}e.push(o)}return e};function fo(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}u(fo,"_getAttribute");var av=u(function(r,e,t){var n={};if(r!==Vt["RSASSA-PSS"])return n;t&&(n={hash:{algorithmOid:Vt.sha1},mgf:{algorithmOid:Vt.mgf1,hash:{algorithmOid:Vt.sha1}},saltLength:20});var s={},i=[];if(!_.validate(e,WU,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=_.derToOid(s.hashOid)),s.maskGenOid!==void 0&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=_.derToOid(s.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=_.derToOid(s.maskGenHashOid)),s.saltLength!==void 0&&(n.saltLength=s.saltLength.charCodeAt(0)),n},"_readSignatureParameters"),ov=u(function(r){switch(Vt[r.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return rt.md.sha1.create();case"md5WithRSAEncryption":return rt.md.md5.create();case"sha256WithRSAEncryption":return rt.md.sha256.create();case"sha384WithRSAEncryption":return rt.md.sha384.create();case"sha512WithRSAEncryption":return rt.md.sha512.create();case"RSASSA-PSS":return rt.md.sha256.create();default:var e=new Error("Could not compute "+r.type+" digest. Unknown signature OID.");throw e.signatureOid=r.signatureOid,e}},"_createSignatureDigest"),nB=u(function(r){var e=r.certificate,t;switch(e.signatureOid){case Vt.sha1WithRSAEncryption:case Vt.sha1WithRSASignature:break;case Vt["RSASSA-PSS"]:var n,s;if(n=Vt[e.signatureParameters.mgf.hash.algorithmOid],n===void 0||rt.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=Vt[e.signatureParameters.mgf.algorithmOid],s===void 0||rt.mgf[s]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=e.signatureParameters.mgf.algorithmOid,i.name=s,i}if(s=rt.mgf[s].create(rt.md[n].create()),n=Vt[e.signatureParameters.hash.algorithmOid],n===void 0||rt.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=rt.pss.create(rt.md[n].create(),s,e.signatureParameters.saltLength);break}return e.publicKey.verify(r.md.digest().getBytes(),r.signature,t)},"_verifySignature");ke.certificateFromPem=function(r,e,t){var n=rt.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=_.fromDer(n.body,t);return ke.certificateFromAsn1(i,e)};ke.certificateToPem=function(r,e){var t={type:"CERTIFICATE",body:_.toDer(ke.certificateToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.publicKeyFromPem=function(r){var e=rt.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=_.fromDer(e.body);return ke.publicKeyFromAsn1(n)};ke.publicKeyToPem=function(r,e){var t={type:"PUBLIC KEY",body:_.toDer(ke.publicKeyToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.publicKeyToRSAPublicKeyPem=function(r,e){var t={type:"RSA PUBLIC KEY",body:_.toDer(ke.publicKeyToRSAPublicKey(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||rt.md.sha1.create(),n=e.type||"RSAPublicKey",s;switch(n){case"RSAPublicKey":s=_.toDer(ke.publicKeyToRSAPublicKey(r)).getBytes();break;case"SubjectPublicKeyInfo":s=_.toDer(ke.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};ke.certificationRequestFromPem=function(r,e,t){var n=rt.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=_.fromDer(n.body,t);return ke.certificationRequestFromAsn1(i,e)};ke.certificationRequestToPem=function(r,e){var t={type:"CERTIFICATE REQUEST",body:_.toDer(ke.certificationRequestToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.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 fo(r.issuer,e)},r.issuer.addField=function(e){As([e]),r.issuer.attributes.push(e)},r.issuer.attributes=[],r.issuer.hash=null,r.subject={},r.subject.getField=function(e){return fo(r.subject,e)},r.subject.addField=function(e){As([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){As(e),r.subject.attributes=e,delete r.subject.uniqueId,t&&(r.subject.uniqueId=t),r.subject.hash=null},r.setIssuer=function(e,t){As(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)sB(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||rt.md.sha1.create();var n=Vt[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=ke.getTBSCertificate(r);var i=_.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=ov({signatureOid:e.signatureOid,type:"certificate"});var o=e.tbsCertificate||ke.getTBSCertificate(e),l=_.toDer(o);a.update(l.getBytes())}return a!==null&&(t=nB({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,o=0;t&&o<n.attributes.length;++o)i=n.attributes[o],a=s.attributes[o],(i.type!==a.type||i.value!==a.value)&&(t=!1)}return t},r.issued=function(e){return e.isIssuer(r)},r.generateSubjectKeyIdentifier=function(){return ke.getPublicKeyFingerprint(r.publicKey,{type:"RSAPublicKey"})},r.verifySubjectKeyIdentifier=function(){for(var e=Vt.subjectKeyIdentifier,t=0;t<r.extensions.length;++t){var n=r.extensions[t];if(n.id===e){var s=r.generateSubjectKeyIdentifier().getBytes();return rt.util.hexToBytes(n.subjectKeyIdentifier)===s}}return!1},r};ke.certificateFromAsn1=function(r,e){var t={},n=[];if(!_.validate(r,$U,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=_.derToOid(t.publicKeyOid);if(i!==ke.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=ke.createCertificate();a.version=t.certVersion?t.certVersion.charCodeAt(0):0;var o=rt.util.createBuffer(t.certSerialNumber);a.serialNumber=o.toHex(),a.signatureOid=rt.asn1.derToOid(t.certSignatureOid),a.signatureParameters=av(a.signatureOid,t.certSignatureParams,!0),a.siginfo.algorithmOid=rt.asn1.derToOid(t.certinfoSignatureOid),a.siginfo.parameters=av(a.siginfo.algorithmOid,t.certinfoSignatureParams,!1),a.signature=t.certSignature;var l=[];if(t.certValidity1UTCTime!==void 0&&l.push(_.utcTimeToDate(t.certValidity1UTCTime)),t.certValidity2GeneralizedTime!==void 0&&l.push(_.generalizedTimeToDate(t.certValidity2GeneralizedTime)),t.certValidity3UTCTime!==void 0&&l.push(_.utcTimeToDate(t.certValidity3UTCTime)),t.certValidity4GeneralizedTime!==void 0&&l.push(_.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=ov({signatureOid:a.signatureOid,type:"certificate"});var c=_.toDer(a.tbsCertificate);a.md.update(c.getBytes())}var f=rt.md.sha1.create(),p=_.toDer(t.certIssuer);f.update(p.getBytes()),a.issuer.getField=function(m){return fo(a.issuer,m)},a.issuer.addField=function(m){As([m]),a.issuer.attributes.push(m)},a.issuer.attributes=ke.RDNAttributesAsArray(t.certIssuer),t.certIssuerUniqueId&&(a.issuer.uniqueId=t.certIssuerUniqueId),a.issuer.hash=f.digest().toHex();var d=rt.md.sha1.create(),g=_.toDer(t.certSubject);return d.update(g.getBytes()),a.subject.getField=function(m){return fo(a.subject,m)},a.subject.addField=function(m){As([m]),a.subject.attributes.push(m)},a.subject.attributes=ke.RDNAttributesAsArray(t.certSubject),t.certSubjectUniqueId&&(a.subject.uniqueId=t.certSubjectUniqueId),a.subject.hash=d.digest().toHex(),t.certExtensions?a.extensions=ke.certificateExtensionsFromAsn1(t.certExtensions):a.extensions=[],a.publicKey=ke.publicKeyFromAsn1(t.subjectPublicKeyInfo),a};ke.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(ke.certificateExtensionFromAsn1(n.value[s]));return e};ke.certificateExtensionFromAsn1=function(r){var e={};if(e.id=_.derToOid(r.value[0].value),e.critical=!1,r.value[1].type===_.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 Vt){if(e.name=Vt[e.id],e.name==="keyUsage"){var t=_.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=_.fromDer(e.value);t.value.length>0&&t.value[0].type===_.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===_.Type.INTEGER?i=t.value[0].value:t.value.length>1&&(i=t.value[1].value),i!==null&&(e.pathLenConstraint=_.derToInteger(i))}else if(e.name==="extKeyUsage")for(var t=_.fromDer(e.value),a=0;a<t.value.length;++a){var o=_.derToOid(t.value[a].value);o in Vt?e[Vt[o]]=!0:e[o]=!0}else if(e.name==="nsCertType"){var t=_.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=_.fromDer(e.value),c=0;c<t.value.length;++c){l=t.value[c];var f={type:l.type,value:l.value};switch(e.altNames.push(f),l.type){case 1:case 2:case 6:break;case 7:f.ip=rt.util.bytesToIP(l.value);break;case 8:f.oid=_.derToOid(l.value);break;default:}}}else if(e.name==="subjectKeyIdentifier"){var t=_.fromDer(e.value);e.subjectKeyIdentifier=rt.util.bytesToHex(t.value)}}return e};ke.certificationRequestFromAsn1=function(r,e){var t={},n=[];if(!_.validate(r,JU,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=_.derToOid(t.publicKeyOid);if(i!==ke.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=ke.createCertificationRequest();if(a.version=t.csrVersion?t.csrVersion.charCodeAt(0):0,a.signatureOid=rt.asn1.derToOid(t.csrSignatureOid),a.signatureParameters=av(a.signatureOid,t.csrSignatureParams,!0),a.siginfo.algorithmOid=rt.asn1.derToOid(t.csrSignatureOid),a.siginfo.parameters=av(a.siginfo.algorithmOid,t.csrSignatureParams,!1),a.signature=t.csrSignature,a.certificationRequestInfo=t.certificationRequestInfo,e){a.md=ov({signatureOid:a.signatureOid,type:"certification request"});var o=_.toDer(a.certificationRequestInfo);a.md.update(o.getBytes())}var l=rt.md.sha1.create();return a.subject.getField=function(c){return fo(a.subject,c)},a.subject.addField=function(c){As([c]),a.subject.attributes.push(c)},a.subject.attributes=ke.RDNAttributesAsArray(t.certificationRequestInfoSubject,l),a.subject.hash=l.digest().toHex(),a.publicKey=ke.publicKeyFromAsn1(t.subjectPublicKeyInfo),a.getAttribute=function(c){return fo(a,c)},a.addAttribute=function(c){As([c]),a.attributes.push(c)},a.attributes=ke.CRIAttributesAsArray(t.certificationRequestInfoAttributes||[]),a};ke.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 fo(r.subject,e)},r.subject.addField=function(e){As([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.publicKey=null,r.attributes=[],r.getAttribute=function(e){return fo(r,e)},r.addAttribute=function(e){As([e]),r.attributes.push(e)},r.md=null,r.setSubject=function(e){As(e),r.subject.attributes=e,r.subject.hash=null},r.setAttributes=function(e){As(e),r.attributes=e},r.sign=function(e,t){r.md=t||rt.md.sha1.create();var n=Vt[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=ke.getCertificationRequestInfo(r);var i=_.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=ov({signatureOid:r.signatureOid,type:"certification request"});var n=r.certificationRequestInfo||ke.getCertificationRequestInfo(r),s=_.toDer(n);t.update(s.getBytes())}return t!==null&&(e=nB({certificate:r,md:t,signature:r.signature})),e},r};function Cf(r){for(var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),t,n,s=r.attributes,i=0;i<s.length;++i){t=s[i];var a=t.value,o=_.Type.PRINTABLESTRING;"valueTagClass"in t&&(o=t.valueTagClass,o===_.Type.UTF8&&(a=rt.util.encodeUtf8(a))),n=_.create(_.Class.UNIVERSAL,_.Type.SET,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(t.type).getBytes()),_.create(_.Class.UNIVERSAL,o,!1,a)])]),e.value.push(n)}return e}u(Cf,"_dnToAsn1");function As(r){for(var e,t=0;t<r.length;++t){if(e=r[t],typeof e.name>"u"&&(e.type&&e.type in ke.oids?e.name=ke.oids[e.type]:e.shortName&&e.shortName in Dr&&(e.name=ke.oids[Dr[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in ke.oids)e.type=ke.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 Dr&&(e.shortName=Dr[e.name]),e.type===Vt.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=_.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var s=0;s<e.extensions.length;++s)e.value.push(ke.certificateExtensionToAsn1(sB(e.extensions[s])))}if(typeof e.value>"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}u(As,"_fillMissingFields");function sB(r,e){if(e=e||{},typeof r.name>"u"&&r.id&&r.id in ke.oids&&(r.name=ke.oids[r.id]),typeof r.id>"u")if(r.name&&r.name in ke.oids)r.id=ke.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=_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,a)}else if(r.name==="basicConstraints")r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),r.cA&&r.value.value.push(_.create(_.Class.UNIVERSAL,_.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in r&&r.value.value.push(_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.pathLenConstraint).getBytes()));else if(r.name==="extKeyUsage"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);var o=r.value.value;for(var l in r)r[l]===!0&&(l in Vt?o.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Vt[l]).getBytes())):l.indexOf(".")!==-1&&o.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.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=_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,a)}else if(r.name==="subjectAltName"||r.name==="issuerAltName"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);for(var c,f=0;f<r.altNames.length;++f){c=r.altNames[f];var a=c.value;if(c.type===7&&c.ip){if(a=rt.util.bytesFromIP(c.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else c.type===8&&(c.oid?a=_.oidToDer(_.oidToDer(c.oid)):a=_.oidToDer(a));r.value.value.push(_.create(_.Class.CONTEXT_SPECIFIC,c.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=_.create(_.Class.UNIVERSAL,_.Type.IA5STRING,!1,r.comment)}else if(r.name==="subjectKeyIdentifier"&&e.cert){var p=e.cert.generateSubjectKeyIdentifier();r.subjectKeyIdentifier=p.toHex(),r.value=_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,p.getBytes())}else if(r.name==="authorityKeyIdentifier"&&e.cert){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);var o=r.value.value;if(r.keyIdentifier){var d=r.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():r.keyIdentifier;o.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!1,d))}if(r.authorityCertIssuer){var g=[_.create(_.Class.CONTEXT_SPECIFIC,4,!0,[Cf(r.authorityCertIssuer===!0?e.cert.issuer:r.authorityCertIssuer)])];o.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,g))}if(r.serialNumber){var m=rt.util.hexToBytes(r.serialNumber===!0?e.cert.serialNumber:r.serialNumber);o.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if(r.name==="cRLDistributionPoints"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);for(var o=r.value.value,v=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),y=_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[]),c,f=0;f<r.altNames.length;++f){c=r.altNames[f];var a=c.value;if(c.type===7&&c.ip){if(a=rt.util.bytesFromIP(c.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else c.type===8&&(c.oid?a=_.oidToDer(_.oidToDer(c.oid)):a=_.oidToDer(a));y.value.push(_.create(_.Class.CONTEXT_SPECIFIC,c.type,!1,a))}v.value.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[y])),o.push(v)}if(typeof r.value>"u"){var t=new Error("Extension value not specified.");throw t.extension=r,t}return r}u(sB,"_fillMissingExtensionFields");function WA(r,e){switch(r){case Vt["RSASSA-PSS"]:var t=[];return e.hash.algorithmOid!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.hash.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.mgf.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.mgf.hash.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(e.saltLength).getBytes())])),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,t);default:return _.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")}}u(WA,"_signatureParametersToAsn1");function YU(r){var e=_.create(_.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=_.Type.UTF8;"valueTagClass"in s&&(a=s.valueTagClass),a===_.Type.UTF8&&(i=rt.util.encodeUtf8(i));var o=!1;"valueConstructed"in s&&(o=s.valueConstructed);var l=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(s.type).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SET,!0,[_.create(_.Class.UNIVERSAL,a,o,i)])]);e.value.push(l)}return e}u(YU,"_CRIAttributesToAsn1");var QU=new Date("1950-01-01T00:00:00Z"),ZU=new Date("2050-01-01T00:00:00Z");function tB(r){return r>=QU&&r<ZU?_.create(_.Class.UNIVERSAL,_.Type.UTCTIME,!1,_.dateToUtcTime(r)):_.create(_.Class.UNIVERSAL,_.Type.GENERALIZEDTIME,!1,_.dateToGeneralizedTime(r))}u(tB,"_dateToAsn1");ke.getTBSCertificate=function(r){var e=tB(r.validity.notBefore),t=tB(r.validity.notAfter),n=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.version).getBytes())]),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,rt.util.hexToBytes(r.serialNumber)),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.siginfo.algorithmOid).getBytes()),WA(r.siginfo.algorithmOid,r.siginfo.parameters)]),Cf(r.issuer),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,t]),Cf(r.subject),ke.publicKeyToAsn1(r.publicKey)]);return r.issuer.uniqueId&&n.value.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,[_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.issuer.uniqueId)])),r.subject.uniqueId&&n.value.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!0,[_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.subject.uniqueId)])),r.extensions.length>0&&n.value.push(ke.certificateExtensionsToAsn1(r.extensions)),n};ke.getCertificationRequestInfo=function(r){var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.version).getBytes()),Cf(r.subject),ke.publicKeyToAsn1(r.publicKey),YU(r)]);return e};ke.distinguishedNameToAsn1=function(r){return Cf(r)};ke.certificateToAsn1=function(r){var e=r.tbsCertificate||ke.getTBSCertificate(r);return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.signatureOid).getBytes()),WA(r.signatureOid,r.signatureParameters)]),_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.signature)])};ke.certificateExtensionsToAsn1=function(r){var e=_.create(_.Class.CONTEXT_SPECIFIC,3,!0,[]),t=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);e.value.push(t);for(var n=0;n<r.length;++n)t.value.push(ke.certificateExtensionToAsn1(r[n]));return e};ke.certificateExtensionToAsn1=function(r){var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);e.value.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.id).getBytes())),r.critical&&e.value.push(_.create(_.Class.UNIVERSAL,_.Type.BOOLEAN,!1,"\xFF"));var t=r.value;return typeof r.value!="string"&&(t=_.toDer(t).getBytes()),e.value.push(_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,t)),e};ke.certificationRequestToAsn1=function(r){var e=r.certificationRequestInfo||ke.getCertificationRequestInfo(r);return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.signatureOid).getBytes()),WA(r.signatureOid,r.signatureParameters)]),_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.signature)])};ke.createCaStore=function(r){var e={certs:{}};e.getIssuer=function(a){var o=t(a.issuer);return o},e.addCertificate=function(a){if(typeof a=="string"&&(a=rt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))if(a.subject.hash in e.certs){var o=e.certs[a.subject.hash];rt.util.isArray(o)||(o=[o]),o.push(a),e.certs[a.subject.hash]=o}else e.certs[a.subject.hash]=a},e.hasCertificate=function(a){typeof a=="string"&&(a=rt.pki.certificateFromPem(a));var o=t(a.subject);if(!o)return!1;rt.util.isArray(o)||(o=[o]);for(var l=_.toDer(ke.certificateToAsn1(a)).getBytes(),c=0;c<o.length;++c){var f=_.toDer(ke.certificateToAsn1(o[c])).getBytes();if(l===f)return!0}return!1},e.listAllCertificates=function(){var a=[];for(var o in e.certs)if(e.certs.hasOwnProperty(o)){var l=e.certs[o];if(!rt.util.isArray(l))a.push(l);else for(var c=0;c<l.length;++c)a.push(l[c])}return a},e.removeCertificate=function(a){var o;if(typeof a=="string"&&(a=rt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))return null;var l=t(a.subject);if(!rt.util.isArray(l))return o=e.certs[a.subject.hash],delete e.certs[a.subject.hash],o;for(var c=_.toDer(ke.certificateToAsn1(a)).getBytes(),f=0;f<l.length;++f){var p=_.toDer(ke.certificateToAsn1(l[f])).getBytes();c===p&&(o=l[f],l.splice(f,1))}return l.length===0&&delete e.certs[a.subject.hash],o};function t(a){return n(a),e.certs[a.hash]||null}u(t,"getBySubject");function n(a){if(!a.hash){var o=rt.md.sha1.create();a.attributes=ke.RDNAttributesAsArray(Cf(a),o),a.hash=o.digest().toHex()}}if(u(n,"ensureSubjectHasHash"),r)for(var s=0;s<r.length;++s){var i=r[s];e.addCertificate(i)}return e};ke.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"};ke.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,o=0;do{var l=e.shift(),c=null,f=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(a={message:"Certificate is not valid yet or has expired.",error:ke.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),a===null){if(c=e[0]||r.getIssuer(l),c===null&&l.isIssuer(l)&&(f=!0,c=l),c){var p=c;rt.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){c=p.shift();try{d=c.verify(l)}catch{}}d||(a={message:"Certificate signature is invalid.",error:ke.certificateError.bad_certificate})}a===null&&(!c||f)&&!r.hasCertificate(l)&&(a={message:"Certificate is not trusted.",error:ke.certificateError.unknown_ca})}if(a===null&&c&&!l.isIssuer(c)&&(a={message:"Certificate issuer is invalid.",error:ke.certificateError.bad_certificate}),a===null)for(var g={keyUsage:!0,basicConstraints:!0},m=0;a===null&&m<l.extensions.length;++m){var v=l.extensions[m];v.critical&&!(v.name in g)&&(a={message:"Certificate has an unsupported critical extension.",error:ke.certificateError.unsupported_certificate})}if(a===null&&(!i||e.length===0&&(!c||f))){var y=l.getExtension("basicConstraints"),S=l.getExtension("keyUsage");if(S!==null&&(!S.keyCertSign||y===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:ke.certificateError.bad_certificate}),a===null&&y===null&&(a={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:ke.certificateError.bad_certificate}),a===null&&y!==null&&!y.cA&&(a={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:ke.certificateError.bad_certificate}),a===null&&S!==null&&"pathLenConstraint"in y){var C=o-1;C>y.pathLenConstraint&&(a={message:"Certificate basicConstraints pathLenConstraint violated.",error:ke.certificateError.bad_certificate})}}var w=a===null?!0:a.error,E=t.verify?t.verify(w,o,n):w;if(E===!0)a=null;else throw w===!0&&(a={message:"The application rejected the certificate.",error:ke.certificateError.bad_certificate}),(E||E===0)&&(typeof E=="object"&&!rt.util.isArray(E)?(E.message&&(a.message=E.message),E.error&&(a.error=E.error)):typeof E=="string"&&(a.error=E)),a;i=!1,++o}while(e.length>0);return!0}});var JA=ue((Xee,oB)=>{"use strict";var fr=bt();Js();gf();uo();GA();XA();Es();id();wf();jt();uv();var G=fr.asn1,Dt=fr.pki,od=oB.exports=fr.pkcs12=fr.pkcs12||{},aB={name:"ContentInfo",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},eM={name:"PFX",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,capture:"version"},aB,{name:"PFX.macData",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:G.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},tM={name:"SafeBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},rM={name:"Attribute",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,capture:"values"}]},nM={name:"CertBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:G.Class.UNIVERSAL,type:G.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function ad(r,e,t,n){for(var s=[],i=0;i<r.length;i++)for(var a=0;a<r[i].safeBags.length;a++){var o=r[i].safeBags[a];if(!(n!==void 0&&o.type!==n)){if(e===null){s.push(o);continue}o.attributes[e]!==void 0&&o.attributes[e].indexOf(t)>=0&&s.push(o)}}return s}u(ad,"_getBagsByAttribute");od.pkcs12FromAsn1=function(r,e,t){typeof e=="string"?(t=e,e=!0):e===void 0&&(e=!0);var n={},s=[];if(!G.validate(r,eM,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:u(function(y){var S={},C;return"localKeyId"in y?C=y.localKeyId:"localKeyIdHex"in y&&(C=fr.util.hexToBytes(y.localKeyIdHex)),C===void 0&&!("friendlyName"in y)&&"bagType"in y&&(S[y.bagType]=ad(a.safeContents,null,null,y.bagType)),C!==void 0&&(S.localKeyId=ad(a.safeContents,"localKeyId",C,y.bagType)),"friendlyName"in y&&(S.friendlyName=ad(a.safeContents,"friendlyName",y.friendlyName,y.bagType)),S},"getBags"),getBagsByFriendlyName:u(function(y,S){return ad(a.safeContents,"friendlyName",y,S)},"getBagsByFriendlyName"),getBagsByLocalKeyId:u(function(y,S){return ad(a.safeContents,"localKeyId",y,S)},"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(G.derToOid(n.contentType)!==Dt.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=G.derToOid(n.contentType),i}var o=n.content.value[0];if(o.tagClass!==G.Class.UNIVERSAL||o.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=zA(o),n.mac){var l=null,c=0,f=G.derToOid(n.macAlgorithm);switch(f){case Dt.oids.sha1:l=fr.md.sha1.create(),c=20;break;case Dt.oids.sha256:l=fr.md.sha256.create(),c=32;break;case Dt.oids.sha384:l=fr.md.sha384.create(),c=48;break;case Dt.oids.sha512:l=fr.md.sha512.create(),c=64;break;case Dt.oids.md5:l=fr.md.md5.create(),c=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var p=new fr.util.ByteBuffer(n.macSalt),d="macIterations"in n?parseInt(fr.util.bytesToHex(n.macIterations),16):1,g=od.generateKey(t,p,3,d,c,l),m=fr.hmac.create();m.start(l,g),m.update(o.value);var v=m.getMac();if(v.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(r.value)&&r.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return sM(a,o.value,e,t),a};function zA(r){if(r.composed||r.constructed){for(var e=fr.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}u(zA,"_decodePkcs7Data");function sM(r,e,t,n){if(e=G.fromDer(e,t),e.tagClass!==G.Class.UNIVERSAL||e.type!==G.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={},o=[];if(!G.validate(i,aB,a,o)){var l=new Error("Cannot read ContentInfo.");throw l.errors=o,l}var c={encrypted:!1},f=null,p=a.content.value[0];switch(G.derToOid(a.contentType)){case Dt.oids.data:if(p.tagClass!==G.Class.UNIVERSAL||p.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");f=zA(p).value;break;case Dt.oids.encryptedData:f=iM(p,n),c.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=G.derToOid(a.contentType),l}c.safeBags=aM(f,t,n),r.safeContents.push(c)}}u(sM,"_decodeAuthenticatedSafe");function iM(r,e){var t={},n=[];if(!G.validate(r,fr.pkcs7.asn1.encryptedDataValidator,t,n)){var s=new Error("Cannot read EncryptedContentInfo.");throw s.errors=n,s}var i=G.derToOid(t.contentType);if(i!==Dt.oids.data){var s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw s.oid=i,s}i=G.derToOid(t.encAlgorithm);var a=Dt.pbe.getCipher(i,t.encParameter,e),o=zA(t.encryptedContentAsn1),l=fr.util.createBuffer(o.value);if(a.update(l),!a.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return a.output.getBytes()}u(iM,"_decryptSafeContents");function aM(r,e,t){if(!e&&r.length===0)return[];if(r=G.fromDer(r,e),r.tagClass!==G.Class.UNIVERSAL||r.type!==G.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={},o=[];if(!G.validate(i,tM,a,o)){var l=new Error("Cannot read SafeBag.");throw l.errors=o,l}var c={type:G.derToOid(a.bagId),attributes:oM(a.bagAttributes)};n.push(c);var f,p,d=a.bagValue.value[0];switch(c.type){case Dt.oids.pkcs8ShroudedKeyBag:if(d=Dt.decryptPrivateKeyInfo(d,t),d===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Dt.oids.keyBag:try{c.key=Dt.privateKeyFromAsn1(d)}catch{c.key=null,c.asn1=d}continue;case Dt.oids.certBag:f=nM,p=u(function(){if(G.derToOid(a.certId)!==Dt.oids.x509Certificate){var m=new Error("Unsupported certificate type, only X.509 supported.");throw m.oid=G.derToOid(a.certId),m}var v=G.fromDer(a.cert,e);try{c.cert=Dt.certificateFromAsn1(v,!0)}catch{c.cert=null,c.asn1=v}},"decoder");break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=c.type,l}if(f!==void 0&&!G.validate(d,f,a,o)){var l=new Error("Cannot read PKCS#12 "+f.name);throw l.errors=o,l}p()}return n}u(aM,"_decodeSafeContents");function oM(r){var e={};if(r!==void 0)for(var t=0;t<r.length;++t){var n={},s=[];if(!G.validate(r[t],rM,n,s)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=s,i}var a=G.derToOid(n.oid);if(Dt.oids[a]!==void 0){e[Dt.oids[a]]=[];for(var o=0;o<n.values.length;++o)e[Dt.oids[a]].push(n.values[o].value)}}return e}u(oM,"_decodeBagAttributes");od.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=fr.util.hexToBytes(s);else if(n.generateLocalKeyId)if(e){var a=fr.util.isArray(e)?e[0]:e;typeof a=="string"&&(a=Dt.certificateFromPem(a));var o=fr.md.sha1.create();o.update(G.toDer(Dt.certificateToAsn1(a)).getBytes()),s=o.digest().getBytes()}else s=fr.random.getBytes(20);var l=[];s!==null&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.localKeyId).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,s)])])),"friendlyName"in n&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.friendlyName).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.BMPSTRING,!1,n.friendlyName)])])),l.length>0&&(i=G.create(G.Class.UNIVERSAL,G.Type.SET,!0,l));var c=[],f=[];e!==null&&(fr.util.isArray(e)?f=e:f=[e]);for(var p=[],d=0;d<f.length;++d){e=f[d],typeof e=="string"&&(e=Dt.certificateFromPem(e));var g=d===0?i:void 0,m=Dt.certificateToAsn1(e),v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.certBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.x509Certificate).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(m).getBytes())])])]),g]);p.push(v)}if(p.length>0){var y=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,p),S=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(y).getBytes())])]);c.push(S)}var C=null;if(r!==null){var w=Dt.wrapRsaPrivateKey(Dt.privateKeyToAsn1(r));t===null?C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.keyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[w]),i]):C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.pkcs8ShroudedKeyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[Dt.encryptPrivateKeyInfo(w,t,n)]),i]);var E=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[C]),A=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(E).getBytes())])]);c.push(A)}var b=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,c),V;if(n.useMac){var o=fr.md.sha1.create(),I=new fr.util.ByteBuffer(fr.random.getBytes(n.saltSize)),D=n.count,r=od.generateKey(t,I,3,D,20),U=fr.hmac.create();U.start(o,r),U.update(G.toDer(b).getBytes());var F=U.getMac();V=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.sha1).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.NULL,!1,"")]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,F.getBytes())]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,I.getBytes()),G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(D).getBytes())])}return G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(3).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(b).getBytes())])]),V])};od.generateKey=fr.pbe.generatePkcs12Key});var QA=ue(($ee,uB)=>{"use strict";var ho=bt();Js();uo();XA();zu();Qy();JA();iv();id();jt();uv();var YA=ho.asn1,xf=uB.exports=ho.pki=ho.pki||{};xf.pemToDer=function(r){var e=ho.pem.decode(r)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return ho.util.createBuffer(e.body)};xf.privateKeyFromPem=function(r){var e=ho.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=YA.fromDer(e.body);return xf.privateKeyFromAsn1(n)};xf.privateKeyToPem=function(r,e){var t={type:"RSA PRIVATE KEY",body:YA.toDer(xf.privateKeyToAsn1(r)).getBytes()};return ho.pem.encode(t,{maxline:e})};xf.privateKeyInfoToPem=function(r,e){var t={type:"PRIVATE KEY",body:YA.toDer(r).getBytes()};return ho.pem.encode(t,{maxline:e})}});var sC=ue((Wee,gB)=>{"use strict";var be=bt();Js();gf();Wy();zu();QA();Es();wf();jt();var hv=u(function(r,e,t,n){var s=be.util.createBuffer(),i=r.length>>1,a=i+(r.length&1),o=r.substr(0,a),l=r.substr(i,a),c=be.util.createBuffer(),f=be.hmac.create();t=e+t;var p=Math.ceil(n/16),d=Math.ceil(n/20);f.start("MD5",o);var g=be.util.createBuffer();c.putBytes(t);for(var m=0;m<p;++m)f.start(null,null),f.update(c.getBytes()),c.putBuffer(f.digest()),f.start(null,null),f.update(c.bytes()+t),g.putBuffer(f.digest());f.start("SHA1",l);var v=be.util.createBuffer();c.clear(),c.putBytes(t);for(var m=0;m<d;++m)f.start(null,null),f.update(c.getBytes()),c.putBuffer(f.digest()),f.start(null,null),f.update(c.bytes()+t),v.putBuffer(f.digest());return s.putBytes(be.util.xorBytes(g.getBytes(),v.getBytes(),n)),s},"prf_TLS1"),uM=u(function(r,e,t){var n=be.hmac.create();n.start("SHA1",r);var s=be.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"),lM=u(function(r,e,t){var n=!1;try{var s=r.deflate(e.fragment.getBytes());e.fragment=be.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"deflate"),cM=u(function(r,e,t){var n=!1;try{var s=r.inflate(e.fragment.getBytes());e.fragment=be.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"inflate"),us=u(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 be.util.createBuffer(r.getBytes(t))},"readVector"),Cs=u(function(r,e,t){r.putInt(t.length(),e<<3),r.putBuffer(t)},"writeVector"),L={};L.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};L.SupportedVersions=[L.Versions.TLS_1_1,L.Versions.TLS_1_0];L.Version=L.SupportedVersions[0];L.MaxFragment=15360;L.ConnectionEnd={server:0,client:1};L.PRFAlgorithm={tls_prf_sha256:0};L.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};L.CipherType={stream:0,block:1,aead:2};L.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};L.CompressionMethod={none:0,deflate:1};L.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};L.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};L.Alert={};L.Alert.Level={warning:1,fatal:2};L.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};L.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};L.CipherSuites={};L.getCipherSuite=function(r){var e=null;for(var t in L.CipherSuites){var n=L.CipherSuites[t];if(n.id[0]===r.charCodeAt(0)&&n.id[1]===r.charCodeAt(1)){e=n;break}}return e};L.handleUnexpected=function(r,e){var t=!r.open&&r.entity===L.ConnectionEnd.client;t||r.error(r,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})};L.handleHelloRequest=function(r,e,t){!r.handshaking&&r.handshakes>0&&(L.queue(r,L.createAlert(r,{level:L.Alert.Level.warning,description:L.Alert.Description.no_renegotiation})),L.flush(r)),r.process()};L.parseHelloMessage=function(r,e,t){var n=null,s=r.entity===L.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:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});else{var i=e.fragment,a=i.length();if(n={version:{major:i.getByte(),minor:i.getByte()},random:be.util.createBuffer(i.getBytes(32)),session_id:us(i,1),extensions:[]},s?(n.cipher_suite=i.getBytes(2),n.compression_method=i.getByte()):(n.cipher_suites=us(i,2),n.compression_methods=us(i,1)),a=t-(a-i.length()),a>0){for(var o=us(i,2);o.length()>0;)n.extensions.push({type:[o.getByte(),o.getByte()],data:us(o,2)});if(!s)for(var l=0;l<n.extensions.length;++l){var c=n.extensions[l];if(c.type[0]===0&&c.type[1]===0)for(var f=us(c.data,2);f.length()>0;){var p=f.getByte();if(p!==0)break;r.session.extensions.server_name.serverNameList.push(us(f,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:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});if(s)r.session.cipherSuite=L.getCipherSuite(n.cipher_suite);else for(var d=be.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(r.session.cipherSuite=L.getCipherSuite(d.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:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure},cipherSuite:be.util.bytesToHex(n.cipher_suite)});s?r.session.compressionMethod=n.compression_method:r.session.compressionMethod=L.CompressionMethod.none}return n};L.createSecurityParameters=function(r,e){var t=r.entity===L.ConnectionEnd.client,n=e.random.bytes(),s=t?r.session.sp.client_random:n,i=t?n:L.createRandom().getBytes();r.session.sp={entity:r.entity,prf_algorithm:L.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:r.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:s,server_random:i}};L.handleServerHello=function(r,e,t){var n=L.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:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});r.session.version=r.version;var s=n.session_id.bytes();s.length>0&&s===r.session.id?(r.expect=fB,r.session.resuming=!0,r.session.sp.server_random=n.random.bytes()):(r.expect=hM,r.session.resuming=!1,L.createSecurityParameters(r,n)),r.session.id=s,r.process()}};L.handleClientHello=function(r,e,t){var n=L.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=be.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,o=1;o<L.SupportedVersions.length&&(a=L.SupportedVersions[o],!(a.minor<=n.version.minor));++o);r.version={major:a.major,minor:a.minor},r.session.version=r.version}i!==null?(r.expect=rC,r.session.resuming=!0,r.session.sp.client_random=n.random.bytes()):(r.expect=r.verifyClient!==!1?EM:tC,r.session.resuming=!1,L.createSecurityParameters(r,n)),r.open=!0,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerHello(r)})),r.session.resuming?(L.queue(r,L.createRecord(r,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),r.state.pending=L.createConnectionState(r),r.state.current.write=r.state.pending.write,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createFinished(r)}))):(L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificate(r)})),r.fail||(L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerKeyExchange(r)})),r.verifyClient!==!1&&L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificateRequest(r)})),L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerHelloDone(r)})))),L.flush(r),r.process()}};L.handleCertificate=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_list:us(n,3)},i,a,o=[];try{for(;s.certificate_list.length()>0;)i=us(s.certificate_list,3),a=be.asn1.fromDer(i),i=be.pki.certificateFromAsn1(a,!0),o.push(i)}catch(c){return r.error(r,{message:"Could not parse certificate list.",cause:c,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var l=r.entity===L.ConnectionEnd.client;(l||r.verifyClient===!0)&&o.length===0?r.error(r,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}}):o.length===0?r.expect=l?lB:tC:(l?r.session.serverCertificate=o[0]:r.session.clientCertificate=o[0],L.verifyCertificateChain(r,o)&&(r.expect=l?lB:tC)),r.process()};L.handleServerKeyExchange=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});r.expect=pM,r.process()};L.handleClientKeyExchange=function(r,e,t){if(t<48)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});var n=e.fragment,s={enc_pre_master_secret:us(n,2).getBytes()},i=null;if(r.getPrivateKey)try{i=r.getPrivateKey(r,r.session.serverCertificate),i=be.pki.privateKeyFromPem(i)}catch(l){r.error(r,{message:"Could not get private key.",cause:l,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}if(i===null)return r.error(r,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}});try{var a=r.session.sp;a.pre_master_secret=i.decrypt(s.enc_pre_master_secret);var o=r.session.clientHelloVersion;if(o.major!==a.pre_master_secret.charCodeAt(0)||o.minor!==a.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{a.pre_master_secret=be.random.getBytes(48)}r.expect=rC,r.session.clientCertificate!==null&&(r.expect=wM),r.process()};L.handleCertificateRequest=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_types:us(n,1),certificate_authorities:us(n,2)};r.session.certificateRequest=s,r.expect=dM,r.process()};L.handleCertificateVerify=function(r,e,t){if(t<2)return r.error(r,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i={signature:us(n,2).getBytes()},a=be.util.createBuffer();a.putBuffer(r.session.md5.digest()),a.putBuffer(r.session.sha1.digest()),a=a.getBytes();try{var o=r.session.clientCertificate;if(!o.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:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure}})}r.expect=rC,r.process()};L.handleServerHelloDone=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.record_overflow}});if(r.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.insufficient_security}},s=0,i=r.verify(r,n.alert.description,s,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!be.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=L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificate(r)}),L.queue(r,e)),e=L.createRecord(r,{type:L.ContentType.handshake,data:L.createClientKeyExchange(r)}),L.queue(r,e),r.expect=yM;var a=u(function(o,l){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createCertificateVerify(o,l)})),L.queue(o,L.createRecord(o,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),o.state.pending=L.createConnectionState(o),o.state.current.write=o.state.pending.write,L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createFinished(o)})),o.expect=fB,L.flush(o),o.process()},"callback");if(r.session.certificateRequest===null||r.session.clientCertificate===null)return a(r,null);L.getClientSignature(r,a)};L.handleChangeCipherSpec=function(r,e){if(e.fragment.getByte()!==1)return r.error(r,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var t=r.entity===L.ConnectionEnd.client;(r.session.resuming&&t||!r.session.resuming&&!t)&&(r.state.pending=L.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?mM:SM,r.process()};L.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=be.util.createBuffer(),n.putBuffer(r.session.md5.digest()),n.putBuffer(r.session.sha1.digest());var a=r.entity===L.ConnectionEnd.client,o=a?"server finished":"client finished",l=r.session.sp,c=12,f=hv;if(n=f(l.master_secret,o,n.getBytes(),c),n.getBytes()!==i)return r.error(r,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decrypt_error}});r.session.md5.update(s),r.session.sha1.update(s),(r.session.resuming&&a||!r.session.resuming&&!a)&&(L.queue(r,L.createRecord(r,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),r.state.current.write=r.state.pending.write,r.state.pending=null,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createFinished(r)}))),r.expect=a?gM:AM,r.handshaking=!1,++r.handshakes,r.peerCertificate=a?r.session.serverCertificate:r.session.clientCertificate,L.flush(r),r.isConnected=!0,r.connected(r),r.process()};L.handleAlert=function(r,e){var t=e.fragment,n={level:t.getByte(),description:t.getByte()},s;switch(n.description){case L.Alert.Description.close_notify:s="Connection closed.";break;case L.Alert.Description.unexpected_message:s="Unexpected message.";break;case L.Alert.Description.bad_record_mac:s="Bad record MAC.";break;case L.Alert.Description.decryption_failed:s="Decryption failed.";break;case L.Alert.Description.record_overflow:s="Record overflow.";break;case L.Alert.Description.decompression_failure:s="Decompression failed.";break;case L.Alert.Description.handshake_failure:s="Handshake failure.";break;case L.Alert.Description.bad_certificate:s="Bad certificate.";break;case L.Alert.Description.unsupported_certificate:s="Unsupported certificate.";break;case L.Alert.Description.certificate_revoked:s="Certificate revoked.";break;case L.Alert.Description.certificate_expired:s="Certificate expired.";break;case L.Alert.Description.certificate_unknown:s="Certificate unknown.";break;case L.Alert.Description.illegal_parameter:s="Illegal parameter.";break;case L.Alert.Description.unknown_ca:s="Unknown certificate authority.";break;case L.Alert.Description.access_denied:s="Access denied.";break;case L.Alert.Description.decode_error:s="Decode error.";break;case L.Alert.Description.decrypt_error:s="Decrypt error.";break;case L.Alert.Description.export_restriction:s="Export restriction.";break;case L.Alert.Description.protocol_version:s="Unsupported protocol version.";break;case L.Alert.Description.insufficient_security:s="Insufficient security.";break;case L.Alert.Description.internal_error:s="Internal error.";break;case L.Alert.Description.user_canceled:s="User canceled.";break;case L.Alert.Description.no_renegotiation:s="Renegotiation not supported.";break;default:s="Unknown error.";break}if(n.description===L.Alert.Description.close_notify)return r.close();r.error(r,{message:s,send:!1,origin:r.entity===L.ConnectionEnd.client?"server":"client",alert:n}),r.process()};L.handleHandshake=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt24();if(s>t.length())return r.fragmented=e,e.fragment=be.util.createBuffer(),t.read-=4,r.process();r.fragmented=null,t.read-=4;var i=t.bytes(s+4);t.read+=4,n in fv[r.entity][r.expect]?(r.entity===L.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:be.md.md5.create(),sha1:be.md.sha1.create()}),n!==L.HandshakeType.hello_request&&n!==L.HandshakeType.certificate_verify&&n!==L.HandshakeType.finished&&(r.session.md5.update(i),r.session.sha1.update(i)),fv[r.entity][r.expect][n](r,e,s)):L.handleUnexpected(r,e)};L.handleApplicationData=function(r,e){r.data.putBuffer(e.fragment),r.dataReady(r),r.process()};L.handleHeartbeat=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt16(),i=t.getBytes(s);if(n===L.HeartbeatMessageType.heartbeat_request){if(r.handshaking||s>i.length)return r.process();L.queue(r,L.createRecord(r,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_response,i)})),L.flush(r)}else if(n===L.HeartbeatMessageType.heartbeat_response){if(i!==r.expectedHeartbeatPayload)return r.process();r.heartbeatReceived&&r.heartbeatReceived(r,be.util.createBuffer(i))}r.process()};var fM=0,hM=1,lB=2,pM=3,dM=4,fB=5,mM=6,gM=7,yM=8,vM=0,EM=1,tC=2,wM=3,rC=4,SM=5,AM=6,k=L.handleUnexpected,hB=L.handleChangeCipherSpec,pn=L.handleAlert,Pn=L.handleHandshake,pB=L.handleApplicationData,dn=L.handleHeartbeat,nC=[];nC[L.ConnectionEnd.client]=[[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[hB,pn,k,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,pB,dn],[k,pn,Pn,k,dn]];nC[L.ConnectionEnd.server]=[[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[hB,pn,k,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,pB,dn],[k,pn,Pn,k,dn]];var po=L.handleHelloRequest,CM=L.handleServerHello,dB=L.handleCertificate,cB=L.handleServerKeyExchange,ZA=L.handleCertificateRequest,lv=L.handleServerHelloDone,mB=L.handleFinished,fv=[];fv[L.ConnectionEnd.client]=[[k,k,CM,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,dB,cB,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,cB,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,mB],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]];var xM=L.handleClientHello,bM=L.handleClientKeyExchange,NM=L.handleCertificateVerify;fv[L.ConnectionEnd.server]=[[k,xM,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,dB,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,bM,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,NM,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,mB],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]];L.generateKeys=function(r,e){var t=hv,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===L.Versions.TLS_1_0.major&&r.version.minor===L.Versions.TLS_1_0.minor;i&&(s+=2*e.fixed_iv_length);var a=t(e.master_secret,"key expansion",n,s),o={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&&(o.client_write_IV=a.getBytes(e.fixed_iv_length),o.server_write_IV=a.getBytes(e.fixed_iv_length)),o};L.createConnectionState=function(r){var e=r.entity===L.ConnectionEnd.client,t=u(function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:u(function(a){return!0},"cipherFunction"),compressionState:null,compressFunction:u(function(a){return!0},"compressFunction"),updateSequenceNumber:u(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:L.Alert.Level.fatal,description:L.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.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:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}),!i.fail},r.session){var s=r.session.sp;switch(r.session.cipherSuite.initSecurityParameters(s),s.keys=L.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 L.CompressionMethod.none:break;case L.CompressionMethod.deflate:n.read.compressFunction=cM,n.write.compressFunction=lM;break;default:throw new Error("Unsupported compression algorithm.")}}return n};L.createRandom=function(){var r=new Date,e=+r+r.getTimezoneOffset()*6e4,t=be.util.createBuffer();return t.putInt32(e),t.putBytes(be.random.getBytes(28)),t};L.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};L.createAlert=function(r,e){var t=be.util.createBuffer();return t.putByte(e.level),t.putByte(e.description),L.createRecord(r,{type:L.ContentType.alert,data:t})};L.createClientHello=function(r){r.session.clientHelloVersion={major:r.version.major,minor:r.version.minor};for(var e=be.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=be.util.createBuffer();i.putByte(L.CompressionMethod.none);var a=i.length(),o=be.util.createBuffer();if(r.virtualHost){var l=be.util.createBuffer();l.putByte(0),l.putByte(0);var c=be.util.createBuffer();c.putByte(0),Cs(c,2,be.util.createBuffer(r.virtualHost));var f=be.util.createBuffer();Cs(f,2,c),Cs(l,2,f),o.putBuffer(l)}var p=o.length();p>0&&(p+=2);var d=r.session.id,g=d.length+1+2+4+28+2+s+1+a+p,m=be.util.createBuffer();return m.putByte(L.HandshakeType.client_hello),m.putInt24(g),m.putByte(r.version.major),m.putByte(r.version.minor),m.putBytes(r.session.sp.client_random),Cs(m,1,be.util.createBuffer(d)),Cs(m,2,e),Cs(m,1,i),p>0&&Cs(m,2,o),m};L.createServerHello=function(r){var e=r.session.id,t=e.length+1+2+4+28+2+1,n=be.util.createBuffer();return n.putByte(L.HandshakeType.server_hello),n.putInt24(t),n.putByte(r.version.major),n.putByte(r.version.minor),n.putBytes(r.session.sp.server_random),Cs(n,1,be.util.createBuffer(e)),n.putByte(r.session.cipherSuite.id[0]),n.putByte(r.session.cipherSuite.id[1]),n.putByte(r.session.compressionMethod),n};L.createCertificate=function(r){var e=r.entity===L.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=be.util.createBuffer();if(t!==null)try{be.util.isArray(t)||(t=[t]);for(var i=null,a=0;a<t.length;++a){var o=be.pem.decode(t[a])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.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=o.type,l}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var c=be.util.createBuffer(o.body);i===null&&(i=be.asn1.fromDer(c.bytes(),!1));var f=be.util.createBuffer();Cs(f,3,c),s.putBuffer(f)}t=be.pki.certificateFromAsn1(i),e?r.session.clientCertificate=t:r.session.serverCertificate=t}catch(g){return r.error(r,{message:"Could not send certificate list.",cause:g,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var p=3+s.length(),d=be.util.createBuffer();return d.putByte(L.HandshakeType.certificate),d.putInt24(p),Cs(d,3,s),d};L.createClientKeyExchange=function(r){var e=be.util.createBuffer();e.putByte(r.session.clientHelloVersion.major),e.putByte(r.session.clientHelloVersion.minor),e.putBytes(be.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=be.util.createBuffer();return i.putByte(L.HandshakeType.client_key_exchange),i.putInt24(s),i.putInt16(e.length),i.putBytes(e),i};L.createServerKeyExchange=function(r){var e=0,t=be.util.createBuffer();return e>0&&(t.putByte(L.HandshakeType.server_key_exchange),t.putInt24(e)),t};L.getClientSignature=function(r,e){var t=be.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=be.pki.privateKeyFromPem(a)}catch(o){n.error(n,{message:"Could not get private key.",cause:o,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}a===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):s=a.sign(s,null),i(n,s)},r.getSignature(r,t,e)};L.createCertificateVerify=function(r,e){var t=e.length+2,n=be.util.createBuffer();return n.putByte(L.HandshakeType.certificate_verify),n.putInt24(t),n.putInt16(e.length),n.putBytes(e),n};L.createCertificateRequest=function(r){var e=be.util.createBuffer();e.putByte(1);var t=be.util.createBuffer();for(var n in r.caStore.certs){var s=r.caStore.certs[n],i=be.pki.distinguishedNameToAsn1(s.subject),a=be.asn1.toDer(i);t.putInt16(a.length()),t.putBuffer(a)}var o=1+e.length()+2+t.length(),l=be.util.createBuffer();return l.putByte(L.HandshakeType.certificate_request),l.putInt24(o),Cs(l,1,e),Cs(l,2,t),l};L.createServerHelloDone=function(r){var e=be.util.createBuffer();return e.putByte(L.HandshakeType.server_hello_done),e.putInt24(0),e};L.createChangeCipherSpec=function(){var r=be.util.createBuffer();return r.putByte(1),r};L.createFinished=function(r){var e=be.util.createBuffer();e.putBuffer(r.session.md5.digest()),e.putBuffer(r.session.sha1.digest());var t=r.entity===L.ConnectionEnd.client,n=r.session.sp,s=12,i=hv,a=t?"client finished":"server finished";e=i(n.master_secret,a,e.getBytes(),s);var o=be.util.createBuffer();return o.putByte(L.HandshakeType.finished),o.putInt24(e.length()),o.putBuffer(e),o};L.createHeartbeat=function(r,e,t){typeof t>"u"&&(t=e.length);var n=be.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(be.random.getBytes(i)),n};L.queue=function(r,e){if(e&&!(e.fragment.length()===0&&(e.type===L.ContentType.handshake||e.type===L.ContentType.alert||e.type===L.ContentType.change_cipher_spec))){if(e.type===L.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()<=L.MaxFragment)n=[e];else{n=[];for(var s=e.fragment.bytes();s.length>L.MaxFragment;)n.push(L.createRecord(r,{type:e.type,data:be.util.createBuffer(s.slice(0,L.MaxFragment))})),s=s.slice(L.MaxFragment);s.length>0&&n.push(L.createRecord(r,{type:e.type,data:be.util.createBuffer(s)}))}for(var i=0;i<n.length&&!r.fail;++i){var a=n[i],o=r.state.current.write;o.update(r,a)&&r.records.push(a)}}};L.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 eC=u(function(r){switch(r){case!0:return!0;case be.pki.certificateError.bad_certificate:return L.Alert.Description.bad_certificate;case be.pki.certificateError.unsupported_certificate:return L.Alert.Description.unsupported_certificate;case be.pki.certificateError.certificate_revoked:return L.Alert.Description.certificate_revoked;case be.pki.certificateError.certificate_expired:return L.Alert.Description.certificate_expired;case be.pki.certificateError.certificate_unknown:return L.Alert.Description.certificate_unknown;case be.pki.certificateError.unknown_ca:return L.Alert.Description.unknown_ca;default:return L.Alert.Description.bad_certificate}},"_certErrorToAlertDesc"),TM=u(function(r){switch(r){case!0:return!0;case L.Alert.Description.bad_certificate:return be.pki.certificateError.bad_certificate;case L.Alert.Description.unsupported_certificate:return be.pki.certificateError.unsupported_certificate;case L.Alert.Description.certificate_revoked:return be.pki.certificateError.certificate_revoked;case L.Alert.Description.certificate_expired:return be.pki.certificateError.certificate_expired;case L.Alert.Description.certificate_unknown:return be.pki.certificateError.certificate_unknown;case L.Alert.Description.unknown_ca:return be.pki.certificateError.unknown_ca;default:return be.pki.certificateError.bad_certificate}},"_alertDescToCertError");L.verifyCertificateChain=function(r,e){try{var t={};for(var n in r.verifyOptions)t[n]=r.verifyOptions[n];t.verify=function(i,a,o){var l=eC(i),c=r.verify(r,i,a,o);if(c!==!0){if(typeof c=="object"&&!be.util.isArray(c)){var f=new Error("The application rejected the certificate.");throw f.send=!0,f.alert={level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate},c.message&&(f.message=c.message),c.alert&&(f.alert.description=c.alert),f}c!==i&&(c=TM(c))}return c},be.pki.verifyCertificateChain(r.caStore,e,t)}catch(i){var s=i;(typeof s!="object"||be.util.isArray(s))&&(s={send:!0,alert:{level:L.Alert.Level.fatal,description:eC(i)}}),"send"in s||(s.send=!0),"alert"in s||(s.alert={level:L.Alert.Level.fatal,description:eC(s.error)}),r.error(r,s)}return!r.fail};L.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=be.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 o in t.order)if(t.order[o]===a){t.order.splice(o,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=be.util.bytesToHex(s);t.order.push(a),t.cache[a]=i}}return t};L.createConnection=function(r){var e=null;r.caStore?be.util.isArray(r.caStore)?e=be.pki.createCaStore(r.caStore):e=r.caStore:e=be.pki.createCaStore();var t=r.cipherSuites||null;if(t===null){t=[];for(var n in L.CipherSuites)t.push(L.CipherSuites[n])}var s=r.server?L.ConnectionEnd.server:L.ConnectionEnd.client,i=r.sessionCache?L.createSessionCache(r.sessionCache):null,a={version:{major:L.Version.major,minor:L.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(f,p,d,g){return p},verifyOptions:r.verifyOptions||{},getCertificate:r.getCertificate||null,getPrivateKey:r.getPrivateKey||null,getSignature:r.getSignature||null,input:be.util.createBuffer(),tlsData:be.util.createBuffer(),data:be.util.createBuffer(),tlsDataReady:r.tlsDataReady,dataReady:r.dataReady,heartbeatReceived:r.heartbeatReceived,closed:r.closed,error:u(function(f,p){p.origin=p.origin||(f.entity===L.ConnectionEnd.client?"client":"server"),p.send&&(L.queue(f,L.createAlert(f,p.alert)),L.flush(f));var d=p.fatal!==!1;d&&(f.fail=!0),r.error(f,p),d&&f.close(!1)},"error"),deflate:r.deflate||null,inflate:r.inflate||null};a.reset=function(f){a.version={major:L.Version.major,minor:L.Version.minor},a.record=null,a.session=null,a.peerCertificate=null,a.state={pending:null,current:null},a.expect=a.entity===L.ConnectionEnd.client?fM:vM,a.fragmented=null,a.records=[],a.open=!1,a.handshakes=0,a.handshaking=!1,a.isConnected=!1,a.fail=!(f||typeof f>"u"),a.input.clear(),a.tlsData.clear(),a.data.clear(),a.state.current=L.createConnectionState(a)},a.reset();var o=u(function(f,p){var d=p.type-L.ContentType.change_cipher_spec,g=nC[f.entity][f.expect];d in g?g[d](f,p):L.handleUnexpected(f,p)},"_update"),l=u(function(f){var p=0,d=f.input,g=d.length();if(g<5)p=5-g;else{f.record={type:d.getByte(),version:{major:d.getByte(),minor:d.getByte()},length:d.getInt16(),fragment:be.util.createBuffer(),ready:!1};var m=f.record.version.major===f.version.major;m&&f.session&&f.session.version&&(m=f.record.version.minor===f.version.minor),m||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}})}return p},"_readRecordHeader"),c=u(function(f){var p=0,d=f.input,g=d.length();if(g<f.record.length)p=f.record.length-g;else{f.record.fragment.putBytes(d.getBytes(f.record.length)),d.compact();var m=f.state.current.read;m.update(f,f.record)&&(f.fragmented!==null&&(f.fragmented.type===f.record.type?(f.fragmented.fragment.putBuffer(f.record.fragment),f.record=f.fragmented):f.error(f,{message:"Invalid fragmented record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})),f.record.ready=!0)}return p},"_readRecord");return a.handshake=function(f){if(a.entity!==L.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,f=f||"";var p=null;f.length>0&&(a.sessionCache&&(p=a.sessionCache.getSession(f)),p===null&&(f="")),f.length===0&&a.sessionCache&&(p=a.sessionCache.getSession(),p!==null&&(f=p.id)),a.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:be.md.md5.create(),sha1:be.md.sha1.create()},p&&(a.version=p.version,a.session.sp=p.sp),a.session.sp.client_random=L.createRandom().getBytes(),a.open=!0,L.queue(a,L.createRecord(a,{type:L.ContentType.handshake,data:L.createClientHello(a)})),L.flush(a)}},a.process=function(f){var p=0;return f&&a.input.putBytes(f),a.fail||(a.record!==null&&a.record.ready&&a.record.fragment.isEmpty()&&(a.record=null),a.record===null&&(p=l(a)),!a.fail&&a.record!==null&&!a.record.ready&&(p=c(a)),!a.fail&&a.record!==null&&a.record.ready&&o(a,a.record)),p},a.prepare=function(f){return L.queue(a,L.createRecord(a,{type:L.ContentType.application_data,data:be.util.createBuffer(f)})),L.flush(a)},a.prepareHeartbeatRequest=function(f,p){return f instanceof be.util.ByteBuffer&&(f=f.bytes()),typeof p>"u"&&(p=f.length),a.expectedHeartbeatPayload=f,L.queue(a,L.createRecord(a,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_request,f,p)})),L.flush(a)},a.close=function(f){if(!a.fail&&a.sessionCache&&a.session){var p={id:a.session.id,version:a.session.version,sp:a.session.sp};p.sp.keys=null,a.sessionCache.setSession(p.id,p)}a.open&&(a.open=!1,a.input.clear(),(a.isConnected||a.handshaking)&&(a.isConnected=a.handshaking=!1,L.queue(a,L.createAlert(a,{level:L.Alert.Level.warning,description:L.Alert.Description.close_notify})),L.flush(a)),a.closed(a)),a.reset(f)},a};gB.exports=be.tls=be.tls||{};for(cv in L)typeof L[cv]!="function"&&(be.tls[cv]=L[cv]);var cv;be.tls.prf_tls1=hv;be.tls.hmac_sha1=uM;be.tls.createSessionCache=L.createSessionCache;be.tls.createConnection=L.createConnection});var EB=ue((Jee,vB)=>{"use strict";var mo=bt();oo();sC();var xs=vB.exports=mo.tls;xs.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:u(function(r){r.bulk_cipher_algorithm=xs.BulkCipherAlgorithm.aes,r.cipher_type=xs.CipherType.block,r.enc_key_length=16,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=xs.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:yB};xs.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:u(function(r){r.bulk_cipher_algorithm=xs.BulkCipherAlgorithm.aes,r.cipher_type=xs.CipherType.block,r.enc_key_length=32,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=xs.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:yB};function yB(r,e,t){var n=e.entity===mo.tls.ConnectionEnd.client;r.read.cipherState={init:!1,cipher:mo.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:mo.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=RM,r.write.cipherFunction=IM,r.read.macLength=r.write.macLength=t.mac_length,r.read.macFunction=r.write.macFunction=xs.hmac_sha1}u(yB,"initConnectionState");function IM(r,e){var t=!1,n=e.macFunction(e.macKey,e.sequenceNumber,r);r.fragment.putBytes(n),e.updateSequenceNumber();var s;r.version.minor===xs.Versions.TLS_1_0.minor?s=e.cipherState.init?null:e.cipherState.iv:s=mo.random.getBytesSync(16),e.cipherState.init=!0;var i=e.cipherState.cipher;return i.start({iv:s}),r.version.minor>=xs.Versions.TLS_1_1.minor&&i.output.putBytes(s),i.update(r.fragment),i.finish(DM)&&(r.fragment=i.output,r.length=r.fragment.length(),t=!0),t}u(IM,"encrypt_aes_cbc_sha1");function DM(r,e,t){if(!t){var n=r-e.length()%r;e.fillWithByte(n-1,n)}return!0}u(DM,"encrypt_aes_cbc_sha1_padding");function BM(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}u(BM,"decrypt_aes_cbc_sha1_padding");function RM(r,e){var t=!1,n;r.version.minor===xs.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(BM);var i=e.macLength,a=mo.random.getBytesSync(i),o=s.output.length();o>=i?(r.fragment=s.output.getBytes(o-i),a=s.output.getBytes(i)):r.fragment=s.output.getBytes(),r.fragment=mo.util.createBuffer(r.fragment),r.length=r.fragment.length();var l=e.macFunction(e.macKey,e.sequenceNumber,r);return e.updateSequenceNumber(),t=OM(e.macKey,a,l)&&t,t}u(RM,"decrypt_aes_cbc_sha1");function OM(r,e,t){var n=mo.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}u(OM,"compareMacs")});var oC=ue((Qee,CB)=>{"use strict";var vr=bt();yi();jt();var ud=CB.exports=vr.sha512=vr.sha512||{};vr.md.sha512=vr.md.algorithms.sha512=ud;var SB=vr.sha384=vr.sha512.sha384=vr.sha512.sha384||{};SB.create=function(){return ud.create("SHA-384")};vr.md.sha384=vr.md.algorithms.sha384=SB;vr.sha512.sha256=vr.sha512.sha256||{create:u(function(){return ud.create("SHA-512/256")},"create")};vr.md["sha512/256"]=vr.md.algorithms["sha512/256"]=vr.sha512.sha256;vr.sha512.sha224=vr.sha512.sha224||{create:u(function(){return ud.create("SHA-512/224")},"create")};vr.md["sha512/224"]=vr.md.algorithms["sha512/224"]=vr.sha512.sha224;ud.create=function(r){if(AB||_M(),typeof r>"u"&&(r="SHA-512"),!(r in tl))throw new Error("Invalid SHA-512 algorithm: "+r);for(var e=tl[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 o={algorithm:r.replace("-","").toLowerCase(),blockLength:128,digestLength:a,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var l=o.messageLengthSize/4,c=0;c<l;++c)o.fullMessageLength.push(0);n=vr.util.createBuffer(),t=new Array(e.length);for(var c=0;c<e.length;++c)t[c]=e[c].slice(0);return o},o.start(),o.update=function(l,c){c==="utf8"&&(l=vr.util.encodeUtf8(l));var f=l.length;o.messageLength+=f,f=[f/4294967296>>>0,f>>>0];for(var p=o.fullMessageLength.length-1;p>=0;--p)o.fullMessageLength[p]+=f[1],f[1]=f[0]+(o.fullMessageLength[p]/4294967296>>>0),o.fullMessageLength[p]=o.fullMessageLength[p]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(l),wB(t,s,n),(n.read>2048||n.length()===0)&&n.compact(),o},o.digest=function(){var l=vr.util.createBuffer();l.putBytes(n.bytes());var c=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,f=c&o.blockLength-1;l.putBytes(iC.substr(0,o.blockLength-f));for(var p,d,g=o.fullMessageLength[0]*8,m=0;m<o.fullMessageLength.length-1;++m)p=o.fullMessageLength[m+1]*8,d=p/4294967296>>>0,g+=d,l.putInt32(g>>>0),g=p>>>0;l.putInt32(g);for(var v=new Array(t.length),m=0;m<t.length;++m)v[m]=t[m].slice(0);wB(v,s,l);var y=vr.util.createBuffer(),S;r==="SHA-512"?S=v.length:r==="SHA-384"?S=v.length-2:S=v.length-4;for(var m=0;m<S;++m)y.putInt32(v[m][0]),(m!==S-1||r!=="SHA-512/224")&&y.putInt32(v[m][1]);return y},o};var iC=null,AB=!1,aC=null,tl=null;function _M(){iC="\x80",iC+=vr.util.fillString("\0",128),aC=[[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]],tl={},tl["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],tl["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],tl["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],tl["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],AB=!0}u(_M,"_init");function wB(r,e,t){for(var n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C,w,E,A,b,V,I,D,U,F,M,se,ee,ie,X,he,Ce,xe,pe,W,fe=t.length();fe>=128;){for(ie=0;ie<16;++ie)e[ie][0]=t.getInt32()>>>0,e[ie][1]=t.getInt32()>>>0;for(;ie<80;++ie)Ce=e[ie-2],X=Ce[0],he=Ce[1],n=((X>>>19|he<<13)^(he>>>29|X<<3)^X>>>6)>>>0,s=((X<<13|he>>>19)^(he<<3|X>>>29)^(X<<26|he>>>6))>>>0,pe=e[ie-15],X=pe[0],he=pe[1],i=((X>>>1|he<<31)^(X>>>8|he<<24)^X>>>7)>>>0,a=((X<<31|he>>>1)^(X<<24|he>>>8)^(X<<25|he>>>7))>>>0,xe=e[ie-7],W=e[ie-16],he=s+xe[1]+a+W[1],e[ie][0]=n+xe[0]+i+W[0]+(he/4294967296>>>0)>>>0,e[ie][1]=he>>>0;for(v=r[0][0],y=r[0][1],S=r[1][0],C=r[1][1],w=r[2][0],E=r[2][1],A=r[3][0],b=r[3][1],V=r[4][0],I=r[4][1],D=r[5][0],U=r[5][1],F=r[6][0],M=r[6][1],se=r[7][0],ee=r[7][1],ie=0;ie<80;++ie)c=((V>>>14|I<<18)^(V>>>18|I<<14)^(I>>>9|V<<23))>>>0,f=((V<<18|I>>>14)^(V<<14|I>>>18)^(I<<23|V>>>9))>>>0,p=(F^V&(D^F))>>>0,d=(M^I&(U^M))>>>0,o=((v>>>28|y<<4)^(y>>>2|v<<30)^(y>>>7|v<<25))>>>0,l=((v<<4|y>>>28)^(y<<30|v>>>2)^(y<<25|v>>>7))>>>0,g=(v&S|w&(v^S))>>>0,m=(y&C|E&(y^C))>>>0,he=ee+f+d+aC[ie][1]+e[ie][1],n=se+c+p+aC[ie][0]+e[ie][0]+(he/4294967296>>>0)>>>0,s=he>>>0,he=l+m,i=o+g+(he/4294967296>>>0)>>>0,a=he>>>0,se=F,ee=M,F=D,M=U,D=V,U=I,he=b+s,V=A+n+(he/4294967296>>>0)>>>0,I=he>>>0,A=w,b=E,w=S,E=C,S=v,C=y,he=s+a,v=n+i+(he/4294967296>>>0)>>>0,y=he>>>0;he=r[0][1]+y,r[0][0]=r[0][0]+v+(he/4294967296>>>0)>>>0,r[0][1]=he>>>0,he=r[1][1]+C,r[1][0]=r[1][0]+S+(he/4294967296>>>0)>>>0,r[1][1]=he>>>0,he=r[2][1]+E,r[2][0]=r[2][0]+w+(he/4294967296>>>0)>>>0,r[2][1]=he>>>0,he=r[3][1]+b,r[3][0]=r[3][0]+A+(he/4294967296>>>0)>>>0,r[3][1]=he>>>0,he=r[4][1]+I,r[4][0]=r[4][0]+V+(he/4294967296>>>0)>>>0,r[4][1]=he>>>0,he=r[5][1]+U,r[5][0]=r[5][0]+D+(he/4294967296>>>0)>>>0,r[5][1]=he>>>0,he=r[6][1]+M,r[6][0]=r[6][0]+F+(he/4294967296>>>0)>>>0,r[6][1]=he>>>0,he=r[7][1]+ee,r[7][0]=r[7][0]+se+(he/4294967296>>>0)>>>0,r[7][1]=he>>>0,fe-=128}}u(wB,"_update")});var xB=ue(uC=>{"use strict";var PM=bt();Js();var tn=PM.asn1;uC.privateKeyValidator={name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:tn.Class.UNIVERSAL,type:tn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};uC.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:tn.Class.UNIVERSAL,type:tn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var VB=ue((tte,LB)=>{"use strict";var mn=bt();sd();Es();oC();jt();var BB=xB(),kM=BB.publicKeyValidator,LM=BB.privateKeyValidator;typeof bB>"u"&&(bB=mn.jsbn.BigInteger);var bB,cC=mn.util.ByteBuffer,Hn=typeof Buffer>"u"?Uint8Array:Buffer;mn.pki=mn.pki||{};LB.exports=mn.pki.ed25519=mn.ed25519=mn.ed25519||{};var Bt=mn.ed25519;Bt.constants={};Bt.constants.PUBLIC_KEY_BYTE_LENGTH=32;Bt.constants.PRIVATE_KEY_BYTE_LENGTH=64;Bt.constants.SEED_BYTE_LENGTH=32;Bt.constants.SIGN_BYTE_LENGTH=64;Bt.constants.HASH_BYTE_LENGTH=64;Bt.generateKeyPair=function(r){r=r||{};var e=r.seed;if(e===void 0)e=mn.random.getBytesSync(Bt.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Bt.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Bt.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=aa({message:e,encoding:"binary"});for(var t=new Hn(Bt.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Hn(Bt.constants.PRIVATE_KEY_BYTE_LENGTH),s=0;s<32;++s)n[s]=e[s];return MM(t,n),{publicKey:t,privateKey:n}};Bt.privateKeyFromAsn1=function(r){var e={},t=[],n=mn.asn1.validate(r,LM,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=mn.asn1.derToOid(e.privateKeyOid),a=mn.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=e.privateKey,l=aa({message:mn.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:l}};Bt.publicKeyFromAsn1=function(r){var e={},t=[],n=mn.asn1.validate(r,kM,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=mn.asn1.derToOid(e.publicKeyOid),a=mn.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=e.ed25519PublicKey;if(o.length!==Bt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return aa({message:o,encoding:"binary"})};Bt.publicKeyFromPrivateKey=function(r){r=r||{};var e=aa({message:r.privateKey,encoding:"binary"});if(e.length!==Bt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Bt.constants.PRIVATE_KEY_BYTE_LENGTH);for(var t=new Hn(Bt.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<t.length;++n)t[n]=e[32+n];return t};Bt.sign=function(r){r=r||{};var e=aa(r),t=aa({message:r.privateKey,encoding:"binary"});if(t.length===Bt.constants.SEED_BYTE_LENGTH){var n=Bt.generateKeyPair({seed:t});t=n.privateKey}else if(t.length!==Bt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Bt.constants.SEED_BYTE_LENGTH+" or "+Bt.constants.PRIVATE_KEY_BYTE_LENGTH);var s=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length);jM(s,e,e.length,t);for(var i=new Hn(Bt.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=s[a];return i};Bt.verify=function(r){r=r||{};var e=aa(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=aa({message:r.signature,encoding:"binary"});if(t.length!==Bt.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Bt.constants.SIGN_BYTE_LENGTH);var n=aa({message:r.publicKey,encoding:"binary"});if(n.length!==Bt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Bt.constants.PUBLIC_KEY_BYTE_LENGTH);var s=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length),i=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length),a;for(a=0;a<Bt.constants.SIGN_BYTE_LENGTH;++a)s[a]=t[a];for(a=0;a<e.length;++a)s[a+Bt.constants.SIGN_BYTE_LENGTH]=e[a];return qM(i,s,s.length,n)>=0};function aa(r){var e=r.message;if(e instanceof Uint8Array||e instanceof Hn)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 cC(e,t)}else if(!(e instanceof cC))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 Hn(e.length()),s=0;s<n.length;++s)n[s]=e.at(s);return n}u(aa,"messageToNativeBuffer");var fC=ot(),pv=ot([1]),VM=ot([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),FM=ot([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),NB=ot([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),TB=ot([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ld=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]),UM=ot([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function cd(r,e){var t=mn.md.sha512.create(),n=new cC(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 Hn(Bt.constants.HASH_BYTE_LENGTH),a=0;a<64;++a)i[a]=s.charCodeAt(a);return i}u(cd,"sha512");function MM(r,e){var t=[ot(),ot(),ot(),ot()],n,s=cd(e,32);for(s[0]&=248,s[31]&=127,s[31]|=64,mC(t,s),dC(r,t),n=0;n<32;++n)e[n+32]=r[n];return 0}u(MM,"crypto_sign_keypair");function jM(r,e,t,n){var s,i,a=new Float64Array(64),o=[ot(),ot(),ot(),ot()],l=cd(n,32);l[0]&=248,l[31]&=127,l[31]|=64;var c=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 f=cd(r.subarray(32),t+32);for(hC(f),mC(o,f),dC(r,o),s=32;s<64;++s)r[s]=n[s];var p=cd(r,t+64);for(hC(p),s=32;s<64;++s)a[s]=0;for(s=0;s<32;++s)a[s]=f[s];for(s=0;s<32;++s)for(i=0;i<32;i++)a[s+i]+=p[s]*l[i];return RB(r.subarray(32),a),c}u(jM,"crypto_sign");function qM(r,e,t,n){var s,i,a=new Hn(32),o=[ot(),ot(),ot(),ot()],l=[ot(),ot(),ot(),ot()];if(i=-1,t<64||KM(l,n)||!HM(e,32))return-1;for(s=0;s<t;++s)r[s]=e[s];for(s=0;s<32;++s)r[s+32]=n[s];var c=cd(r,t);if(hC(c),PB(o,l,c),mC(l,e.subarray(32)),pC(o,l),dC(a,o),t-=64,OB(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}u(qM,"crypto_sign_open");function HM(r,e){var t;for(t=31;t>=0;--t){if(r[e+t]<ld[t])return!0;if(r[e+t]>ld[t])return!1}return!1}u(HM,"_isCanonicalSignatureScalar");function RB(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]*ld[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)*ld[s],t=e[s]>>8,e[s]&=255;for(s=0;s<32;++s)e[s]-=t*ld[s];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,r[n]=e[n]&255}u(RB,"modL");function hC(r){for(var e=new Float64Array(64),t=0;t<64;++t)e[t]=r[t],r[t]=0;RB(r,e)}u(hC,"reduce");function pC(r,e){var t=ot(),n=ot(),s=ot(),i=ot(),a=ot(),o=ot(),l=ot(),c=ot(),f=ot();Nf(t,r[1],r[0]),Nf(f,e[1],e[0]),ur(t,t,f),bf(n,r[0],r[1]),bf(f,e[0],e[1]),ur(n,n,f),ur(s,r[3],e[3]),ur(s,s,FM),ur(i,r[2],e[2]),bf(i,i,i),Nf(a,n,t),Nf(o,i,s),bf(l,i,s),bf(c,n,t),ur(r[0],a,o),ur(r[1],c,l),ur(r[2],l,o),ur(r[3],a,c)}u(pC,"add");function IB(r,e,t){for(var n=0;n<4;++n)kB(r[n],e[n],t)}u(IB,"cswap");function dC(r,e){var t=ot(),n=ot(),s=ot();WM(s,e[2]),ur(t,e[0],s),ur(n,e[1],s),dv(r,n),r[31]^=_B(t)<<7}u(dC,"pack");function dv(r,e){var t,n,s,i=ot(),a=ot();for(t=0;t<16;++t)a[t]=e[t];for(lC(a),lC(a),lC(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,kB(a,i,1-s)}for(t=0;t<16;t++)r[2*t]=a[t]&255,r[2*t+1]=a[t]>>8}u(dv,"pack25519");function KM(r,e){var t=ot(),n=ot(),s=ot(),i=ot(),a=ot(),o=ot(),l=ot();return go(r[2],pv),XM(r[1],e),rl(s,r[1]),ur(i,s,VM),Nf(s,s,r[2]),bf(i,r[2],i),rl(a,i),rl(o,a),ur(l,o,a),ur(t,l,s),ur(t,t,i),GM(t,t),ur(t,t,s),ur(t,t,i),ur(t,t,i),ur(r[0],t,i),rl(n,r[0]),ur(n,n,i),DB(n,s)&&ur(r[0],r[0],UM),rl(n,r[0]),ur(n,n,i),DB(n,s)?-1:(_B(r[0])===e[31]>>7&&Nf(r[0],fC,r[0]),ur(r[3],r[0],r[1]),0)}u(KM,"unpackneg");function XM(r,e){var t;for(t=0;t<16;++t)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}u(XM,"unpack25519");function GM(r,e){var t=ot(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=250;n>=0;--n)rl(t,t),n!==1&&ur(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}u(GM,"pow2523");function DB(r,e){var t=new Hn(32),n=new Hn(32);return dv(t,r),dv(n,e),OB(t,0,n,0)}u(DB,"neq25519");function OB(r,e,t,n){return $M(r,e,t,n,32)}u(OB,"crypto_verify_32");function $M(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}u($M,"vn");function _B(r){var e=new Hn(32);return dv(e,r),e[0]&1}u(_B,"par25519");function PB(r,e,t){var n,s;for(go(r[0],fC),go(r[1],pv),go(r[2],pv),go(r[3],fC),s=255;s>=0;--s)n=t[s/8|0]>>(s&7)&1,IB(r,e,n),pC(e,r),pC(r,r),IB(r,e,n)}u(PB,"scalarmult");function mC(r,e){var t=[ot(),ot(),ot(),ot()];go(t[0],NB),go(t[1],TB),go(t[2],pv),ur(t[3],NB,TB),PB(r,t,e)}u(mC,"scalarbase");function go(r,e){var t;for(t=0;t<16;t++)r[t]=e[t]|0}u(go,"set25519");function WM(r,e){var t=ot(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=253;n>=0;--n)rl(t,t),n!==2&&n!==4&&ur(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}u(WM,"inv25519");function lC(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)}u(lC,"car25519");function kB(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}u(kB,"sel25519");function ot(r){var e,t=new Float64Array(16);if(r)for(e=0;e<r.length;++e)t[e]=r[e];return t}u(ot,"gf");function bf(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]+t[n]}u(bf,"A");function Nf(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]-t[n]}u(Nf,"Z");function rl(r,e){ur(r,e,e)}u(rl,"S");function ur(r,e,t){var n,s,i=0,a=0,o=0,l=0,c=0,f=0,p=0,d=0,g=0,m=0,v=0,y=0,S=0,C=0,w=0,E=0,A=0,b=0,V=0,I=0,D=0,U=0,F=0,M=0,se=0,ee=0,ie=0,X=0,he=0,Ce=0,xe=0,pe=t[0],W=t[1],fe=t[2],Ie=t[3],Ve=t[4],Le=t[5],O=t[6],B=t[7],Q=t[8],K=t[9],_e=t[10],R=t[11],N=t[12],J=t[13],$=t[14],ge=t[15];n=e[0],i+=n*pe,a+=n*W,o+=n*fe,l+=n*Ie,c+=n*Ve,f+=n*Le,p+=n*O,d+=n*B,g+=n*Q,m+=n*K,v+=n*_e,y+=n*R,S+=n*N,C+=n*J,w+=n*$,E+=n*ge,n=e[1],a+=n*pe,o+=n*W,l+=n*fe,c+=n*Ie,f+=n*Ve,p+=n*Le,d+=n*O,g+=n*B,m+=n*Q,v+=n*K,y+=n*_e,S+=n*R,C+=n*N,w+=n*J,E+=n*$,A+=n*ge,n=e[2],o+=n*pe,l+=n*W,c+=n*fe,f+=n*Ie,p+=n*Ve,d+=n*Le,g+=n*O,m+=n*B,v+=n*Q,y+=n*K,S+=n*_e,C+=n*R,w+=n*N,E+=n*J,A+=n*$,b+=n*ge,n=e[3],l+=n*pe,c+=n*W,f+=n*fe,p+=n*Ie,d+=n*Ve,g+=n*Le,m+=n*O,v+=n*B,y+=n*Q,S+=n*K,C+=n*_e,w+=n*R,E+=n*N,A+=n*J,b+=n*$,V+=n*ge,n=e[4],c+=n*pe,f+=n*W,p+=n*fe,d+=n*Ie,g+=n*Ve,m+=n*Le,v+=n*O,y+=n*B,S+=n*Q,C+=n*K,w+=n*_e,E+=n*R,A+=n*N,b+=n*J,V+=n*$,I+=n*ge,n=e[5],f+=n*pe,p+=n*W,d+=n*fe,g+=n*Ie,m+=n*Ve,v+=n*Le,y+=n*O,S+=n*B,C+=n*Q,w+=n*K,E+=n*_e,A+=n*R,b+=n*N,V+=n*J,I+=n*$,D+=n*ge,n=e[6],p+=n*pe,d+=n*W,g+=n*fe,m+=n*Ie,v+=n*Ve,y+=n*Le,S+=n*O,C+=n*B,w+=n*Q,E+=n*K,A+=n*_e,b+=n*R,V+=n*N,I+=n*J,D+=n*$,U+=n*ge,n=e[7],d+=n*pe,g+=n*W,m+=n*fe,v+=n*Ie,y+=n*Ve,S+=n*Le,C+=n*O,w+=n*B,E+=n*Q,A+=n*K,b+=n*_e,V+=n*R,I+=n*N,D+=n*J,U+=n*$,F+=n*ge,n=e[8],g+=n*pe,m+=n*W,v+=n*fe,y+=n*Ie,S+=n*Ve,C+=n*Le,w+=n*O,E+=n*B,A+=n*Q,b+=n*K,V+=n*_e,I+=n*R,D+=n*N,U+=n*J,F+=n*$,M+=n*ge,n=e[9],m+=n*pe,v+=n*W,y+=n*fe,S+=n*Ie,C+=n*Ve,w+=n*Le,E+=n*O,A+=n*B,b+=n*Q,V+=n*K,I+=n*_e,D+=n*R,U+=n*N,F+=n*J,M+=n*$,se+=n*ge,n=e[10],v+=n*pe,y+=n*W,S+=n*fe,C+=n*Ie,w+=n*Ve,E+=n*Le,A+=n*O,b+=n*B,V+=n*Q,I+=n*K,D+=n*_e,U+=n*R,F+=n*N,M+=n*J,se+=n*$,ee+=n*ge,n=e[11],y+=n*pe,S+=n*W,C+=n*fe,w+=n*Ie,E+=n*Ve,A+=n*Le,b+=n*O,V+=n*B,I+=n*Q,D+=n*K,U+=n*_e,F+=n*R,M+=n*N,se+=n*J,ee+=n*$,ie+=n*ge,n=e[12],S+=n*pe,C+=n*W,w+=n*fe,E+=n*Ie,A+=n*Ve,b+=n*Le,V+=n*O,I+=n*B,D+=n*Q,U+=n*K,F+=n*_e,M+=n*R,se+=n*N,ee+=n*J,ie+=n*$,X+=n*ge,n=e[13],C+=n*pe,w+=n*W,E+=n*fe,A+=n*Ie,b+=n*Ve,V+=n*Le,I+=n*O,D+=n*B,U+=n*Q,F+=n*K,M+=n*_e,se+=n*R,ee+=n*N,ie+=n*J,X+=n*$,he+=n*ge,n=e[14],w+=n*pe,E+=n*W,A+=n*fe,b+=n*Ie,V+=n*Ve,I+=n*Le,D+=n*O,U+=n*B,F+=n*Q,M+=n*K,se+=n*_e,ee+=n*R,ie+=n*N,X+=n*J,he+=n*$,Ce+=n*ge,n=e[15],E+=n*pe,A+=n*W,b+=n*fe,V+=n*Ie,I+=n*Ve,D+=n*Le,U+=n*O,F+=n*B,M+=n*Q,se+=n*K,ee+=n*_e,ie+=n*R,X+=n*N,he+=n*J,Ce+=n*$,xe+=n*ge,i+=38*A,a+=38*b,o+=38*V,l+=38*I,c+=38*D,f+=38*U,p+=38*F,d+=38*M,g+=38*se,m+=38*ee,v+=38*ie,y+=38*X,S+=38*he,C+=38*Ce,w+=38*xe,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=o+s+65535,s=Math.floor(n/65536),o=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=c+s+65535,s=Math.floor(n/65536),c=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=p+s+65535,s=Math.floor(n/65536),p=n-s*65536,n=d+s+65535,s=Math.floor(n/65536),d=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=v+s+65535,s=Math.floor(n/65536),v=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=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=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=o+s+65535,s=Math.floor(n/65536),o=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=c+s+65535,s=Math.floor(n/65536),c=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=p+s+65535,s=Math.floor(n/65536),p=n-s*65536,n=d+s+65535,s=Math.floor(n/65536),d=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=v+s+65535,s=Math.floor(n/65536),v=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=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,i+=s-1+37*(s-1),r[0]=i,r[1]=a,r[2]=o,r[3]=l,r[4]=c,r[5]=f,r[6]=p,r[7]=d,r[8]=g,r[9]=m,r[10]=v,r[11]=y,r[12]=S,r[13]=C,r[14]=w,r[15]=E}u(ur,"M")});var jB=ue((nte,MB)=>{"use strict";var ls=bt();jt();Es();sd();MB.exports=ls.kem=ls.kem||{};var FB=ls.jsbn.BigInteger;ls.kem.rsa={};ls.kem.rsa.create=function(r,e){e=e||{};var t=e.prng||ls.random,n={};return n.encrypt=function(s,i){var a=Math.ceil(s.n.bitLength()/8),o;do o=new FB(ls.util.bytesToHex(t.getBytesSync(a)),16).mod(s.n);while(o.compareTo(FB.ONE)<=0);o=ls.util.hexToBytes(o.toString(16));var l=a-o.length;l>0&&(o=ls.util.fillString("\0",l)+o);var c=s.encrypt(o,"NONE"),f=r.generate(o,i);return{encapsulation:c,key:f}},n.decrypt=function(s,i,a){var o=s.decrypt(i,"NONE");return r.generate(o,a)},n};ls.kem.kdf1=function(r,e){UB(this,r,0,e||r.digestLength)};ls.kem.kdf2=function(r,e){UB(this,r,1,e||r.digestLength)};function UB(r,e,t,n){r.generate=function(s,i){for(var a=new ls.util.ByteBuffer,o=Math.ceil(i/n)+t,l=new ls.util.ByteBuffer,c=t;c<o;++c){l.putInt32(c),e.start(),e.update(s+l.getBytes());var f=e.digest();a.putBytes(f.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}u(UB,"_createKDF")});var XB=ue((ite,KB)=>{"use strict";var Ot=bt();jt();KB.exports=Ot.log=Ot.log||{};Ot.log.levels=["none","error","warning","info","debug","verbose","max"];var mv={},vC=[],hd=null;Ot.log.LEVEL_LOCKED=2;Ot.log.NO_LEVEL_CHECK=4;Ot.log.INTERPOLATE=8;for(bi=0;bi<Ot.log.levels.length;++bi)gC=Ot.log.levels[bi],mv[gC]={index:bi,name:gC.toUpperCase()};var gC,bi;Ot.log.logMessage=function(r){for(var e=mv[r.level].index,t=0;t<vC.length;++t){var n=vC[t];if(n.flags&Ot.log.NO_LEVEL_CHECK)n.f(r);else{var s=mv[n.level].index;e<=s&&n.f(n,r)}}};Ot.log.prepareStandard=function(r){"standard"in r||(r.standard=mv[r.level].name+" ["+r.category+"] "+r.message)};Ot.log.prepareFull=function(r){if(!("full"in r)){var e=[r.message];e=e.concat([]),r.full=Ot.util.format.apply(this,e)}};Ot.log.prepareStandardFull=function(r){"standardFull"in r||(Ot.log.prepareStandard(r),r.standardFull=r.standard)};for(yC=["error","warning","info","debug","verbose"],bi=0;bi<yC.length;++bi)(function(e){Ot.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};Ot.log.logMessage(i)}})(yC[bi]);var yC,bi;Ot.log.makeLogger=function(r){var e={flags:0,f:r};return Ot.log.setLevel(e,"none"),e};Ot.log.setLevel=function(r,e){var t=!1;if(r&&!(r.flags&Ot.log.LEVEL_LOCKED))for(var n=0;n<Ot.log.levels.length;++n){var s=Ot.log.levels[n];if(e==s){r.level=e,t=!0;break}}return t};Ot.log.lock=function(r,e){typeof e>"u"||e?r.flags|=Ot.log.LEVEL_LOCKED:r.flags&=~Ot.log.LEVEL_LOCKED};Ot.log.addLogger=function(r){vC.push(r)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(qB={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},pd=u(function(r,e){Ot.log.prepareStandard(e);var t=qB[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),t.apply(console,n)},"f"),Tf=Ot.log.makeLogger(pd)):(pd=u(function(e,t){Ot.log.prepareStandardFull(t),console.log(t.standardFull)},"f"),Tf=Ot.log.makeLogger(pd)),Ot.log.setLevel(Tf,"debug"),Ot.log.addLogger(Tf),hd=Tf):console={log:u(function(){},"log")};var Tf,qB,pd;hd!==null&&typeof window<"u"&&window.location&&(fd=new URL(window.location.href).searchParams,fd.has("console.level")&&Ot.log.setLevel(hd,fd.get("console.level").slice(-1)[0]),fd.has("console.lock")&&(HB=fd.get("console.lock").slice(-1)[0],HB=="true"&&Ot.log.lock(hd)));var fd,HB;Ot.log.consoleLogger=hd});var $B=ue((ote,GB)=>{"use strict";GB.exports=yi();Wy();wf();OA();oC()});var JB=ue((ute,zB)=>{"use strict";var Fe=bt();oo();Js();rd();uo();zu();GA();Es();jt();uv();var z=Fe.asn1,kn=zB.exports=Fe.pkcs7=Fe.pkcs7||{};kn.messageFromPem=function(r){var e=Fe.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=z.fromDer(e.body);return kn.messageFromAsn1(n)};kn.messageToPem=function(r,e){var t={type:"PKCS7",body:z.toDer(r.toAsn1()).getBytes()};return Fe.pem.encode(t,{maxline:e})};kn.messageFromAsn1=function(r){var e={},t=[];if(!z.validate(r,kn.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=z.derToOid(e.contentType),i;switch(s){case Fe.pki.oids.envelopedData:i=kn.createEnvelopedData();break;case Fe.pki.oids.encryptedData:i=kn.createEncryptedData();break;case Fe.pki.oids.signedData:i=kn.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};kn.createSignedData=function(){var r=null;return r={type:Fe.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:u(function(n){if(wC(r,n,kn.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(Fe.pki.certificateFromAsn1(s[i]))},"fromAsn1"),toAsn1:u(function(){r.contentInfo||r.sign();for(var n=[],s=0;s<r.certificates.length;++s)n.push(Fe.pki.certificateToAsn1(r.certificates[s]));var i=[],a=z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,r.digestAlgorithmIdentifiers),r.contentInfo])]);return n.length>0&&a.value[0].value.push(z.create(z.Class.CONTEXT_SPECIFIC,0,!0,n)),i.length>0&&a.value[0].value.push(z.create(z.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(z.create(z.Class.UNIVERSAL,z.Type.SET,!0,r.signerInfos)),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),a])},"toAsn1"),addSigner:u(function(n){var s=n.issuer,i=n.serialNumber;if(n.certificate){var a=n.certificate;typeof a=="string"&&(a=Fe.pki.certificateFromPem(a)),s=a.issuer.attributes,i=a.serialNumber}var o=n.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=Fe.pki.privateKeyFromPem(o));var l=n.digestAlgorithm||Fe.pki.oids.sha1;switch(l){case Fe.pki.oids.sha1:case Fe.pki.oids.sha256:case Fe.pki.oids.sha384:case Fe.pki.oids.sha512:case Fe.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var c=n.authenticatedAttributes||[];if(c.length>0){for(var f=!1,p=!1,d=0;d<c.length;++d){var g=c[d];if(!f&&g.type===Fe.pki.oids.contentType){if(f=!0,p)break;continue}if(!p&&g.type===Fe.pki.oids.messageDigest){if(p=!0,f)break;continue}}if(!f||!p)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}r.signers.push({key:o,version:1,issuer:s,serialNumber:i,digestAlgorithm:l,signatureAlgorithm:Fe.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},"addSigner"),sign:u(function(n){if(n=n||{},(typeof r.content!="object"||r.contentInfo===null)&&(r.contentInfo=z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(Fe.pki.oids.data).getBytes())]),"content"in r)){var s;r.content instanceof Fe.util.ByteBuffer?s=r.content.bytes():typeof r.content=="string"&&(s=Fe.util.encodeUtf8(r.content)),n.detached?r.detachedContent=z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,s):r.contentInfo.value.push(z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,s)]))}if(r.signers.length!==0){var i=e();t(i)}},"sign"),verify:u(function(){throw new Error("PKCS#7 signature verification not yet implemented.")},"verify"),addCertificate:u(function(n){typeof n=="string"&&(n=Fe.pki.certificateFromPem(n)),r.certificates.push(n)},"addCertificate"),addCertificateRevokationList:u(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]=Fe.md[Fe.pki.oids[a]].create()),i.authenticatedAttributes.length===0?i.md=n[a]:i.md=Fe.md[Fe.pki.oids[a]].create()}r.digestAlgorithmIdentifiers=[];for(var a in n)r.digestAlgorithmIdentifiers.push(z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(a).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")]));return n}u(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=z.derToOid(r.contentInfo.value[0].value),a=z.toDer(s);a.getByte(),z.getBerValueLength(a),a=a.getBytes();for(var o in n)n[o].start().update(a);for(var l=new Date,c=0;c<r.signers.length;++c){var f=r.signers[c];if(f.authenticatedAttributes.length===0){if(i!==Fe.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=z.create(z.Class.UNIVERSAL,z.Type.SET,!0,[]),d=0;d<f.authenticatedAttributes.length;++d){var g=f.authenticatedAttributes[d];g.type===Fe.pki.oids.messageDigest?g.value=n[f.digestAlgorithm].digest():g.type===Fe.pki.oids.signingTime&&(g.value||(g.value=l)),p.value.push(EC(g)),f.authenticatedAttributesAsn1.value.push(EC(g))}a=z.toDer(p).getBytes(),f.md.start().update(a)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}r.signerInfos=e9(r.signers)}u(t,"addSignerInfos")};kn.createEncryptedData=function(){var r=null;return r={type:Fe.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:Fe.pki.oids["aes256-CBC"]},fromAsn1:u(function(e){wC(r,e,kn.asn1.encryptedDataValidator)},"fromAsn1"),decrypt:u(function(e){e!==void 0&&(r.encryptedContent.key=e),WB(r)},"decrypt")},r};kn.createEnvelopedData=function(){var r=null;return r={type:Fe.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:Fe.pki.oids["aes256-CBC"]},fromAsn1:u(function(e){var t=wC(r,e,kn.asn1.envelopedDataValidator);r.recipients=YM(t.recipientInfos.value)},"fromAsn1"),toAsn1:u(function(){return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,QM(r.recipients)),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,t9(r.encryptedContent))])])])},"toAsn1"),findRecipient:u(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,o=0;o<t.length;++o)if(i[o].type!==t[o].type||i[o].value!==t[o].value){a=!1;break}if(a)return s}}return null},"findRecipient"),decrypt:u(function(e,t){if(r.encryptedContent.key===void 0&&e!==void 0&&t!==void 0)switch(e.encryptedContent.algorithm){case Fe.pki.oids.rsaEncryption:case Fe.pki.oids.desCBC:var n=t.decrypt(e.encryptedContent.content);r.encryptedContent.key=Fe.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+e.encryptedContent.algorithm)}WB(r)},"decrypt"),addRecipient:u(function(e){r.recipients.push({version:0,issuer:e.issuer.attributes,serialNumber:e.serialNumber,encryptedContent:{algorithm:Fe.pki.oids.rsaEncryption,key:e.publicKey}})},"addRecipient"),encrypt:u(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 Fe.pki.oids["aes128-CBC"]:n=16,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["aes192-CBC"]:n=24,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["aes256-CBC"]:n=32,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["des-EDE3-CBC"]:n=24,s=8,i=Fe.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+t)}if(e===void 0)e=Fe.util.createBuffer(Fe.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=Fe.util.createBuffer(Fe.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 o=0;o<r.recipients.length;++o){var l=r.recipients[o];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case Fe.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 zM(r){var e={},t=[];if(!z.validate(r,kn.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:Fe.pki.RDNAttributesAsArray(e.issuer),serialNumber:Fe.util.createBuffer(e.serial).toHex(),encryptedContent:{algorithm:z.derToOid(e.encAlgorithm),parameter:e.encParameter?e.encParameter.value:void 0,content:e.encKey}}}u(zM,"_recipientFromAsn1");function JM(r){return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[Fe.pki.distinguishedNameToAsn1({attributes:r.issuer}),z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,Fe.util.hexToBytes(r.serialNumber))]),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.encryptedContent.algorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")]),z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.encryptedContent.content)])}u(JM,"_recipientToAsn1");function YM(r){for(var e=[],t=0;t<r.length;++t)e.push(zM(r[t]));return e}u(YM,"_recipientsFromAsn1");function QM(r){for(var e=[],t=0;t<r.length;++t)e.push(JM(r[t]));return e}u(QM,"_recipientsToAsn1");function ZM(r){var e=z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[Fe.pki.distinguishedNameToAsn1({attributes:r.issuer}),z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,Fe.util.hexToBytes(r.serialNumber))]),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.digestAlgorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")])]);if(r.authenticatedAttributesAsn1&&e.value.push(r.authenticatedAttributesAsn1),e.value.push(z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.signatureAlgorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")])),e.value.push(z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.signature)),r.unauthenticatedAttributes.length>0){for(var t=z.create(z.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<r.unauthenticatedAttributes.length;++n){var s=r.unauthenticatedAttributes[n];t.values.push(EC(s))}e.value.push(t)}return e}u(ZM,"_signerToAsn1");function e9(r){for(var e=[],t=0;t<r.length;++t)e.push(ZM(r[t]));return e}u(e9,"_signersToAsn1");function EC(r){var e;if(r.type===Fe.pki.oids.contentType)e=z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.value).getBytes());else if(r.type===Fe.pki.oids.messageDigest)e=z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.value.bytes());else if(r.type===Fe.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=z.utcTimeToDate(s):s=z.generalizedTimeToDate(s):s=new Date(i)}s>=t&&s<n?e=z.create(z.Class.UNIVERSAL,z.Type.UTCTIME,!1,z.dateToUtcTime(s)):e=z.create(z.Class.UNIVERSAL,z.Type.GENERALIZEDTIME,!1,z.dateToGeneralizedTime(s))}return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,[e])])}u(EC,"_attributeToAsn1");function t9(r){return[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(Fe.pki.oids.data).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.algorithm).getBytes()),r.parameter?z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.parameter.getBytes()):void 0]),z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.content.getBytes())])]}u(t9,"_encryptedContentToAsn1");function wC(r,e,t){var n={},s=[];if(!z.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=z.derToOid(n.contentType);if(a!==Fe.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var o="";if(Fe.util.isArray(n.encryptedContent))for(var l=0;l<n.encryptedContent.length;++l){if(n.encryptedContent[l].type!==z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=n.encryptedContent[l].value}else o=n.encryptedContent;r.encryptedContent={algorithm:z.derToOid(n.encAlgorithm),parameter:Fe.util.createBuffer(n.encParameter.value),content:Fe.util.createBuffer(o)}}if(n.content){var o="";if(Fe.util.isArray(n.content))for(var l=0;l<n.content.length;++l){if(n.content[l].type!==z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=n.content[l].value}else o=n.content;r.content=Fe.util.createBuffer(o)}return r.version=n.version.charCodeAt(0),r.rawCapture=n,n}u(wC,"_fromAsn1");function WB(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 Fe.pki.oids["aes128-CBC"]:case Fe.pki.oids["aes192-CBC"]:case Fe.pki.oids["aes256-CBC"]:e=Fe.aes.createDecryptionCipher(r.encryptedContent.key);break;case Fe.pki.oids.desCBC:case Fe.pki.oids["des-EDE3-CBC"]:e=Fe.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}}u(WB,"_decryptContent")});var QB=ue((cte,YB)=>{"use strict";var Mr=bt();oo();gf();Wy();wf();jt();var yv=YB.exports=Mr.ssh=Mr.ssh||{};yv.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
+ `+o+e.substr(a+1),i=s-a-1,a=-1,++s}else(e[s]===" "||e[s]===" "||e[s]===",")&&(a=s);return e}u(zy,"foldHeader");function I6(r){return r.replace(/^\s+/,"")}u(I6,"ltrim")});var rd=ue((dee,fD)=>{"use strict";var wr=bt();jy();bA();jt();fD.exports=wr.des=wr.des||{};wr.des.startEncrypting=function(r,e,t,n){var s=Yy({key:r,output:t,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};wr.des.createEncryptionCipher=function(r,e){return Yy({key:r,output:null,decrypt:!1,mode:e})};wr.des.startDecrypting=function(r,e,t,n){var s=Yy({key:r,output:t,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};wr.des.createDecryptionCipher=function(r,e){return Yy({key:r,output:null,decrypt:!0,mode:e})};wr.des.Algorithm=function(r,e){var t=this;t.name=r,t.mode=new e({blockSize:8,cipher:{encrypt:u(function(n,s){return cD(t._keys,n,s,!1)},"encrypt"),decrypt:u(function(n,s){return cD(t._keys,n,s,!0)},"decrypt")}}),t._init=!1};wr.des.Algorithm.prototype.initialize=function(r){if(!this._init){var e=wr.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=V6(e),this._init=!0}};Ei("DES-ECB",wr.cipher.modes.ecb);Ei("DES-CBC",wr.cipher.modes.cbc);Ei("DES-CFB",wr.cipher.modes.cfb);Ei("DES-OFB",wr.cipher.modes.ofb);Ei("DES-CTR",wr.cipher.modes.ctr);Ei("3DES-ECB",wr.cipher.modes.ecb);Ei("3DES-CBC",wr.cipher.modes.cbc);Ei("3DES-CFB",wr.cipher.modes.cfb);Ei("3DES-OFB",wr.cipher.modes.ofb);Ei("3DES-CTR",wr.cipher.modes.ctr);function Ei(r,e){var t=u(function(){return new wr.des.Algorithm(r,e)},"factory");wr.cipher.registerAlgorithm(r,t)}u(Ei,"registerAlgorithm");var D6=[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],B6=[-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],R6=[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],O6=[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],_6=[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],P6=[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],k6=[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],L6=[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 V6(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],o=[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],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=r.length()>8?3:1,y=[],S=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,w,E=0;E<v;E++){var A=r.getInt32(),b=r.getInt32();w=(A>>>4^b)&252645135,b^=w,A^=w<<4,w=(b>>>-16^A)&65535,A^=w,b^=w<<-16,w=(A>>>2^b)&858993459,b^=w,A^=w<<2,w=(b>>>-16^A)&65535,A^=w,b^=w<<-16,w=(A>>>1^b)&1431655765,b^=w,A^=w<<1,w=(b>>>8^A)&16711935,A^=w,b^=w<<8,w=(A>>>1^b)&1431655765,b^=w,A^=w<<1,w=A<<8|b>>>20&240,A=b<<24|b<<8&16711680|b>>>8&65280|b>>>24&240,b=w;for(var V=0;V<S.length;++V){S[V]?(A=A<<2|A>>>26,b=b<<2|b>>>26):(A=A<<1|A>>>27,b=b<<1|b>>>27),A&=-15,b&=-15;var I=e[A>>>28]|t[A>>>24&15]|n[A>>>20&15]|s[A>>>16&15]|i[A>>>12&15]|a[A>>>8&15]|o[A>>>4&15],D=l[b>>>28]|c[b>>>24&15]|f[b>>>20&15]|p[b>>>16&15]|d[b>>>12&15]|g[b>>>8&15]|m[b>>>4&15];w=(D>>>16^I)&65535,y[C++]=I^w,y[C++]=D^w<<16}}return y}u(V6,"_createKeys");function cD(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,o=e[0],l=e[1];a=(o>>>4^l)&252645135,l^=a,o^=a<<4,a=(o>>>16^l)&65535,l^=a,o^=a<<16,a=(l>>>2^o)&858993459,o^=a,l^=a<<2,a=(l>>>8^o)&16711935,o^=a,l^=a<<8,a=(o>>>1^l)&1431655765,l^=a,o^=a<<1,o=o<<1|o>>>31,l=l<<1|l>>>31;for(var c=0;c<s;c+=3){for(var f=i[c+1],p=i[c+2],d=i[c];d!=f;d+=p){var g=l^r[d],m=(l>>>4|l<<28)^r[d+1];a=o,o=l,l=a^(B6[g>>>24&63]|O6[g>>>16&63]|P6[g>>>8&63]|L6[g&63]|D6[m>>>24&63]|R6[m>>>16&63]|_6[m>>>8&63]|k6[m&63])}a=o,o=l,l=a}o=o>>>1|o<<31,l=l>>>1|l<<31,a=(o>>>1^l)&1431655765,l^=a,o^=a<<1,a=(l>>>8^o)&16711935,o^=a,l^=a<<8,a=(l>>>2^o)&858993459,o^=a,l^=a<<2,a=(o>>>16^l)&65535,l^=a,o^=a<<16,a=(o>>>4^l)&252645135,l^=a,o^=a<<4,t[0]=o,t[1]=l}u(cD,"_updateBlock");function Yy(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="DES-"+e,n;r.decrypt?n=wr.cipher.createDecipher(t,r.key):n=wr.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var o=null;a instanceof wr.util.ByteBuffer&&(o=a,a={}),a=a||{},a.output=o,a.iv=i,s.call(n,a)},n}u(Yy,"_createCipher")});var Qy=ue((gee,hD)=>{"use strict";var _n=bt();gf();yi();jt();var F6=_n.pkcs5=_n.pkcs5||{},sa;_n.util.isNodejs&&!_n.options.usePureJavaScript&&(sa=st("crypto"));hD.exports=_n.pbkdf2=F6.pbkdf2=function(r,e,t,n,s,i){if(typeof s=="function"&&(i=s,s=null),_n.util.isNodejs&&!_n.options.usePureJavaScript&&sa.pbkdf2&&(s===null||typeof s!="object")&&(sa.pbkdf2Sync.length>4||!s||s==="sha1"))return typeof s!="string"&&(s="sha1"),r=Buffer.from(r,"binary"),e=Buffer.from(e,"binary"),i?sa.pbkdf2Sync.length===4?sa.pbkdf2(r,e,t,n,function(w,E){if(w)return i(w);i(null,E.toString("binary"))}):sa.pbkdf2(r,e,t,n,s,function(w,E){if(w)return i(w);i(null,E.toString("binary"))}):sa.pbkdf2Sync.length===4?sa.pbkdf2Sync(r,e,t,n).toString("binary"):sa.pbkdf2Sync(r,e,t,n,s).toString("binary");if((typeof s>"u"||s===null)&&(s="sha1"),typeof s=="string"){if(!(s in _n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=_n.md[s].create()}var a=s.digestLength;if(n>4294967295*a){var o=new Error("Derived key is too long.");if(i)return i(o);throw o}var l=Math.ceil(n/a),c=n-(l-1)*a,f=_n.hmac.create();f.start(s,r);var p="",d,g,m;if(!i){for(var v=1;v<=l;++v){f.start(null,null),f.update(e),f.update(_n.util.int32ToBytes(v)),d=m=f.digest().getBytes();for(var y=2;y<=t;++y)f.start(null,null),f.update(m),g=f.digest().getBytes(),d=_n.util.xorBytes(d,g,a),m=g;p+=v<l?d:d.substr(0,c)}return p}var v=1,y;function S(){if(v>l)return i(null,p);f.start(null,null),f.update(e),f.update(_n.util.int32ToBytes(v)),d=m=f.digest().getBytes(),y=2,C()}u(S,"outer");function C(){if(y<=t)return f.start(null,null),f.update(m),g=f.digest().getBytes(),d=_n.util.xorBytes(d,g,a),m=g,++y,_n.util.setImmediate(C);p+=v<l?d:d.substr(0,c),++v,S()}u(C,"inner"),S()}});var OA=ue((vee,yD)=>{"use strict";var wi=bt();yi();jt();var dD=yD.exports=wi.sha256=wi.sha256||{};wi.md.sha256=wi.md.algorithms.sha256=dD;dD.create=function(){mD||U6();var r=null,e=wi.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=wi.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=wi.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),pD(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=wi.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(RA.substr(0,n.blockLength-a));for(var o,l,c=n.fullMessageLength[0]*8,f=0;f<n.fullMessageLength.length-1;++f)o=n.fullMessageLength[f+1]*8,l=o/4294967296>>>0,c+=l,s.putInt32(c>>>0),c=o>>>0;s.putInt32(c);var p={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4,h5:r.h5,h6:r.h6,h7:r.h7};pD(p,t,s);var d=wi.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d.putInt32(p.h5),d.putInt32(p.h6),d.putInt32(p.h7),d},n};var RA=null,mD=!1,gD=null;function U6(){RA="\x80",RA+=wi.util.fillString("\0",64),gD=[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],mD=!0}u(U6,"_init");function pD(r,e,t){for(var n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C=t.length();C>=64;){for(c=0;c<16;++c)e[c]=t.getInt32();for(;c<64;++c)n=e[c-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,s=e[c-15],s=(s>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,e[c]=n+e[c-7]+s+e[c-16]|0;for(f=r.h0,p=r.h1,d=r.h2,g=r.h3,m=r.h4,v=r.h5,y=r.h6,S=r.h7,c=0;c<64;++c)a=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),o=y^m&(v^y),i=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),l=f&p|d&(f^p),n=S+a+o+gD[c]+e[c],s=i+l,S=y,y=v,v=m,m=g+n>>>0,g=d,d=p,p=f,f=n+s>>>0;r.h0=r.h0+f|0,r.h1=r.h1+p|0,r.h2=r.h2+d|0,r.h3=r.h3+g|0,r.h4=r.h4+m|0,r.h5=r.h5+v|0,r.h6=r.h6+y|0,r.h7=r.h7+S|0,C-=64}}u(pD,"_update")});var _A=ue((wee,vD)=>{"use strict";var Si=bt();jt();var Zy=null;Si.util.isNodejs&&!Si.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Zy=st("crypto"));var M6=vD.exports=Si.prng=Si.prng||{};M6.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(c,f){if(!f)return e.generateSync(c);var p=e.plugin.cipher,d=e.plugin.increment,g=e.plugin.formatKey,m=e.plugin.formatSeed,v=Si.util.createBuffer();e.key=null,y();function y(S){if(S)return f(S);if(v.length()>=c)return f(null,v.getBytes(c));if(e.generated>1048575&&(e.key=null),e.key===null)return Si.util.nextTick(function(){i(y)});var C=p(e.key,e.seed);e.generated+=C.length,v.putBytes(C),e.key=g(p(e.key,d(e.seed))),e.seed=m(p(e.key,e.seed)),Si.util.setImmediate(y)}u(y,"generate")},e.generateSync=function(c){var f=e.plugin.cipher,p=e.plugin.increment,d=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var m=Si.util.createBuffer();m.length()<c;){e.generated>1048575&&(e.key=null),e.key===null&&a();var v=f(e.key,e.seed);e.generated+=v.length,m.putBytes(v),e.key=d(f(e.key,p(e.seed))),e.seed=g(f(e.key,e.seed))}return m.getBytes(c)};function i(c){if(e.pools[0].messageLength>=32)return o(),c();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(p,d){if(p)return c(p);e.collect(d),o(),c()})}u(i,"_reseed");function a(){if(e.pools[0].messageLength>=32)return o();var c=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(c)),o()}u(a,"_reseedSync");function o(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var c=e.plugin.md.create();c.update(e.keyBytes);for(var f=1,p=0;p<32;++p)e.reseeds%f===0&&(c.update(e.pools[p].digest().getBytes()),e.pools[p].start()),f=f<<1;e.keyBytes=c.digest().getBytes(),c.start(),c.update(e.keyBytes);var d=c.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(d),e.generated=0}u(o,"_seed");function l(c){var f=null,p=Si.util.globalScope,d=p.crypto||p.msCrypto;d&&d.getRandomValues&&(f=u(function(A){return d.getRandomValues(A)},"getRandomValues"));var g=Si.util.createBuffer();if(f)for(;g.length()<c;){var m=Math.max(1,Math.min(c-g.length(),65536)/4),v=new Uint32Array(Math.floor(m));try{f(v);for(var y=0;y<v.length;++y)g.putInt32(v[y])}catch(A){if(!(typeof QuotaExceededError<"u"&&A instanceof QuotaExceededError))throw A}}if(g.length()<c)for(var S,C,w,E=Math.floor(Math.random()*65536);g.length()<c;){C=16807*(E&65535),S=16807*(E>>16),C+=(S&32767)<<16,C+=S>>15,C=(C&2147483647)+(C>>31),E=C&4294967295;for(var y=0;y<3;++y)w=E>>>(y<<3),w^=Math.floor(Math.random()*256),g.putByte(w&255)}return g.getBytes(c)}return u(l,"defaultSeedFile"),Zy?(e.seedFile=function(c,f){Zy.randomBytes(c,function(p,d){if(p)return f(p);f(null,d.toString())})},e.seedFileSync=function(c){return Zy.randomBytes(c).toString()}):(e.seedFile=function(c,f){try{f(null,l(c))}catch(p){f(p)}},e.seedFileSync=l),e.collect=function(c){for(var f=c.length,p=0;p<f;++p)e.pools[e.pool].update(c.substr(p,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(c,f){for(var p="",d=0;d<f;d+=8)p+=String.fromCharCode(c>>d&255);e.collect(p)},e.registerWorker=function(c){if(c===self)e.seedFile=function(p,d){function g(m){var v=m.data;v.forge&&v.forge.prng&&(self.removeEventListener("message",g),d(v.forge.prng.err,v.forge.prng.bytes))}u(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:p}}})};else{var f=u(function(p){var d=p.data;d.forge&&d.forge.prng&&e.seedFile(d.forge.prng.needed,function(g,m){c.postMessage({forge:{prng:{err:g,bytes:m}}})})},"listener");c.addEventListener("message",f)}},e}});var Es=ue((Aee,PA)=>{"use strict";var en=bt();oo();OA();_A();jt();(function(){if(en.random&&en.random.getBytes){PA.exports=en.random;return}(function(r){var e={},t=new Array(4),n=en.util.createBuffer();e.formatKey=function(p){var d=en.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),en.aes._expandKey(p,!1)},e.formatSeed=function(p){var d=en.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),p},e.cipher=function(p,d){return en.aes._updateBlock(p,d,t,!1),n.putInt32(t[0]),n.putInt32(t[1]),n.putInt32(t[2]),n.putInt32(t[3]),n.getBytes()},e.increment=function(p){return++p[3],p},e.md=en.md.sha256;function s(){var p=en.prng.create(e);return p.getBytes=function(d,g){return p.generate(d,g)},p.getBytesSync=function(d){return p.generate(d)},p}u(s,"spawnPrng");var i=s(),a=null,o=en.util.globalScope,l=o.crypto||o.msCrypto;if(l&&l.getRandomValues&&(a=u(function(p){return l.getRandomValues(p)},"getRandomValues")),en.options.usePureJavaScript||!en.util.isNodejs&&!a){if(typeof window>"u"||window.document,i.collectInt(+new Date,32),typeof navigator<"u"){var c="";for(var f in navigator)try{typeof navigator[f]=="string"&&(c+=navigator[f])}catch{}i.collect(c),c=null}r&&(r().mousemove(function(p){i.collectInt(p.clientX,16),i.collectInt(p.clientY,16)}),r().keypress(function(p){i.collectInt(p.charCode,8)}))}if(!en.random)en.random=i;else for(var f in i)en.random[f]=i[f];en.random.createInstance=s,PA.exports=en.random})(typeof jQuery<"u"?jQuery:null)})()});var LA=ue((xee,SD)=>{"use strict";var qn=bt();jt();var kA=[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],ED=[1,2,3,5],j6=u(function(r,e){return r<<e&65535|(r&65535)>>16-e},"rol"),q6=u(function(r,e){return(r&65535)>>e|r<<16-e&65535},"ror");SD.exports=qn.rc2=qn.rc2||{};qn.rc2.expandKey=function(r,e){typeof r=="string"&&(r=qn.util.createBuffer(r)),e=e||128;var t=r,n=r.length(),s=e,i=Math.ceil(s/8),a=255>>(s&7),o;for(o=n;o<128;o++)t.putByte(kA[t.at(o-1)+t.at(o-n)&255]);for(t.setAt(128-i,kA[t.at(128-i)&a]),o=127-i;o>=0;o--)t.setAt(o,kA[t.at(o+1)^t.at(o+i)]);return t};var wD=u(function(r,e,t){var n=!1,s=null,i=null,a=null,o,l,c,f,p=[];for(r=qn.rc2.expandKey(r,e),c=0;c<64;c++)p.push(r.getInt16Le());t?(o=u(function(m){for(c=0;c<4;c++)m[c]+=p[f]+(m[(c+3)%4]&m[(c+2)%4])+(~m[(c+3)%4]&m[(c+1)%4]),m[c]=j6(m[c],ED[c]),f++},"mixRound"),l=u(function(m){for(c=0;c<4;c++)m[c]+=p[m[(c+3)%4]&63]},"mashRound")):(o=u(function(m){for(c=3;c>=0;c--)m[c]=q6(m[c],ED[c]),m[c]-=p[f]+(m[(c+3)%4]&m[(c+2)%4])+(~m[(c+3)%4]&m[(c+1)%4]),f--},"mixRound"),l=u(function(m){for(c=3;c>=0;c--)m[c]-=p[m[(c+3)%4]&63]},"mashRound"));var d=u(function(m){var v=[];for(c=0;c<4;c++){var y=s.getInt16Le();a!==null&&(t?y^=a.getInt16Le():a.putInt16Le(y)),v.push(y&65535)}f=t?0:63;for(var S=0;S<m.length;S++)for(var C=0;C<m[S][0];C++)m[S][1](v);for(c=0;c<4;c++)a!==null&&(t?a.putInt16Le(v[c]):v[c]^=a.getInt16Le()),i.putInt16Le(v[c])},"runPlan"),g=null;return g={start:u(function(m,v){m&&typeof m=="string"&&(m=qn.util.createBuffer(m)),n=!1,s=qn.util.createBuffer(),i=v||new qn.util.createBuffer,a=m,g.output=i},"start"),update:u(function(m){for(n||s.putBuffer(m);s.length()>=8;)d([[5,o],[1,l],[6,o],[1,l],[5,o]])},"update"),finish:u(function(m){var v=!0;if(t)if(m)v=m(8,s,!t);else{var y=s.length()===8?8:8-s.length();s.fillWithByte(y,y)}if(v&&(n=!0,g.update()),!t&&(v=s.length()===0,v))if(m)v=m(8,i,!t);else{var S=i.length(),C=i.at(S-1);C>S?v=!1:i.truncate(C)}return v},"finish")},g},"createCipher");qn.rc2.startEncrypting=function(r,e,t){var n=qn.rc2.createEncryptionCipher(r,128);return n.start(e,t),n};qn.rc2.createEncryptionCipher=function(r,e){return wD(r,e,!0)};qn.rc2.startDecrypting=function(r,e,t){var n=qn.rc2.createDecryptionCipher(r,128);return n.start(e,t),n};qn.rc2.createDecryptionCipher=function(r,e){return wD(r,e,!1)}});var sd=ue((Nee,DD)=>{"use strict";var VA=bt();DD.exports=VA.jsbn=VA.jsbn||{};var ia,H6=0xdeadbeefcafe,AD=(H6&16777215)==15715070;function Ae(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))}u(Ae,"BigInteger");VA.jsbn.BigInteger=Ae;function Lt(){return new Ae(null)}u(Lt,"nbi");function K6(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}u(K6,"am1");function X6(r,e,t,n,s,i){for(var a=e&32767,o=e>>15;--i>=0;){var l=this.data[r]&32767,c=this.data[r++]>>15,f=o*l+c*a;l=a*l+((f&32767)<<15)+t.data[n]+(s&1073741823),s=(l>>>30)+(f>>>15)+o*c+(s>>>30),t.data[n++]=l&1073741823}return s}u(X6,"am2");function CD(r,e,t,n,s,i){for(var a=e&16383,o=e>>14;--i>=0;){var l=this.data[r]&16383,c=this.data[r++]>>14,f=o*l+c*a;l=a*l+((f&16383)<<14)+t.data[n]+s,s=(l>>28)+(f>>14)+o*c,t.data[n++]=l&268435455}return s}u(CD,"am3");typeof navigator>"u"?(Ae.prototype.am=CD,ia=28):AD&&navigator.appName=="Microsoft Internet Explorer"?(Ae.prototype.am=X6,ia=30):AD&&navigator.appName!="Netscape"?(Ae.prototype.am=K6,ia=26):(Ae.prototype.am=CD,ia=28);Ae.prototype.DB=ia;Ae.prototype.DM=(1<<ia)-1;Ae.prototype.DV=1<<ia;var FA=52;Ae.prototype.FV=Math.pow(2,FA);Ae.prototype.F1=FA-ia;Ae.prototype.F2=2*ia-FA;var G6="0123456789abcdefghijklmnopqrstuvwxyz",ev=new Array,vf,ws;vf=48;for(ws=0;ws<=9;++ws)ev[vf++]=ws;vf=97;for(ws=10;ws<36;++ws)ev[vf++]=ws;vf=65;for(ws=10;ws<36;++ws)ev[vf++]=ws;function xD(r){return G6.charAt(r)}u(xD,"int2char");function bD(r,e){var t=ev[r.charCodeAt(e)];return t??-1}u(bD,"intAt");function $6(r){for(var e=this.t-1;e>=0;--e)r.data[e]=this.data[e];r.t=this.t,r.s=this.s}u($6,"bnpCopyTo");function W6(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}u(W6,"bnpFromInt");function lo(r){var e=Lt();return e.fromInt(r),e}u(lo,"nbv");function z6(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:bD(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&&Ae.ZERO.subTo(this,this)}u(z6,"bnpFromString");function J6(){for(var r=this.s&this.DM;this.t>0&&this.data[this.t-1]==r;)--this.t}u(J6,"bnpClamp");function Y6(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,o=this.DB-a*this.DB%e;if(a-- >0)for(o<this.DB&&(n=this.data[a]>>o)>0&&(s=!0,i=xD(n));a>=0;)o<e?(n=(this.data[a]&(1<<o)-1)<<e-o,n|=this.data[--a]>>(o+=this.DB-e)):(n=this.data[a]>>(o-=e)&t,o<=0&&(o+=this.DB,--a)),n>0&&(s=!0),s&&(i+=xD(n));return s?i:"0"}u(Y6,"bnToString");function Q6(){var r=Lt();return Ae.ZERO.subTo(this,r),r}u(Q6,"bnNegate");function Z6(){return this.s<0?this.negate():this}u(Z6,"bnAbs");function eF(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}u(eF,"bnCompareTo");function tv(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}u(tv,"nbits");function tF(){return this.t<=0?0:this.DB*(this.t-1)+tv(this.data[this.t-1]^this.s&this.DM)}u(tF,"bnBitLength");function rF(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}u(rF,"bnpDLShiftTo");function nF(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}u(nF,"bnpDRShiftTo");function sF(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,o;for(o=this.t-1;o>=0;--o)e.data[o+i+1]=this.data[o]>>n|a,a=(this.data[o]&s)<<t;for(o=i-1;o>=0;--o)e.data[o]=0;e.data[i]=a,e.t=this.t+i+1,e.s=this.s,e.clamp()}u(sF,"bnpLShiftTo");function iF(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()}u(iF,"bnpRShiftTo");function aF(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()}u(aF,"bnpSubTo");function oF(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&&Ae.ZERO.subTo(e,e)}u(oF,"bnpMultiplyTo");function uF(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()}u(uF,"bnpSquareTo");function lF(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=Lt());var i=Lt(),a=this.s,o=r.s,l=this.DB-tv(n.data[n.t-1]);l>0?(n.lShiftTo(l,i),s.lShiftTo(l,t)):(n.copyTo(i),s.copyTo(t));var c=i.t,f=i.data[c-1];if(f!=0){var p=f*(1<<this.F1)+(c>1?i.data[c-2]>>this.F2:0),d=this.FV/p,g=(1<<this.F1)/p,m=1<<this.F2,v=t.t,y=v-c,S=e??Lt();for(i.dlShiftTo(y,S),t.compareTo(S)>=0&&(t.data[t.t++]=1,t.subTo(S,t)),Ae.ONE.dlShiftTo(c,S),S.subTo(i,i);i.t<c;)i.data[i.t++]=0;for(;--y>=0;){var C=t.data[--v]==f?this.DM:Math.floor(t.data[v]*d+(t.data[v-1]+m)*g);if((t.data[v]+=i.am(0,C,t,y,0,c))<C)for(i.dlShiftTo(y,S),t.subTo(S,t);t.data[v]<--C;)t.subTo(S,t)}e!=null&&(t.drShiftTo(c,e),a!=o&&Ae.ZERO.subTo(e,e)),t.t=c,t.clamp(),l>0&&t.rShiftTo(l,t),a<0&&Ae.ZERO.subTo(t,t)}}}u(lF,"bnpDivRemTo");function cF(r){var e=Lt();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(Ae.ZERO)>0&&r.subTo(e,e),e}u(cF,"bnMod");function Ju(r){this.m=r}u(Ju,"Classic");function fF(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}u(fF,"cConvert");function hF(r){return r}u(hF,"cRevert");function pF(r){r.divRemTo(this.m,null,r)}u(pF,"cReduce");function dF(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(dF,"cMulTo");function mF(r,e){r.squareTo(e),this.reduce(e)}u(mF,"cSqrTo");Ju.prototype.convert=fF;Ju.prototype.revert=hF;Ju.prototype.reduce=pF;Ju.prototype.mulTo=dF;Ju.prototype.sqrTo=mF;function gF(){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}u(gF,"bnpInvDigit");function Yu(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}u(Yu,"Montgomery");function yF(r){var e=Lt();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(Ae.ZERO)>0&&this.m.subTo(e,e),e}u(yF,"montConvert");function vF(r){var e=Lt();return r.copyTo(e),this.reduce(e),e}u(vF,"montRevert");function EF(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)}u(EF,"montReduce");function wF(r,e){r.squareTo(e),this.reduce(e)}u(wF,"montSqrTo");function SF(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(SF,"montMulTo");Yu.prototype.convert=yF;Yu.prototype.revert=vF;Yu.prototype.reduce=EF;Yu.prototype.mulTo=SF;Yu.prototype.sqrTo=wF;function AF(){return(this.t>0?this.data[0]&1:this.s)==0}u(AF,"bnpIsEven");function CF(r,e){if(r>4294967295||r<1)return Ae.ONE;var t=Lt(),n=Lt(),s=e.convert(this),i=tv(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)}u(CF,"bnpExp");function xF(r,e){var t;return r<256||e.isEven()?t=new Ju(e):t=new Yu(e),this.exp(r,t)}u(xF,"bnModPowInt");Ae.prototype.copyTo=$6;Ae.prototype.fromInt=W6;Ae.prototype.fromString=z6;Ae.prototype.clamp=J6;Ae.prototype.dlShiftTo=rF;Ae.prototype.drShiftTo=nF;Ae.prototype.lShiftTo=sF;Ae.prototype.rShiftTo=iF;Ae.prototype.subTo=aF;Ae.prototype.multiplyTo=oF;Ae.prototype.squareTo=uF;Ae.prototype.divRemTo=lF;Ae.prototype.invDigit=gF;Ae.prototype.isEven=AF;Ae.prototype.exp=CF;Ae.prototype.toString=Y6;Ae.prototype.negate=Q6;Ae.prototype.abs=Z6;Ae.prototype.compareTo=eF;Ae.prototype.bitLength=tF;Ae.prototype.mod=cF;Ae.prototype.modPowInt=xF;Ae.ZERO=lo(0);Ae.ONE=lo(1);function bF(){var r=Lt();return this.copyTo(r),r}u(bF,"bnClone");function NF(){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]}u(NF,"bnIntValue");function TF(){return this.t==0?this.s:this.data[0]<<24>>24}u(TF,"bnByteValue");function IF(){return this.t==0?this.s:this.data[0]<<16>>16}u(IF,"bnShortValue");function DF(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}u(DF,"bnpChunkSize");function BF(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}u(BF,"bnSigNum");function RF(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=lo(t),s=Lt(),i=Lt(),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}u(RF,"bnpToRadix");function OF(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,o=0;o<r.length;++o){var l=bD(r,o);if(l<0){r.charAt(o)=="-"&&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&&Ae.ZERO.subTo(this,this)}u(OF,"bnpFromRadix");function _F(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(Ae.ONE.shiftLeft(r-1),UA,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(Ae.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)}}u(_F,"bnpFromNumber");function PF(){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}u(PF,"bnToByteArray");function kF(r){return this.compareTo(r)==0}u(kF,"bnEquals");function LF(r){return this.compareTo(r)<0?this:r}u(LF,"bnMin");function VF(r){return this.compareTo(r)>0?this:r}u(VF,"bnMax");function FF(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()}u(FF,"bnpBitwiseTo");function UF(r,e){return r&e}u(UF,"op_and");function MF(r){var e=Lt();return this.bitwiseTo(r,UF,e),e}u(MF,"bnAnd");function UA(r,e){return r|e}u(UA,"op_or");function jF(r){var e=Lt();return this.bitwiseTo(r,UA,e),e}u(jF,"bnOr");function ND(r,e){return r^e}u(ND,"op_xor");function qF(r){var e=Lt();return this.bitwiseTo(r,ND,e),e}u(qF,"bnXor");function TD(r,e){return r&~e}u(TD,"op_andnot");function HF(r){var e=Lt();return this.bitwiseTo(r,TD,e),e}u(HF,"bnAndNot");function KF(){for(var r=Lt(),e=0;e<this.t;++e)r.data[e]=this.DM&~this.data[e];return r.t=this.t,r.s=~this.s,r}u(KF,"bnNot");function XF(r){var e=Lt();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}u(XF,"bnShiftLeft");function GF(r){var e=Lt();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}u(GF,"bnShiftRight");function $F(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}u($F,"lbit");function WF(){for(var r=0;r<this.t;++r)if(this.data[r]!=0)return r*this.DB+$F(this.data[r]);return this.s<0?this.t*this.DB:-1}u(WF,"bnGetLowestSetBit");function zF(r){for(var e=0;r!=0;)r&=r-1,++e;return e}u(zF,"cbit");function JF(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=zF(this.data[t]^e);return r}u(JF,"bnBitCount");function YF(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<r%this.DB)!=0}u(YF,"bnTestBit");function QF(r,e){var t=Ae.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}u(QF,"bnpChangeBit");function ZF(r){return this.changeBit(r,UA)}u(ZF,"bnSetBit");function eU(r){return this.changeBit(r,TD)}u(eU,"bnClearBit");function tU(r){return this.changeBit(r,ND)}u(tU,"bnFlipBit");function rU(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()}u(rU,"bnpAddTo");function nU(r){var e=Lt();return this.addTo(r,e),e}u(nU,"bnAdd");function sU(r){var e=Lt();return this.subTo(r,e),e}u(sU,"bnSubtract");function iU(r){var e=Lt();return this.multiplyTo(r,e),e}u(iU,"bnMultiply");function aU(){var r=Lt();return this.squareTo(r),r}u(aU,"bnSquare");function oU(r){var e=Lt();return this.divRemTo(r,e,null),e}u(oU,"bnDivide");function uU(r){var e=Lt();return this.divRemTo(r,null,e),e}u(uU,"bnRemainder");function lU(r){var e=Lt(),t=Lt();return this.divRemTo(r,e,t),new Array(e,t)}u(lU,"bnDivideAndRemainder");function cU(r){this.data[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}u(cU,"bnpDMultiply");function fU(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]}}u(fU,"bnpDAddOffset");function nd(){}u(nd,"NullExp");function ID(r){return r}u(ID,"nNop");function hU(r,e,t){r.multiplyTo(e,t)}u(hU,"nMulTo");function pU(r,e){r.squareTo(e)}u(pU,"nSqrTo");nd.prototype.convert=ID;nd.prototype.revert=ID;nd.prototype.mulTo=hU;nd.prototype.sqrTo=pU;function dU(r){return this.exp(r,new nd)}u(dU,"bnPow");function mU(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()}u(mU,"bnpMultiplyLowerTo");function gU(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)}u(gU,"bnpMultiplyUpperTo");function Ef(r){this.r2=Lt(),this.q3=Lt(),Ae.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}u(Ef,"Barrett");function yU(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=Lt();return r.copyTo(e),this.reduce(e),e}u(yU,"barrettConvert");function vU(r){return r}u(vU,"barrettRevert");function EU(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)}u(EU,"barrettReduce");function wU(r,e){r.squareTo(e),this.reduce(e)}u(wU,"barrettSqrTo");function SU(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(SU,"barrettMulTo");Ef.prototype.convert=yU;Ef.prototype.revert=vU;Ef.prototype.reduce=EU;Ef.prototype.mulTo=SU;Ef.prototype.sqrTo=wU;function AU(r,e){var t=r.bitLength(),n,s=lo(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 Ju(e):e.isEven()?i=new Ef(e):i=new Yu(e);var a=new Array,o=3,l=n-1,c=(1<<n)-1;if(a[1]=i.convert(this),n>1){var f=Lt();for(i.sqrTo(a[1],f);o<=c;)a[o]=Lt(),i.mulTo(f,a[o-2],a[o]),o+=2}var p=r.t-1,d,g=!0,m=Lt(),v;for(t=tv(r.data[p])-1;p>=0;){for(t>=l?d=r.data[p]>>t-l&c:(d=(r.data[p]&(1<<t+1)-1)<<l-t,p>0&&(d|=r.data[p-1]>>this.DB+t-l)),o=n;(d&1)==0;)d>>=1,--o;if((t-=o)<0&&(t+=this.DB,--p),g)a[d].copyTo(s),g=!1;else{for(;o>1;)i.sqrTo(s,m),i.sqrTo(m,s),o-=2;o>0?i.sqrTo(s,m):(v=s,s=m,m=v),i.mulTo(m,a[d],s)}for(;p>=0&&(r.data[p]&1<<t)==0;)i.sqrTo(s,m),v=s,s=m,m=v,--t<0&&(t=this.DB-1,--p)}return i.revert(s)}u(AU,"bnModPow");function CU(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}u(CU,"bnGCD");function xU(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}u(xU,"bnpModInt");function bU(r){if(this.signum()==0)return Ae.ZERO;var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return Ae.ZERO;for(var t=r.clone(),n=this.clone(),s=lo(1),i=lo(0),a=lo(0),o=lo(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()||!o.isEven())&&(a.addTo(this,a),o.subTo(r,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(r,o),o.rShiftTo(1,o);t.compareTo(n)>=0?(t.subTo(n,t),e&&s.subTo(a,s),i.subTo(o,i)):(n.subTo(t,n),e&&a.subTo(s,a),o.subTo(i,o))}if(n.compareTo(Ae.ONE)!=0)return Ae.ZERO;if(o.compareTo(r)>=0)return o.subtract(r);if(o.signum()<0)o.addTo(r,o);else return o;return o.signum()<0?o.add(r):o}u(bU,"bnModInverse");var Ys=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],NU=(1<<26)/Ys[Ys.length-1];function TU(r){var e,t=this.abs();if(t.t==1&&t.data[0]<=Ys[Ys.length-1]){for(e=0;e<Ys.length;++e)if(t.data[0]==Ys[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<Ys.length;){for(var n=Ys[e],s=e+1;s<Ys.length&&n<NU;)n*=Ys[s++];for(n=t.modInt(n);e<s;)if(n%Ys[e++]==0)return!1}return t.millerRabin(r)}u(TU,"bnIsProbablePrime");function IU(r){var e=this.subtract(Ae.ONE),t=e.getLowestSetBit();if(t<=0)return!1;for(var n=e.shiftRight(t),s=DU(),i,a=0;a<r;++a){do i=new Ae(this.bitLength(),s);while(i.compareTo(Ae.ONE)<=0||i.compareTo(e)>=0);var o=i.modPow(n,this);if(o.compareTo(Ae.ONE)!=0&&o.compareTo(e)!=0){for(var l=1;l++<t&&o.compareTo(e)!=0;)if(o=o.modPowInt(2,this),o.compareTo(Ae.ONE)==0)return!1;if(o.compareTo(e)!=0)return!1}}return!0}u(IU,"bnpMillerRabin");function DU(){return{nextBytes:u(function(r){for(var e=0;e<r.length;++e)r[e]=Math.floor(Math.random()*256)},"nextBytes")}}u(DU,"bnGetPrng");Ae.prototype.chunkSize=DF;Ae.prototype.toRadix=RF;Ae.prototype.fromRadix=OF;Ae.prototype.fromNumber=_F;Ae.prototype.bitwiseTo=FF;Ae.prototype.changeBit=QF;Ae.prototype.addTo=rU;Ae.prototype.dMultiply=cU;Ae.prototype.dAddOffset=fU;Ae.prototype.multiplyLowerTo=mU;Ae.prototype.multiplyUpperTo=gU;Ae.prototype.modInt=xU;Ae.prototype.millerRabin=IU;Ae.prototype.clone=bF;Ae.prototype.intValue=NF;Ae.prototype.byteValue=TF;Ae.prototype.shortValue=IF;Ae.prototype.signum=BF;Ae.prototype.toByteArray=PF;Ae.prototype.equals=kF;Ae.prototype.min=LF;Ae.prototype.max=VF;Ae.prototype.and=MF;Ae.prototype.or=jF;Ae.prototype.xor=qF;Ae.prototype.andNot=HF;Ae.prototype.not=KF;Ae.prototype.shiftLeft=XF;Ae.prototype.shiftRight=GF;Ae.prototype.getLowestSetBit=WF;Ae.prototype.bitCount=JF;Ae.prototype.testBit=YF;Ae.prototype.setBit=ZF;Ae.prototype.clearBit=eU;Ae.prototype.flipBit=tU;Ae.prototype.add=nU;Ae.prototype.subtract=sU;Ae.prototype.multiply=iU;Ae.prototype.divide=oU;Ae.prototype.remainder=uU;Ae.prototype.divideAndRemainder=lU;Ae.prototype.modPow=AU;Ae.prototype.modInverse=bU;Ae.prototype.pow=dU;Ae.prototype.gcd=CU;Ae.prototype.isProbablePrime=TU;Ae.prototype.square=aU});var wf=ue((Iee,_D)=>{"use strict";var Ai=bt();yi();jt();var RD=_D.exports=Ai.sha1=Ai.sha1||{};Ai.md.sha1=Ai.md.algorithms.sha1=RD;RD.create=function(){OD||BU();var r=null,e=Ai.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=Ai.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=Ai.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),BD(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=Ai.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(MA.substr(0,n.blockLength-a));for(var o,l,c=n.fullMessageLength[0]*8,f=0;f<n.fullMessageLength.length-1;++f)o=n.fullMessageLength[f+1]*8,l=o/4294967296>>>0,c+=l,s.putInt32(c>>>0),c=o>>>0;s.putInt32(c);var p={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4};BD(p,t,s);var d=Ai.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d},n};var MA=null,OD=!1;function BU(){MA="\x80",MA+=Ai.util.fillString("\0",64),OD=!0}u(BU,"_init");function BD(r,e,t){for(var n,s,i,a,o,l,c,f,p=t.length();p>=64;){for(s=r.h0,i=r.h1,a=r.h2,o=r.h3,l=r.h4,f=0;f<16;++f)n=t.getInt32(),e[f]=n,c=o^i&(a^o),n=(s<<5|s>>>27)+c+l+1518500249+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,c=o^i&(a^o),n=(s<<5|s>>>27)+c+l+1518500249+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+1859775393+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+1859775393+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i&a|o&(i^a),n=(s<<5|s>>>27)+c+l+2400959708+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+3395469782+n,l=o,o=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+o|0,r.h4=r.h4+l|0,p-=64}}u(BD,"_update")});var jA=ue((Bee,kD)=>{"use strict";var Ci=bt();jt();Es();wf();var PD=kD.exports=Ci.pkcs1=Ci.pkcs1||{};PD.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=Ci.md.sha1.create(),a||(a=i);var o=Math.ceil(r.n.bitLength()/8),l=o-2*i.digestLength-2;if(e.length>l){var c=new Error("RSAES-OAEP input message length is too long.");throw c.length=e.length,c.maxLength=l,c}n||(n=""),i.update(n,"raw");for(var f=i.digest(),p="",d=l-e.length,g=0;g<d;g++)p+="\0";var m=f.getBytes()+p+""+e;if(!s)s=Ci.random.getBytes(i.digestLength);else if(s.length!==i.digestLength){var c=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw c.seedLength=s.length,c.digestLength=i.digestLength,c}var v=rv(s,o-i.digestLength-1,a),y=Ci.util.xorBytes(m,v,m.length),S=rv(y,i.digestLength,a),C=Ci.util.xorBytes(s,S,s.length);return"\0"+C+y};PD.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 y=new Error("RSAES-OAEP encoded message length is invalid.");throw y.length=e.length,y.expectedLength=a,y}if(s===void 0?s=Ci.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 o=s.digest().getBytes(),l=e.charAt(0),c=e.substring(1,s.digestLength+1),f=e.substring(1+s.digestLength),p=rv(f,s.digestLength,i),d=Ci.util.xorBytes(c,p,c.length),g=rv(d,a-s.digestLength-1,i),m=Ci.util.xorBytes(f,g,f.length),v=m.substring(0,s.digestLength),y=l!=="\0",S=0;S<s.digestLength;++S)y|=o.charAt(S)!==v.charAt(S);for(var C=1,w=s.digestLength,E=s.digestLength;E<m.length;E++){var A=m.charCodeAt(E),b=A&1^1,V=C?65534:0;y|=A&V,C=C&b,w+=C}if(y||m.charCodeAt(w)!==1)throw new Error("Invalid RSAES-OAEP padding.");return m.substring(w+1)};function rv(r,e,t){t||(t=Ci.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)}u(rv,"rsa_mgf1")});var HA=ue((Oee,qA)=>{"use strict";var co=bt();jt();sd();Es();(function(){if(co.prime){qA.exports=co.prime;return}var r=qA.exports=co.prime=co.prime||{},e=co.jsbn.BigInteger,t=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var s=u(function(p,d){return p|d},"op_or");r.generateProbablePrime=function(p,d,g){typeof d=="function"&&(g=d,d={}),d=d||{};var m=d.algorithm||"PRIMEINC";typeof m=="string"&&(m={name:m}),m.options=m.options||{};var v=d.prng||co.random,y={nextBytes:u(function(S){for(var C=v.getBytesSync(S.length),w=0;w<S.length;++w)S[w]=C.charCodeAt(w)},"nextBytes")};if(m.name==="PRIMEINC")return i(p,y,m.options,g);throw new Error("Invalid prime generation algorithm: "+m.name)};function i(p,d,g,m){return"workers"in g?l(p,d,g,m):a(p,d,g,m)}u(i,"primeincFindPrime");function a(p,d,g,m){var v=c(p,d),y=0,S=f(v.bitLength());"millerRabinTests"in g&&(S=g.millerRabinTests);var C=10;"maxBlockTime"in g&&(C=g.maxBlockTime),o(v,p,d,y,S,C,m)}u(a,"primeincFindPrimeWithoutWorkers");function o(p,d,g,m,v,y,S){var C=+new Date;do{if(p.bitLength()>d&&(p=c(d,g)),p.isProbablePrime(v))return S(null,p);p.dAddOffset(t[m++%8],0)}while(y<0||+new Date-C<y);co.util.setImmediate(function(){o(p,d,g,m,v,y,S)})}u(o,"_primeinc");function l(p,d,g,m){if(typeof Worker>"u")return a(p,d,g,m);var v=c(p,d),y=g.workers,S=g.workLoad||100,C=S*30/8,w=g.workerScript||"forge/prime.worker.js";if(y===-1)return co.util.estimateCores(function(A,b){A&&(b=2),y=b-1,E()});E();function E(){y=Math.max(1,y);for(var A=[],b=0;b<y;++b)A[b]=new Worker(w);for(var V=y,b=0;b<y;++b)A[b].addEventListener("message",D);var I=!1;function D(U){if(!I){--V;var F=U.data;if(F.found){for(var M=0;M<A.length;++M)A[M].terminate();return I=!0,m(null,new e(F.prime,16))}v.bitLength()>p&&(v=c(p,d));var se=v.toString(16);U.target.postMessage({hex:se,workLoad:S}),v.dAddOffset(C,0)}}u(D,"workerMessage")}u(E,"generate")}u(l,"primeincFindPrimeWithWorkers");function c(p,d){var g=new e(p,d),m=p-1;return g.testBit(m)||g.bitwiseTo(e.ONE.shiftLeft(m),s,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}u(c,"generateRandom");function f(p){return p<=100?27:p<=150?18:p<=200?15:p<=250?12:p<=300?9:p<=350?8:p<=400?7:p<=500?6:p<=600?5:p<=800?4:p<=1250?3:2}u(f,"getMillerRabinTests")})()});var id=ue((Pee,qD)=>{"use strict";var tt=bt();Js();sd();uo();jA();HA();Es();jt();typeof Vt>"u"&&(Vt=tt.jsbn.BigInteger);var Vt,KA=tt.util.isNodejs?st("crypto"):null,ae=tt.asn1,Ss=tt.util;tt.pki=tt.pki||{};qD.exports=tt.pki.rsa=tt.rsa=tt.rsa||{};var mt=tt.pki,RU=[6,4,2,4,2,4,6,2],OU={name:"PrivateKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},_U={name:"RSAPrivateKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},PU={name:"RSAPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},kU=tt.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},LU={name:"DigestInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:ae.Class.UNIVERSAL,type:ae.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},VU=u(function(r){var e;if(r.algorithm in mt.oids)e=mt.oids[r.algorithm];else{var t=new Error("Unknown message digest algorithm.");throw t.algorithm=r.algorithm,t}var n=ae.oidToDer(e).getBytes(),s=ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[]),i=ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[]);i.value.push(ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,n)),i.value.push(ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,""));var a=ae.create(ae.Class.UNIVERSAL,ae.Type.OCTETSTRING,!1,r.digest().getBytes());return s.value.push(i),s.value.push(a),ae.toDer(s).getBytes()},"emsaPkcs1v15encode"),MD=u(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(Vt.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Vt.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Vt(tt.util.bytesToHex(tt.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Vt.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");mt.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=jD(r,e,t)):(s=tt.util.createBuffer(),s.putBytes(r));for(var a=new Vt(s.toHex(),16),o=MD(a,e,n),l=o.toString(16),c=tt.util.createBuffer(),f=i-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(tt.util.hexToBytes(l)),c.getBytes()};mt.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 Vt(tt.util.createBuffer(r).toHex(),16);if(a.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=MD(a,e,t),l=o.toString(16),c=tt.util.createBuffer(),f=s-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(tt.util.hexToBytes(l)),n!==!1?nv(c.getBytes(),e,t):c.getBytes()};mt.rsa.createKeyPairGenerationState=function(r,e,t){typeof r=="string"&&(r=parseInt(r,10)),r=r||2048,t=t||{};var n=t.prng||tt.random,s={nextBytes:u(function(o){for(var l=n.getBytesSync(o.length),c=0;c<o.length;++c)o[c]=l.charCodeAt(c)},"nextBytes")},i=t.algorithm||"PRIMEINC",a;if(i==="PRIMEINC")a={algorithm:i,state:0,bits:r,rng:s,eInt:e||65537,e:new Vt(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};mt.rsa.stepKeyPairGenerationState=function(r,e){"algorithm"in r||(r.algorithm="PRIMEINC");var t=new Vt(null);t.fromInt(30);for(var n=0,s=u(function(p,d){return p|d},"op_or"),i=+new Date,a,o=0;r.keys===null&&(e<=0||o<e);){if(r.state===0){var l=r.p===null?r.pBits:r.qBits,c=l-1;r.pqState===0?(r.num=new Vt(l,r.rng),r.num.testBit(c)||r.num.bitwiseTo(Vt.ONE.shiftLeft(c),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(UU(r.num.bitLength()))?++r.pqState:r.num.dAddOffset(RU[n++%8],0):r.pqState===2?r.pqState=r.num.subtract(Vt.ONE).gcd(r.e).compareTo(Vt.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(Vt.ONE),r.q1=r.q.subtract(Vt.ONE),r.phi=r.p1.multiply(r.q1),++r.state;else if(r.state===3)r.phi.gcd(r.e).compareTo(Vt.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 f=r.e.modInverse(r.phi);r.keys={privateKey:mt.rsa.setPrivateKey(r.n,r.e,f,r.p,r.q,f.mod(r.p1),f.mod(r.q1),r.q.modInverse(r.p)),publicKey:mt.rsa.setPublicKey(r.n,r.e)}}a=+new Date,o+=a-i,i=a}return r.keys!==null};mt.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),!tt.options.usePureJavaScript&&!t.prng&&r>=256&&r<=16384&&(e===65537||e===3)){if(n){if(LD("generateKeyPair"))return KA.generateKeyPair("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,l,c){if(o)return n(o);n(null,{privateKey:mt.privateKeyFromPem(c),publicKey:mt.publicKeyFromPem(l)})});if(VD("generateKey")&&VD("exportKey"))return Ss.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:UD(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return Ss.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){n(o)}).then(function(o){if(o){var l=mt.privateKeyFromAsn1(ae.fromDer(tt.util.createBuffer(o)));n(null,{privateKey:l,publicKey:mt.setRsaPublicKey(l.n,l.e)})}});if(FD("generateKey")&&FD("exportKey")){var s=Ss.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:UD(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);s.oncomplete=function(o){var l=o.target.result,c=Ss.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);c.oncomplete=function(f){var p=f.target.result,d=mt.privateKeyFromAsn1(ae.fromDer(tt.util.createBuffer(p)));n(null,{privateKey:d,publicKey:mt.setRsaPublicKey(d.n,d.e)})},c.onerror=function(f){n(f)}},s.onerror=function(o){n(o)};return}}else if(LD("generateKeyPairSync")){var i=KA.generateKeyPairSync("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:mt.privateKeyFromPem(i.privateKey),publicKey:mt.publicKeyFromPem(i.publicKey)}}}var a=mt.rsa.createKeyPairGenerationState(r,e,t);if(!n)return mt.rsa.stepKeyPairGenerationState(a,0),a.keys;FU(a,t,n)};mt.setRsaPublicKey=mt.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:u(function(o,l,c){return jD(o,l,2).getBytes()},"encode")};else if(s==="RSA-OAEP"||s==="RSAES-OAEP")s={encode:u(function(o,l){return tt.pkcs1.encode_rsa_oaep(l,o,i)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(s)!==-1)s={encode:u(function(o){return o},"encode")};else if(typeof s=="string")throw new Error('Unsupported encryption scheme: "'+s+'".');var a=s.encode(n,t,!0);return mt.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,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),"_skipPaddingChecks"in a||(a._skipPaddingChecks=!1),i==="RSASSA-PKCS1-V1_5"?i={verify:u(function(l,c){c=nv(c,t,!0,void 0,a);var f=ae.fromDer(c,{parseAllBytes:a._parseAllDigestBytes}),p={},d=[];if(!ae.validate(f,LU,p,d)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=d,g}var m=ae.derToOid(p.algorithmIdentifier);if(!(m===tt.oids.md2||m===tt.oids.md5||m===tt.oids.sha1||m===tt.oids.sha224||m===tt.oids.sha256||m===tt.oids.sha384||m===tt.oids.sha512||m===tt.oids["sha512-224"]||m===tt.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=m,g}if((m===tt.oids.md2||m===tt.oids.md5)&&!("parameters"in p))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return l===p.digest},"verify")}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:u(function(l,c){return c=nv(c,t,!0,void 0,a),l===c},"verify")});var o=mt.rsa.decrypt(s,t,!0,!1);return i.verify(n,o,t.n.bitLength())},t};mt.setRsaPrivateKey=mt.rsa.setPrivateKey=function(r,e,t,n,s,i,a,o){var l={n:r,e,d:t,p:n,q:s,dP:i,dQ:a,qInv:o};return l.decrypt=function(c,f,p){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var d=mt.rsa.decrypt(c,l,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:nv};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:u(function(g,m){return tt.pkcs1.decode_rsa_oaep(m,g,p)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:u(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(d,l,!1)},l.sign=function(c,f){var p=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:VU},p=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:u(function(){return c},"encode")},p=1);var d=f.encode(c,l.n.bitLength());return mt.rsa.encrypt(d,l,p)},l};mt.wrapRsaPrivateKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,ae.integerToDer(0).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,ae.oidToDer(mt.oids.rsaEncryption).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,"")]),ae.create(ae.Class.UNIVERSAL,ae.Type.OCTETSTRING,!1,ae.toDer(r).getBytes())])};mt.privateKeyFromAsn1=function(r){var e={},t=[];if(ae.validate(r,OU,e,t)&&(r=ae.fromDer(tt.util.createBuffer(e.privateKey))),e={},t=[],!ae.validate(r,_U,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,o,l,c,f,p;return s=tt.util.createBuffer(e.privateKeyModulus).toHex(),i=tt.util.createBuffer(e.privateKeyPublicExponent).toHex(),a=tt.util.createBuffer(e.privateKeyPrivateExponent).toHex(),o=tt.util.createBuffer(e.privateKeyPrime1).toHex(),l=tt.util.createBuffer(e.privateKeyPrime2).toHex(),c=tt.util.createBuffer(e.privateKeyExponent1).toHex(),f=tt.util.createBuffer(e.privateKeyExponent2).toHex(),p=tt.util.createBuffer(e.privateKeyCoefficient).toHex(),mt.setRsaPrivateKey(new Vt(s,16),new Vt(i,16),new Vt(a,16),new Vt(o,16),new Vt(l,16),new Vt(c,16),new Vt(f,16),new Vt(p,16))};mt.privateKeyToAsn1=mt.privateKeyToRSAPrivateKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,ae.integerToDer(0).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.n)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.e)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.d)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.p)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.q)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.dP)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.dQ)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.qInv))])};mt.publicKeyFromAsn1=function(r){var e={},t=[];if(ae.validate(r,kU,e,t)){var n=ae.derToOid(e.publicKeyOid);if(n!==mt.oids.rsaEncryption){var s=new Error("Cannot read public key. Unknown OID.");throw s.oid=n,s}r=e.rsaPublicKey}if(t=[],!ae.validate(r,PU,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=tt.util.createBuffer(e.publicKeyModulus).toHex(),a=tt.util.createBuffer(e.publicKeyExponent).toHex();return mt.setRsaPublicKey(new Vt(i,16),new Vt(a,16))};mt.publicKeyToAsn1=mt.publicKeyToSubjectPublicKeyInfo=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,ae.oidToDer(mt.oids.rsaEncryption).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,"")]),ae.create(ae.Class.UNIVERSAL,ae.Type.BITSTRING,!1,[mt.publicKeyToRSAPublicKey(r)])])};mt.publicKeyToRSAPublicKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.n)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.e))])};function jD(r,e,t){var n=tt.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,o;if(t===0||t===1){o=t===0?0:255;for(var l=0;l<a;++l)n.putByte(o)}else for(;a>0;){for(var c=0,f=tt.random.getBytes(a),l=0;l<a;++l)o=f.charCodeAt(l),o===0?++c:n.putByte(o);a=c}return n.putByte(0),n.putBytes(r),n}u(jD,"_encodePkcs1_v1_5");function nv(r,e,t,n,s){var i=Math.ceil(e.n.bitLength()/8),a=tt.util.createBuffer(r),o=a.getByte(),l=a.getByte();if(o!==0||t&&l!==0&&l!==1||!t&&l!==2||t&&l===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var c=0;if(l===0){c=i-3-n;for(var f=0;f<c;++f)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(l===1){for(c=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++c}if(c<8&&!(s&&s._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(l===2){for(c=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++c}if(c<8&&!(s&&s._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var p=a.getByte();if(p!==0||c!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}u(nv,"_decodePkcs1_v1_5");function FU(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(o,l){if(o)return t(o);if(r.p=l,r.q!==null)return a(o,r.q);i(r.qBits,a)})}u(s,"generate");function i(o,l){tt.prime.generateProbablePrime(o,n,l)}u(i,"getPrime");function a(o,l){if(o)return t(o);if(r.q=l,r.p.compareTo(r.q)<0){var c=r.p;r.p=r.q,r.q=c}if(r.p.subtract(Vt.ONE).gcd(r.e).compareTo(Vt.ONE)!==0){r.p=null,s();return}if(r.q.subtract(Vt.ONE).gcd(r.e).compareTo(Vt.ONE)!==0){r.q=null,i(r.qBits,a);return}if(r.p1=r.p.subtract(Vt.ONE),r.q1=r.q.subtract(Vt.ONE),r.phi=r.p1.multiply(r.q1),r.phi.gcd(r.e).compareTo(Vt.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 f=r.e.modInverse(r.phi);r.keys={privateKey:mt.rsa.setPrivateKey(r.n,r.e,f,r.p,r.q,f.mod(r.p1),f.mod(r.q1),r.q.modInverse(r.p)),publicKey:mt.rsa.setPublicKey(r.n,r.e)},t(null,r.keys)}u(a,"finish")}u(FU,"_generateKeyPair");function xi(r){var e=r.toString(16);e[0]>="8"&&(e="00"+e);var t=tt.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}u(xi,"_bnToBytes");function UU(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}u(UU,"_getMillerRabinTests");function LD(r){return tt.util.isNodejs&&typeof KA[r]=="function"}u(LD,"_detectNodeCrypto");function VD(r){return typeof Ss.globalScope<"u"&&typeof Ss.globalScope.crypto=="object"&&typeof Ss.globalScope.crypto.subtle=="object"&&typeof Ss.globalScope.crypto.subtle[r]=="function"}u(VD,"_detectSubtleCrypto");function FD(r){return typeof Ss.globalScope<"u"&&typeof Ss.globalScope.msCrypto=="object"&&typeof Ss.globalScope.msCrypto.subtle=="object"&&typeof Ss.globalScope.msCrypto.subtle[r]=="function"}u(FD,"_detectSubtleMsCrypto");function UD(r){for(var e=tt.util.hexToBytes(r.toString(16)),t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}u(UD,"_intToUint8Array")});var XA=ue((Lee,$D)=>{"use strict";var Ke=bt();oo();Js();rd();yi();uo();Qy();zu();Es();LA();id();jt();typeof HD>"u"&&(HD=Ke.jsbn.BigInteger);var HD,de=Ke.asn1,St=Ke.pki=Ke.pki||{};$D.exports=St.pbe=Ke.pbe=Ke.pbe||{};var Qu=St.oids,MU={name:"EncryptedPrivateKeyInfo",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},jU={name:"PBES2Algorithms",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},qU={name:"pkcs-12PbeParams",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,capture:"iterations"}]};St.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=Ke.random.getBytesSync(t.saltSize),s=t.count,i=de.integerToDer(s),a,o,l;if(t.algorithm.indexOf("aes")===0||t.algorithm==="des"){var c,f,p;switch(t.algorithm){case"aes128":a=16,c=16,f=Qu["aes128-CBC"],p=Ke.aes.createEncryptionCipher;break;case"aes192":a=24,c=16,f=Qu["aes192-CBC"],p=Ke.aes.createEncryptionCipher;break;case"aes256":a=32,c=16,f=Qu["aes256-CBC"],p=Ke.aes.createEncryptionCipher;break;case"des":a=8,c=8,f=Qu.desCBC,p=Ke.des.createEncryptionCipher;break;default:var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=t.algorithm,d}var g="hmacWith"+t.prfAlgorithm.toUpperCase(),m=GD(g),v=Ke.pkcs5.pbkdf2(e,n,s,a,m),y=Ke.random.getBytesSync(c),S=p(v);S.start(y),S.update(de.toDer(r)),S.finish(),l=S.output.getBytes();var C=HU(n,i,a,g);o=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu.pkcs5PBES2).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu.pkcs5PBKDF2).getBytes()),C]),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(f).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,y)])])])}else if(t.algorithm==="3des"){a=24;var w=new Ke.util.ByteBuffer(n),v=St.pbe.generatePkcs12Key(e,w,1,s,a),y=St.pbe.generatePkcs12Key(e,w,2,s,a),S=Ke.des.createEncryptionCipher(v);S.start(y),S.update(de.toDer(r)),S.finish(),l=S.output.getBytes(),o=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,n),de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,i.getBytes())])])}else{var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=t.algorithm,d}var E=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[o,de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,l)]);return E};St.decryptPrivateKeyInfo=function(r,e){var t=null,n={},s=[];if(!de.validate(r,MU,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=de.derToOid(n.encryptionOid),o=St.pbe.getCipher(a,n.encryptionParams,e),l=Ke.util.createBuffer(n.encryptedData);return o.update(l),o.finish()&&(t=de.fromDer(o.output)),t};St.encryptedPrivateKeyToPem=function(r,e){var t={type:"ENCRYPTED PRIVATE KEY",body:de.toDer(r).getBytes()};return Ke.pem.encode(t,{maxline:e})};St.encryptedPrivateKeyFromPem=function(r){var e=Ke.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 de.fromDer(e.body)};St.encryptRsaPrivateKey=function(r,e,t){if(t=t||{},!t.legacy){var n=St.wrapRsaPrivateKey(St.privateKeyToAsn1(r));return n=St.encryptPrivateKeyInfo(n,e,t),St.encryptedPrivateKeyToPem(n)}var s,i,a,o;switch(t.algorithm){case"aes128":s="AES-128-CBC",a=16,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",a=24,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",a=32,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",a=24,i=Ke.random.getBytesSync(8),o=Ke.des.createEncryptionCipher;break;case"des":s="DES-CBC",a=8,i=Ke.random.getBytesSync(8),o=Ke.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 c=Ke.pbe.opensslDeriveBytes(e,i.substr(0,8),a),f=o(c);f.start(i),f.update(de.toDer(St.privateKeyToAsn1(r))),f.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:Ke.util.bytesToHex(i).toUpperCase()},body:f.output.getBytes()};return Ke.pem.encode(p)};St.decryptRsaPrivateKey=function(r,e){var t=null,n=Ke.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=Ke.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=Ke.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=Ke.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=Ke.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=Ke.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,40)},"cipherFn");break;case"RC2-64-CBC":i=8,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,64)},"cipherFn");break;case"RC2-128-CBC":i=16,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,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 o=Ke.util.hexToBytes(n.dekInfo.parameters),l=Ke.pbe.opensslDeriveBytes(e,o.substr(0,8),i),c=a(l);if(c.start(o),c.update(Ke.util.createBuffer(n.body)),c.finish())t=c.output.getBytes();else return t}else t=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?t=St.decryptPrivateKeyInfo(de.fromDer(t),e):t=de.fromDer(t),t!==null&&(t=St.privateKeyFromAsn1(t)),t};St.pbe.generatePkcs12Key=function(r,e,t,n,s,i){var a,o;if(typeof i>"u"||i===null){if(!("sha1"in Ke.md))throw new Error('"sha1" hash algorithm unavailable.');i=Ke.md.sha1.create()}var l=i.digestLength,c=i.blockLength,f=new Ke.util.ByteBuffer,p=new Ke.util.ByteBuffer;if(r!=null){for(o=0;o<r.length;o++)p.putInt16(r.charCodeAt(o));p.putInt16(0)}var d=p.length(),g=e.length(),m=new Ke.util.ByteBuffer;m.fillWithByte(t,c);var v=c*Math.ceil(g/c),y=new Ke.util.ByteBuffer;for(o=0;o<v;o++)y.putByte(e.at(o%g));var S=c*Math.ceil(d/c),C=new Ke.util.ByteBuffer;for(o=0;o<S;o++)C.putByte(p.at(o%d));var w=y;w.putBuffer(C);for(var E=Math.ceil(s/l),A=1;A<=E;A++){var b=new Ke.util.ByteBuffer;b.putBytes(m.bytes()),b.putBytes(w.bytes());for(var V=0;V<n;V++)i.start(),i.update(b.getBytes()),b=i.digest();var I=new Ke.util.ByteBuffer;for(o=0;o<c;o++)I.putByte(b.at(o%l));var D=Math.ceil(g/c)+Math.ceil(d/c),U=new Ke.util.ByteBuffer;for(a=0;a<D;a++){var F=new Ke.util.ByteBuffer(w.getBytes(c)),M=511;for(o=I.length()-1;o>=0;o--)M=M>>8,M+=I.at(o)+F.at(o),F.setAt(o,M&255);U.putBuffer(F)}w=U,f.putBuffer(b)}return f.truncate(f.length()-s),f};St.pbe.getCipher=function(r,e,t){switch(r){case St.oids.pkcs5PBES2:return St.pbe.getCipherForPBES2(r,e,t);case St.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case St.oids["pbewithSHAAnd40BitRC2-CBC"]:return St.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}};St.pbe.getCipherForPBES2=function(r,e,t){var n={},s=[];if(!de.validate(e,jU,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=de.derToOid(n.kdfOid),r!==St.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=de.derToOid(n.encOid),r!==St.oids["aes128-CBC"]&&r!==St.oids["aes192-CBC"]&&r!==St.oids["aes256-CBC"]&&r!==St.oids["des-EDE3-CBC"]&&r!==St.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,o=Ke.util.createBuffer(n.kdfIterationCount);o=o.getInt(o.length()<<3);var l,c;switch(St.oids[r]){case"aes128-CBC":l=16,c=Ke.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,c=Ke.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,c=Ke.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,c=Ke.des.createDecryptionCipher;break;case"desCBC":l=8,c=Ke.des.createDecryptionCipher;break}var f=XD(n.prfOid),p=Ke.pkcs5.pbkdf2(t,a,o,l,f),d=n.encIv,g=c(p);return g.start(d),g};St.pbe.getCipherForPKCS12PBE=function(r,e,t){var n={},s=[];if(!de.validate(e,qU,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=Ke.util.createBuffer(n.salt),o=Ke.util.createBuffer(n.iterations);o=o.getInt(o.length()<<3);var l,c,f;switch(r){case St.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,c=8,f=Ke.des.startDecrypting;break;case St.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,c=8,f=u(function(v,y){var S=Ke.rc2.createDecryptionCipher(v,40);return S.start(y,null),S},"cipherFn");break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=r,i}var p=XD(n.prfOid),d=St.pbe.generatePkcs12Key(t,a,1,o,l,p);p.start();var g=St.pbe.generatePkcs12Key(t,a,2,o,c,p);return f(d,g)};St.pbe.opensslDeriveBytes=function(r,e,t,n){if(typeof n>"u"||n===null){if(!("md5"in Ke.md))throw new Error('"md5" hash algorithm unavailable.');n=Ke.md.md5.create()}e===null&&(e="");for(var s=[KD(n,r+e)],i=16,a=1;i<t;++a,i+=16)s.push(KD(n,s[a-1]+r+e));return s.join("").substr(0,t)};function KD(r,e){return r.start().update(e).digest().getBytes()}u(KD,"hash");function XD(r){var e;if(!r)e="hmacWithSHA1";else if(e=St.oids[de.derToOid(r)],!e){var t=new Error("Unsupported PRF OID.");throw t.oid=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}return GD(e)}u(XD,"prfOidToMessageDigest");function GD(r){var e=Ke.md;switch(r){case"hmacWithSHA224":e=Ke.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()}u(GD,"prfAlgorithmToMessageDigest");function HU(r,e,t,n){var s=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,r),de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&s.value.push(de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,Ke.util.hexToBytes(t.toString(16))),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(St.oids[n]).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.NULL,!1,"")])),s}u(HU,"createPbkdf2Params")});var GA=ue((Fee,JD)=>{"use strict";var Sf=bt();Js();jt();var Me=Sf.asn1,Af=JD.exports=Sf.pkcs7asn1=Sf.pkcs7asn1||{};Sf.pkcs7=Sf.pkcs7||{};Sf.pkcs7.asn1=Af;var WD={name:"ContentInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Af.contentInfoValidator=WD;var zD={name:"EncryptedContentInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Af.envelopedDataValidator={name:"EnvelopedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(zD)};Af.encryptedDataValidator={name:"EncryptedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"}].concat(zD)};var KU={name:"SignerInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:Me.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Af.signedDataValidator={name:"SignedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},WD,{name:"SignedData.Certificates",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:Me.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,capture:"signerInfos",optional:!0,value:[KU]}]};Af.recipientInfoValidator={name:"RecipientInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var $A=ue((Uee,YD)=>{"use strict";var Zu=bt();jt();Zu.mgf=Zu.mgf||{};var XU=YD.exports=Zu.mgf.mgf1=Zu.mgf1=Zu.mgf1||{};XU.create=function(r){var e={generate:u(function(t,n){for(var s=new Zu.util.ByteBuffer,i=Math.ceil(n/r.digestLength),a=0;a<i;a++){var o=new Zu.util.ByteBuffer;o.putInt32(a),r.start(),r.update(t+o.getBytes()),s.putBuffer(r.digest())}return s.truncate(s.length()-n),s.getBytes()},"generate")};return e}});var ZD=ue((jee,QD)=>{"use strict";var sv=bt();$A();QD.exports=sv.mgf=sv.mgf||{};sv.mgf.mgf1=sv.mgf1});var iv=ue((qee,eB)=>{"use strict";var el=bt();Es();jt();var GU=eB.exports=el.pss=el.pss||{};GU.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=el.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||el.random,o={};return o.encode=function(l,c){var f,p=c-1,d=Math.ceil(p/8),g=l.digest().getBytes();if(d<n+i+2)throw new Error("Message is too long to encrypt.");var m;s===null?m=a.getBytesSync(i):m=s.bytes();var v=new el.util.ByteBuffer;v.fillWithByte(0,8),v.putBytes(g),v.putBytes(m),e.start(),e.update(v.getBytes());var y=e.digest().getBytes(),S=new el.util.ByteBuffer;S.fillWithByte(0,d-i-n-2),S.putByte(1),S.putBytes(m);var C=S.getBytes(),w=d-n-1,E=t.generate(y,w),A="";for(f=0;f<w;f++)A+=String.fromCharCode(C.charCodeAt(f)^E.charCodeAt(f));var b=65280>>8*d-p&255;return A=String.fromCharCode(A.charCodeAt(0)&~b)+A.substr(1),A+y+"\xBC"},o.verify=function(l,c,f){var p,d=f-1,g=Math.ceil(d/8);if(c=c.substr(-g),g<n+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(c.charCodeAt(g-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var m=g-n-1,v=c.substr(0,m),y=c.substr(m,n),S=65280>>8*g-d&255;if((v.charCodeAt(0)&S)!==0)throw new Error("Bits beyond keysize not zero as expected.");var C=t.generate(y,m),w="";for(p=0;p<m;p++)w+=String.fromCharCode(v.charCodeAt(p)^C.charCodeAt(p));w=String.fromCharCode(w.charCodeAt(0)&~S)+w.substr(1);var E=g-n-i-2;for(p=0;p<E;p++)if(w.charCodeAt(p)!==0)throw new Error("Leftmost octets not zero as expected");if(w.charCodeAt(E)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var A=w.substr(-i),b=new el.util.ByteBuffer;b.fillWithByte(0,8),b.putBytes(l),b.putBytes(A),e.start(),e.update(b.getBytes());var V=e.digest().getBytes();return y===V},o}});var uv=ue((Hee,iB)=>{"use strict";var rt=bt();oo();Js();rd();yi();ZD();uo();zu();iv();id();jt();var _=rt.asn1,ke=iB.exports=rt.pki=rt.pki||{},Ft=ke.oids,Dr={};Dr.CN=Ft.commonName;Dr.commonName="CN";Dr.C=Ft.countryName;Dr.countryName="C";Dr.L=Ft.localityName;Dr.localityName="L";Dr.ST=Ft.stateOrProvinceName;Dr.stateOrProvinceName="ST";Dr.O=Ft.organizationName;Dr.organizationName="O";Dr.OU=Ft.organizationalUnitName;Dr.organizationalUnitName="OU";Dr.E=Ft.emailAddress;Dr.emailAddress="E";var rB=rt.pki.rsa.publicKeyValidator,$U={name:"Certificate",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:_.Class.UNIVERSAL,type:_.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:_.Class.UNIVERSAL,type:_.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:_.Class.UNIVERSAL,type:_.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:_.Class.UNIVERSAL,type:_.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},rB,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:_.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:_.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:_.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},WU={name:"rsapss",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:_.Class.UNIVERSAL,type:_.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:_.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:_.Class.UNIVERSAL,type:_.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:_.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:_.Class.UNIVERSAL,type:_.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:_.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:_.Class.UNIVERSAL,type:_.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},zU={name:"CertificationRequestInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},rB,{name:"CertificationRequestInfo.attributes",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:_.Class.UNIVERSAL,type:_.Type.SET,constructed:!0}]}]}]},JU={name:"CertificationRequest",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[zU,{name:"CertificationRequest.signatureAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};ke.RDNAttributesAsArray=function(r,e){for(var t=[],n,s,i,a=0;a<r.value.length;++a){n=r.value[a];for(var o=0;o<n.value.length;++o)i={},s=n.value[o],i.type=_.derToOid(s.value[0].value),i.value=s.value[1].value,i.valueTagClass=s.value[1].type,i.type in Ft&&(i.name=Ft[i.type],i.name in Dr&&(i.shortName=Dr[i.name])),e&&(e.update(i.type),e.update(i.value)),t.push(i)}return t};ke.CRIAttributesAsArray=function(r){for(var e=[],t=0;t<r.length;++t)for(var n=r[t],s=_.derToOid(n.value[0].value),i=n.value[1].value,a=0;a<i.length;++a){var o={};if(o.type=s,o.value=i[a].value,o.valueTagClass=i[a].type,o.type in Ft&&(o.name=Ft[o.type],o.name in Dr&&(o.shortName=Dr[o.name])),o.type===Ft.extensionRequest){o.extensions=[];for(var l=0;l<o.value.length;++l)o.extensions.push(ke.certificateExtensionFromAsn1(o.value[l]))}e.push(o)}return e};function fo(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}u(fo,"_getAttribute");var av=u(function(r,e,t){var n={};if(r!==Ft["RSASSA-PSS"])return n;t&&(n={hash:{algorithmOid:Ft.sha1},mgf:{algorithmOid:Ft.mgf1,hash:{algorithmOid:Ft.sha1}},saltLength:20});var s={},i=[];if(!_.validate(e,WU,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=_.derToOid(s.hashOid)),s.maskGenOid!==void 0&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=_.derToOid(s.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=_.derToOid(s.maskGenHashOid)),s.saltLength!==void 0&&(n.saltLength=s.saltLength.charCodeAt(0)),n},"_readSignatureParameters"),ov=u(function(r){switch(Ft[r.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return rt.md.sha1.create();case"md5WithRSAEncryption":return rt.md.md5.create();case"sha256WithRSAEncryption":return rt.md.sha256.create();case"sha384WithRSAEncryption":return rt.md.sha384.create();case"sha512WithRSAEncryption":return rt.md.sha512.create();case"RSASSA-PSS":return rt.md.sha256.create();default:var e=new Error("Could not compute "+r.type+" digest. Unknown signature OID.");throw e.signatureOid=r.signatureOid,e}},"_createSignatureDigest"),nB=u(function(r){var e=r.certificate,t;switch(e.signatureOid){case Ft.sha1WithRSAEncryption:case Ft.sha1WithRSASignature:break;case Ft["RSASSA-PSS"]:var n,s;if(n=Ft[e.signatureParameters.mgf.hash.algorithmOid],n===void 0||rt.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=Ft[e.signatureParameters.mgf.algorithmOid],s===void 0||rt.mgf[s]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=e.signatureParameters.mgf.algorithmOid,i.name=s,i}if(s=rt.mgf[s].create(rt.md[n].create()),n=Ft[e.signatureParameters.hash.algorithmOid],n===void 0||rt.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=rt.pss.create(rt.md[n].create(),s,e.signatureParameters.saltLength);break}return e.publicKey.verify(r.md.digest().getBytes(),r.signature,t)},"_verifySignature");ke.certificateFromPem=function(r,e,t){var n=rt.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=_.fromDer(n.body,t);return ke.certificateFromAsn1(i,e)};ke.certificateToPem=function(r,e){var t={type:"CERTIFICATE",body:_.toDer(ke.certificateToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.publicKeyFromPem=function(r){var e=rt.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=_.fromDer(e.body);return ke.publicKeyFromAsn1(n)};ke.publicKeyToPem=function(r,e){var t={type:"PUBLIC KEY",body:_.toDer(ke.publicKeyToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.publicKeyToRSAPublicKeyPem=function(r,e){var t={type:"RSA PUBLIC KEY",body:_.toDer(ke.publicKeyToRSAPublicKey(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||rt.md.sha1.create(),n=e.type||"RSAPublicKey",s;switch(n){case"RSAPublicKey":s=_.toDer(ke.publicKeyToRSAPublicKey(r)).getBytes();break;case"SubjectPublicKeyInfo":s=_.toDer(ke.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};ke.certificationRequestFromPem=function(r,e,t){var n=rt.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=_.fromDer(n.body,t);return ke.certificationRequestFromAsn1(i,e)};ke.certificationRequestToPem=function(r,e){var t={type:"CERTIFICATE REQUEST",body:_.toDer(ke.certificationRequestToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.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 fo(r.issuer,e)},r.issuer.addField=function(e){As([e]),r.issuer.attributes.push(e)},r.issuer.attributes=[],r.issuer.hash=null,r.subject={},r.subject.getField=function(e){return fo(r.subject,e)},r.subject.addField=function(e){As([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){As(e),r.subject.attributes=e,delete r.subject.uniqueId,t&&(r.subject.uniqueId=t),r.subject.hash=null},r.setIssuer=function(e,t){As(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)sB(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||rt.md.sha1.create();var n=Ft[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=ke.getTBSCertificate(r);var i=_.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=ov({signatureOid:e.signatureOid,type:"certificate"});var o=e.tbsCertificate||ke.getTBSCertificate(e),l=_.toDer(o);a.update(l.getBytes())}return a!==null&&(t=nB({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,o=0;t&&o<n.attributes.length;++o)i=n.attributes[o],a=s.attributes[o],(i.type!==a.type||i.value!==a.value)&&(t=!1)}return t},r.issued=function(e){return e.isIssuer(r)},r.generateSubjectKeyIdentifier=function(){return ke.getPublicKeyFingerprint(r.publicKey,{type:"RSAPublicKey"})},r.verifySubjectKeyIdentifier=function(){for(var e=Ft.subjectKeyIdentifier,t=0;t<r.extensions.length;++t){var n=r.extensions[t];if(n.id===e){var s=r.generateSubjectKeyIdentifier().getBytes();return rt.util.hexToBytes(n.subjectKeyIdentifier)===s}}return!1},r};ke.certificateFromAsn1=function(r,e){var t={},n=[];if(!_.validate(r,$U,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=_.derToOid(t.publicKeyOid);if(i!==ke.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=ke.createCertificate();a.version=t.certVersion?t.certVersion.charCodeAt(0):0;var o=rt.util.createBuffer(t.certSerialNumber);a.serialNumber=o.toHex(),a.signatureOid=rt.asn1.derToOid(t.certSignatureOid),a.signatureParameters=av(a.signatureOid,t.certSignatureParams,!0),a.siginfo.algorithmOid=rt.asn1.derToOid(t.certinfoSignatureOid),a.siginfo.parameters=av(a.siginfo.algorithmOid,t.certinfoSignatureParams,!1),a.signature=t.certSignature;var l=[];if(t.certValidity1UTCTime!==void 0&&l.push(_.utcTimeToDate(t.certValidity1UTCTime)),t.certValidity2GeneralizedTime!==void 0&&l.push(_.generalizedTimeToDate(t.certValidity2GeneralizedTime)),t.certValidity3UTCTime!==void 0&&l.push(_.utcTimeToDate(t.certValidity3UTCTime)),t.certValidity4GeneralizedTime!==void 0&&l.push(_.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=ov({signatureOid:a.signatureOid,type:"certificate"});var c=_.toDer(a.tbsCertificate);a.md.update(c.getBytes())}var f=rt.md.sha1.create(),p=_.toDer(t.certIssuer);f.update(p.getBytes()),a.issuer.getField=function(m){return fo(a.issuer,m)},a.issuer.addField=function(m){As([m]),a.issuer.attributes.push(m)},a.issuer.attributes=ke.RDNAttributesAsArray(t.certIssuer),t.certIssuerUniqueId&&(a.issuer.uniqueId=t.certIssuerUniqueId),a.issuer.hash=f.digest().toHex();var d=rt.md.sha1.create(),g=_.toDer(t.certSubject);return d.update(g.getBytes()),a.subject.getField=function(m){return fo(a.subject,m)},a.subject.addField=function(m){As([m]),a.subject.attributes.push(m)},a.subject.attributes=ke.RDNAttributesAsArray(t.certSubject),t.certSubjectUniqueId&&(a.subject.uniqueId=t.certSubjectUniqueId),a.subject.hash=d.digest().toHex(),t.certExtensions?a.extensions=ke.certificateExtensionsFromAsn1(t.certExtensions):a.extensions=[],a.publicKey=ke.publicKeyFromAsn1(t.subjectPublicKeyInfo),a};ke.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(ke.certificateExtensionFromAsn1(n.value[s]));return e};ke.certificateExtensionFromAsn1=function(r){var e={};if(e.id=_.derToOid(r.value[0].value),e.critical=!1,r.value[1].type===_.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 Ft){if(e.name=Ft[e.id],e.name==="keyUsage"){var t=_.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=_.fromDer(e.value);t.value.length>0&&t.value[0].type===_.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===_.Type.INTEGER?i=t.value[0].value:t.value.length>1&&(i=t.value[1].value),i!==null&&(e.pathLenConstraint=_.derToInteger(i))}else if(e.name==="extKeyUsage")for(var t=_.fromDer(e.value),a=0;a<t.value.length;++a){var o=_.derToOid(t.value[a].value);o in Ft?e[Ft[o]]=!0:e[o]=!0}else if(e.name==="nsCertType"){var t=_.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=_.fromDer(e.value),c=0;c<t.value.length;++c){l=t.value[c];var f={type:l.type,value:l.value};switch(e.altNames.push(f),l.type){case 1:case 2:case 6:break;case 7:f.ip=rt.util.bytesToIP(l.value);break;case 8:f.oid=_.derToOid(l.value);break;default:}}}else if(e.name==="subjectKeyIdentifier"){var t=_.fromDer(e.value);e.subjectKeyIdentifier=rt.util.bytesToHex(t.value)}}return e};ke.certificationRequestFromAsn1=function(r,e){var t={},n=[];if(!_.validate(r,JU,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=_.derToOid(t.publicKeyOid);if(i!==ke.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=ke.createCertificationRequest();if(a.version=t.csrVersion?t.csrVersion.charCodeAt(0):0,a.signatureOid=rt.asn1.derToOid(t.csrSignatureOid),a.signatureParameters=av(a.signatureOid,t.csrSignatureParams,!0),a.siginfo.algorithmOid=rt.asn1.derToOid(t.csrSignatureOid),a.siginfo.parameters=av(a.siginfo.algorithmOid,t.csrSignatureParams,!1),a.signature=t.csrSignature,a.certificationRequestInfo=t.certificationRequestInfo,e){a.md=ov({signatureOid:a.signatureOid,type:"certification request"});var o=_.toDer(a.certificationRequestInfo);a.md.update(o.getBytes())}var l=rt.md.sha1.create();return a.subject.getField=function(c){return fo(a.subject,c)},a.subject.addField=function(c){As([c]),a.subject.attributes.push(c)},a.subject.attributes=ke.RDNAttributesAsArray(t.certificationRequestInfoSubject,l),a.subject.hash=l.digest().toHex(),a.publicKey=ke.publicKeyFromAsn1(t.subjectPublicKeyInfo),a.getAttribute=function(c){return fo(a,c)},a.addAttribute=function(c){As([c]),a.attributes.push(c)},a.attributes=ke.CRIAttributesAsArray(t.certificationRequestInfoAttributes||[]),a};ke.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 fo(r.subject,e)},r.subject.addField=function(e){As([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.publicKey=null,r.attributes=[],r.getAttribute=function(e){return fo(r,e)},r.addAttribute=function(e){As([e]),r.attributes.push(e)},r.md=null,r.setSubject=function(e){As(e),r.subject.attributes=e,r.subject.hash=null},r.setAttributes=function(e){As(e),r.attributes=e},r.sign=function(e,t){r.md=t||rt.md.sha1.create();var n=Ft[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=ke.getCertificationRequestInfo(r);var i=_.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=ov({signatureOid:r.signatureOid,type:"certification request"});var n=r.certificationRequestInfo||ke.getCertificationRequestInfo(r),s=_.toDer(n);t.update(s.getBytes())}return t!==null&&(e=nB({certificate:r,md:t,signature:r.signature})),e},r};function Cf(r){for(var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),t,n,s=r.attributes,i=0;i<s.length;++i){t=s[i];var a=t.value,o=_.Type.PRINTABLESTRING;"valueTagClass"in t&&(o=t.valueTagClass,o===_.Type.UTF8&&(a=rt.util.encodeUtf8(a))),n=_.create(_.Class.UNIVERSAL,_.Type.SET,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(t.type).getBytes()),_.create(_.Class.UNIVERSAL,o,!1,a)])]),e.value.push(n)}return e}u(Cf,"_dnToAsn1");function As(r){for(var e,t=0;t<r.length;++t){if(e=r[t],typeof e.name>"u"&&(e.type&&e.type in ke.oids?e.name=ke.oids[e.type]:e.shortName&&e.shortName in Dr&&(e.name=ke.oids[Dr[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in ke.oids)e.type=ke.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 Dr&&(e.shortName=Dr[e.name]),e.type===Ft.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=_.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var s=0;s<e.extensions.length;++s)e.value.push(ke.certificateExtensionToAsn1(sB(e.extensions[s])))}if(typeof e.value>"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}u(As,"_fillMissingFields");function sB(r,e){if(e=e||{},typeof r.name>"u"&&r.id&&r.id in ke.oids&&(r.name=ke.oids[r.id]),typeof r.id>"u")if(r.name&&r.name in ke.oids)r.id=ke.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=_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,a)}else if(r.name==="basicConstraints")r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),r.cA&&r.value.value.push(_.create(_.Class.UNIVERSAL,_.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in r&&r.value.value.push(_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.pathLenConstraint).getBytes()));else if(r.name==="extKeyUsage"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);var o=r.value.value;for(var l in r)r[l]===!0&&(l in Ft?o.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Ft[l]).getBytes())):l.indexOf(".")!==-1&&o.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.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=_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,a)}else if(r.name==="subjectAltName"||r.name==="issuerAltName"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);for(var c,f=0;f<r.altNames.length;++f){c=r.altNames[f];var a=c.value;if(c.type===7&&c.ip){if(a=rt.util.bytesFromIP(c.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else c.type===8&&(c.oid?a=_.oidToDer(_.oidToDer(c.oid)):a=_.oidToDer(a));r.value.value.push(_.create(_.Class.CONTEXT_SPECIFIC,c.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=_.create(_.Class.UNIVERSAL,_.Type.IA5STRING,!1,r.comment)}else if(r.name==="subjectKeyIdentifier"&&e.cert){var p=e.cert.generateSubjectKeyIdentifier();r.subjectKeyIdentifier=p.toHex(),r.value=_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,p.getBytes())}else if(r.name==="authorityKeyIdentifier"&&e.cert){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);var o=r.value.value;if(r.keyIdentifier){var d=r.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():r.keyIdentifier;o.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!1,d))}if(r.authorityCertIssuer){var g=[_.create(_.Class.CONTEXT_SPECIFIC,4,!0,[Cf(r.authorityCertIssuer===!0?e.cert.issuer:r.authorityCertIssuer)])];o.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,g))}if(r.serialNumber){var m=rt.util.hexToBytes(r.serialNumber===!0?e.cert.serialNumber:r.serialNumber);o.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if(r.name==="cRLDistributionPoints"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);for(var o=r.value.value,v=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),y=_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[]),c,f=0;f<r.altNames.length;++f){c=r.altNames[f];var a=c.value;if(c.type===7&&c.ip){if(a=rt.util.bytesFromIP(c.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else c.type===8&&(c.oid?a=_.oidToDer(_.oidToDer(c.oid)):a=_.oidToDer(a));y.value.push(_.create(_.Class.CONTEXT_SPECIFIC,c.type,!1,a))}v.value.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[y])),o.push(v)}if(typeof r.value>"u"){var t=new Error("Extension value not specified.");throw t.extension=r,t}return r}u(sB,"_fillMissingExtensionFields");function WA(r,e){switch(r){case Ft["RSASSA-PSS"]:var t=[];return e.hash.algorithmOid!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.hash.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.mgf.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.mgf.hash.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(e.saltLength).getBytes())])),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,t);default:return _.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")}}u(WA,"_signatureParametersToAsn1");function YU(r){var e=_.create(_.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=_.Type.UTF8;"valueTagClass"in s&&(a=s.valueTagClass),a===_.Type.UTF8&&(i=rt.util.encodeUtf8(i));var o=!1;"valueConstructed"in s&&(o=s.valueConstructed);var l=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(s.type).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SET,!0,[_.create(_.Class.UNIVERSAL,a,o,i)])]);e.value.push(l)}return e}u(YU,"_CRIAttributesToAsn1");var QU=new Date("1950-01-01T00:00:00Z"),ZU=new Date("2050-01-01T00:00:00Z");function tB(r){return r>=QU&&r<ZU?_.create(_.Class.UNIVERSAL,_.Type.UTCTIME,!1,_.dateToUtcTime(r)):_.create(_.Class.UNIVERSAL,_.Type.GENERALIZEDTIME,!1,_.dateToGeneralizedTime(r))}u(tB,"_dateToAsn1");ke.getTBSCertificate=function(r){var e=tB(r.validity.notBefore),t=tB(r.validity.notAfter),n=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.version).getBytes())]),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,rt.util.hexToBytes(r.serialNumber)),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.siginfo.algorithmOid).getBytes()),WA(r.siginfo.algorithmOid,r.siginfo.parameters)]),Cf(r.issuer),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,t]),Cf(r.subject),ke.publicKeyToAsn1(r.publicKey)]);return r.issuer.uniqueId&&n.value.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,[_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.issuer.uniqueId)])),r.subject.uniqueId&&n.value.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!0,[_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.subject.uniqueId)])),r.extensions.length>0&&n.value.push(ke.certificateExtensionsToAsn1(r.extensions)),n};ke.getCertificationRequestInfo=function(r){var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.version).getBytes()),Cf(r.subject),ke.publicKeyToAsn1(r.publicKey),YU(r)]);return e};ke.distinguishedNameToAsn1=function(r){return Cf(r)};ke.certificateToAsn1=function(r){var e=r.tbsCertificate||ke.getTBSCertificate(r);return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.signatureOid).getBytes()),WA(r.signatureOid,r.signatureParameters)]),_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.signature)])};ke.certificateExtensionsToAsn1=function(r){var e=_.create(_.Class.CONTEXT_SPECIFIC,3,!0,[]),t=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);e.value.push(t);for(var n=0;n<r.length;++n)t.value.push(ke.certificateExtensionToAsn1(r[n]));return e};ke.certificateExtensionToAsn1=function(r){var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);e.value.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.id).getBytes())),r.critical&&e.value.push(_.create(_.Class.UNIVERSAL,_.Type.BOOLEAN,!1,"\xFF"));var t=r.value;return typeof r.value!="string"&&(t=_.toDer(t).getBytes()),e.value.push(_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,t)),e};ke.certificationRequestToAsn1=function(r){var e=r.certificationRequestInfo||ke.getCertificationRequestInfo(r);return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.signatureOid).getBytes()),WA(r.signatureOid,r.signatureParameters)]),_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.signature)])};ke.createCaStore=function(r){var e={certs:{}};e.getIssuer=function(a){var o=t(a.issuer);return o},e.addCertificate=function(a){if(typeof a=="string"&&(a=rt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))if(a.subject.hash in e.certs){var o=e.certs[a.subject.hash];rt.util.isArray(o)||(o=[o]),o.push(a),e.certs[a.subject.hash]=o}else e.certs[a.subject.hash]=a},e.hasCertificate=function(a){typeof a=="string"&&(a=rt.pki.certificateFromPem(a));var o=t(a.subject);if(!o)return!1;rt.util.isArray(o)||(o=[o]);for(var l=_.toDer(ke.certificateToAsn1(a)).getBytes(),c=0;c<o.length;++c){var f=_.toDer(ke.certificateToAsn1(o[c])).getBytes();if(l===f)return!0}return!1},e.listAllCertificates=function(){var a=[];for(var o in e.certs)if(e.certs.hasOwnProperty(o)){var l=e.certs[o];if(!rt.util.isArray(l))a.push(l);else for(var c=0;c<l.length;++c)a.push(l[c])}return a},e.removeCertificate=function(a){var o;if(typeof a=="string"&&(a=rt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))return null;var l=t(a.subject);if(!rt.util.isArray(l))return o=e.certs[a.subject.hash],delete e.certs[a.subject.hash],o;for(var c=_.toDer(ke.certificateToAsn1(a)).getBytes(),f=0;f<l.length;++f){var p=_.toDer(ke.certificateToAsn1(l[f])).getBytes();c===p&&(o=l[f],l.splice(f,1))}return l.length===0&&delete e.certs[a.subject.hash],o};function t(a){return n(a),e.certs[a.hash]||null}u(t,"getBySubject");function n(a){if(!a.hash){var o=rt.md.sha1.create();a.attributes=ke.RDNAttributesAsArray(Cf(a),o),a.hash=o.digest().toHex()}}if(u(n,"ensureSubjectHasHash"),r)for(var s=0;s<r.length;++s){var i=r[s];e.addCertificate(i)}return e};ke.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"};ke.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,o=0;do{var l=e.shift(),c=null,f=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(a={message:"Certificate is not valid yet or has expired.",error:ke.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),a===null){if(c=e[0]||r.getIssuer(l),c===null&&l.isIssuer(l)&&(f=!0,c=l),c){var p=c;rt.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){c=p.shift();try{d=c.verify(l)}catch{}}d||(a={message:"Certificate signature is invalid.",error:ke.certificateError.bad_certificate})}a===null&&(!c||f)&&!r.hasCertificate(l)&&(a={message:"Certificate is not trusted.",error:ke.certificateError.unknown_ca})}if(a===null&&c&&!l.isIssuer(c)&&(a={message:"Certificate issuer is invalid.",error:ke.certificateError.bad_certificate}),a===null)for(var g={keyUsage:!0,basicConstraints:!0},m=0;a===null&&m<l.extensions.length;++m){var v=l.extensions[m];v.critical&&!(v.name in g)&&(a={message:"Certificate has an unsupported critical extension.",error:ke.certificateError.unsupported_certificate})}if(a===null&&(!i||e.length===0&&(!c||f))){var y=l.getExtension("basicConstraints"),S=l.getExtension("keyUsage");if(S!==null&&(!S.keyCertSign||y===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:ke.certificateError.bad_certificate}),a===null&&y===null&&(a={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:ke.certificateError.bad_certificate}),a===null&&y!==null&&!y.cA&&(a={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:ke.certificateError.bad_certificate}),a===null&&S!==null&&"pathLenConstraint"in y){var C=o-1;C>y.pathLenConstraint&&(a={message:"Certificate basicConstraints pathLenConstraint violated.",error:ke.certificateError.bad_certificate})}}var w=a===null?!0:a.error,E=t.verify?t.verify(w,o,n):w;if(E===!0)a=null;else throw w===!0&&(a={message:"The application rejected the certificate.",error:ke.certificateError.bad_certificate}),(E||E===0)&&(typeof E=="object"&&!rt.util.isArray(E)?(E.message&&(a.message=E.message),E.error&&(a.error=E.error)):typeof E=="string"&&(a.error=E)),a;i=!1,++o}while(e.length>0);return!0}});var JA=ue((Xee,oB)=>{"use strict";var fr=bt();Js();gf();uo();GA();XA();Es();id();wf();jt();uv();var G=fr.asn1,Dt=fr.pki,od=oB.exports=fr.pkcs12=fr.pkcs12||{},aB={name:"ContentInfo",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},eM={name:"PFX",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,capture:"version"},aB,{name:"PFX.macData",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:G.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},tM={name:"SafeBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},rM={name:"Attribute",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,capture:"values"}]},nM={name:"CertBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:G.Class.UNIVERSAL,type:G.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function ad(r,e,t,n){for(var s=[],i=0;i<r.length;i++)for(var a=0;a<r[i].safeBags.length;a++){var o=r[i].safeBags[a];if(!(n!==void 0&&o.type!==n)){if(e===null){s.push(o);continue}o.attributes[e]!==void 0&&o.attributes[e].indexOf(t)>=0&&s.push(o)}}return s}u(ad,"_getBagsByAttribute");od.pkcs12FromAsn1=function(r,e,t){typeof e=="string"?(t=e,e=!0):e===void 0&&(e=!0);var n={},s=[];if(!G.validate(r,eM,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:u(function(y){var S={},C;return"localKeyId"in y?C=y.localKeyId:"localKeyIdHex"in y&&(C=fr.util.hexToBytes(y.localKeyIdHex)),C===void 0&&!("friendlyName"in y)&&"bagType"in y&&(S[y.bagType]=ad(a.safeContents,null,null,y.bagType)),C!==void 0&&(S.localKeyId=ad(a.safeContents,"localKeyId",C,y.bagType)),"friendlyName"in y&&(S.friendlyName=ad(a.safeContents,"friendlyName",y.friendlyName,y.bagType)),S},"getBags"),getBagsByFriendlyName:u(function(y,S){return ad(a.safeContents,"friendlyName",y,S)},"getBagsByFriendlyName"),getBagsByLocalKeyId:u(function(y,S){return ad(a.safeContents,"localKeyId",y,S)},"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(G.derToOid(n.contentType)!==Dt.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=G.derToOid(n.contentType),i}var o=n.content.value[0];if(o.tagClass!==G.Class.UNIVERSAL||o.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=zA(o),n.mac){var l=null,c=0,f=G.derToOid(n.macAlgorithm);switch(f){case Dt.oids.sha1:l=fr.md.sha1.create(),c=20;break;case Dt.oids.sha256:l=fr.md.sha256.create(),c=32;break;case Dt.oids.sha384:l=fr.md.sha384.create(),c=48;break;case Dt.oids.sha512:l=fr.md.sha512.create(),c=64;break;case Dt.oids.md5:l=fr.md.md5.create(),c=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var p=new fr.util.ByteBuffer(n.macSalt),d="macIterations"in n?parseInt(fr.util.bytesToHex(n.macIterations),16):1,g=od.generateKey(t,p,3,d,c,l),m=fr.hmac.create();m.start(l,g),m.update(o.value);var v=m.getMac();if(v.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(r.value)&&r.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return sM(a,o.value,e,t),a};function zA(r){if(r.composed||r.constructed){for(var e=fr.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}u(zA,"_decodePkcs7Data");function sM(r,e,t,n){if(e=G.fromDer(e,t),e.tagClass!==G.Class.UNIVERSAL||e.type!==G.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={},o=[];if(!G.validate(i,aB,a,o)){var l=new Error("Cannot read ContentInfo.");throw l.errors=o,l}var c={encrypted:!1},f=null,p=a.content.value[0];switch(G.derToOid(a.contentType)){case Dt.oids.data:if(p.tagClass!==G.Class.UNIVERSAL||p.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");f=zA(p).value;break;case Dt.oids.encryptedData:f=iM(p,n),c.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=G.derToOid(a.contentType),l}c.safeBags=aM(f,t,n),r.safeContents.push(c)}}u(sM,"_decodeAuthenticatedSafe");function iM(r,e){var t={},n=[];if(!G.validate(r,fr.pkcs7.asn1.encryptedDataValidator,t,n)){var s=new Error("Cannot read EncryptedContentInfo.");throw s.errors=n,s}var i=G.derToOid(t.contentType);if(i!==Dt.oids.data){var s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw s.oid=i,s}i=G.derToOid(t.encAlgorithm);var a=Dt.pbe.getCipher(i,t.encParameter,e),o=zA(t.encryptedContentAsn1),l=fr.util.createBuffer(o.value);if(a.update(l),!a.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return a.output.getBytes()}u(iM,"_decryptSafeContents");function aM(r,e,t){if(!e&&r.length===0)return[];if(r=G.fromDer(r,e),r.tagClass!==G.Class.UNIVERSAL||r.type!==G.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={},o=[];if(!G.validate(i,tM,a,o)){var l=new Error("Cannot read SafeBag.");throw l.errors=o,l}var c={type:G.derToOid(a.bagId),attributes:oM(a.bagAttributes)};n.push(c);var f,p,d=a.bagValue.value[0];switch(c.type){case Dt.oids.pkcs8ShroudedKeyBag:if(d=Dt.decryptPrivateKeyInfo(d,t),d===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Dt.oids.keyBag:try{c.key=Dt.privateKeyFromAsn1(d)}catch{c.key=null,c.asn1=d}continue;case Dt.oids.certBag:f=nM,p=u(function(){if(G.derToOid(a.certId)!==Dt.oids.x509Certificate){var m=new Error("Unsupported certificate type, only X.509 supported.");throw m.oid=G.derToOid(a.certId),m}var v=G.fromDer(a.cert,e);try{c.cert=Dt.certificateFromAsn1(v,!0)}catch{c.cert=null,c.asn1=v}},"decoder");break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=c.type,l}if(f!==void 0&&!G.validate(d,f,a,o)){var l=new Error("Cannot read PKCS#12 "+f.name);throw l.errors=o,l}p()}return n}u(aM,"_decodeSafeContents");function oM(r){var e={};if(r!==void 0)for(var t=0;t<r.length;++t){var n={},s=[];if(!G.validate(r[t],rM,n,s)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=s,i}var a=G.derToOid(n.oid);if(Dt.oids[a]!==void 0){e[Dt.oids[a]]=[];for(var o=0;o<n.values.length;++o)e[Dt.oids[a]].push(n.values[o].value)}}return e}u(oM,"_decodeBagAttributes");od.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=fr.util.hexToBytes(s);else if(n.generateLocalKeyId)if(e){var a=fr.util.isArray(e)?e[0]:e;typeof a=="string"&&(a=Dt.certificateFromPem(a));var o=fr.md.sha1.create();o.update(G.toDer(Dt.certificateToAsn1(a)).getBytes()),s=o.digest().getBytes()}else s=fr.random.getBytes(20);var l=[];s!==null&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.localKeyId).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,s)])])),"friendlyName"in n&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.friendlyName).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.BMPSTRING,!1,n.friendlyName)])])),l.length>0&&(i=G.create(G.Class.UNIVERSAL,G.Type.SET,!0,l));var c=[],f=[];e!==null&&(fr.util.isArray(e)?f=e:f=[e]);for(var p=[],d=0;d<f.length;++d){e=f[d],typeof e=="string"&&(e=Dt.certificateFromPem(e));var g=d===0?i:void 0,m=Dt.certificateToAsn1(e),v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.certBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.x509Certificate).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(m).getBytes())])])]),g]);p.push(v)}if(p.length>0){var y=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,p),S=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(y).getBytes())])]);c.push(S)}var C=null;if(r!==null){var w=Dt.wrapRsaPrivateKey(Dt.privateKeyToAsn1(r));t===null?C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.keyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[w]),i]):C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.pkcs8ShroudedKeyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[Dt.encryptPrivateKeyInfo(w,t,n)]),i]);var E=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[C]),A=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(E).getBytes())])]);c.push(A)}var b=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,c),V;if(n.useMac){var o=fr.md.sha1.create(),I=new fr.util.ByteBuffer(fr.random.getBytes(n.saltSize)),D=n.count,r=od.generateKey(t,I,3,D,20),U=fr.hmac.create();U.start(o,r),U.update(G.toDer(b).getBytes());var F=U.getMac();V=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.sha1).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.NULL,!1,"")]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,F.getBytes())]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,I.getBytes()),G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(D).getBytes())])}return G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(3).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(b).getBytes())])]),V])};od.generateKey=fr.pbe.generatePkcs12Key});var QA=ue(($ee,uB)=>{"use strict";var ho=bt();Js();uo();XA();zu();Qy();JA();iv();id();jt();uv();var YA=ho.asn1,xf=uB.exports=ho.pki=ho.pki||{};xf.pemToDer=function(r){var e=ho.pem.decode(r)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return ho.util.createBuffer(e.body)};xf.privateKeyFromPem=function(r){var e=ho.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=YA.fromDer(e.body);return xf.privateKeyFromAsn1(n)};xf.privateKeyToPem=function(r,e){var t={type:"RSA PRIVATE KEY",body:YA.toDer(xf.privateKeyToAsn1(r)).getBytes()};return ho.pem.encode(t,{maxline:e})};xf.privateKeyInfoToPem=function(r,e){var t={type:"PRIVATE KEY",body:YA.toDer(r).getBytes()};return ho.pem.encode(t,{maxline:e})}});var sC=ue((Wee,gB)=>{"use strict";var be=bt();Js();gf();Wy();zu();QA();Es();wf();jt();var hv=u(function(r,e,t,n){var s=be.util.createBuffer(),i=r.length>>1,a=i+(r.length&1),o=r.substr(0,a),l=r.substr(i,a),c=be.util.createBuffer(),f=be.hmac.create();t=e+t;var p=Math.ceil(n/16),d=Math.ceil(n/20);f.start("MD5",o);var g=be.util.createBuffer();c.putBytes(t);for(var m=0;m<p;++m)f.start(null,null),f.update(c.getBytes()),c.putBuffer(f.digest()),f.start(null,null),f.update(c.bytes()+t),g.putBuffer(f.digest());f.start("SHA1",l);var v=be.util.createBuffer();c.clear(),c.putBytes(t);for(var m=0;m<d;++m)f.start(null,null),f.update(c.getBytes()),c.putBuffer(f.digest()),f.start(null,null),f.update(c.bytes()+t),v.putBuffer(f.digest());return s.putBytes(be.util.xorBytes(g.getBytes(),v.getBytes(),n)),s},"prf_TLS1"),uM=u(function(r,e,t){var n=be.hmac.create();n.start("SHA1",r);var s=be.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"),lM=u(function(r,e,t){var n=!1;try{var s=r.deflate(e.fragment.getBytes());e.fragment=be.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"deflate"),cM=u(function(r,e,t){var n=!1;try{var s=r.inflate(e.fragment.getBytes());e.fragment=be.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"inflate"),us=u(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 be.util.createBuffer(r.getBytes(t))},"readVector"),Cs=u(function(r,e,t){r.putInt(t.length(),e<<3),r.putBuffer(t)},"writeVector"),L={};L.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};L.SupportedVersions=[L.Versions.TLS_1_1,L.Versions.TLS_1_0];L.Version=L.SupportedVersions[0];L.MaxFragment=15360;L.ConnectionEnd={server:0,client:1};L.PRFAlgorithm={tls_prf_sha256:0};L.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};L.CipherType={stream:0,block:1,aead:2};L.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};L.CompressionMethod={none:0,deflate:1};L.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};L.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};L.Alert={};L.Alert.Level={warning:1,fatal:2};L.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};L.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};L.CipherSuites={};L.getCipherSuite=function(r){var e=null;for(var t in L.CipherSuites){var n=L.CipherSuites[t];if(n.id[0]===r.charCodeAt(0)&&n.id[1]===r.charCodeAt(1)){e=n;break}}return e};L.handleUnexpected=function(r,e){var t=!r.open&&r.entity===L.ConnectionEnd.client;t||r.error(r,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})};L.handleHelloRequest=function(r,e,t){!r.handshaking&&r.handshakes>0&&(L.queue(r,L.createAlert(r,{level:L.Alert.Level.warning,description:L.Alert.Description.no_renegotiation})),L.flush(r)),r.process()};L.parseHelloMessage=function(r,e,t){var n=null,s=r.entity===L.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:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});else{var i=e.fragment,a=i.length();if(n={version:{major:i.getByte(),minor:i.getByte()},random:be.util.createBuffer(i.getBytes(32)),session_id:us(i,1),extensions:[]},s?(n.cipher_suite=i.getBytes(2),n.compression_method=i.getByte()):(n.cipher_suites=us(i,2),n.compression_methods=us(i,1)),a=t-(a-i.length()),a>0){for(var o=us(i,2);o.length()>0;)n.extensions.push({type:[o.getByte(),o.getByte()],data:us(o,2)});if(!s)for(var l=0;l<n.extensions.length;++l){var c=n.extensions[l];if(c.type[0]===0&&c.type[1]===0)for(var f=us(c.data,2);f.length()>0;){var p=f.getByte();if(p!==0)break;r.session.extensions.server_name.serverNameList.push(us(f,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:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});if(s)r.session.cipherSuite=L.getCipherSuite(n.cipher_suite);else for(var d=be.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(r.session.cipherSuite=L.getCipherSuite(d.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:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure},cipherSuite:be.util.bytesToHex(n.cipher_suite)});s?r.session.compressionMethod=n.compression_method:r.session.compressionMethod=L.CompressionMethod.none}return n};L.createSecurityParameters=function(r,e){var t=r.entity===L.ConnectionEnd.client,n=e.random.bytes(),s=t?r.session.sp.client_random:n,i=t?n:L.createRandom().getBytes();r.session.sp={entity:r.entity,prf_algorithm:L.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:r.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:s,server_random:i}};L.handleServerHello=function(r,e,t){var n=L.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:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});r.session.version=r.version;var s=n.session_id.bytes();s.length>0&&s===r.session.id?(r.expect=fB,r.session.resuming=!0,r.session.sp.server_random=n.random.bytes()):(r.expect=hM,r.session.resuming=!1,L.createSecurityParameters(r,n)),r.session.id=s,r.process()}};L.handleClientHello=function(r,e,t){var n=L.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=be.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,o=1;o<L.SupportedVersions.length&&(a=L.SupportedVersions[o],!(a.minor<=n.version.minor));++o);r.version={major:a.major,minor:a.minor},r.session.version=r.version}i!==null?(r.expect=rC,r.session.resuming=!0,r.session.sp.client_random=n.random.bytes()):(r.expect=r.verifyClient!==!1?EM:tC,r.session.resuming=!1,L.createSecurityParameters(r,n)),r.open=!0,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerHello(r)})),r.session.resuming?(L.queue(r,L.createRecord(r,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),r.state.pending=L.createConnectionState(r),r.state.current.write=r.state.pending.write,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createFinished(r)}))):(L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificate(r)})),r.fail||(L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerKeyExchange(r)})),r.verifyClient!==!1&&L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificateRequest(r)})),L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerHelloDone(r)})))),L.flush(r),r.process()}};L.handleCertificate=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_list:us(n,3)},i,a,o=[];try{for(;s.certificate_list.length()>0;)i=us(s.certificate_list,3),a=be.asn1.fromDer(i),i=be.pki.certificateFromAsn1(a,!0),o.push(i)}catch(c){return r.error(r,{message:"Could not parse certificate list.",cause:c,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var l=r.entity===L.ConnectionEnd.client;(l||r.verifyClient===!0)&&o.length===0?r.error(r,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}}):o.length===0?r.expect=l?lB:tC:(l?r.session.serverCertificate=o[0]:r.session.clientCertificate=o[0],L.verifyCertificateChain(r,o)&&(r.expect=l?lB:tC)),r.process()};L.handleServerKeyExchange=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});r.expect=pM,r.process()};L.handleClientKeyExchange=function(r,e,t){if(t<48)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});var n=e.fragment,s={enc_pre_master_secret:us(n,2).getBytes()},i=null;if(r.getPrivateKey)try{i=r.getPrivateKey(r,r.session.serverCertificate),i=be.pki.privateKeyFromPem(i)}catch(l){r.error(r,{message:"Could not get private key.",cause:l,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}if(i===null)return r.error(r,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}});try{var a=r.session.sp;a.pre_master_secret=i.decrypt(s.enc_pre_master_secret);var o=r.session.clientHelloVersion;if(o.major!==a.pre_master_secret.charCodeAt(0)||o.minor!==a.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{a.pre_master_secret=be.random.getBytes(48)}r.expect=rC,r.session.clientCertificate!==null&&(r.expect=wM),r.process()};L.handleCertificateRequest=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_types:us(n,1),certificate_authorities:us(n,2)};r.session.certificateRequest=s,r.expect=dM,r.process()};L.handleCertificateVerify=function(r,e,t){if(t<2)return r.error(r,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i={signature:us(n,2).getBytes()},a=be.util.createBuffer();a.putBuffer(r.session.md5.digest()),a.putBuffer(r.session.sha1.digest()),a=a.getBytes();try{var o=r.session.clientCertificate;if(!o.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:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure}})}r.expect=rC,r.process()};L.handleServerHelloDone=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.record_overflow}});if(r.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.insufficient_security}},s=0,i=r.verify(r,n.alert.description,s,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!be.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=L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificate(r)}),L.queue(r,e)),e=L.createRecord(r,{type:L.ContentType.handshake,data:L.createClientKeyExchange(r)}),L.queue(r,e),r.expect=yM;var a=u(function(o,l){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createCertificateVerify(o,l)})),L.queue(o,L.createRecord(o,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),o.state.pending=L.createConnectionState(o),o.state.current.write=o.state.pending.write,L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createFinished(o)})),o.expect=fB,L.flush(o),o.process()},"callback");if(r.session.certificateRequest===null||r.session.clientCertificate===null)return a(r,null);L.getClientSignature(r,a)};L.handleChangeCipherSpec=function(r,e){if(e.fragment.getByte()!==1)return r.error(r,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var t=r.entity===L.ConnectionEnd.client;(r.session.resuming&&t||!r.session.resuming&&!t)&&(r.state.pending=L.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?mM:SM,r.process()};L.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=be.util.createBuffer(),n.putBuffer(r.session.md5.digest()),n.putBuffer(r.session.sha1.digest());var a=r.entity===L.ConnectionEnd.client,o=a?"server finished":"client finished",l=r.session.sp,c=12,f=hv;if(n=f(l.master_secret,o,n.getBytes(),c),n.getBytes()!==i)return r.error(r,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decrypt_error}});r.session.md5.update(s),r.session.sha1.update(s),(r.session.resuming&&a||!r.session.resuming&&!a)&&(L.queue(r,L.createRecord(r,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),r.state.current.write=r.state.pending.write,r.state.pending=null,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createFinished(r)}))),r.expect=a?gM:AM,r.handshaking=!1,++r.handshakes,r.peerCertificate=a?r.session.serverCertificate:r.session.clientCertificate,L.flush(r),r.isConnected=!0,r.connected(r),r.process()};L.handleAlert=function(r,e){var t=e.fragment,n={level:t.getByte(),description:t.getByte()},s;switch(n.description){case L.Alert.Description.close_notify:s="Connection closed.";break;case L.Alert.Description.unexpected_message:s="Unexpected message.";break;case L.Alert.Description.bad_record_mac:s="Bad record MAC.";break;case L.Alert.Description.decryption_failed:s="Decryption failed.";break;case L.Alert.Description.record_overflow:s="Record overflow.";break;case L.Alert.Description.decompression_failure:s="Decompression failed.";break;case L.Alert.Description.handshake_failure:s="Handshake failure.";break;case L.Alert.Description.bad_certificate:s="Bad certificate.";break;case L.Alert.Description.unsupported_certificate:s="Unsupported certificate.";break;case L.Alert.Description.certificate_revoked:s="Certificate revoked.";break;case L.Alert.Description.certificate_expired:s="Certificate expired.";break;case L.Alert.Description.certificate_unknown:s="Certificate unknown.";break;case L.Alert.Description.illegal_parameter:s="Illegal parameter.";break;case L.Alert.Description.unknown_ca:s="Unknown certificate authority.";break;case L.Alert.Description.access_denied:s="Access denied.";break;case L.Alert.Description.decode_error:s="Decode error.";break;case L.Alert.Description.decrypt_error:s="Decrypt error.";break;case L.Alert.Description.export_restriction:s="Export restriction.";break;case L.Alert.Description.protocol_version:s="Unsupported protocol version.";break;case L.Alert.Description.insufficient_security:s="Insufficient security.";break;case L.Alert.Description.internal_error:s="Internal error.";break;case L.Alert.Description.user_canceled:s="User canceled.";break;case L.Alert.Description.no_renegotiation:s="Renegotiation not supported.";break;default:s="Unknown error.";break}if(n.description===L.Alert.Description.close_notify)return r.close();r.error(r,{message:s,send:!1,origin:r.entity===L.ConnectionEnd.client?"server":"client",alert:n}),r.process()};L.handleHandshake=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt24();if(s>t.length())return r.fragmented=e,e.fragment=be.util.createBuffer(),t.read-=4,r.process();r.fragmented=null,t.read-=4;var i=t.bytes(s+4);t.read+=4,n in fv[r.entity][r.expect]?(r.entity===L.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:be.md.md5.create(),sha1:be.md.sha1.create()}),n!==L.HandshakeType.hello_request&&n!==L.HandshakeType.certificate_verify&&n!==L.HandshakeType.finished&&(r.session.md5.update(i),r.session.sha1.update(i)),fv[r.entity][r.expect][n](r,e,s)):L.handleUnexpected(r,e)};L.handleApplicationData=function(r,e){r.data.putBuffer(e.fragment),r.dataReady(r),r.process()};L.handleHeartbeat=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt16(),i=t.getBytes(s);if(n===L.HeartbeatMessageType.heartbeat_request){if(r.handshaking||s>i.length)return r.process();L.queue(r,L.createRecord(r,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_response,i)})),L.flush(r)}else if(n===L.HeartbeatMessageType.heartbeat_response){if(i!==r.expectedHeartbeatPayload)return r.process();r.heartbeatReceived&&r.heartbeatReceived(r,be.util.createBuffer(i))}r.process()};var fM=0,hM=1,lB=2,pM=3,dM=4,fB=5,mM=6,gM=7,yM=8,vM=0,EM=1,tC=2,wM=3,rC=4,SM=5,AM=6,k=L.handleUnexpected,hB=L.handleChangeCipherSpec,pn=L.handleAlert,Pn=L.handleHandshake,pB=L.handleApplicationData,dn=L.handleHeartbeat,nC=[];nC[L.ConnectionEnd.client]=[[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[hB,pn,k,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,pB,dn],[k,pn,Pn,k,dn]];nC[L.ConnectionEnd.server]=[[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[hB,pn,k,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,pB,dn],[k,pn,Pn,k,dn]];var po=L.handleHelloRequest,CM=L.handleServerHello,dB=L.handleCertificate,cB=L.handleServerKeyExchange,ZA=L.handleCertificateRequest,lv=L.handleServerHelloDone,mB=L.handleFinished,fv=[];fv[L.ConnectionEnd.client]=[[k,k,CM,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,dB,cB,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,cB,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,mB],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]];var xM=L.handleClientHello,bM=L.handleClientKeyExchange,NM=L.handleCertificateVerify;fv[L.ConnectionEnd.server]=[[k,xM,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,dB,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,bM,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,NM,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,mB],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]];L.generateKeys=function(r,e){var t=hv,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===L.Versions.TLS_1_0.major&&r.version.minor===L.Versions.TLS_1_0.minor;i&&(s+=2*e.fixed_iv_length);var a=t(e.master_secret,"key expansion",n,s),o={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&&(o.client_write_IV=a.getBytes(e.fixed_iv_length),o.server_write_IV=a.getBytes(e.fixed_iv_length)),o};L.createConnectionState=function(r){var e=r.entity===L.ConnectionEnd.client,t=u(function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:u(function(a){return!0},"cipherFunction"),compressionState:null,compressFunction:u(function(a){return!0},"compressFunction"),updateSequenceNumber:u(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:L.Alert.Level.fatal,description:L.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.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:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}),!i.fail},r.session){var s=r.session.sp;switch(r.session.cipherSuite.initSecurityParameters(s),s.keys=L.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 L.CompressionMethod.none:break;case L.CompressionMethod.deflate:n.read.compressFunction=cM,n.write.compressFunction=lM;break;default:throw new Error("Unsupported compression algorithm.")}}return n};L.createRandom=function(){var r=new Date,e=+r+r.getTimezoneOffset()*6e4,t=be.util.createBuffer();return t.putInt32(e),t.putBytes(be.random.getBytes(28)),t};L.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};L.createAlert=function(r,e){var t=be.util.createBuffer();return t.putByte(e.level),t.putByte(e.description),L.createRecord(r,{type:L.ContentType.alert,data:t})};L.createClientHello=function(r){r.session.clientHelloVersion={major:r.version.major,minor:r.version.minor};for(var e=be.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=be.util.createBuffer();i.putByte(L.CompressionMethod.none);var a=i.length(),o=be.util.createBuffer();if(r.virtualHost){var l=be.util.createBuffer();l.putByte(0),l.putByte(0);var c=be.util.createBuffer();c.putByte(0),Cs(c,2,be.util.createBuffer(r.virtualHost));var f=be.util.createBuffer();Cs(f,2,c),Cs(l,2,f),o.putBuffer(l)}var p=o.length();p>0&&(p+=2);var d=r.session.id,g=d.length+1+2+4+28+2+s+1+a+p,m=be.util.createBuffer();return m.putByte(L.HandshakeType.client_hello),m.putInt24(g),m.putByte(r.version.major),m.putByte(r.version.minor),m.putBytes(r.session.sp.client_random),Cs(m,1,be.util.createBuffer(d)),Cs(m,2,e),Cs(m,1,i),p>0&&Cs(m,2,o),m};L.createServerHello=function(r){var e=r.session.id,t=e.length+1+2+4+28+2+1,n=be.util.createBuffer();return n.putByte(L.HandshakeType.server_hello),n.putInt24(t),n.putByte(r.version.major),n.putByte(r.version.minor),n.putBytes(r.session.sp.server_random),Cs(n,1,be.util.createBuffer(e)),n.putByte(r.session.cipherSuite.id[0]),n.putByte(r.session.cipherSuite.id[1]),n.putByte(r.session.compressionMethod),n};L.createCertificate=function(r){var e=r.entity===L.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=be.util.createBuffer();if(t!==null)try{be.util.isArray(t)||(t=[t]);for(var i=null,a=0;a<t.length;++a){var o=be.pem.decode(t[a])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.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=o.type,l}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var c=be.util.createBuffer(o.body);i===null&&(i=be.asn1.fromDer(c.bytes(),!1));var f=be.util.createBuffer();Cs(f,3,c),s.putBuffer(f)}t=be.pki.certificateFromAsn1(i),e?r.session.clientCertificate=t:r.session.serverCertificate=t}catch(g){return r.error(r,{message:"Could not send certificate list.",cause:g,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var p=3+s.length(),d=be.util.createBuffer();return d.putByte(L.HandshakeType.certificate),d.putInt24(p),Cs(d,3,s),d};L.createClientKeyExchange=function(r){var e=be.util.createBuffer();e.putByte(r.session.clientHelloVersion.major),e.putByte(r.session.clientHelloVersion.minor),e.putBytes(be.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=be.util.createBuffer();return i.putByte(L.HandshakeType.client_key_exchange),i.putInt24(s),i.putInt16(e.length),i.putBytes(e),i};L.createServerKeyExchange=function(r){var e=0,t=be.util.createBuffer();return e>0&&(t.putByte(L.HandshakeType.server_key_exchange),t.putInt24(e)),t};L.getClientSignature=function(r,e){var t=be.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=be.pki.privateKeyFromPem(a)}catch(o){n.error(n,{message:"Could not get private key.",cause:o,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}a===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):s=a.sign(s,null),i(n,s)},r.getSignature(r,t,e)};L.createCertificateVerify=function(r,e){var t=e.length+2,n=be.util.createBuffer();return n.putByte(L.HandshakeType.certificate_verify),n.putInt24(t),n.putInt16(e.length),n.putBytes(e),n};L.createCertificateRequest=function(r){var e=be.util.createBuffer();e.putByte(1);var t=be.util.createBuffer();for(var n in r.caStore.certs){var s=r.caStore.certs[n],i=be.pki.distinguishedNameToAsn1(s.subject),a=be.asn1.toDer(i);t.putInt16(a.length()),t.putBuffer(a)}var o=1+e.length()+2+t.length(),l=be.util.createBuffer();return l.putByte(L.HandshakeType.certificate_request),l.putInt24(o),Cs(l,1,e),Cs(l,2,t),l};L.createServerHelloDone=function(r){var e=be.util.createBuffer();return e.putByte(L.HandshakeType.server_hello_done),e.putInt24(0),e};L.createChangeCipherSpec=function(){var r=be.util.createBuffer();return r.putByte(1),r};L.createFinished=function(r){var e=be.util.createBuffer();e.putBuffer(r.session.md5.digest()),e.putBuffer(r.session.sha1.digest());var t=r.entity===L.ConnectionEnd.client,n=r.session.sp,s=12,i=hv,a=t?"client finished":"server finished";e=i(n.master_secret,a,e.getBytes(),s);var o=be.util.createBuffer();return o.putByte(L.HandshakeType.finished),o.putInt24(e.length()),o.putBuffer(e),o};L.createHeartbeat=function(r,e,t){typeof t>"u"&&(t=e.length);var n=be.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(be.random.getBytes(i)),n};L.queue=function(r,e){if(e&&!(e.fragment.length()===0&&(e.type===L.ContentType.handshake||e.type===L.ContentType.alert||e.type===L.ContentType.change_cipher_spec))){if(e.type===L.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()<=L.MaxFragment)n=[e];else{n=[];for(var s=e.fragment.bytes();s.length>L.MaxFragment;)n.push(L.createRecord(r,{type:e.type,data:be.util.createBuffer(s.slice(0,L.MaxFragment))})),s=s.slice(L.MaxFragment);s.length>0&&n.push(L.createRecord(r,{type:e.type,data:be.util.createBuffer(s)}))}for(var i=0;i<n.length&&!r.fail;++i){var a=n[i],o=r.state.current.write;o.update(r,a)&&r.records.push(a)}}};L.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 eC=u(function(r){switch(r){case!0:return!0;case be.pki.certificateError.bad_certificate:return L.Alert.Description.bad_certificate;case be.pki.certificateError.unsupported_certificate:return L.Alert.Description.unsupported_certificate;case be.pki.certificateError.certificate_revoked:return L.Alert.Description.certificate_revoked;case be.pki.certificateError.certificate_expired:return L.Alert.Description.certificate_expired;case be.pki.certificateError.certificate_unknown:return L.Alert.Description.certificate_unknown;case be.pki.certificateError.unknown_ca:return L.Alert.Description.unknown_ca;default:return L.Alert.Description.bad_certificate}},"_certErrorToAlertDesc"),TM=u(function(r){switch(r){case!0:return!0;case L.Alert.Description.bad_certificate:return be.pki.certificateError.bad_certificate;case L.Alert.Description.unsupported_certificate:return be.pki.certificateError.unsupported_certificate;case L.Alert.Description.certificate_revoked:return be.pki.certificateError.certificate_revoked;case L.Alert.Description.certificate_expired:return be.pki.certificateError.certificate_expired;case L.Alert.Description.certificate_unknown:return be.pki.certificateError.certificate_unknown;case L.Alert.Description.unknown_ca:return be.pki.certificateError.unknown_ca;default:return be.pki.certificateError.bad_certificate}},"_alertDescToCertError");L.verifyCertificateChain=function(r,e){try{var t={};for(var n in r.verifyOptions)t[n]=r.verifyOptions[n];t.verify=function(i,a,o){var l=eC(i),c=r.verify(r,i,a,o);if(c!==!0){if(typeof c=="object"&&!be.util.isArray(c)){var f=new Error("The application rejected the certificate.");throw f.send=!0,f.alert={level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate},c.message&&(f.message=c.message),c.alert&&(f.alert.description=c.alert),f}c!==i&&(c=TM(c))}return c},be.pki.verifyCertificateChain(r.caStore,e,t)}catch(i){var s=i;(typeof s!="object"||be.util.isArray(s))&&(s={send:!0,alert:{level:L.Alert.Level.fatal,description:eC(i)}}),"send"in s||(s.send=!0),"alert"in s||(s.alert={level:L.Alert.Level.fatal,description:eC(s.error)}),r.error(r,s)}return!r.fail};L.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=be.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 o in t.order)if(t.order[o]===a){t.order.splice(o,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=be.util.bytesToHex(s);t.order.push(a),t.cache[a]=i}}return t};L.createConnection=function(r){var e=null;r.caStore?be.util.isArray(r.caStore)?e=be.pki.createCaStore(r.caStore):e=r.caStore:e=be.pki.createCaStore();var t=r.cipherSuites||null;if(t===null){t=[];for(var n in L.CipherSuites)t.push(L.CipherSuites[n])}var s=r.server?L.ConnectionEnd.server:L.ConnectionEnd.client,i=r.sessionCache?L.createSessionCache(r.sessionCache):null,a={version:{major:L.Version.major,minor:L.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(f,p,d,g){return p},verifyOptions:r.verifyOptions||{},getCertificate:r.getCertificate||null,getPrivateKey:r.getPrivateKey||null,getSignature:r.getSignature||null,input:be.util.createBuffer(),tlsData:be.util.createBuffer(),data:be.util.createBuffer(),tlsDataReady:r.tlsDataReady,dataReady:r.dataReady,heartbeatReceived:r.heartbeatReceived,closed:r.closed,error:u(function(f,p){p.origin=p.origin||(f.entity===L.ConnectionEnd.client?"client":"server"),p.send&&(L.queue(f,L.createAlert(f,p.alert)),L.flush(f));var d=p.fatal!==!1;d&&(f.fail=!0),r.error(f,p),d&&f.close(!1)},"error"),deflate:r.deflate||null,inflate:r.inflate||null};a.reset=function(f){a.version={major:L.Version.major,minor:L.Version.minor},a.record=null,a.session=null,a.peerCertificate=null,a.state={pending:null,current:null},a.expect=a.entity===L.ConnectionEnd.client?fM:vM,a.fragmented=null,a.records=[],a.open=!1,a.handshakes=0,a.handshaking=!1,a.isConnected=!1,a.fail=!(f||typeof f>"u"),a.input.clear(),a.tlsData.clear(),a.data.clear(),a.state.current=L.createConnectionState(a)},a.reset();var o=u(function(f,p){var d=p.type-L.ContentType.change_cipher_spec,g=nC[f.entity][f.expect];d in g?g[d](f,p):L.handleUnexpected(f,p)},"_update"),l=u(function(f){var p=0,d=f.input,g=d.length();if(g<5)p=5-g;else{f.record={type:d.getByte(),version:{major:d.getByte(),minor:d.getByte()},length:d.getInt16(),fragment:be.util.createBuffer(),ready:!1};var m=f.record.version.major===f.version.major;m&&f.session&&f.session.version&&(m=f.record.version.minor===f.version.minor),m||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}})}return p},"_readRecordHeader"),c=u(function(f){var p=0,d=f.input,g=d.length();if(g<f.record.length)p=f.record.length-g;else{f.record.fragment.putBytes(d.getBytes(f.record.length)),d.compact();var m=f.state.current.read;m.update(f,f.record)&&(f.fragmented!==null&&(f.fragmented.type===f.record.type?(f.fragmented.fragment.putBuffer(f.record.fragment),f.record=f.fragmented):f.error(f,{message:"Invalid fragmented record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})),f.record.ready=!0)}return p},"_readRecord");return a.handshake=function(f){if(a.entity!==L.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,f=f||"";var p=null;f.length>0&&(a.sessionCache&&(p=a.sessionCache.getSession(f)),p===null&&(f="")),f.length===0&&a.sessionCache&&(p=a.sessionCache.getSession(),p!==null&&(f=p.id)),a.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:be.md.md5.create(),sha1:be.md.sha1.create()},p&&(a.version=p.version,a.session.sp=p.sp),a.session.sp.client_random=L.createRandom().getBytes(),a.open=!0,L.queue(a,L.createRecord(a,{type:L.ContentType.handshake,data:L.createClientHello(a)})),L.flush(a)}},a.process=function(f){var p=0;return f&&a.input.putBytes(f),a.fail||(a.record!==null&&a.record.ready&&a.record.fragment.isEmpty()&&(a.record=null),a.record===null&&(p=l(a)),!a.fail&&a.record!==null&&!a.record.ready&&(p=c(a)),!a.fail&&a.record!==null&&a.record.ready&&o(a,a.record)),p},a.prepare=function(f){return L.queue(a,L.createRecord(a,{type:L.ContentType.application_data,data:be.util.createBuffer(f)})),L.flush(a)},a.prepareHeartbeatRequest=function(f,p){return f instanceof be.util.ByteBuffer&&(f=f.bytes()),typeof p>"u"&&(p=f.length),a.expectedHeartbeatPayload=f,L.queue(a,L.createRecord(a,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_request,f,p)})),L.flush(a)},a.close=function(f){if(!a.fail&&a.sessionCache&&a.session){var p={id:a.session.id,version:a.session.version,sp:a.session.sp};p.sp.keys=null,a.sessionCache.setSession(p.id,p)}a.open&&(a.open=!1,a.input.clear(),(a.isConnected||a.handshaking)&&(a.isConnected=a.handshaking=!1,L.queue(a,L.createAlert(a,{level:L.Alert.Level.warning,description:L.Alert.Description.close_notify})),L.flush(a)),a.closed(a)),a.reset(f)},a};gB.exports=be.tls=be.tls||{};for(cv in L)typeof L[cv]!="function"&&(be.tls[cv]=L[cv]);var cv;be.tls.prf_tls1=hv;be.tls.hmac_sha1=uM;be.tls.createSessionCache=L.createSessionCache;be.tls.createConnection=L.createConnection});var EB=ue((Jee,vB)=>{"use strict";var mo=bt();oo();sC();var xs=vB.exports=mo.tls;xs.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:u(function(r){r.bulk_cipher_algorithm=xs.BulkCipherAlgorithm.aes,r.cipher_type=xs.CipherType.block,r.enc_key_length=16,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=xs.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:yB};xs.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:u(function(r){r.bulk_cipher_algorithm=xs.BulkCipherAlgorithm.aes,r.cipher_type=xs.CipherType.block,r.enc_key_length=32,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=xs.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:yB};function yB(r,e,t){var n=e.entity===mo.tls.ConnectionEnd.client;r.read.cipherState={init:!1,cipher:mo.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:mo.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=RM,r.write.cipherFunction=IM,r.read.macLength=r.write.macLength=t.mac_length,r.read.macFunction=r.write.macFunction=xs.hmac_sha1}u(yB,"initConnectionState");function IM(r,e){var t=!1,n=e.macFunction(e.macKey,e.sequenceNumber,r);r.fragment.putBytes(n),e.updateSequenceNumber();var s;r.version.minor===xs.Versions.TLS_1_0.minor?s=e.cipherState.init?null:e.cipherState.iv:s=mo.random.getBytesSync(16),e.cipherState.init=!0;var i=e.cipherState.cipher;return i.start({iv:s}),r.version.minor>=xs.Versions.TLS_1_1.minor&&i.output.putBytes(s),i.update(r.fragment),i.finish(DM)&&(r.fragment=i.output,r.length=r.fragment.length(),t=!0),t}u(IM,"encrypt_aes_cbc_sha1");function DM(r,e,t){if(!t){var n=r-e.length()%r;e.fillWithByte(n-1,n)}return!0}u(DM,"encrypt_aes_cbc_sha1_padding");function BM(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}u(BM,"decrypt_aes_cbc_sha1_padding");function RM(r,e){var t=!1,n;r.version.minor===xs.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(BM);var i=e.macLength,a=mo.random.getBytesSync(i),o=s.output.length();o>=i?(r.fragment=s.output.getBytes(o-i),a=s.output.getBytes(i)):r.fragment=s.output.getBytes(),r.fragment=mo.util.createBuffer(r.fragment),r.length=r.fragment.length();var l=e.macFunction(e.macKey,e.sequenceNumber,r);return e.updateSequenceNumber(),t=OM(e.macKey,a,l)&&t,t}u(RM,"decrypt_aes_cbc_sha1");function OM(r,e,t){var n=mo.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}u(OM,"compareMacs")});var oC=ue((Qee,CB)=>{"use strict";var vr=bt();yi();jt();var ud=CB.exports=vr.sha512=vr.sha512||{};vr.md.sha512=vr.md.algorithms.sha512=ud;var SB=vr.sha384=vr.sha512.sha384=vr.sha512.sha384||{};SB.create=function(){return ud.create("SHA-384")};vr.md.sha384=vr.md.algorithms.sha384=SB;vr.sha512.sha256=vr.sha512.sha256||{create:u(function(){return ud.create("SHA-512/256")},"create")};vr.md["sha512/256"]=vr.md.algorithms["sha512/256"]=vr.sha512.sha256;vr.sha512.sha224=vr.sha512.sha224||{create:u(function(){return ud.create("SHA-512/224")},"create")};vr.md["sha512/224"]=vr.md.algorithms["sha512/224"]=vr.sha512.sha224;ud.create=function(r){if(AB||_M(),typeof r>"u"&&(r="SHA-512"),!(r in tl))throw new Error("Invalid SHA-512 algorithm: "+r);for(var e=tl[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 o={algorithm:r.replace("-","").toLowerCase(),blockLength:128,digestLength:a,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var l=o.messageLengthSize/4,c=0;c<l;++c)o.fullMessageLength.push(0);n=vr.util.createBuffer(),t=new Array(e.length);for(var c=0;c<e.length;++c)t[c]=e[c].slice(0);return o},o.start(),o.update=function(l,c){c==="utf8"&&(l=vr.util.encodeUtf8(l));var f=l.length;o.messageLength+=f,f=[f/4294967296>>>0,f>>>0];for(var p=o.fullMessageLength.length-1;p>=0;--p)o.fullMessageLength[p]+=f[1],f[1]=f[0]+(o.fullMessageLength[p]/4294967296>>>0),o.fullMessageLength[p]=o.fullMessageLength[p]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(l),wB(t,s,n),(n.read>2048||n.length()===0)&&n.compact(),o},o.digest=function(){var l=vr.util.createBuffer();l.putBytes(n.bytes());var c=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,f=c&o.blockLength-1;l.putBytes(iC.substr(0,o.blockLength-f));for(var p,d,g=o.fullMessageLength[0]*8,m=0;m<o.fullMessageLength.length-1;++m)p=o.fullMessageLength[m+1]*8,d=p/4294967296>>>0,g+=d,l.putInt32(g>>>0),g=p>>>0;l.putInt32(g);for(var v=new Array(t.length),m=0;m<t.length;++m)v[m]=t[m].slice(0);wB(v,s,l);var y=vr.util.createBuffer(),S;r==="SHA-512"?S=v.length:r==="SHA-384"?S=v.length-2:S=v.length-4;for(var m=0;m<S;++m)y.putInt32(v[m][0]),(m!==S-1||r!=="SHA-512/224")&&y.putInt32(v[m][1]);return y},o};var iC=null,AB=!1,aC=null,tl=null;function _M(){iC="\x80",iC+=vr.util.fillString("\0",128),aC=[[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]],tl={},tl["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],tl["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],tl["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],tl["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],AB=!0}u(_M,"_init");function wB(r,e,t){for(var n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C,w,E,A,b,V,I,D,U,F,M,se,ee,ie,X,he,Ce,xe,pe,W,fe=t.length();fe>=128;){for(ie=0;ie<16;++ie)e[ie][0]=t.getInt32()>>>0,e[ie][1]=t.getInt32()>>>0;for(;ie<80;++ie)Ce=e[ie-2],X=Ce[0],he=Ce[1],n=((X>>>19|he<<13)^(he>>>29|X<<3)^X>>>6)>>>0,s=((X<<13|he>>>19)^(he<<3|X>>>29)^(X<<26|he>>>6))>>>0,pe=e[ie-15],X=pe[0],he=pe[1],i=((X>>>1|he<<31)^(X>>>8|he<<24)^X>>>7)>>>0,a=((X<<31|he>>>1)^(X<<24|he>>>8)^(X<<25|he>>>7))>>>0,xe=e[ie-7],W=e[ie-16],he=s+xe[1]+a+W[1],e[ie][0]=n+xe[0]+i+W[0]+(he/4294967296>>>0)>>>0,e[ie][1]=he>>>0;for(v=r[0][0],y=r[0][1],S=r[1][0],C=r[1][1],w=r[2][0],E=r[2][1],A=r[3][0],b=r[3][1],V=r[4][0],I=r[4][1],D=r[5][0],U=r[5][1],F=r[6][0],M=r[6][1],se=r[7][0],ee=r[7][1],ie=0;ie<80;++ie)c=((V>>>14|I<<18)^(V>>>18|I<<14)^(I>>>9|V<<23))>>>0,f=((V<<18|I>>>14)^(V<<14|I>>>18)^(I<<23|V>>>9))>>>0,p=(F^V&(D^F))>>>0,d=(M^I&(U^M))>>>0,o=((v>>>28|y<<4)^(y>>>2|v<<30)^(y>>>7|v<<25))>>>0,l=((v<<4|y>>>28)^(y<<30|v>>>2)^(y<<25|v>>>7))>>>0,g=(v&S|w&(v^S))>>>0,m=(y&C|E&(y^C))>>>0,he=ee+f+d+aC[ie][1]+e[ie][1],n=se+c+p+aC[ie][0]+e[ie][0]+(he/4294967296>>>0)>>>0,s=he>>>0,he=l+m,i=o+g+(he/4294967296>>>0)>>>0,a=he>>>0,se=F,ee=M,F=D,M=U,D=V,U=I,he=b+s,V=A+n+(he/4294967296>>>0)>>>0,I=he>>>0,A=w,b=E,w=S,E=C,S=v,C=y,he=s+a,v=n+i+(he/4294967296>>>0)>>>0,y=he>>>0;he=r[0][1]+y,r[0][0]=r[0][0]+v+(he/4294967296>>>0)>>>0,r[0][1]=he>>>0,he=r[1][1]+C,r[1][0]=r[1][0]+S+(he/4294967296>>>0)>>>0,r[1][1]=he>>>0,he=r[2][1]+E,r[2][0]=r[2][0]+w+(he/4294967296>>>0)>>>0,r[2][1]=he>>>0,he=r[3][1]+b,r[3][0]=r[3][0]+A+(he/4294967296>>>0)>>>0,r[3][1]=he>>>0,he=r[4][1]+I,r[4][0]=r[4][0]+V+(he/4294967296>>>0)>>>0,r[4][1]=he>>>0,he=r[5][1]+U,r[5][0]=r[5][0]+D+(he/4294967296>>>0)>>>0,r[5][1]=he>>>0,he=r[6][1]+M,r[6][0]=r[6][0]+F+(he/4294967296>>>0)>>>0,r[6][1]=he>>>0,he=r[7][1]+ee,r[7][0]=r[7][0]+se+(he/4294967296>>>0)>>>0,r[7][1]=he>>>0,fe-=128}}u(wB,"_update")});var xB=ue(uC=>{"use strict";var PM=bt();Js();var tn=PM.asn1;uC.privateKeyValidator={name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:tn.Class.UNIVERSAL,type:tn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};uC.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:tn.Class.UNIVERSAL,type:tn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var VB=ue((tte,LB)=>{"use strict";var mn=bt();sd();Es();oC();jt();var BB=xB(),kM=BB.publicKeyValidator,LM=BB.privateKeyValidator;typeof bB>"u"&&(bB=mn.jsbn.BigInteger);var bB,cC=mn.util.ByteBuffer,Hn=typeof Buffer>"u"?Uint8Array:Buffer;mn.pki=mn.pki||{};LB.exports=mn.pki.ed25519=mn.ed25519=mn.ed25519||{};var Bt=mn.ed25519;Bt.constants={};Bt.constants.PUBLIC_KEY_BYTE_LENGTH=32;Bt.constants.PRIVATE_KEY_BYTE_LENGTH=64;Bt.constants.SEED_BYTE_LENGTH=32;Bt.constants.SIGN_BYTE_LENGTH=64;Bt.constants.HASH_BYTE_LENGTH=64;Bt.generateKeyPair=function(r){r=r||{};var e=r.seed;if(e===void 0)e=mn.random.getBytesSync(Bt.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Bt.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Bt.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=aa({message:e,encoding:"binary"});for(var t=new Hn(Bt.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Hn(Bt.constants.PRIVATE_KEY_BYTE_LENGTH),s=0;s<32;++s)n[s]=e[s];return MM(t,n),{publicKey:t,privateKey:n}};Bt.privateKeyFromAsn1=function(r){var e={},t=[],n=mn.asn1.validate(r,LM,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=mn.asn1.derToOid(e.privateKeyOid),a=mn.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=e.privateKey,l=aa({message:mn.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:l}};Bt.publicKeyFromAsn1=function(r){var e={},t=[],n=mn.asn1.validate(r,kM,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=mn.asn1.derToOid(e.publicKeyOid),a=mn.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=e.ed25519PublicKey;if(o.length!==Bt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return aa({message:o,encoding:"binary"})};Bt.publicKeyFromPrivateKey=function(r){r=r||{};var e=aa({message:r.privateKey,encoding:"binary"});if(e.length!==Bt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Bt.constants.PRIVATE_KEY_BYTE_LENGTH);for(var t=new Hn(Bt.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<t.length;++n)t[n]=e[32+n];return t};Bt.sign=function(r){r=r||{};var e=aa(r),t=aa({message:r.privateKey,encoding:"binary"});if(t.length===Bt.constants.SEED_BYTE_LENGTH){var n=Bt.generateKeyPair({seed:t});t=n.privateKey}else if(t.length!==Bt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Bt.constants.SEED_BYTE_LENGTH+" or "+Bt.constants.PRIVATE_KEY_BYTE_LENGTH);var s=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length);jM(s,e,e.length,t);for(var i=new Hn(Bt.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=s[a];return i};Bt.verify=function(r){r=r||{};var e=aa(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=aa({message:r.signature,encoding:"binary"});if(t.length!==Bt.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Bt.constants.SIGN_BYTE_LENGTH);var n=aa({message:r.publicKey,encoding:"binary"});if(n.length!==Bt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Bt.constants.PUBLIC_KEY_BYTE_LENGTH);var s=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length),i=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length),a;for(a=0;a<Bt.constants.SIGN_BYTE_LENGTH;++a)s[a]=t[a];for(a=0;a<e.length;++a)s[a+Bt.constants.SIGN_BYTE_LENGTH]=e[a];return qM(i,s,s.length,n)>=0};function aa(r){var e=r.message;if(e instanceof Uint8Array||e instanceof Hn)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 cC(e,t)}else if(!(e instanceof cC))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 Hn(e.length()),s=0;s<n.length;++s)n[s]=e.at(s);return n}u(aa,"messageToNativeBuffer");var fC=ot(),pv=ot([1]),VM=ot([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),FM=ot([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),NB=ot([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),TB=ot([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ld=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]),UM=ot([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function cd(r,e){var t=mn.md.sha512.create(),n=new cC(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 Hn(Bt.constants.HASH_BYTE_LENGTH),a=0;a<64;++a)i[a]=s.charCodeAt(a);return i}u(cd,"sha512");function MM(r,e){var t=[ot(),ot(),ot(),ot()],n,s=cd(e,32);for(s[0]&=248,s[31]&=127,s[31]|=64,mC(t,s),dC(r,t),n=0;n<32;++n)e[n+32]=r[n];return 0}u(MM,"crypto_sign_keypair");function jM(r,e,t,n){var s,i,a=new Float64Array(64),o=[ot(),ot(),ot(),ot()],l=cd(n,32);l[0]&=248,l[31]&=127,l[31]|=64;var c=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 f=cd(r.subarray(32),t+32);for(hC(f),mC(o,f),dC(r,o),s=32;s<64;++s)r[s]=n[s];var p=cd(r,t+64);for(hC(p),s=32;s<64;++s)a[s]=0;for(s=0;s<32;++s)a[s]=f[s];for(s=0;s<32;++s)for(i=0;i<32;i++)a[s+i]+=p[s]*l[i];return RB(r.subarray(32),a),c}u(jM,"crypto_sign");function qM(r,e,t,n){var s,i,a=new Hn(32),o=[ot(),ot(),ot(),ot()],l=[ot(),ot(),ot(),ot()];if(i=-1,t<64||KM(l,n)||!HM(e,32))return-1;for(s=0;s<t;++s)r[s]=e[s];for(s=0;s<32;++s)r[s+32]=n[s];var c=cd(r,t);if(hC(c),PB(o,l,c),mC(l,e.subarray(32)),pC(o,l),dC(a,o),t-=64,OB(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}u(qM,"crypto_sign_open");function HM(r,e){var t;for(t=31;t>=0;--t){if(r[e+t]<ld[t])return!0;if(r[e+t]>ld[t])return!1}return!1}u(HM,"_isCanonicalSignatureScalar");function RB(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]*ld[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)*ld[s],t=e[s]>>8,e[s]&=255;for(s=0;s<32;++s)e[s]-=t*ld[s];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,r[n]=e[n]&255}u(RB,"modL");function hC(r){for(var e=new Float64Array(64),t=0;t<64;++t)e[t]=r[t],r[t]=0;RB(r,e)}u(hC,"reduce");function pC(r,e){var t=ot(),n=ot(),s=ot(),i=ot(),a=ot(),o=ot(),l=ot(),c=ot(),f=ot();Nf(t,r[1],r[0]),Nf(f,e[1],e[0]),ur(t,t,f),bf(n,r[0],r[1]),bf(f,e[0],e[1]),ur(n,n,f),ur(s,r[3],e[3]),ur(s,s,FM),ur(i,r[2],e[2]),bf(i,i,i),Nf(a,n,t),Nf(o,i,s),bf(l,i,s),bf(c,n,t),ur(r[0],a,o),ur(r[1],c,l),ur(r[2],l,o),ur(r[3],a,c)}u(pC,"add");function IB(r,e,t){for(var n=0;n<4;++n)kB(r[n],e[n],t)}u(IB,"cswap");function dC(r,e){var t=ot(),n=ot(),s=ot();WM(s,e[2]),ur(t,e[0],s),ur(n,e[1],s),dv(r,n),r[31]^=_B(t)<<7}u(dC,"pack");function dv(r,e){var t,n,s,i=ot(),a=ot();for(t=0;t<16;++t)a[t]=e[t];for(lC(a),lC(a),lC(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,kB(a,i,1-s)}for(t=0;t<16;t++)r[2*t]=a[t]&255,r[2*t+1]=a[t]>>8}u(dv,"pack25519");function KM(r,e){var t=ot(),n=ot(),s=ot(),i=ot(),a=ot(),o=ot(),l=ot();return go(r[2],pv),XM(r[1],e),rl(s,r[1]),ur(i,s,VM),Nf(s,s,r[2]),bf(i,r[2],i),rl(a,i),rl(o,a),ur(l,o,a),ur(t,l,s),ur(t,t,i),GM(t,t),ur(t,t,s),ur(t,t,i),ur(t,t,i),ur(r[0],t,i),rl(n,r[0]),ur(n,n,i),DB(n,s)&&ur(r[0],r[0],UM),rl(n,r[0]),ur(n,n,i),DB(n,s)?-1:(_B(r[0])===e[31]>>7&&Nf(r[0],fC,r[0]),ur(r[3],r[0],r[1]),0)}u(KM,"unpackneg");function XM(r,e){var t;for(t=0;t<16;++t)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}u(XM,"unpack25519");function GM(r,e){var t=ot(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=250;n>=0;--n)rl(t,t),n!==1&&ur(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}u(GM,"pow2523");function DB(r,e){var t=new Hn(32),n=new Hn(32);return dv(t,r),dv(n,e),OB(t,0,n,0)}u(DB,"neq25519");function OB(r,e,t,n){return $M(r,e,t,n,32)}u(OB,"crypto_verify_32");function $M(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}u($M,"vn");function _B(r){var e=new Hn(32);return dv(e,r),e[0]&1}u(_B,"par25519");function PB(r,e,t){var n,s;for(go(r[0],fC),go(r[1],pv),go(r[2],pv),go(r[3],fC),s=255;s>=0;--s)n=t[s/8|0]>>(s&7)&1,IB(r,e,n),pC(e,r),pC(r,r),IB(r,e,n)}u(PB,"scalarmult");function mC(r,e){var t=[ot(),ot(),ot(),ot()];go(t[0],NB),go(t[1],TB),go(t[2],pv),ur(t[3],NB,TB),PB(r,t,e)}u(mC,"scalarbase");function go(r,e){var t;for(t=0;t<16;t++)r[t]=e[t]|0}u(go,"set25519");function WM(r,e){var t=ot(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=253;n>=0;--n)rl(t,t),n!==2&&n!==4&&ur(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}u(WM,"inv25519");function lC(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)}u(lC,"car25519");function kB(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}u(kB,"sel25519");function ot(r){var e,t=new Float64Array(16);if(r)for(e=0;e<r.length;++e)t[e]=r[e];return t}u(ot,"gf");function bf(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]+t[n]}u(bf,"A");function Nf(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]-t[n]}u(Nf,"Z");function rl(r,e){ur(r,e,e)}u(rl,"S");function ur(r,e,t){var n,s,i=0,a=0,o=0,l=0,c=0,f=0,p=0,d=0,g=0,m=0,v=0,y=0,S=0,C=0,w=0,E=0,A=0,b=0,V=0,I=0,D=0,U=0,F=0,M=0,se=0,ee=0,ie=0,X=0,he=0,Ce=0,xe=0,pe=t[0],W=t[1],fe=t[2],Ie=t[3],Ve=t[4],Le=t[5],O=t[6],B=t[7],Q=t[8],K=t[9],_e=t[10],R=t[11],N=t[12],J=t[13],$=t[14],ge=t[15];n=e[0],i+=n*pe,a+=n*W,o+=n*fe,l+=n*Ie,c+=n*Ve,f+=n*Le,p+=n*O,d+=n*B,g+=n*Q,m+=n*K,v+=n*_e,y+=n*R,S+=n*N,C+=n*J,w+=n*$,E+=n*ge,n=e[1],a+=n*pe,o+=n*W,l+=n*fe,c+=n*Ie,f+=n*Ve,p+=n*Le,d+=n*O,g+=n*B,m+=n*Q,v+=n*K,y+=n*_e,S+=n*R,C+=n*N,w+=n*J,E+=n*$,A+=n*ge,n=e[2],o+=n*pe,l+=n*W,c+=n*fe,f+=n*Ie,p+=n*Ve,d+=n*Le,g+=n*O,m+=n*B,v+=n*Q,y+=n*K,S+=n*_e,C+=n*R,w+=n*N,E+=n*J,A+=n*$,b+=n*ge,n=e[3],l+=n*pe,c+=n*W,f+=n*fe,p+=n*Ie,d+=n*Ve,g+=n*Le,m+=n*O,v+=n*B,y+=n*Q,S+=n*K,C+=n*_e,w+=n*R,E+=n*N,A+=n*J,b+=n*$,V+=n*ge,n=e[4],c+=n*pe,f+=n*W,p+=n*fe,d+=n*Ie,g+=n*Ve,m+=n*Le,v+=n*O,y+=n*B,S+=n*Q,C+=n*K,w+=n*_e,E+=n*R,A+=n*N,b+=n*J,V+=n*$,I+=n*ge,n=e[5],f+=n*pe,p+=n*W,d+=n*fe,g+=n*Ie,m+=n*Ve,v+=n*Le,y+=n*O,S+=n*B,C+=n*Q,w+=n*K,E+=n*_e,A+=n*R,b+=n*N,V+=n*J,I+=n*$,D+=n*ge,n=e[6],p+=n*pe,d+=n*W,g+=n*fe,m+=n*Ie,v+=n*Ve,y+=n*Le,S+=n*O,C+=n*B,w+=n*Q,E+=n*K,A+=n*_e,b+=n*R,V+=n*N,I+=n*J,D+=n*$,U+=n*ge,n=e[7],d+=n*pe,g+=n*W,m+=n*fe,v+=n*Ie,y+=n*Ve,S+=n*Le,C+=n*O,w+=n*B,E+=n*Q,A+=n*K,b+=n*_e,V+=n*R,I+=n*N,D+=n*J,U+=n*$,F+=n*ge,n=e[8],g+=n*pe,m+=n*W,v+=n*fe,y+=n*Ie,S+=n*Ve,C+=n*Le,w+=n*O,E+=n*B,A+=n*Q,b+=n*K,V+=n*_e,I+=n*R,D+=n*N,U+=n*J,F+=n*$,M+=n*ge,n=e[9],m+=n*pe,v+=n*W,y+=n*fe,S+=n*Ie,C+=n*Ve,w+=n*Le,E+=n*O,A+=n*B,b+=n*Q,V+=n*K,I+=n*_e,D+=n*R,U+=n*N,F+=n*J,M+=n*$,se+=n*ge,n=e[10],v+=n*pe,y+=n*W,S+=n*fe,C+=n*Ie,w+=n*Ve,E+=n*Le,A+=n*O,b+=n*B,V+=n*Q,I+=n*K,D+=n*_e,U+=n*R,F+=n*N,M+=n*J,se+=n*$,ee+=n*ge,n=e[11],y+=n*pe,S+=n*W,C+=n*fe,w+=n*Ie,E+=n*Ve,A+=n*Le,b+=n*O,V+=n*B,I+=n*Q,D+=n*K,U+=n*_e,F+=n*R,M+=n*N,se+=n*J,ee+=n*$,ie+=n*ge,n=e[12],S+=n*pe,C+=n*W,w+=n*fe,E+=n*Ie,A+=n*Ve,b+=n*Le,V+=n*O,I+=n*B,D+=n*Q,U+=n*K,F+=n*_e,M+=n*R,se+=n*N,ee+=n*J,ie+=n*$,X+=n*ge,n=e[13],C+=n*pe,w+=n*W,E+=n*fe,A+=n*Ie,b+=n*Ve,V+=n*Le,I+=n*O,D+=n*B,U+=n*Q,F+=n*K,M+=n*_e,se+=n*R,ee+=n*N,ie+=n*J,X+=n*$,he+=n*ge,n=e[14],w+=n*pe,E+=n*W,A+=n*fe,b+=n*Ie,V+=n*Ve,I+=n*Le,D+=n*O,U+=n*B,F+=n*Q,M+=n*K,se+=n*_e,ee+=n*R,ie+=n*N,X+=n*J,he+=n*$,Ce+=n*ge,n=e[15],E+=n*pe,A+=n*W,b+=n*fe,V+=n*Ie,I+=n*Ve,D+=n*Le,U+=n*O,F+=n*B,M+=n*Q,se+=n*K,ee+=n*_e,ie+=n*R,X+=n*N,he+=n*J,Ce+=n*$,xe+=n*ge,i+=38*A,a+=38*b,o+=38*V,l+=38*I,c+=38*D,f+=38*U,p+=38*F,d+=38*M,g+=38*se,m+=38*ee,v+=38*ie,y+=38*X,S+=38*he,C+=38*Ce,w+=38*xe,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=o+s+65535,s=Math.floor(n/65536),o=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=c+s+65535,s=Math.floor(n/65536),c=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=p+s+65535,s=Math.floor(n/65536),p=n-s*65536,n=d+s+65535,s=Math.floor(n/65536),d=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=v+s+65535,s=Math.floor(n/65536),v=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=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=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=o+s+65535,s=Math.floor(n/65536),o=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=c+s+65535,s=Math.floor(n/65536),c=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=p+s+65535,s=Math.floor(n/65536),p=n-s*65536,n=d+s+65535,s=Math.floor(n/65536),d=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=v+s+65535,s=Math.floor(n/65536),v=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=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,i+=s-1+37*(s-1),r[0]=i,r[1]=a,r[2]=o,r[3]=l,r[4]=c,r[5]=f,r[6]=p,r[7]=d,r[8]=g,r[9]=m,r[10]=v,r[11]=y,r[12]=S,r[13]=C,r[14]=w,r[15]=E}u(ur,"M")});var jB=ue((nte,MB)=>{"use strict";var ls=bt();jt();Es();sd();MB.exports=ls.kem=ls.kem||{};var FB=ls.jsbn.BigInteger;ls.kem.rsa={};ls.kem.rsa.create=function(r,e){e=e||{};var t=e.prng||ls.random,n={};return n.encrypt=function(s,i){var a=Math.ceil(s.n.bitLength()/8),o;do o=new FB(ls.util.bytesToHex(t.getBytesSync(a)),16).mod(s.n);while(o.compareTo(FB.ONE)<=0);o=ls.util.hexToBytes(o.toString(16));var l=a-o.length;l>0&&(o=ls.util.fillString("\0",l)+o);var c=s.encrypt(o,"NONE"),f=r.generate(o,i);return{encapsulation:c,key:f}},n.decrypt=function(s,i,a){var o=s.decrypt(i,"NONE");return r.generate(o,a)},n};ls.kem.kdf1=function(r,e){UB(this,r,0,e||r.digestLength)};ls.kem.kdf2=function(r,e){UB(this,r,1,e||r.digestLength)};function UB(r,e,t,n){r.generate=function(s,i){for(var a=new ls.util.ByteBuffer,o=Math.ceil(i/n)+t,l=new ls.util.ByteBuffer,c=t;c<o;++c){l.putInt32(c),e.start(),e.update(s+l.getBytes());var f=e.digest();a.putBytes(f.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}u(UB,"_createKDF")});var XB=ue((ite,KB)=>{"use strict";var Ot=bt();jt();KB.exports=Ot.log=Ot.log||{};Ot.log.levels=["none","error","warning","info","debug","verbose","max"];var mv={},vC=[],hd=null;Ot.log.LEVEL_LOCKED=2;Ot.log.NO_LEVEL_CHECK=4;Ot.log.INTERPOLATE=8;for(bi=0;bi<Ot.log.levels.length;++bi)gC=Ot.log.levels[bi],mv[gC]={index:bi,name:gC.toUpperCase()};var gC,bi;Ot.log.logMessage=function(r){for(var e=mv[r.level].index,t=0;t<vC.length;++t){var n=vC[t];if(n.flags&Ot.log.NO_LEVEL_CHECK)n.f(r);else{var s=mv[n.level].index;e<=s&&n.f(n,r)}}};Ot.log.prepareStandard=function(r){"standard"in r||(r.standard=mv[r.level].name+" ["+r.category+"] "+r.message)};Ot.log.prepareFull=function(r){if(!("full"in r)){var e=[r.message];e=e.concat([]),r.full=Ot.util.format.apply(this,e)}};Ot.log.prepareStandardFull=function(r){"standardFull"in r||(Ot.log.prepareStandard(r),r.standardFull=r.standard)};for(yC=["error","warning","info","debug","verbose"],bi=0;bi<yC.length;++bi)(function(e){Ot.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};Ot.log.logMessage(i)}})(yC[bi]);var yC,bi;Ot.log.makeLogger=function(r){var e={flags:0,f:r};return Ot.log.setLevel(e,"none"),e};Ot.log.setLevel=function(r,e){var t=!1;if(r&&!(r.flags&Ot.log.LEVEL_LOCKED))for(var n=0;n<Ot.log.levels.length;++n){var s=Ot.log.levels[n];if(e==s){r.level=e,t=!0;break}}return t};Ot.log.lock=function(r,e){typeof e>"u"||e?r.flags|=Ot.log.LEVEL_LOCKED:r.flags&=~Ot.log.LEVEL_LOCKED};Ot.log.addLogger=function(r){vC.push(r)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(qB={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},pd=u(function(r,e){Ot.log.prepareStandard(e);var t=qB[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),t.apply(console,n)},"f"),Tf=Ot.log.makeLogger(pd)):(pd=u(function(e,t){Ot.log.prepareStandardFull(t),console.log(t.standardFull)},"f"),Tf=Ot.log.makeLogger(pd)),Ot.log.setLevel(Tf,"debug"),Ot.log.addLogger(Tf),hd=Tf):console={log:u(function(){},"log")};var Tf,qB,pd;hd!==null&&typeof window<"u"&&window.location&&(fd=new URL(window.location.href).searchParams,fd.has("console.level")&&Ot.log.setLevel(hd,fd.get("console.level").slice(-1)[0]),fd.has("console.lock")&&(HB=fd.get("console.lock").slice(-1)[0],HB=="true"&&Ot.log.lock(hd)));var fd,HB;Ot.log.consoleLogger=hd});var $B=ue((ote,GB)=>{"use strict";GB.exports=yi();Wy();wf();OA();oC()});var JB=ue((ute,zB)=>{"use strict";var Fe=bt();oo();Js();rd();uo();zu();GA();Es();jt();uv();var z=Fe.asn1,kn=zB.exports=Fe.pkcs7=Fe.pkcs7||{};kn.messageFromPem=function(r){var e=Fe.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=z.fromDer(e.body);return kn.messageFromAsn1(n)};kn.messageToPem=function(r,e){var t={type:"PKCS7",body:z.toDer(r.toAsn1()).getBytes()};return Fe.pem.encode(t,{maxline:e})};kn.messageFromAsn1=function(r){var e={},t=[];if(!z.validate(r,kn.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=z.derToOid(e.contentType),i;switch(s){case Fe.pki.oids.envelopedData:i=kn.createEnvelopedData();break;case Fe.pki.oids.encryptedData:i=kn.createEncryptedData();break;case Fe.pki.oids.signedData:i=kn.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};kn.createSignedData=function(){var r=null;return r={type:Fe.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:u(function(n){if(wC(r,n,kn.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(Fe.pki.certificateFromAsn1(s[i]))},"fromAsn1"),toAsn1:u(function(){r.contentInfo||r.sign();for(var n=[],s=0;s<r.certificates.length;++s)n.push(Fe.pki.certificateToAsn1(r.certificates[s]));var i=[],a=z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,r.digestAlgorithmIdentifiers),r.contentInfo])]);return n.length>0&&a.value[0].value.push(z.create(z.Class.CONTEXT_SPECIFIC,0,!0,n)),i.length>0&&a.value[0].value.push(z.create(z.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(z.create(z.Class.UNIVERSAL,z.Type.SET,!0,r.signerInfos)),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),a])},"toAsn1"),addSigner:u(function(n){var s=n.issuer,i=n.serialNumber;if(n.certificate){var a=n.certificate;typeof a=="string"&&(a=Fe.pki.certificateFromPem(a)),s=a.issuer.attributes,i=a.serialNumber}var o=n.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=Fe.pki.privateKeyFromPem(o));var l=n.digestAlgorithm||Fe.pki.oids.sha1;switch(l){case Fe.pki.oids.sha1:case Fe.pki.oids.sha256:case Fe.pki.oids.sha384:case Fe.pki.oids.sha512:case Fe.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var c=n.authenticatedAttributes||[];if(c.length>0){for(var f=!1,p=!1,d=0;d<c.length;++d){var g=c[d];if(!f&&g.type===Fe.pki.oids.contentType){if(f=!0,p)break;continue}if(!p&&g.type===Fe.pki.oids.messageDigest){if(p=!0,f)break;continue}}if(!f||!p)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}r.signers.push({key:o,version:1,issuer:s,serialNumber:i,digestAlgorithm:l,signatureAlgorithm:Fe.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},"addSigner"),sign:u(function(n){if(n=n||{},(typeof r.content!="object"||r.contentInfo===null)&&(r.contentInfo=z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(Fe.pki.oids.data).getBytes())]),"content"in r)){var s;r.content instanceof Fe.util.ByteBuffer?s=r.content.bytes():typeof r.content=="string"&&(s=Fe.util.encodeUtf8(r.content)),n.detached?r.detachedContent=z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,s):r.contentInfo.value.push(z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,s)]))}if(r.signers.length!==0){var i=e();t(i)}},"sign"),verify:u(function(){throw new Error("PKCS#7 signature verification not yet implemented.")},"verify"),addCertificate:u(function(n){typeof n=="string"&&(n=Fe.pki.certificateFromPem(n)),r.certificates.push(n)},"addCertificate"),addCertificateRevokationList:u(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]=Fe.md[Fe.pki.oids[a]].create()),i.authenticatedAttributes.length===0?i.md=n[a]:i.md=Fe.md[Fe.pki.oids[a]].create()}r.digestAlgorithmIdentifiers=[];for(var a in n)r.digestAlgorithmIdentifiers.push(z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(a).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")]));return n}u(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=z.derToOid(r.contentInfo.value[0].value),a=z.toDer(s);a.getByte(),z.getBerValueLength(a),a=a.getBytes();for(var o in n)n[o].start().update(a);for(var l=new Date,c=0;c<r.signers.length;++c){var f=r.signers[c];if(f.authenticatedAttributes.length===0){if(i!==Fe.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=z.create(z.Class.UNIVERSAL,z.Type.SET,!0,[]),d=0;d<f.authenticatedAttributes.length;++d){var g=f.authenticatedAttributes[d];g.type===Fe.pki.oids.messageDigest?g.value=n[f.digestAlgorithm].digest():g.type===Fe.pki.oids.signingTime&&(g.value||(g.value=l)),p.value.push(EC(g)),f.authenticatedAttributesAsn1.value.push(EC(g))}a=z.toDer(p).getBytes(),f.md.start().update(a)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}r.signerInfos=e9(r.signers)}u(t,"addSignerInfos")};kn.createEncryptedData=function(){var r=null;return r={type:Fe.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:Fe.pki.oids["aes256-CBC"]},fromAsn1:u(function(e){wC(r,e,kn.asn1.encryptedDataValidator)},"fromAsn1"),decrypt:u(function(e){e!==void 0&&(r.encryptedContent.key=e),WB(r)},"decrypt")},r};kn.createEnvelopedData=function(){var r=null;return r={type:Fe.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:Fe.pki.oids["aes256-CBC"]},fromAsn1:u(function(e){var t=wC(r,e,kn.asn1.envelopedDataValidator);r.recipients=YM(t.recipientInfos.value)},"fromAsn1"),toAsn1:u(function(){return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,QM(r.recipients)),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,t9(r.encryptedContent))])])])},"toAsn1"),findRecipient:u(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,o=0;o<t.length;++o)if(i[o].type!==t[o].type||i[o].value!==t[o].value){a=!1;break}if(a)return s}}return null},"findRecipient"),decrypt:u(function(e,t){if(r.encryptedContent.key===void 0&&e!==void 0&&t!==void 0)switch(e.encryptedContent.algorithm){case Fe.pki.oids.rsaEncryption:case Fe.pki.oids.desCBC:var n=t.decrypt(e.encryptedContent.content);r.encryptedContent.key=Fe.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+e.encryptedContent.algorithm)}WB(r)},"decrypt"),addRecipient:u(function(e){r.recipients.push({version:0,issuer:e.issuer.attributes,serialNumber:e.serialNumber,encryptedContent:{algorithm:Fe.pki.oids.rsaEncryption,key:e.publicKey}})},"addRecipient"),encrypt:u(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 Fe.pki.oids["aes128-CBC"]:n=16,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["aes192-CBC"]:n=24,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["aes256-CBC"]:n=32,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["des-EDE3-CBC"]:n=24,s=8,i=Fe.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+t)}if(e===void 0)e=Fe.util.createBuffer(Fe.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=Fe.util.createBuffer(Fe.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 o=0;o<r.recipients.length;++o){var l=r.recipients[o];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case Fe.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 zM(r){var e={},t=[];if(!z.validate(r,kn.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:Fe.pki.RDNAttributesAsArray(e.issuer),serialNumber:Fe.util.createBuffer(e.serial).toHex(),encryptedContent:{algorithm:z.derToOid(e.encAlgorithm),parameter:e.encParameter?e.encParameter.value:void 0,content:e.encKey}}}u(zM,"_recipientFromAsn1");function JM(r){return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[Fe.pki.distinguishedNameToAsn1({attributes:r.issuer}),z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,Fe.util.hexToBytes(r.serialNumber))]),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.encryptedContent.algorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")]),z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.encryptedContent.content)])}u(JM,"_recipientToAsn1");function YM(r){for(var e=[],t=0;t<r.length;++t)e.push(zM(r[t]));return e}u(YM,"_recipientsFromAsn1");function QM(r){for(var e=[],t=0;t<r.length;++t)e.push(JM(r[t]));return e}u(QM,"_recipientsToAsn1");function ZM(r){var e=z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[Fe.pki.distinguishedNameToAsn1({attributes:r.issuer}),z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,Fe.util.hexToBytes(r.serialNumber))]),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.digestAlgorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")])]);if(r.authenticatedAttributesAsn1&&e.value.push(r.authenticatedAttributesAsn1),e.value.push(z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.signatureAlgorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")])),e.value.push(z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.signature)),r.unauthenticatedAttributes.length>0){for(var t=z.create(z.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<r.unauthenticatedAttributes.length;++n){var s=r.unauthenticatedAttributes[n];t.values.push(EC(s))}e.value.push(t)}return e}u(ZM,"_signerToAsn1");function e9(r){for(var e=[],t=0;t<r.length;++t)e.push(ZM(r[t]));return e}u(e9,"_signersToAsn1");function EC(r){var e;if(r.type===Fe.pki.oids.contentType)e=z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.value).getBytes());else if(r.type===Fe.pki.oids.messageDigest)e=z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.value.bytes());else if(r.type===Fe.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=z.utcTimeToDate(s):s=z.generalizedTimeToDate(s):s=new Date(i)}s>=t&&s<n?e=z.create(z.Class.UNIVERSAL,z.Type.UTCTIME,!1,z.dateToUtcTime(s)):e=z.create(z.Class.UNIVERSAL,z.Type.GENERALIZEDTIME,!1,z.dateToGeneralizedTime(s))}return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,[e])])}u(EC,"_attributeToAsn1");function t9(r){return[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(Fe.pki.oids.data).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.algorithm).getBytes()),r.parameter?z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.parameter.getBytes()):void 0]),z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.content.getBytes())])]}u(t9,"_encryptedContentToAsn1");function wC(r,e,t){var n={},s=[];if(!z.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=z.derToOid(n.contentType);if(a!==Fe.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var o="";if(Fe.util.isArray(n.encryptedContent))for(var l=0;l<n.encryptedContent.length;++l){if(n.encryptedContent[l].type!==z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=n.encryptedContent[l].value}else o=n.encryptedContent;r.encryptedContent={algorithm:z.derToOid(n.encAlgorithm),parameter:Fe.util.createBuffer(n.encParameter.value),content:Fe.util.createBuffer(o)}}if(n.content){var o="";if(Fe.util.isArray(n.content))for(var l=0;l<n.content.length;++l){if(n.content[l].type!==z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=n.content[l].value}else o=n.content;r.content=Fe.util.createBuffer(o)}return r.version=n.version.charCodeAt(0),r.rawCapture=n,n}u(wC,"_fromAsn1");function WB(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 Fe.pki.oids["aes128-CBC"]:case Fe.pki.oids["aes192-CBC"]:case Fe.pki.oids["aes256-CBC"]:e=Fe.aes.createDecryptionCipher(r.encryptedContent.key);break;case Fe.pki.oids.desCBC:case Fe.pki.oids["des-EDE3-CBC"]:e=Fe.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}}u(WB,"_decryptContent")});var QB=ue((cte,YB)=>{"use strict";var Mr=bt();oo();gf();Wy();wf();jt();var yv=YB.exports=Mr.ssh=Mr.ssh||{};yv.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
16
16
  `;i+="Encryption: "+s+`\r
17
17
  `,i+="Comment: "+t+`\r
18
18
  `;var a=Mr.util.createBuffer();If(a,n),Ni(a,r.e),Ni(a,r.n);var o=Mr.util.encode64(a.bytes(),64),l=Math.floor(o.length/66)+1;i+="Public-Lines: "+l+`\r
@@ -45,7 +45,7 @@ ${t.replace(/ /g,"")}
45
45
  `:"",a=n?`
46
46
  `:"",o=Qv.encodeSpecialCharactersInText(e.data);return`${i}<!--${o}-->${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"}};Mf.C14nCanonicalization=T3;var TK=class extends T3{static{u(this,"C14nCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"}};Mf.C14nCanonicalizationWithComments=TK});var dx=ue(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.ExclusiveCanonicalizationWithComments=jf.ExclusiveCanonicalization=void 0;var cl=bd(),hx=Uf();function px(r,e,t){let n=!1;return r.forEach(function(s){s.prefix===e&&s.namespaceURI===t&&(n=!0)}),n}u(px,"isPrefixInScope");var I3=class{static{u(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(hx.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,'="',cl.encodeSpecialCharactersInAttribute(n.value),'"');return s.join("")}renderNs(e,t,n,s,i){let a,o,l=[],c=n,f=[],p=e.namespaceURI||"";if(e.prefix?px(t,e.prefix,e.namespaceURI||s[e.prefix])||(f.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]})):n!==p&&(c=e.namespaceURI,l.push(' xmlns="',c,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)o=e.attributes[a],o.prefix&&!px(t,o.localName,o.value)&&i.indexOf(o.localName)>=0&&(f.push({prefix:o.localName,namespaceURI:o.value}),t.push({prefix:o.localName,namespaceURI:o.value})),o.prefix&&!px(t,o.prefix,o.namespaceURI)&&o.prefix!=="xmlns"&&o.prefix!=="xml"&&(f.push({prefix:o.prefix,namespaceURI:o.namespaceURI}),t.push({prefix:o.prefix,namespaceURI:o.namespaceURI}));f.sort(this.nsCompare);for(let d of f)l.push(" xmlns:",d.prefix,'="',d.namespaceURI,'"');return{rendered:l.join(""),newDefaultNs:c}}processInner(e,t,n,s,i){if(hx.isCommentNode(e))return this.renderComment(e);if(e.data)return cl.encodeSpecialCharactersInText(e.data);if(hx.isElementNode(e)){let a,o,l=this.renderNs(e,t,n,s,i),c=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)o=t.slice(0),c.push(this.processInner(e.childNodes[a],o,l.newDefaultNs,s,i));return c.push("</",e.tagName,">"),c.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,c=e;for(;l!=null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;c!=null;){if(c===e.ownerDocument.documentElement){s=!0;break}c=c.previousSibling}}let i=s?`
47
47
  `:"",a=n?`
48
- `:"",o=cl.encodeSpecialCharactersInText(e.data);return`${i}<!--${o}-->${a}`}process(e,t){t=t||{};let n=t.inclusiveNamespacesPrefixList||[],s=t.defaultNs||"",i=t.defaultNsForPrefix||{},a=t.ancestorNamespaces||[];if(!cl.isArrayHasLength(n)){let l=cl.findChildren(e,"CanonicalizationMethod");if(l.length!==0){let c=cl.findChildren(l[0],"InclusiveNamespaces");c.length!==0&&(n=(c[0].getAttribute("PrefixList")||"").split(" "))}}return cl.isArrayHasLength(n)&&n.forEach(function(l){a&&a.forEach(function(c){l===c.prefix&&e.setAttributeNS("http://www.w3.org/2000/xmlns/",`xmlns:${l}`,c.namespaceURI)})}),this.processInner(e,[],s,i,n)}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#"}};jf.ExclusiveCanonicalization=I3;var IK=class extends I3{static{u(this,"ExclusiveCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#WithComments"}};jf.ExclusiveCanonicalizationWithComments=IK});var Nd=ue(qf=>{"use strict";function DK(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}}u(DK,"find");function mx(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}u(mx,"freeze");function BK(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}u(BK,"assign");var D3=mx({HTML:"text/html",isHTML:u(function(r){return r===D3.HTML},"isHTML"),XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),B3=mx({HTML:"http://www.w3.org/1999/xhtml",isHTML:u(function(r){return r===B3.HTML},"isHTML"),SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});qf.assign=BK;qf.find=DK;qf.freeze=mx;qf.MIME_TYPE=D3;qf.NAMESPACE=B3});var Tx=ue(pa=>{"use strict";var F3=Nd(),Oi=F3.find,Td=F3.NAMESPACE;function RK(r){return r!==""}u(RK,"notEmptyString");function OK(r){return r?r.split(/[\t\n\f\r ]+/).filter(RK):[]}u(OK,"splitOnASCIIWhitespace");function _K(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}u(_K,"orderedSetReducer");function R3(r){if(!r)return[];var e=OK(r);return Object.keys(e.reduce(_K,{}))}u(R3,"toOrderedSet");function PK(r){return function(e){return r&&r.indexOf(e)!==-1}}u(PK,"arrayIncludes");function Dd(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}u(Dd,"copy");function Wn(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};var n=s;u(s,"t"),s.prototype=e.prototype,s=new s,Dd(t,s),r.prototype=t=s}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}u(Wn,"_extends");var zn={},Bs=zn.ELEMENT_NODE=1,Kf=zn.ATTRIBUTE_NODE=2,e2=zn.TEXT_NODE=3,U3=zn.CDATA_SECTION_NODE=4,M3=zn.ENTITY_REFERENCE_NODE=5,kK=zn.ENTITY_NODE=6,gx=zn.PROCESSING_INSTRUCTION_NODE=7,yx=zn.COMMENT_NODE=8,j3=zn.DOCUMENT_NODE=9,q3=zn.DOCUMENT_TYPE_NODE=10,ca=zn.DOCUMENT_FRAGMENT_NODE=11,LK=zn.NOTATION_NODE=12,bn={},sn={},Xne=bn.INDEX_SIZE_ERR=(sn[1]="Index size error",1),Gne=bn.DOMSTRING_SIZE_ERR=(sn[2]="DOMString size error",2),$n=bn.HIERARCHY_REQUEST_ERR=(sn[3]="Hierarchy request error",3),$ne=bn.WRONG_DOCUMENT_ERR=(sn[4]="Wrong document",4),VK=bn.INVALID_CHARACTER_ERR=(sn[5]="Invalid character",5),Wne=bn.NO_DATA_ALLOWED_ERR=(sn[6]="No data allowed",6),zne=bn.NO_MODIFICATION_ALLOWED_ERR=(sn[7]="No modification allowed",7),H3=bn.NOT_FOUND_ERR=(sn[8]="Not found",8),Jne=bn.NOT_SUPPORTED_ERR=(sn[9]="Not supported",9),O3=bn.INUSE_ATTRIBUTE_ERR=(sn[10]="Attribute in use",10),Hf=bn.INVALID_STATE_ERR=(sn[11]="Invalid state",11),Yne=bn.SYNTAX_ERR=(sn[12]="Syntax error",12),Qne=bn.INVALID_MODIFICATION_ERR=(sn[13]="Invalid modification",13),Zne=bn.NAMESPACE_ERR=(sn[14]="Invalid namespace",14),ese=bn.INVALID_ACCESS_ERR=(sn[15]="Invalid access",15);function nr(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,sn[r]),this.message=sn[r],Error.captureStackTrace&&Error.captureStackTrace(this,nr);return t.code=r,e&&(this.message=this.message+": "+e),t}u(nr,"DOMException");nr.prototype=Error.prototype;Dd(bn,nr);function fa(){}u(fa,"NodeList");fa.prototype={length:0,item:u(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:u(function(r,e,t){for(var n=!!t&&!!t.requireWellFormed,s=[],i=0;i<this.length;i++)Nx(this[i],s,r,e,null,n);return s.join("")},"toString"),filter:u(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:u(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};function Xf(r,e){this._node=r,this._refresh=e,vx(this)}u(Xf,"LiveNodeList");function vx(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(t_(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];Dd(t,r),r._inc=e}}u(vx,"_updateLiveList");Xf.prototype.item=function(r){return vx(this),this[r]||null};Wn(Xf,fa);function t2(){}u(t2,"NamedNodeMap");function K3(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}u(K3,"_findNodeIndex");function _3(r,e,t,n){if(n?e[K3(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&$3(s,r,n),FK(s,r,t))}}u(_3,"_addNamedNode");function P3(r,e,t){var n=K3(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&&($3(i,r,t),t.ownerElement=null)}}else throw new nr(H3,new Error(r.tagName+"@"+t))}u(P3,"_removeNamedNode");t2.prototype={length:0,item:fa.prototype.item,getNamedItem:u(function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},"getNamedItem"),setNamedItem:u(function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new nr(O3);var t=this.getNamedItem(r.nodeName);return _3(this._ownerElement,this,r,t),t},"setNamedItem"),setNamedItemNS:u(function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new nr(O3);return t=this.getNamedItemNS(r.namespaceURI,r.localName),_3(this._ownerElement,this,r,t),t},"setNamedItemNS"),removeNamedItem:u(function(r){var e=this.getNamedItem(r);return P3(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:u(function(r,e){var t=this.getNamedItemNS(r,e);return P3(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:u(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 X3(){}u(X3,"DOMImplementation");X3.prototype={hasFeature:u(function(r,e){return!0},"hasFeature"),createDocument:u(function(r,e,t){var n=new Bd;if(n.implementation=this,n.childNodes=new fa,n.doctype=t||null,t&&n.appendChild(t),e){var s=n.createElementNS(r,e);n.appendChild(s)}return n},"createDocument"),createDocumentType:u(function(r,e,t){var n=new i2;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n},"createDocumentType")};function Zt(){}u(Zt,"Node");Zt.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:u(function(r,e){return n2(this,r,e)},"insertBefore"),replaceChild:u(function(r,e){n2(this,r,e,z3),e&&this.removeChild(e)},"replaceChild"),removeChild:u(function(r){return W3(this,r)},"removeChild"),appendChild:u(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:u(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:u(function(r){return e_(this.ownerDocument||this,this,r)},"cloneNode"),normalize:u(function(){nn(this,null,{enter:u(function(r){for(var e=r.firstChild;e;){var t=e.nextSibling;t!==null&&t.nodeType===e2&&e.nodeType===e2?(r.removeChild(t),e.appendData(t.data)):e=t}return!0},"enter")})},"normalize"),isSupported:u(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),hasAttributes:u(function(){return this.attributes.length>0},"hasAttributes"),lookupPrefix:u(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==Kf?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:u(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==Kf?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:u(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace")};function G3(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}u(G3,"_xmlEncoder");Dd(zn,Zt);Dd(zn,Zt.prototype);function r2(r,e){return nn(r,null,{enter:u(function(t){return e(t)?nn.STOP:!0},"enter")})===nn.STOP}u(r2,"_visitNode");function nn(r,e,t){for(var n=[{node:r,context:e,phase:nn.ENTER}];n.length>0;){var s=n.pop();if(s.phase===nn.ENTER){var i=t.enter(s.node,s.context);if(i===nn.STOP)return nn.STOP;if(n.push({node:s.node,context:i,phase:nn.EXIT}),i==null)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:i,phase:nn.ENTER}),a=a.previousSibling}else t.exit&&t.exit(s.node,s.context)}}u(nn,"walkDOM");nn.STOP=Symbol("walkDOM.STOP");nn.ENTER=0;nn.EXIT=1;function Bd(){this.ownerDocument=this}u(Bd,"Document");function FK(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===Td.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}u(FK,"_onAddAttribute");function $3(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===Td.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}u($3,"_onRemoveAttribute");function Ex(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]}}}u(Ex,"_onUpdateChild");function W3(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,Ex(r.ownerDocument,r),e}u(W3,"_removeChild");function UK(r){return r&&(r.nodeType===Zt.DOCUMENT_NODE||r.nodeType===Zt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Zt.ELEMENT_NODE)}u(UK,"hasValidParentNodeType");function MK(r){return r&&(_i(r)||wx(r)||ha(r)||r.nodeType===Zt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Zt.COMMENT_NODE||r.nodeType===Zt.PROCESSING_INSTRUCTION_NODE)}u(MK,"hasInsertableNodeType");function ha(r){return r&&r.nodeType===Zt.DOCUMENT_TYPE_NODE}u(ha,"isDocTypeNode");function _i(r){return r&&r.nodeType===Zt.ELEMENT_NODE}u(_i,"isElementNode");function wx(r){return r&&r.nodeType===Zt.TEXT_NODE}u(wx,"isTextNode");function k3(r,e){var t=r.childNodes||[];if(Oi(t,_i)||ha(e))return!1;var n=Oi(t,ha);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}u(k3,"isElementInsertionPossible");function L3(r,e){var t=r.childNodes||[];function n(i){return _i(i)&&i!==e}if(u(n,"hasElementChildThatIsNotChild"),Oi(t,n))return!1;var s=Oi(t,ha);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}u(L3,"isElementReplacementPossible");function jK(r,e,t){if(!UK(r))throw new nr($n,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new nr(H3,"child not in parent");if(!MK(e)||ha(e)&&r.nodeType!==Zt.DOCUMENT_NODE)throw new nr($n,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}u(jK,"assertPreInsertionValidity1to5");function qK(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Zt.DOCUMENT_FRAGMENT_NODE){var i=s.filter(_i);if(i.length>1||Oi(s,wx))throw new nr($n,"More than one element or text in fragment");if(i.length===1&&!k3(r,t))throw new nr($n,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!k3(r,t))throw new nr($n,"Only one element can be added and only after doctype");if(ha(e)){if(Oi(n,ha))throw new nr($n,"Only one doctype is allowed");var a=Oi(n,_i);if(t&&n.indexOf(a)<n.indexOf(t))throw new nr($n,"Doctype can only be inserted before an element");if(!t&&a)throw new nr($n,"Doctype can not be appended since element is present")}}u(qK,"assertPreInsertionValidityInDocument");function z3(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Zt.DOCUMENT_FRAGMENT_NODE){var i=s.filter(_i);if(i.length>1||Oi(s,wx))throw new nr($n,"More than one element or text in fragment");if(i.length===1&&!L3(r,t))throw new nr($n,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!L3(r,t))throw new nr($n,"Only one element can be added and only after doctype");if(ha(e)){let l=function(c){return ha(c)&&c!==t};var o=l;if(u(l,"hasDoctypeChildThatIsNotChild"),Oi(n,l))throw new nr($n,"Only one doctype is allowed");var a=Oi(n,_i);if(t&&n.indexOf(a)<n.indexOf(t))throw new nr($n,"Doctype can only be inserted before an element")}}u(z3,"assertPreReplacementValidityInDocument");function n2(r,e,t,n){jK(r,e,t),r.nodeType===Zt.DOCUMENT_NODE&&(n||qK)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===ca){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var o=t?t.previousSibling:r.lastChild;i.previousSibling=o,a.nextSibling=t,o?o.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do{i.parentNode=r;var l=r.ownerDocument||r;Id(i,l)}while(i!==a&&(i=i.nextSibling));return Ex(r.ownerDocument||r,r),e.nodeType==ca&&(e.firstChild=e.lastChild=null),e}u(n2,"_insertBefore");function Id(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===Bs&&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;)Id(s,e),s=s.nextSibling}}u(Id,"_updateOwnerDocument");function HK(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,Ex(r.ownerDocument,r,e);var t=r.ownerDocument||r;return Id(e,t),e}u(HK,"_appendSingleChild");Bd.prototype={nodeName:"#document",nodeType:j3,doctype:null,documentElement:null,_inc:1,insertBefore:u(function(r,e){if(r.nodeType==ca){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return n2(this,r,e),Id(r,this),this.documentElement===null&&r.nodeType===Bs&&(this.documentElement=r),r},"insertBefore"),removeChild:u(function(r){return this.documentElement==r&&(this.documentElement=null),W3(this,r)},"removeChild"),replaceChild:u(function(r,e){n2(this,r,e,z3),Id(r,this),e&&this.removeChild(e),_i(r)&&(this.documentElement=r)},"replaceChild"),importNode:u(function(r,e){return KK(this,r,e)},"importNode"),getElementById:u(function(r){var e=null;return r2(this.documentElement,function(t){if(t.nodeType==Bs&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),getElementsByClassName:u(function(r){var e=R3(r);return new Xf(this,function(t){var n=[];return e.length>0&&r2(t.documentElement,function(s){if(s!==t&&s.nodeType===Bs){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var o=R3(i);a=e.every(PK(o))}a&&n.push(s)}}}),n})},"getElementsByClassName"),createElement:u(function(r){var e=new fl;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new fa;var t=e.attributes=new t2;return t._ownerElement=e,e},"createElement"),createDocumentFragment:u(function(){var r=new a2;return r.ownerDocument=this,r.childNodes=new fa,r},"createDocumentFragment"),createTextNode:u(function(r){var e=new Sx;return e.ownerDocument=this,e.appendData(r),e},"createTextNode"),createComment:u(function(r){var e=new Ax;return e.ownerDocument=this,e.appendData(r),e},"createComment"),createCDATASection:u(function(r){if(r.indexOf("]]>")!==-1)throw new nr(VK,'data contains "]]>"');var e=new Cx;return e.ownerDocument=this,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:u(function(r,e){var t=new bx;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:u(function(r){var e=new s2;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"createAttribute"),createEntityReference:u(function(r){var e=new xx;return e.ownerDocument=this,e.nodeName=r,e},"createEntityReference"),createElementNS:u(function(r,e){var t=new fl,n=e.split(":"),s=t.attributes=new t2;return t.childNodes=new fa,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:u(function(r,e){var t=new s2,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")};Wn(Bd,Zt);function fl(){this._nsMap={}}u(fl,"Element");fl.prototype={nodeType:Bs,hasAttribute:u(function(r){return this.getAttributeNode(r)!=null},"hasAttribute"),getAttribute:u(function(r){var e=this.getAttributeNode(r);return e&&e.value||""},"getAttribute"),getAttributeNode:u(function(r){return this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:u(function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},"setAttribute"),removeAttribute:u(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),appendChild:u(function(r){return r.nodeType===ca?this.insertBefore(r,null):HK(this,r)},"appendChild"),setAttributeNode:u(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:u(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:u(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:u(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},"getAttributeNS"),setAttributeNS:u(function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},"setAttributeNS"),getAttributeNodeNS:u(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByTagName:u(function(r){return new Xf(this,function(e){var t=[];return r2(e,function(n){n!==e&&n.nodeType==Bs&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},"getElementsByTagName"),getElementsByTagNameNS:u(function(r,e){return new Xf(this,function(t){var n=[];return r2(t,function(s){s!==t&&s.nodeType===Bs&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Bd.prototype.getElementsByTagName=fl.prototype.getElementsByTagName;Bd.prototype.getElementsByTagNameNS=fl.prototype.getElementsByTagNameNS;Wn(fl,Zt);function s2(){}u(s2,"Attr");s2.prototype.nodeType=Kf;Wn(s2,Zt);function Rd(){}u(Rd,"CharacterData");Rd.prototype={data:"",substringData:u(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:u(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:u(function(r,e){this.replaceData(r,0,e)},"insertData"),appendChild:u(function(r){throw new Error(sn[$n])},"appendChild"),deleteData:u(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:u(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")};Wn(Rd,Zt);function Sx(){}u(Sx,"Text");Sx.prototype={nodeName:"#text",nodeType:e2,splitText:u(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")};Wn(Sx,Rd);function Ax(){}u(Ax,"Comment");Ax.prototype={nodeName:"#comment",nodeType:yx};Wn(Ax,Rd);function Cx(){}u(Cx,"CDATASection");Cx.prototype={nodeName:"#cdata-section",nodeType:U3};Wn(Cx,Rd);function i2(){}u(i2,"DocumentType");i2.prototype.nodeType=q3;Wn(i2,Zt);function J3(){}u(J3,"Notation");J3.prototype.nodeType=LK;Wn(J3,Zt);function Y3(){}u(Y3,"Entity");Y3.prototype.nodeType=kK;Wn(Y3,Zt);function xx(){}u(xx,"EntityReference");xx.prototype.nodeType=M3;Wn(xx,Zt);function a2(){}u(a2,"DocumentFragment");a2.prototype.nodeName="#document-fragment";a2.prototype.nodeType=ca;Wn(a2,Zt);function bx(){}u(bx,"ProcessingInstruction");bx.prototype.nodeType=gx;Wn(bx,Zt);function Q3(){}u(Q3,"XMLSerializer");Q3.prototype.serializeToString=function(r,e,t,n){return Z3.call(r,e,t,n)};Zt.prototype.toString=Z3;function Z3(r,e,t){var n=!!t&&!!t.requireWellFormed,s=[],i=this.nodeType==9&&this.documentElement||this,a=i.prefix,o=i.namespaceURI;if(o&&a==null){var a=i.lookupPrefix(o);if(a==null)var l=[{namespace:o,prefix:null}]}return Nx(this,s,r,e,l,n),s.join("")}u(Z3,"nodeSerializeToString");function V3(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===Td.XML||s===Td.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}u(V3,"needNamespaceDefine");function Zv(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,G3),'"')}u(Zv,"addSerializedAttribute");function Nx(r,e,t,n,s,i){s||(s=[]),nn(r,{ns:s,isHTML:t},{enter:u(function(a,o){var l=o.ns,c=o.isHTML;if(n)if(a=n(a),a){if(typeof a=="string")return e.push(a),null}else return null;switch(a.nodeType){case Bs:var f=a.attributes,p=f.length,d=a.tagName;c=Td.isHTML(a.namespaceURI)||c;var g=d;if(!c&&!a.prefix&&a.namespaceURI){for(var m,v=0;v<f.length;v++)if(f.item(v).name==="xmlns"){m=f.item(v).value;break}if(!m)for(var y=l.length-1;y>=0;y--){var S=l[y];if(S.prefix===""&&S.namespace===a.namespaceURI){m=S.namespace;break}}if(m!==a.namespaceURI)for(var y=l.length-1;y>=0;y--){var S=l[y];if(S.namespace===a.namespaceURI){S.prefix&&(g=S.prefix+":"+d);break}}}e.push("<",g);for(var C=l.slice(),w=0;w<p;w++){var E=f.item(w);E.prefix=="xmlns"?C.push({prefix:E.localName,namespace:E.value}):E.nodeName=="xmlns"&&C.push({prefix:"",namespace:E.value})}for(var w=0;w<p;w++){var E=f.item(w);if(V3(E,c,C)){var A=E.prefix||"",b=E.namespaceURI;Zv(e,A?"xmlns:"+A:"xmlns",b),C.push({prefix:A,namespace:b})}var V=n?n(E):E;V&&(typeof V=="string"?e.push(V):Zv(e,V.name,V.value))}if(d===g&&V3(a,c,C)){var I=a.prefix||"",b=a.namespaceURI;Zv(e,I?"xmlns:"+I:"xmlns",b),C.push({prefix:I,namespace:b})}var D=a.firstChild;if(D||c&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(e.push(">"),c&&/^script$/i.test(d)){for(;D;)D.data?e.push(D.data):Nx(D,e,c,n,C.slice(),i),D=D.nextSibling;return e.push("</",d,">"),null}return{ns:C,isHTML:c,tag:g}}else return e.push("/>"),null;case j3:case ca:return{ns:l.slice(),isHTML:c,tag:null};case Kf:return Zv(e,a.name,a.value),null;case e2:return e.push(a.data.replace(/[<&>]/g,G3)),null;case U3:if(i&&a.data.indexOf("]]>")!==-1)throw new nr(Hf,'The CDATASection data contains "]]>"');return e.push("<![CDATA[",a.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case yx:if(i&&a.data.indexOf("-->")!==-1)throw new nr(Hf,'The comment node data contains "-->"');return e.push("<!--",a.data,"-->"),null;case q3:if(i){if(a.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(a.publicId))throw new nr(Hf,"DocumentType publicId is not a valid PubidLiteral");if(a.systemId&&!/^("[^"]*"|'[^']*')$/.test(a.systemId))throw new nr(Hf,"DocumentType systemId is not a valid SystemLiteral");if(a.internalSubset&&a.internalSubset.indexOf("]>")!==-1)throw new nr(Hf,'DocumentType internalSubset contains "]>"')}var U=a.publicId,F=a.systemId;if(e.push("<!DOCTYPE ",a.name),U)e.push(" PUBLIC ",U),F&&F!="."&&e.push(" ",F),e.push(">");else if(F&&F!=".")e.push(" SYSTEM ",F,">");else{var M=a.internalSubset;M&&e.push(" [",M,"]"),e.push(">")}return null;case gx:if(i&&a.data.indexOf("?>")!==-1)throw new nr(Hf,'The ProcessingInstruction data contains "?>"');return e.push("<?",a.target," ",a.data,"?>"),null;case M3:return e.push("&",a.nodeName,";"),null;default:return e.push("??",a.nodeName),null}},"enter"),exit:u(function(a,o){o&&o.tag&&e.push("</",o.tag,">")},"exit")})}u(Nx,"serializeToString");function KK(r,e,t){var n;return nn(e,null,{enter:u(function(s,i){var a=s.cloneNode(!1);a.ownerDocument=r,a.parentNode=null,i===null?n=a:i.appendChild(a);var o=s.nodeType===Kf||t;return o?a:null},"enter")}),n}u(KK,"importNode");function e_(r,e,t){var n;return nn(e,null,{enter:u(function(s,i){var a=new s.constructor;for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o)){var l=s[o];typeof l!="object"&&l!=a[o]&&(a[o]=l)}s.childNodes&&(a.childNodes=new fa),a.ownerDocument=r;var c=t;switch(a.nodeType){case Bs:var f=s.attributes,p=a.attributes=new t2,d=f.length;p._ownerElement=a;for(var g=0;g<d;g++)a.setAttributeNode(e_(r,f.item(g),!0));break;case Kf:c=!0}return i!==null?i.appendChild(a):n=a,c?a:null},"enter")}),n}u(e_,"cloneNode");function t_(r,e,t){r[e]=t}u(t_,"__set__");try{Object.defineProperty&&(Object.defineProperty(Xf.prototype,"length",{get:u(function(){return vx(this),this.$$length},"get")}),Object.defineProperty(Zt.prototype,"textContent",{get:u(function(){if(this.nodeType===Bs||this.nodeType===ca){var r=[];return nn(this,null,{enter:u(function(e){if(e.nodeType===Bs||e.nodeType===ca)return!0;if(e.nodeType===gx||e.nodeType===yx)return null;r.push(e.nodeValue)},"enter")}),r.join("")}return this.nodeValue},"get"),set:u(function(r){switch(this.nodeType){case Bs:case ca:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}},"set")}),t_=u(function(r,e,t){r["$$"+e]=t},"__set__"))}catch{}pa.DocumentType=i2;pa.DOMException=nr;pa.DOMImplementation=X3;pa.Element=fl;pa.Node=Zt;pa.NodeList=fa;pa.walkDOM=nn;pa.XMLSerializer=Q3});var n_=ue(Od=>{"use strict";var r_=Nd().freeze;Od.XML_ENTITIES=r_({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Od.HTML_ENTITIES=r_({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:`
48
+ `:"",o=cl.encodeSpecialCharactersInText(e.data);return`${i}<!--${o}-->${a}`}process(e,t){t=t||{};let n=t.inclusiveNamespacesPrefixList||[],s=t.defaultNs||"",i=t.defaultNsForPrefix||{},a=t.ancestorNamespaces||[];if(!cl.isArrayHasLength(n)){let l=cl.findChildren(e,"CanonicalizationMethod");if(l.length!==0){let c=cl.findChildren(l[0],"InclusiveNamespaces");c.length!==0&&(n=(c[0].getAttribute("PrefixList")||"").split(" "))}}return cl.isArrayHasLength(n)&&n.forEach(function(l){a&&a.forEach(function(c){l===c.prefix&&e.setAttributeNS("http://www.w3.org/2000/xmlns/",`xmlns:${l}`,c.namespaceURI)})}),this.processInner(e,[],s,i,n)}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#"}};jf.ExclusiveCanonicalization=I3;var IK=class extends I3{static{u(this,"ExclusiveCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#WithComments"}};jf.ExclusiveCanonicalizationWithComments=IK});var Nd=ue(qf=>{"use strict";function DK(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}}u(DK,"find");function mx(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}u(mx,"freeze");function BK(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}u(BK,"assign");var D3=mx({HTML:"text/html",isHTML:u(function(r){return r===D3.HTML},"isHTML"),XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),B3=mx({HTML:"http://www.w3.org/1999/xhtml",isHTML:u(function(r){return r===B3.HTML},"isHTML"),SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});qf.assign=BK;qf.find=DK;qf.freeze=mx;qf.MIME_TYPE=D3;qf.NAMESPACE=B3});var Tx=ue(pa=>{"use strict";var F3=Nd(),Oi=F3.find,Td=F3.NAMESPACE;function RK(r){return r!==""}u(RK,"notEmptyString");function OK(r){return r?r.split(/[\t\n\f\r ]+/).filter(RK):[]}u(OK,"splitOnASCIIWhitespace");function _K(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}u(_K,"orderedSetReducer");function R3(r){if(!r)return[];var e=OK(r);return Object.keys(e.reduce(_K,{}))}u(R3,"toOrderedSet");function PK(r){return function(e){return r&&r.indexOf(e)!==-1}}u(PK,"arrayIncludes");function Dd(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}u(Dd,"copy");function Wn(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};var n=s;u(s,"t"),s.prototype=e.prototype,s=new s,Dd(t,s),r.prototype=t=s}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}u(Wn,"_extends");var zn={},Bs=zn.ELEMENT_NODE=1,Kf=zn.ATTRIBUTE_NODE=2,e2=zn.TEXT_NODE=3,U3=zn.CDATA_SECTION_NODE=4,M3=zn.ENTITY_REFERENCE_NODE=5,kK=zn.ENTITY_NODE=6,gx=zn.PROCESSING_INSTRUCTION_NODE=7,yx=zn.COMMENT_NODE=8,j3=zn.DOCUMENT_NODE=9,q3=zn.DOCUMENT_TYPE_NODE=10,ca=zn.DOCUMENT_FRAGMENT_NODE=11,LK=zn.NOTATION_NODE=12,bn={},sn={},Xne=bn.INDEX_SIZE_ERR=(sn[1]="Index size error",1),Gne=bn.DOMSTRING_SIZE_ERR=(sn[2]="DOMString size error",2),$n=bn.HIERARCHY_REQUEST_ERR=(sn[3]="Hierarchy request error",3),$ne=bn.WRONG_DOCUMENT_ERR=(sn[4]="Wrong document",4),VK=bn.INVALID_CHARACTER_ERR=(sn[5]="Invalid character",5),Wne=bn.NO_DATA_ALLOWED_ERR=(sn[6]="No data allowed",6),zne=bn.NO_MODIFICATION_ALLOWED_ERR=(sn[7]="No modification allowed",7),H3=bn.NOT_FOUND_ERR=(sn[8]="Not found",8),Jne=bn.NOT_SUPPORTED_ERR=(sn[9]="Not supported",9),O3=bn.INUSE_ATTRIBUTE_ERR=(sn[10]="Attribute in use",10),Hf=bn.INVALID_STATE_ERR=(sn[11]="Invalid state",11),Yne=bn.SYNTAX_ERR=(sn[12]="Syntax error",12),Qne=bn.INVALID_MODIFICATION_ERR=(sn[13]="Invalid modification",13),Zne=bn.NAMESPACE_ERR=(sn[14]="Invalid namespace",14),ese=bn.INVALID_ACCESS_ERR=(sn[15]="Invalid access",15);function nr(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,sn[r]),this.message=sn[r],Error.captureStackTrace&&Error.captureStackTrace(this,nr);return t.code=r,e&&(this.message=this.message+": "+e),t}u(nr,"DOMException");nr.prototype=Error.prototype;Dd(bn,nr);function fa(){}u(fa,"NodeList");fa.prototype={length:0,item:u(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:u(function(r,e,t){for(var n=!!t&&!!t.requireWellFormed,s=[],i=0;i<this.length;i++)Nx(this[i],s,r,e,null,n);return s.join("")},"toString"),filter:u(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:u(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};function Xf(r,e){this._node=r,this._refresh=e,vx(this)}u(Xf,"LiveNodeList");function vx(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(t_(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];Dd(t,r),r._inc=e}}u(vx,"_updateLiveList");Xf.prototype.item=function(r){return vx(this),this[r]||null};Wn(Xf,fa);function t2(){}u(t2,"NamedNodeMap");function K3(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}u(K3,"_findNodeIndex");function _3(r,e,t,n){if(n?e[K3(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&$3(s,r,n),FK(s,r,t))}}u(_3,"_addNamedNode");function P3(r,e,t){var n=K3(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&&($3(i,r,t),t.ownerElement=null)}}else throw new nr(H3,new Error(r.tagName+"@"+t))}u(P3,"_removeNamedNode");t2.prototype={length:0,item:fa.prototype.item,getNamedItem:u(function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},"getNamedItem"),setNamedItem:u(function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new nr(O3);var t=this.getNamedItem(r.nodeName);return _3(this._ownerElement,this,r,t),t},"setNamedItem"),setNamedItemNS:u(function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new nr(O3);return t=this.getNamedItemNS(r.namespaceURI,r.localName),_3(this._ownerElement,this,r,t),t},"setNamedItemNS"),removeNamedItem:u(function(r){var e=this.getNamedItem(r);return P3(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:u(function(r,e){var t=this.getNamedItemNS(r,e);return P3(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:u(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 X3(){}u(X3,"DOMImplementation");X3.prototype={hasFeature:u(function(r,e){return!0},"hasFeature"),createDocument:u(function(r,e,t){var n=new Bd;if(n.implementation=this,n.childNodes=new fa,n.doctype=t||null,t&&n.appendChild(t),e){var s=n.createElementNS(r,e);n.appendChild(s)}return n},"createDocument"),createDocumentType:u(function(r,e,t){var n=new i2;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n},"createDocumentType")};function er(){}u(er,"Node");er.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:u(function(r,e){return n2(this,r,e)},"insertBefore"),replaceChild:u(function(r,e){n2(this,r,e,z3),e&&this.removeChild(e)},"replaceChild"),removeChild:u(function(r){return W3(this,r)},"removeChild"),appendChild:u(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:u(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:u(function(r){return e_(this.ownerDocument||this,this,r)},"cloneNode"),normalize:u(function(){nn(this,null,{enter:u(function(r){for(var e=r.firstChild;e;){var t=e.nextSibling;t!==null&&t.nodeType===e2&&e.nodeType===e2?(r.removeChild(t),e.appendData(t.data)):e=t}return!0},"enter")})},"normalize"),isSupported:u(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),hasAttributes:u(function(){return this.attributes.length>0},"hasAttributes"),lookupPrefix:u(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==Kf?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:u(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==Kf?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:u(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace")};function G3(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}u(G3,"_xmlEncoder");Dd(zn,er);Dd(zn,er.prototype);function r2(r,e){return nn(r,null,{enter:u(function(t){return e(t)?nn.STOP:!0},"enter")})===nn.STOP}u(r2,"_visitNode");function nn(r,e,t){for(var n=[{node:r,context:e,phase:nn.ENTER}];n.length>0;){var s=n.pop();if(s.phase===nn.ENTER){var i=t.enter(s.node,s.context);if(i===nn.STOP)return nn.STOP;if(n.push({node:s.node,context:i,phase:nn.EXIT}),i==null)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:i,phase:nn.ENTER}),a=a.previousSibling}else t.exit&&t.exit(s.node,s.context)}}u(nn,"walkDOM");nn.STOP=Symbol("walkDOM.STOP");nn.ENTER=0;nn.EXIT=1;function Bd(){this.ownerDocument=this}u(Bd,"Document");function FK(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===Td.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}u(FK,"_onAddAttribute");function $3(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===Td.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}u($3,"_onRemoveAttribute");function Ex(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]}}}u(Ex,"_onUpdateChild");function W3(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,Ex(r.ownerDocument,r),e}u(W3,"_removeChild");function UK(r){return r&&(r.nodeType===er.DOCUMENT_NODE||r.nodeType===er.DOCUMENT_FRAGMENT_NODE||r.nodeType===er.ELEMENT_NODE)}u(UK,"hasValidParentNodeType");function MK(r){return r&&(_i(r)||wx(r)||ha(r)||r.nodeType===er.DOCUMENT_FRAGMENT_NODE||r.nodeType===er.COMMENT_NODE||r.nodeType===er.PROCESSING_INSTRUCTION_NODE)}u(MK,"hasInsertableNodeType");function ha(r){return r&&r.nodeType===er.DOCUMENT_TYPE_NODE}u(ha,"isDocTypeNode");function _i(r){return r&&r.nodeType===er.ELEMENT_NODE}u(_i,"isElementNode");function wx(r){return r&&r.nodeType===er.TEXT_NODE}u(wx,"isTextNode");function k3(r,e){var t=r.childNodes||[];if(Oi(t,_i)||ha(e))return!1;var n=Oi(t,ha);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}u(k3,"isElementInsertionPossible");function L3(r,e){var t=r.childNodes||[];function n(i){return _i(i)&&i!==e}if(u(n,"hasElementChildThatIsNotChild"),Oi(t,n))return!1;var s=Oi(t,ha);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}u(L3,"isElementReplacementPossible");function jK(r,e,t){if(!UK(r))throw new nr($n,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new nr(H3,"child not in parent");if(!MK(e)||ha(e)&&r.nodeType!==er.DOCUMENT_NODE)throw new nr($n,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}u(jK,"assertPreInsertionValidity1to5");function qK(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===er.DOCUMENT_FRAGMENT_NODE){var i=s.filter(_i);if(i.length>1||Oi(s,wx))throw new nr($n,"More than one element or text in fragment");if(i.length===1&&!k3(r,t))throw new nr($n,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!k3(r,t))throw new nr($n,"Only one element can be added and only after doctype");if(ha(e)){if(Oi(n,ha))throw new nr($n,"Only one doctype is allowed");var a=Oi(n,_i);if(t&&n.indexOf(a)<n.indexOf(t))throw new nr($n,"Doctype can only be inserted before an element");if(!t&&a)throw new nr($n,"Doctype can not be appended since element is present")}}u(qK,"assertPreInsertionValidityInDocument");function z3(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===er.DOCUMENT_FRAGMENT_NODE){var i=s.filter(_i);if(i.length>1||Oi(s,wx))throw new nr($n,"More than one element or text in fragment");if(i.length===1&&!L3(r,t))throw new nr($n,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!L3(r,t))throw new nr($n,"Only one element can be added and only after doctype");if(ha(e)){let l=function(c){return ha(c)&&c!==t};var o=l;if(u(l,"hasDoctypeChildThatIsNotChild"),Oi(n,l))throw new nr($n,"Only one doctype is allowed");var a=Oi(n,_i);if(t&&n.indexOf(a)<n.indexOf(t))throw new nr($n,"Doctype can only be inserted before an element")}}u(z3,"assertPreReplacementValidityInDocument");function n2(r,e,t,n){jK(r,e,t),r.nodeType===er.DOCUMENT_NODE&&(n||qK)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===ca){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var o=t?t.previousSibling:r.lastChild;i.previousSibling=o,a.nextSibling=t,o?o.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do{i.parentNode=r;var l=r.ownerDocument||r;Id(i,l)}while(i!==a&&(i=i.nextSibling));return Ex(r.ownerDocument||r,r),e.nodeType==ca&&(e.firstChild=e.lastChild=null),e}u(n2,"_insertBefore");function Id(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===Bs&&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;)Id(s,e),s=s.nextSibling}}u(Id,"_updateOwnerDocument");function HK(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,Ex(r.ownerDocument,r,e);var t=r.ownerDocument||r;return Id(e,t),e}u(HK,"_appendSingleChild");Bd.prototype={nodeName:"#document",nodeType:j3,doctype:null,documentElement:null,_inc:1,insertBefore:u(function(r,e){if(r.nodeType==ca){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return n2(this,r,e),Id(r,this),this.documentElement===null&&r.nodeType===Bs&&(this.documentElement=r),r},"insertBefore"),removeChild:u(function(r){return this.documentElement==r&&(this.documentElement=null),W3(this,r)},"removeChild"),replaceChild:u(function(r,e){n2(this,r,e,z3),Id(r,this),e&&this.removeChild(e),_i(r)&&(this.documentElement=r)},"replaceChild"),importNode:u(function(r,e){return KK(this,r,e)},"importNode"),getElementById:u(function(r){var e=null;return r2(this.documentElement,function(t){if(t.nodeType==Bs&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),getElementsByClassName:u(function(r){var e=R3(r);return new Xf(this,function(t){var n=[];return e.length>0&&r2(t.documentElement,function(s){if(s!==t&&s.nodeType===Bs){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var o=R3(i);a=e.every(PK(o))}a&&n.push(s)}}}),n})},"getElementsByClassName"),createElement:u(function(r){var e=new fl;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new fa;var t=e.attributes=new t2;return t._ownerElement=e,e},"createElement"),createDocumentFragment:u(function(){var r=new a2;return r.ownerDocument=this,r.childNodes=new fa,r},"createDocumentFragment"),createTextNode:u(function(r){var e=new Sx;return e.ownerDocument=this,e.appendData(r),e},"createTextNode"),createComment:u(function(r){var e=new Ax;return e.ownerDocument=this,e.appendData(r),e},"createComment"),createCDATASection:u(function(r){if(r.indexOf("]]>")!==-1)throw new nr(VK,'data contains "]]>"');var e=new Cx;return e.ownerDocument=this,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:u(function(r,e){var t=new bx;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:u(function(r){var e=new s2;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"createAttribute"),createEntityReference:u(function(r){var e=new xx;return e.ownerDocument=this,e.nodeName=r,e},"createEntityReference"),createElementNS:u(function(r,e){var t=new fl,n=e.split(":"),s=t.attributes=new t2;return t.childNodes=new fa,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:u(function(r,e){var t=new s2,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")};Wn(Bd,er);function fl(){this._nsMap={}}u(fl,"Element");fl.prototype={nodeType:Bs,hasAttribute:u(function(r){return this.getAttributeNode(r)!=null},"hasAttribute"),getAttribute:u(function(r){var e=this.getAttributeNode(r);return e&&e.value||""},"getAttribute"),getAttributeNode:u(function(r){return this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:u(function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},"setAttribute"),removeAttribute:u(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),appendChild:u(function(r){return r.nodeType===ca?this.insertBefore(r,null):HK(this,r)},"appendChild"),setAttributeNode:u(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:u(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:u(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:u(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},"getAttributeNS"),setAttributeNS:u(function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},"setAttributeNS"),getAttributeNodeNS:u(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByTagName:u(function(r){return new Xf(this,function(e){var t=[];return r2(e,function(n){n!==e&&n.nodeType==Bs&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},"getElementsByTagName"),getElementsByTagNameNS:u(function(r,e){return new Xf(this,function(t){var n=[];return r2(t,function(s){s!==t&&s.nodeType===Bs&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Bd.prototype.getElementsByTagName=fl.prototype.getElementsByTagName;Bd.prototype.getElementsByTagNameNS=fl.prototype.getElementsByTagNameNS;Wn(fl,er);function s2(){}u(s2,"Attr");s2.prototype.nodeType=Kf;Wn(s2,er);function Rd(){}u(Rd,"CharacterData");Rd.prototype={data:"",substringData:u(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:u(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:u(function(r,e){this.replaceData(r,0,e)},"insertData"),appendChild:u(function(r){throw new Error(sn[$n])},"appendChild"),deleteData:u(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:u(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")};Wn(Rd,er);function Sx(){}u(Sx,"Text");Sx.prototype={nodeName:"#text",nodeType:e2,splitText:u(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")};Wn(Sx,Rd);function Ax(){}u(Ax,"Comment");Ax.prototype={nodeName:"#comment",nodeType:yx};Wn(Ax,Rd);function Cx(){}u(Cx,"CDATASection");Cx.prototype={nodeName:"#cdata-section",nodeType:U3};Wn(Cx,Rd);function i2(){}u(i2,"DocumentType");i2.prototype.nodeType=q3;Wn(i2,er);function J3(){}u(J3,"Notation");J3.prototype.nodeType=LK;Wn(J3,er);function Y3(){}u(Y3,"Entity");Y3.prototype.nodeType=kK;Wn(Y3,er);function xx(){}u(xx,"EntityReference");xx.prototype.nodeType=M3;Wn(xx,er);function a2(){}u(a2,"DocumentFragment");a2.prototype.nodeName="#document-fragment";a2.prototype.nodeType=ca;Wn(a2,er);function bx(){}u(bx,"ProcessingInstruction");bx.prototype.nodeType=gx;Wn(bx,er);function Q3(){}u(Q3,"XMLSerializer");Q3.prototype.serializeToString=function(r,e,t,n){return Z3.call(r,e,t,n)};er.prototype.toString=Z3;function Z3(r,e,t){var n=!!t&&!!t.requireWellFormed,s=[],i=this.nodeType==9&&this.documentElement||this,a=i.prefix,o=i.namespaceURI;if(o&&a==null){var a=i.lookupPrefix(o);if(a==null)var l=[{namespace:o,prefix:null}]}return Nx(this,s,r,e,l,n),s.join("")}u(Z3,"nodeSerializeToString");function V3(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===Td.XML||s===Td.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}u(V3,"needNamespaceDefine");function Zv(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,G3),'"')}u(Zv,"addSerializedAttribute");function Nx(r,e,t,n,s,i){s||(s=[]),nn(r,{ns:s,isHTML:t},{enter:u(function(a,o){var l=o.ns,c=o.isHTML;if(n)if(a=n(a),a){if(typeof a=="string")return e.push(a),null}else return null;switch(a.nodeType){case Bs:var f=a.attributes,p=f.length,d=a.tagName;c=Td.isHTML(a.namespaceURI)||c;var g=d;if(!c&&!a.prefix&&a.namespaceURI){for(var m,v=0;v<f.length;v++)if(f.item(v).name==="xmlns"){m=f.item(v).value;break}if(!m)for(var y=l.length-1;y>=0;y--){var S=l[y];if(S.prefix===""&&S.namespace===a.namespaceURI){m=S.namespace;break}}if(m!==a.namespaceURI)for(var y=l.length-1;y>=0;y--){var S=l[y];if(S.namespace===a.namespaceURI){S.prefix&&(g=S.prefix+":"+d);break}}}e.push("<",g);for(var C=l.slice(),w=0;w<p;w++){var E=f.item(w);E.prefix=="xmlns"?C.push({prefix:E.localName,namespace:E.value}):E.nodeName=="xmlns"&&C.push({prefix:"",namespace:E.value})}for(var w=0;w<p;w++){var E=f.item(w);if(V3(E,c,C)){var A=E.prefix||"",b=E.namespaceURI;Zv(e,A?"xmlns:"+A:"xmlns",b),C.push({prefix:A,namespace:b})}var V=n?n(E):E;V&&(typeof V=="string"?e.push(V):Zv(e,V.name,V.value))}if(d===g&&V3(a,c,C)){var I=a.prefix||"",b=a.namespaceURI;Zv(e,I?"xmlns:"+I:"xmlns",b),C.push({prefix:I,namespace:b})}var D=a.firstChild;if(D||c&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(e.push(">"),c&&/^script$/i.test(d)){for(;D;)D.data?e.push(D.data):Nx(D,e,c,n,C.slice(),i),D=D.nextSibling;return e.push("</",d,">"),null}return{ns:C,isHTML:c,tag:g}}else return e.push("/>"),null;case j3:case ca:return{ns:l.slice(),isHTML:c,tag:null};case Kf:return Zv(e,a.name,a.value),null;case e2:return e.push(a.data.replace(/[<&>]/g,G3)),null;case U3:if(i&&a.data.indexOf("]]>")!==-1)throw new nr(Hf,'The CDATASection data contains "]]>"');return e.push("<![CDATA[",a.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case yx:if(i&&a.data.indexOf("-->")!==-1)throw new nr(Hf,'The comment node data contains "-->"');return e.push("<!--",a.data,"-->"),null;case q3:if(i){if(a.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(a.publicId))throw new nr(Hf,"DocumentType publicId is not a valid PubidLiteral");if(a.systemId&&!/^("[^"]*"|'[^']*')$/.test(a.systemId))throw new nr(Hf,"DocumentType systemId is not a valid SystemLiteral");if(a.internalSubset&&a.internalSubset.indexOf("]>")!==-1)throw new nr(Hf,'DocumentType internalSubset contains "]>"')}var U=a.publicId,F=a.systemId;if(e.push("<!DOCTYPE ",a.name),U)e.push(" PUBLIC ",U),F&&F!="."&&e.push(" ",F),e.push(">");else if(F&&F!=".")e.push(" SYSTEM ",F,">");else{var M=a.internalSubset;M&&e.push(" [",M,"]"),e.push(">")}return null;case gx:if(i&&a.data.indexOf("?>")!==-1)throw new nr(Hf,'The ProcessingInstruction data contains "?>"');return e.push("<?",a.target," ",a.data,"?>"),null;case M3:return e.push("&",a.nodeName,";"),null;default:return e.push("??",a.nodeName),null}},"enter"),exit:u(function(a,o){o&&o.tag&&e.push("</",o.tag,">")},"exit")})}u(Nx,"serializeToString");function KK(r,e,t){var n;return nn(e,null,{enter:u(function(s,i){var a=s.cloneNode(!1);a.ownerDocument=r,a.parentNode=null,i===null?n=a:i.appendChild(a);var o=s.nodeType===Kf||t;return o?a:null},"enter")}),n}u(KK,"importNode");function e_(r,e,t){var n;return nn(e,null,{enter:u(function(s,i){var a=new s.constructor;for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o)){var l=s[o];typeof l!="object"&&l!=a[o]&&(a[o]=l)}s.childNodes&&(a.childNodes=new fa),a.ownerDocument=r;var c=t;switch(a.nodeType){case Bs:var f=s.attributes,p=a.attributes=new t2,d=f.length;p._ownerElement=a;for(var g=0;g<d;g++)a.setAttributeNode(e_(r,f.item(g),!0));break;case Kf:c=!0}return i!==null?i.appendChild(a):n=a,c?a:null},"enter")}),n}u(e_,"cloneNode");function t_(r,e,t){r[e]=t}u(t_,"__set__");try{Object.defineProperty&&(Object.defineProperty(Xf.prototype,"length",{get:u(function(){return vx(this),this.$$length},"get")}),Object.defineProperty(er.prototype,"textContent",{get:u(function(){if(this.nodeType===Bs||this.nodeType===ca){var r=[];return nn(this,null,{enter:u(function(e){if(e.nodeType===Bs||e.nodeType===ca)return!0;if(e.nodeType===gx||e.nodeType===yx)return null;r.push(e.nodeValue)},"enter")}),r.join("")}return this.nodeValue},"get"),set:u(function(r){switch(this.nodeType){case Bs:case ca:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}},"set")}),t_=u(function(r,e,t){r["$$"+e]=t},"__set__"))}catch{}pa.DocumentType=i2;pa.DOMException=nr;pa.DOMImplementation=X3;pa.Element=fl;pa.Node=er;pa.NodeList=fa;pa.walkDOM=nn;pa.XMLSerializer=Q3});var n_=ue(Od=>{"use strict";var r_=Nd().freeze;Od.XML_ENTITIES=r_({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Od.HTML_ENTITIES=r_({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:`
49
49
  `,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"});Od.entityMap=Od.HTML_ENTITIES});var f_=ue(Dx=>{"use strict";var Ld=Nd().NAMESPACE,Ix=/[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]/,s_=new RegExp("[\\-\\.0-9"+Ix.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i_=new RegExp("^"+Ix.source+s_.source+"*(?::"+Ix.source+s_.source+"*)?$"),_d=0,No=1,Gf=2,Pd=3,$f=4,Wf=5,kd=6,o2=7;function zf(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,zf)}u(zf,"ParseError");zf.prototype=new Error;zf.prototype.name=zf.name;function u_(){}u(u_,"XMLReader");u_.prototype={parse:u(function(r,e,t){var n=this.domBuilder;n.startDocument(),l_(e,e={}),XK(r,e,t,n,this.errorHandler),n.endDocument()},"parse")};function XK(r,e,t,n,s){function i(X){if(X>65535){X-=65536;var he=55296+(X>>10),Ce=56320+(X&1023);return String.fromCharCode(he,Ce)}else return String.fromCharCode(X)}u(i,"fixedFromCharCode");function a(X){var he=X.slice(1,-1);return Object.hasOwnProperty.call(t,he)?t[he]:he.charAt(0)==="#"?i(parseInt(he.substr(1).replace("x","0x"))):(s.error("entity not found:"+X),X)}u(a,"entityReplacer");function o(X){if(X>v){var he=r.substring(v,X).replace(/&#?\w+;/g,a);d&&l(v),n.characters(he,0,X-v),v=X}}u(o,"appendText");function l(X,he){for(;X>=f&&(he=p.exec(r));)c=he.index,f=c+he[0].length,d.lineNumber++;d.columnNumber=X-c+1}u(l,"position");for(var c=0,f=0,p=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,g=[{currentNSMap:e}],m={},v=0;;){try{var y=r.indexOf("<",v);if(y<0){if(!r.substr(v).match(/^\s*$/)){var S=n.doc,C=S.createTextNode(r.substr(v));S.appendChild(C),n.currentElement=C}return}switch(y>v&&o(y),r.charAt(y+1)){case"/":var F=r.indexOf(">",y+3),w=r.substring(y+2,F).replace(/[ \t\n\r]+$/g,""),E=g.pop();F<0?(w=r.substring(y+2).replace(/[\s<].*/,""),s.error("end tag name: "+w+" is not complete:"+E.tagName),F=y+1+w.length):w.match(/\s</)&&(w=w.replace(/[\s<].*/,""),s.error("end tag name: "+w+" maybe not complete"),F=y+1+w.length);var A=E.localNSMap,b=E.tagName==w,V=b||E.tagName&&E.tagName.toLowerCase()==w.toLowerCase();if(V){if(n.endElement(E.uri,E.localName,w),A)for(var I in A)Object.prototype.hasOwnProperty.call(A,I)&&n.endPrefixMapping(I);b||s.fatalError("end tag name: "+w+" is not match the current start tagName:"+E.tagName)}else g.push(E);F++;break;case"?":d&&l(y),F=JK(r,y,n);break;case"!":d&&l(y),F=zK(r,y,n,s);break;default:d&&l(y);var D=new c_,U=g[g.length-1].currentNSMap,F=GK(r,y,D,U,a,s),M=D.length;if(!D.closed&&WK(r,F,D.tagName,m)&&(D.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&M){for(var se=a_(d,{}),ee=0;ee<M;ee++){var ie=D[ee];l(ie.offset),ie.locator=a_(d,{})}n.locator=se,o_(D,n,U)&&g.push(D),n.locator=d}else o_(D,n,U)&&g.push(D);Ld.isHTML(D.uri)&&!D.closed?F=$K(r,F,D.tagName,a,n):F++}}catch(X){if(X instanceof zf)throw X;s.error("element parse error: "+X),F=-1}F>v?v=F:o(Math.max(y,v)+1)}}u(XK,"parse");function a_(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}u(a_,"copyLocator");function GK(r,e,t,n,s,i){function a(g,m,v){t.attributeNames.hasOwnProperty(g)&&i.fatalError("Attribute "+g+" redefined"),t.addValue(g,m.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),v)}u(a,"addAttribute");for(var o,l,c=++e,f=_d;;){var p=r.charAt(c);switch(p){case"=":if(f===No)o=r.slice(e,c),f=Pd;else if(f===Gf)f=Pd;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===Pd||f===No)if(f===No&&(i.warning('attribute value must after "="'),o=r.slice(e,c)),e=c+1,c=r.indexOf(p,e),c>0)l=r.slice(e,c),a(o,l,e-1),f=Wf;else throw new Error("attribute value no end '"+p+"' match");else if(f==$f)l=r.slice(e,c),a(o,l,e),i.warning('attribute "'+o+'" missed start quot('+p+")!!"),e=c+1,f=Wf;else throw new Error('attribute value must after "="');break;case"/":switch(f){case _d:t.setTagName(r.slice(e,c));case Wf:case kd:case o2:f=o2,t.closed=!0;case $f:case No:break;case Gf:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),f==_d&&t.setTagName(r.slice(e,c)),c;case">":switch(f){case _d:t.setTagName(r.slice(e,c));case Wf:case kd:case o2:break;case $f:case No:l=r.slice(e,c),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case Gf:f===Gf&&(l=o),f==$f?(i.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):((!Ld.isHTML(n[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Pd:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(f){case _d:t.setTagName(r.slice(e,c)),f=kd;break;case No:o=r.slice(e,c),f=Gf;break;case $f:var l=r.slice(e,c);i.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case Wf:f=kd;break}else switch(f){case Gf:var d=t.tagName;(!Ld.isHTML(n[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=c,f=No;break;case Wf:i.warning('attribute space is required"'+o+'"!!');case kd:f=No,e=c;break;case Pd:f=$f,e=c;break;case o2:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}u(GK,"parseElementStartPart");function o_(r,e,t){for(var n=r.tagName,s=null,p=r.length;p--;){var i=r[p],a=i.qName,o=i.value,d=a.indexOf(":");if(d>0)var l=i.prefix=a.slice(0,d),c=a.slice(d+1),f=l==="xmlns"&&c;else c=a,l=null,f=a==="xmlns"&&"";i.localName=c,f!==!1&&(s==null&&(s={},l_(t,t={})),t[f]=s[f]=o,i.uri=Ld.XMLNS,e.startPrefixMapping(f,o))}for(var p=r.length;p--;){i=r[p];var l=i.prefix;l&&(l==="xml"&&(i.uri=Ld.XML),l!=="xmlns"&&(i.uri=t[l||""]))}var d=n.indexOf(":");d>0?(l=r.prefix=n.slice(0,d),c=r.localName=n.slice(d+1)):(l=null,c=r.localName=n);var g=r.uri=t[l||""];if(e.startElement(g,c,n,r),r.closed){if(e.endElement(g,c,n),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=s,!0}u(o_,"appendElement");function $K(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}u($K,"parseHtmlSpecialContent");function WK(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}u(WK,"fixSelfClosed");function l_(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}u(l_,"_copy");function zK(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=YK(r,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],c=!1,f=!1;o>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],f=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(f=a[3][0]));var p=a[o-1];return t.startDTD(l,c,f),t.endDTD(),p.index+p[0].length}}return-1}u(zK,"parseDCC");function JK(r,e,t){var n=r.indexOf("?>",e);if(n){var s=r.substring(e,n).match(/^<\?(\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}u(JK,"parseInstruction");function c_(){this.attributeNames={}}u(c_,"ElementAttributes");c_.prototype={setTagName:u(function(r){if(!i_.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},"setTagName"),addValue:u(function(r,e,t){if(!i_.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:u(function(r){return this[r].localName},"getLocalName"),getLocator:u(function(r){return this[r].locator},"getLocator"),getQName:u(function(r){return this[r].qName},"getQName"),getURI:u(function(r){return this[r].uri},"getURI"),getValue:u(function(r){return this[r].value},"getValue")};function YK(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}u(YK,"split");Dx.XMLReader=u_;Dx.ParseError=zf});var v_=ue(l2=>{"use strict";var QK=Nd(),ZK=Tx(),h_=n_(),m_=f_(),eX=ZK.DOMImplementation,p_=QK.NAMESPACE,tX=m_.ParseError,rX=m_.XMLReader;function g_(r){return r.replace(/\r[\n\u0085]/g,`
50
50
  `).replace(/[\r\u0085\u2028]/g,`
51
51
  `)}u(g_,"normalizeLineEndings");function y_(r){this.options=r||{locator:{}}}u(y_,"DOMParser");y_.prototype.parseFromString=function(r,e){var t=this.options,n=new rX,s=t.domBuilder||new Vd,i=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),c=l?h_.HTML_ENTITIES:h_.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=nX(i,s,a),n.domBuilder=t.domBuilder||s,l&&(o[""]=p_.HTML),o.xml=o.xml||p_.XML;var f=t.normalizeLineEndings||g_;return r&&typeof r=="string"?n.parse(f(r),o,c):n.errorHandler.error("invalid doc source"),s.doc};function nX(r,e,t){if(!r){if(e instanceof Vd)return e;r=e}var n={},s=r instanceof Function;t=t||{};function i(a){var o=r[a];!o&&s&&(o=r.length==2?function(l){r(a,l)}:r),n[a]=o&&function(l){o("[xmldom "+a+"] "+l+Bx(t))}||function(){}}return u(i,"build"),i("warning"),i("error"),i("fatalError"),n}u(nX,"buildErrorHandler");function Vd(){this.cdata=!1}u(Vd,"DOMHandler");function Jf(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}u(Jf,"position");Vd.prototype={startDocument:u(function(){this.doc=new eX().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},"startDocument"),startElement:u(function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;u2(this,i),this.currentElement=i,this.locator&&Jf(this.locator,i);for(var o=0;o<a;o++){var r=n.getURI(o),l=n.getValue(o),t=n.getQName(o),c=s.createAttributeNS(r,t);this.locator&&Jf(n.getLocator(o),c),c.value=c.nodeValue=l,i.setAttributeNode(c)}},"startElement"),endElement:u(function(r,e,t){var n=this.currentElement,s=n.tagName;this.currentElement=n.parentNode},"endElement"),startPrefixMapping:u(function(r,e){},"startPrefixMapping"),endPrefixMapping:u(function(r){},"endPrefixMapping"),processingInstruction:u(function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&Jf(this.locator,t),u2(this,t)},"processingInstruction"),ignorableWhitespace:u(function(r,e,t){},"ignorableWhitespace"),characters:u(function(r,e,t){if(r=d_.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&&Jf(this.locator,n)}},"characters"),skippedEntity:u(function(r){},"skippedEntity"),endDocument:u(function(){this.doc.normalize()},"endDocument"),setDocumentLocator:u(function(r){(this.locator=r)&&(r.lineNumber=0)},"setDocumentLocator"),comment:u(function(r,e,t){r=d_.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&Jf(this.locator,n),u2(this,n)},"comment"),startCDATA:u(function(){this.cdata=!0},"startCDATA"),endCDATA:u(function(){this.cdata=!1},"endCDATA"),startDTD:u(function(r,e,t){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(r,e,t);this.locator&&Jf(this.locator,s),u2(this,s),this.doc.doctype=s}},"startDTD"),warning:u(function(r){console.warn("[xmldom warning] "+r,Bx(this.locator))},"warning"),error:u(function(r){console.error("[xmldom error] "+r,Bx(this.locator))},"error"),fatalError:u(function(r){throw new tX(r,this.locator)},"fatalError")};function Bx(r){if(r)return`
@@ -60,7 +60,7 @@ Actual: `+R.attribValue);else if($==="xmlns"&&R.attribValue!==m)W(R,"xmlns: pref
60
60
  Actual: `+R.attribValue);else{var ge=R.tag,et=R.tags[R.tags.length-1]||R;ge.ns===et.ns&&(ge.ns=Object.create(et.ns)),ge.ns[$]=R.attribValue}R.attribList.push([R.attribName,R.attribValue])}else R.tag.attributes[R.attribName]=R.attribValue,X(R,"onattribute",{name:R.attribName,value:R.attribValue});R.attribName=R.attribValue=""}u(Ve,"attrib");function Le(R,N){if(R.opt.xmlns){var J=R.tag,$=Ie(R.tagName);J.prefix=$.prefix,J.local=$.local,J.uri=J.ns[$.prefix]||"",J.prefix&&!J.uri&&(W(R,"Unbound namespace prefix: "+JSON.stringify(R.tagName)),J.uri=$.prefix);var ge=R.tags[R.tags.length-1]||R;J.ns&&ge.ns!==J.ns&&Object.keys(J.ns).forEach(function(os){X(R,"onopennamespace",{prefix:os,uri:J.ns[os]})});for(var et=0,Gt=R.attribList.length;et<Gt;et++){var Be=R.attribList[et],ar=Be[0],Er=Be[1],Jt=Ie(ar,!0),Ir=Jt.prefix,Gs=Jt.local,Je=Ir===""?"":J.ns[Ir]||"",qe={name:ar,value:Er,prefix:Ir,local:Gs,uri:Je};Ir&&Ir!=="xmlns"&&!Je&&(W(R,"Unbound namespace prefix: "+JSON.stringify(Ir)),qe.uri=Ir),R.tag.attributes[ar]=qe,X(R,"onattribute",qe)}R.attribList.length=0}R.tag.isSelfClosing=!!N,R.sawRoot=!0,R.tags.push(R.tag),X(R,"onopentag",R.tag),N||(!R.noscript&&R.tagName.toLowerCase()==="script"?R.state=D.SCRIPT:R.state=D.TEXT,R.tag=null,R.tagName=""),R.attribName=R.attribValue="",R.attribList.length=0}u(Le,"openTag");function O(R){if(!R.tagName){W(R,"Weird empty close tag."),R.textNode+="</>",R.state=D.TEXT;return}if(R.script){if(R.tagName!=="script"){R.script+="</"+R.tagName+">",R.tagName="",R.state=D.SCRIPT;return}X(R,"onscript",R.script),R.script=""}var N=R.tags.length,J=R.tagName;R.strict||(J=J[R.looseCase]());for(var $=J;N--;){var ge=R.tags[N];if(ge.name!==$)W(R,"Unexpected close tag");else break}if(N<0){W(R,"Unmatched closing tag: "+R.tagName),R.textNode+="</"+R.tagName+">",R.state=D.TEXT;return}R.tagName=J;for(var et=R.tags.length;et-- >N;){var Gt=R.tag=R.tags.pop();R.tagName=R.tag.name,X(R,"onclosetag",R.tagName);var Be={};for(var ar in Gt.ns)Be[ar]=Gt.ns[ar];var Er=R.tags[R.tags.length-1]||R;R.opt.xmlns&&Gt.ns!==Er.ns&&Object.keys(Gt.ns).forEach(function(Jt){var Ir=Gt.ns[Jt];X(R,"onclosenamespace",{prefix:Jt,uri:Ir})})}N===0&&(R.closedRoot=!0),R.tagName=R.attribValue=R.attribName="",R.attribList.length=0,R.state=D.TEXT}u(O,"closeTag");function B(R){var N=R.entity,J=N.toLowerCase(),$,ge="";return R.ENTITIES[N]?R.ENTITIES[N]:R.ENTITIES[J]?R.ENTITIES[J]:(N=J,N.charAt(0)==="#"&&(N.charAt(1)==="x"?(N=N.slice(2),$=parseInt(N,16),ge=$.toString(16)):(N=N.slice(1),$=parseInt(N,10),ge=$.toString(10))),N=N.replace(/^0+/,""),isNaN($)||ge.toLowerCase()!==N||$<0||$>1114111?(W(R,"Invalid character entity"),"&"+R.entity+";"):String.fromCodePoint($))}u(B,"parseEntity");function Q(R,N){N==="<"?(R.state=D.OPEN_WAKA,R.startTagPosition=R.position):E(N)||(W(R,"Non-whitespace before first tag."),R.textNode=N,R.state=D.TEXT)}u(Q,"beginWhiteSpace");function K(R,N){var J="";return N<R.length&&(J=R.charAt(N)),J}u(K,"charAt");function _e(R){var N=this;if(this.error)throw this.error;if(N.closed)return xe(N,"Cannot write after close. Assign an onready handler.");if(R===null)return pe(N);typeof R=="object"&&(R=R.toString());for(var J=0,$="";$=K(R,J++),N.c=$,!!$;)switch(N.trackPosition&&(N.position++,$===`
61
61
  `?(N.line++,N.column=0):N.column++),N.state){case D.BEGIN:if(N.state=D.BEGIN_WHITESPACE,$==="\uFEFF")continue;Q(N,$);continue;case D.BEGIN_WHITESPACE:Q(N,$);continue;case D.TEXT:if(N.sawRoot&&!N.closedRoot){for(var et=J-1;$&&$!=="<"&&$!=="&";)$=K(R,J++),$&&N.trackPosition&&(N.position++,$===`
62
62
  `?(N.line++,N.column=0):N.column++);N.textNode+=R.substring(et,J-1)}$==="<"&&!(N.sawRoot&&N.closedRoot&&!N.strict)?(N.state=D.OPEN_WAKA,N.startTagPosition=N.position):(!E($)&&(!N.sawRoot||N.closedRoot)&&W(N,"Text data outside of root node."),$==="&"?N.state=D.TEXT_ENTITY:N.textNode+=$);continue;case D.SCRIPT:$==="<"?N.state=D.SCRIPT_ENDING:N.script+=$;continue;case D.SCRIPT_ENDING:$==="/"?N.state=D.CLOSE_TAG:(N.script+="<"+$,N.state=D.SCRIPT);continue;case D.OPEN_WAKA:if($==="!")N.state=D.SGML_DECL,N.sgmlDecl="";else if(!E($))if(V(y,$))N.state=D.OPEN_TAG,N.tagName=$;else if($==="/")N.state=D.CLOSE_TAG,N.tagName="";else if($==="?")N.state=D.PROC_INST,N.procInstName=N.procInstBody="";else{if(W(N,"Unencoded <"),N.startTagPosition+1<N.position){var ge=N.position-N.startTagPosition;$=new Array(ge).join(" ")+$}N.textNode+="<"+$,N.state=D.TEXT}continue;case D.SGML_DECL:if(N.sgmlDecl+$==="--"){N.state=D.COMMENT,N.comment="",N.sgmlDecl="";continue}N.doctype&&N.doctype!==!0&&N.sgmlDecl?(N.state=D.DOCTYPE_DTD,N.doctype+="<!"+N.sgmlDecl+$,N.sgmlDecl=""):(N.sgmlDecl+$).toUpperCase()===p?(X(N,"onopencdata"),N.state=D.CDATA,N.sgmlDecl="",N.cdata=""):(N.sgmlDecl+$).toUpperCase()===d?(N.state=D.DOCTYPE,(N.doctype||N.sawRoot)&&W(N,"Inappropriately located doctype declaration"),N.doctype="",N.sgmlDecl=""):$===">"?(X(N,"onsgmldeclaration",N.sgmlDecl),N.sgmlDecl="",N.state=D.TEXT):(A($)&&(N.state=D.SGML_DECL_QUOTED),N.sgmlDecl+=$);continue;case D.SGML_DECL_QUOTED:$===N.q&&(N.state=D.SGML_DECL,N.q=""),N.sgmlDecl+=$;continue;case D.DOCTYPE:$===">"?(N.state=D.TEXT,X(N,"ondoctype",N.doctype),N.doctype=!0):(N.doctype+=$,$==="["?N.state=D.DOCTYPE_DTD:A($)&&(N.state=D.DOCTYPE_QUOTED,N.q=$));continue;case D.DOCTYPE_QUOTED:N.doctype+=$,$===N.q&&(N.q="",N.state=D.DOCTYPE);continue;case D.DOCTYPE_DTD:$==="]"?(N.doctype+=$,N.state=D.DOCTYPE):$==="<"?(N.state=D.OPEN_WAKA,N.startTagPosition=N.position):A($)?(N.doctype+=$,N.state=D.DOCTYPE_DTD_QUOTED,N.q=$):N.doctype+=$;continue;case D.DOCTYPE_DTD_QUOTED:N.doctype+=$,$===N.q&&(N.state=D.DOCTYPE_DTD,N.q="");continue;case D.COMMENT:$==="-"?N.state=D.COMMENT_ENDING:N.comment+=$;continue;case D.COMMENT_ENDING:$==="-"?(N.state=D.COMMENT_ENDED,N.comment=Ce(N.opt,N.comment),N.comment&&X(N,"oncomment",N.comment),N.comment=""):(N.comment+="-"+$,N.state=D.COMMENT);continue;case D.COMMENT_ENDED:$!==">"?(W(N,"Malformed comment"),N.comment+="--"+$,N.state=D.COMMENT):N.doctype&&N.doctype!==!0?N.state=D.DOCTYPE_DTD:N.state=D.TEXT;continue;case D.CDATA:for(var et=J-1;$&&$!=="]";)$=K(R,J++),$&&N.trackPosition&&(N.position++,$===`
63
- `?(N.line++,N.column=0):N.column++);N.cdata+=R.substring(et,J-1),$==="]"&&(N.state=D.CDATA_ENDING);continue;case D.CDATA_ENDING:$==="]"?N.state=D.CDATA_ENDING_2:(N.cdata+="]"+$,N.state=D.CDATA);continue;case D.CDATA_ENDING_2:$===">"?(N.cdata&&X(N,"oncdata",N.cdata),X(N,"onclosecdata"),N.cdata="",N.state=D.TEXT):$==="]"?N.cdata+="]":(N.cdata+="]]"+$,N.state=D.CDATA);continue;case D.PROC_INST:$==="?"?N.state=D.PROC_INST_ENDING:E($)?N.state=D.PROC_INST_BODY:N.procInstName+=$;continue;case D.PROC_INST_BODY:if(!N.procInstBody&&E($))continue;$==="?"?N.state=D.PROC_INST_ENDING:N.procInstBody+=$;continue;case D.PROC_INST_ENDING:if($===">"){let Er={name:N.procInstName,body:N.procInstBody};ie(N,Er),X(N,"onprocessinginstruction",Er),N.procInstName=N.procInstBody="",N.state=D.TEXT}else N.procInstBody+="?"+$,N.state=D.PROC_INST_BODY;continue;case D.OPEN_TAG:V(S,$)?N.tagName+=$:(fe(N),$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:(E($)||W(N,"Invalid character in tag name"),N.state=D.ATTRIB));continue;case D.OPEN_TAG_SLASH:$===">"?(Le(N,!0),O(N)):(W(N,"Forward-slash in opening tag not followed by >"),N.state=D.ATTRIB);continue;case D.ATTRIB:if(E($))continue;$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:V(y,$)?(N.attribName=$,N.attribValue="",N.state=D.ATTRIB_NAME):W(N,"Invalid attribute name");continue;case D.ATTRIB_NAME:$==="="?N.state=D.ATTRIB_VALUE:$===">"?(W(N,"Attribute without value"),N.attribValue=N.attribName,Ve(N),Le(N)):E($)?N.state=D.ATTRIB_NAME_SAW_WHITE:V(S,$)?N.attribName+=$:W(N,"Invalid attribute name");continue;case D.ATTRIB_NAME_SAW_WHITE:if($==="=")N.state=D.ATTRIB_VALUE;else{if(E($))continue;W(N,"Attribute without value"),N.tag.attributes[N.attribName]="",N.attribValue="",X(N,"onattribute",{name:N.attribName,value:""}),N.attribName="",$===">"?Le(N):V(y,$)?(N.attribName=$,N.state=D.ATTRIB_NAME):(W(N,"Invalid attribute name"),N.state=D.ATTRIB)}continue;case D.ATTRIB_VALUE:if(E($))continue;A($)?(N.q=$,N.state=D.ATTRIB_VALUE_QUOTED):(N.opt.unquotedAttributeValues||xe(N,"Unquoted attribute value"),N.state=D.ATTRIB_VALUE_UNQUOTED,N.attribValue=$);continue;case D.ATTRIB_VALUE_QUOTED:if($!==N.q){$==="&"?N.state=D.ATTRIB_VALUE_ENTITY_Q:N.attribValue+=$;continue}Ve(N),N.q="",N.state=D.ATTRIB_VALUE_CLOSED;continue;case D.ATTRIB_VALUE_CLOSED:E($)?N.state=D.ATTRIB:$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:V(y,$)?(W(N,"No whitespace between attributes"),N.attribName=$,N.attribValue="",N.state=D.ATTRIB_NAME):W(N,"Invalid attribute name");continue;case D.ATTRIB_VALUE_UNQUOTED:if(!b($)){$==="&"?N.state=D.ATTRIB_VALUE_ENTITY_U:N.attribValue+=$;continue}Ve(N),$===">"?Le(N):N.state=D.ATTRIB;continue;case D.CLOSE_TAG:if(N.tagName)$===">"?O(N):V(S,$)?N.tagName+=$:N.script?(N.script+="</"+N.tagName+$,N.tagName="",N.state=D.SCRIPT):(E($)||W(N,"Invalid tagname in closing tag"),N.state=D.CLOSE_TAG_SAW_WHITE);else{if(E($))continue;I(y,$)?N.script?(N.script+="</"+$,N.state=D.SCRIPT):W(N,"Invalid tagname in closing tag."):N.tagName=$}continue;case D.CLOSE_TAG_SAW_WHITE:if(E($))continue;$===">"?O(N):W(N,"Invalid characters in closing tag");continue;case D.TEXT_ENTITY:case D.ATTRIB_VALUE_ENTITY_Q:case D.ATTRIB_VALUE_ENTITY_U:var Gt,Be;switch(N.state){case D.TEXT_ENTITY:Gt=D.TEXT,Be="textNode";break;case D.ATTRIB_VALUE_ENTITY_Q:Gt=D.ATTRIB_VALUE_QUOTED,Be="attribValue";break;case D.ATTRIB_VALUE_ENTITY_U:Gt=D.ATTRIB_VALUE_UNQUOTED,Be="attribValue";break}if($===";"){var ar=B(N);N.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes(ar)?((N.entityCount+=1)>N.opt.maxEntityCount&&xe(N,"Parsed entity count exceeds max entity count"),(N.entityDepth+=1)>N.opt.maxEntityDepth&&xe(N,"Parsed entity depth exceeds max entity depth"),N.entity="",N.state=Gt,N.write(ar),N.entityDepth-=1):(N[Be]+=ar,N.entity="",N.state=Gt)}else V(N.entity.length?w:C,$)?N.entity+=$:(W(N,"Invalid character in entity name"),N[Be]+="&"+N.entity+$,N.entity="",N.state=Gt);continue;default:throw new Error(N,"Unknown state: "+N.state)}return N.position>=N.bufferCheckPosition&&n(N),N}u(_e,"write");String.fromCodePoint||(function(){var R=String.fromCharCode,N=Math.floor,J=u(function(){var $=16384,ge=[],et,Gt,Be=-1,ar=arguments.length;if(!ar)return"";for(var Er="";++Be<ar;){var Jt=Number(arguments[Be]);if(!isFinite(Jt)||Jt<0||Jt>1114111||N(Jt)!==Jt)throw RangeError("Invalid code point: "+Jt);Jt<=65535?ge.push(Jt):(Jt-=65536,et=(Jt>>10)+55296,Gt=Jt%1024+56320,ge.push(et,Gt)),(Be+1===ar||ge.length>$)&&(Er+=R.apply(null,ge),ge.length=0)}return Er},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:J,configurable:!0,writable:!0}):String.fromCodePoint=J})()})(typeof w2>"u"?w2.sax={}:w2)});var j_=ue(S2=>{"use strict";Object.defineProperty(S2,"__esModule",{value:!0});S2.NamespaceContext=void 0;var qX=class{static{u(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}}},HX=class{static{u(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 qX(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}};S2.NamespaceContext=HX});var Q_=ue($e=>{"use strict";var KX=$e&&$e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($e,"__esModule",{value:!0});$e.ImportElement=$e.IncludeElement=$e.BodyElement=$e.DefinitionsElement=$e.ServiceElement=$e.PortElement=$e.BindingElement=$e.PortTypeElement=$e.OperationElement=$e.TypesElement=$e.SchemaElement=$e.DocumentationElement=$e.MessageElement=$e.AllElement=$e.AttributeElement=$e.SequenceElement=$e.SimpleContentElement=$e.ComplexContentElement=$e.ComplexTypeElement=$e.EnumerationElement=$e.ChoiceElement=$e.ExtensionElement=$e.RestrictionElement=$e.SimpleTypeElement=$e.OutputElement=$e.InputElement=$e.AnyElement=$e.ElementElement=$e.UnexpectedElement=$e.Element=void 0;var Ux=st("assert"),XX=KX(Iy()),lr=Gn(),GX=(0,XX.default)("node-soap"),A2={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},Xt=class{static{u(this,"Element")}constructor(e,t,n,s){this.allowedChildren={},this.children=[];let i=(0,lr.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 o=/^xmlns:?(.*)$/.exec(a);o?this.xmlns[o[1]?o[1]:lr.TNS_PREFIX]=t[a]:a==="value"?this[this.valueKey]=t[a]:this["$"+a]=t[a]}for(let a in s){let o=/^xmlns:?(.*)$/.exec(a);o&&o[1]&&(this.schemaXmlns[o[1]]=s[a])}this.$targetNamespace!==void 0&&(this.xmlns[lr.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,lr.splitQName)(t).name];if(a==null&&!this.strict&&(a=q_),a){let o=new a(t,n,s,i);o.init();let l=e[0];l instanceof zx&&(o.definitionsXmlns=l.xmlns),e.push(o)}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]&&((0,lr.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)}};$e.Element=Xt;var q_=class H_ extends Xt{static{u(this,"UnexpectedElement")}startElement(e,t,n,s,i){let a=new H_(t,n,s,i);a.init(),e.push(a)}};$e.UnexpectedElement=q_;var Mx=class extends Xt{static{u(this,"ElementElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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 o=a>1;o&&s&&(s+="[]"),t&&t[lr.TNS_PREFIX]&&(this.$targetNamespace=t[lr.TNS_PREFIX]);let l=this.$type||this.$ref;if(l){l=(0,lr.splitQName)(l);let c=l.name,f=!!Oo(l.prefix,this.definitionsXmlns,e.xmlns)||!!Oo(this.targetNSAlias,this.definitionsXmlns,e.xmlns)||this.forceUseSchemaXmlns,p=Oo(l.prefix,t,this.xmlns,f?this.schemaXmlns:void 0,this.definitionsXmlns,e.xmlns),d=e.schemas[p],g=d&&(this.$type?d.complexTypes[c]||d.types[c]:d.elements[c]),m=this.$type?e.descriptions.types:e.descriptions.elements,v=p?`${p}::${c}`:c;if(p&&e.schemas[p]&&(t=e.schemas[p].xmlns),g&&!(c in A2))if(v in m)if(this.$ref)if(o){let y=c+"[]",S=p?`${p}::${y}`:y;m[S]=m[v],n[y]=m[S]}else n=m[v];else n[s]=m[v];else{let y={};m[v]=y,o&&"maxOccurs"in g&&(g.maxOccurs=this.$maxOccurs),this.$minOccurs&&"minOccurs"in g&&(g.minOccurs=this.$minOccurs);let S=g.description(e,t);if(typeof S=="string")y=S;else{Object.keys(S).forEach(w=>{y[w]=S[w]});let C=S[Zs.Symbol];C&&(y[Zs.Symbol]=C)}this.$ref?n=y:n[s]=y,typeof y=="object"&&(y.targetNSAlias=l.prefix,y.targetNamespace=p),m[v]=y}else n[s]=this.$type}else{let c=this.children;n[s]={};for(let f of c)(f instanceof T2||f instanceof x2)&&(n[s]=f.description(e,t))}return n}};$e.ElementElement=Mx;var C2=class extends Xt{static{u(this,"AnyElement")}};$e.AnyElement=C2;var K_=class extends Xt{static{u(this,"InputElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof I2&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};$e.InputElement=K_;var X_=class extends Xt{static{u(this,"OutputElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof I2&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};$e.OutputElement=X_;var x2=class extends Xt{static{u(this,"SimpleTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["restriction"])}description(e){for(let t of this.children)if(t instanceof b2)return[this.$name,t.description()].filter(Boolean).join("|");return{}}};$e.SimpleTypeElement=x2;var b2=class extends Xt{static{u(this,"RestrictionElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","choice","enumeration","sequence","attribute"])}description(e,t){let n=this.children,s,i=!1,a={};for(let l of n){if(l instanceof Zs){a[l.$name]=l.description(e);continue}!i&&(l instanceof Md||l instanceof Ud)&&(i=!0,s=l.description(e,t))}if(Object.keys(a).length>0&&(s=s??{},s[Zs.Symbol]=a),s&&this.$base){let l=(0,lr.splitQName)(this.$base),c=l.name,f=Oo(l.prefix,t,this.definitionsXmlns,e.xmlns),p=e.schemas[f],d=p&&(p.complexTypes[c]||p.types[c]||p.elements[c]);if(s.getBase=()=>d.description(e,p.xmlns),d){let g=d.description(e,p.xmlns);g[Zs.Symbol]&&(0,lr.defaults)(a,g[Zs.Symbol]),s=(0,lr.defaults)(s,g)}return s}let o=this.children.map(l=>l.description()).join(",");return[this.$base,o].filter(Boolean).join("|")}};$e.RestrictionElement=b2;var N2=class extends Xt{static{u(this,"ExtensionElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","choice","sequence"])}description(e,t){let n={};for(let s of this.children)(s instanceof Md||s instanceof Ud)&&(n=s.description(e,t));if(this.$base){let s=(0,lr.splitQName)(this.$base),i=s.name,a=Oo(s.prefix,t,this.definitionsXmlns,e.xmlns),o=e.schemas[a];if(i in A2)return this.$base;{let l=o&&(o.complexTypes[i]||o.types[i]||o.elements[i]);if(l){let c=l.description(e,o.xmlns);n=typeof c=="string"?c:(0,lr.defaults)(c,n)}}}return n}};$e.ExtensionElement=N2;var Ud=class extends Xt{static{u(this,"ChoiceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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}};$e.ChoiceElement=Ud;var G_=class extends Xt{static{u(this,"EnumerationElement")}description(){return this[this.valueKey]}};$e.EnumerationElement=G_;var T2=class extends Xt{static{u(this,"ComplexTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","annotation","choice","complexContent","sequence","simpleContent","attribute"])}description(e,t){let n={},s=!1,i={},a=this.children||[];for(let o of a){if(o instanceof Zs){i[o.$name]=o.description(e);continue}!s&&(o instanceof Ud||o instanceof Md||o instanceof Hx||o instanceof qx||o instanceof jx)&&(s=!0,n=o.description(e,t))}return Object.keys(i).length>0&&(n[Zs.Symbol]=i),n}};$e.ComplexTypeElement=T2;var jx=class extends Xt{static{u(this,"ComplexContentElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["extension","restriction"])}description(e,t){for(let n of this.children)if(n instanceof N2||n instanceof b2)return n.description(e,t);return{}}};$e.ComplexContentElement=jx;var qx=class extends Xt{static{u(this,"SimpleContentElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["extension"])}description(e,t){for(let n of this.children)if(n instanceof N2)return n.description(e,t);return{}}};$e.SimpleContentElement=qx;var Md=class extends Xt{static{u(this,"SequenceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){if(s instanceof C2)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};$e.SequenceElement=Md;var Zs=class extends Xt{static{u(this,"AttributeElement")}description(e){return{type:this.$type,required:this.$use==="required"}}};$e.AttributeElement=Zs;Zs.Symbol=Symbol("$attributes");var Hx=class extends Xt{static{u(this,"AllElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["choice","element"])}description(e,t){let n={};for(let s of this.children){if(s instanceof C2)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};$e.AllElement=Hx;var Kx=class extends Xt{static{u(this,"MessageElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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,lr.splitQName)(t.$element),a=Oo(i.prefix,this.definitionsXmlns,e.xmlns),o=e.schemas[a];if(this.element=o.elements[i.name],!this.element){GX(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 c of l)s.push(this._getNestedLookupTypeString(c));if(s.length>0){s=s.join("_").split("_").filter(u(function(p){return p!=="^"},"removeEmptyLookupTypes"));let c=e.schemas[this.element.targetNamespace].xmlns;for(let f=0;f<s.length;f++)s[f]=this._createLookupTypeObject(s[f],c)}if(this.element.$lookupTypes=s,this.element.$type){let c=(0,lr.splitQName)(this.element.$type),f=Oo(c.prefix,o.xmlns,this.definitionsXmlns,e.xmlns);if(f&&!(c.name in A2)){o=e.schemas[f];let p=o.complexTypes[c.name]||o.types[c.name]||o.elements[c.name];p&&(this.parts=p.description(e,o.xmlns))}}else{let c=this.element.description(e,o.xmlns);this.parts=c[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,Ux.ok)(i.name==="part","Expected part element");let a=(0,lr.splitQName)(i.$type),o=Oo(a.prefix,this.definitionsXmlns,e.xmlns),l=a.name;typeof e.schemas[o]<"u"?this.parts[i.$name]=e.schemas[o].types[l]||e.schemas[o].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=o),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,lr.splitQName)(e),s=n.prefix,i=n.name.split("#"),a=i[0],o=i[1];return{$namespace:t[s],$type:s+":"+a,$name:o}}_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}};$e.MessageElement=Kx;var $_=class extends Xt{static{u(this,"DocumentationElement")}};$e.DocumentationElement=$_;var Fd=class W_ extends Xt{static{u(this,"SchemaElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["complexType","element","import","include","simpleType"]),this.complexTypes={},this.types={},this.elements={},this.includes=[]}merge(e){return(0,Ux.ok)(e instanceof W_),(0,lr.merge)(this.complexTypes,e.complexTypes),(0,lr.merge)(this.types,e.types),(0,lr.merge)(this.elements,e.elements),(0,lr.merge)(this.xmlns,e.xmlns),(0,lr.merge)(this,(0,lr.pickBy)(e,(t,n)=>n.startsWith("$")&&!Object.hasOwnProperty.call(this,n))),this}addChild(e){if(!(e.$name in A2)){if(e instanceof Jx||e instanceof Yx){let t=e.$schemaLocation||e.$location;t&&this.includes.push({namespace:e.$namespace||e.$targetNamespace||this.$targetNamespace,location:t})}else e instanceof T2?this.complexTypes[e.$name]=e:e instanceof Mx?this.elements[e.$name]=e:e instanceof x2&&(this.types[e.$name]=e);this.children.pop()}}};$e.SchemaElement=Fd;var Xx=class extends Xt{static{u(this,"TypesElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["documentation","schema"]),this.schemas={}}addChild(e){(0,Ux.ok)(e instanceof Fd);let t=e.includes.find(i=>Object.hasOwnProperty.call(i,"namespace")),n=typeof t<"u"&&Object.hasOwnProperty.call(t,"namespace")&&e instanceof Fd?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}};$e.TypesElement=Xx;var z_=class J_ extends Xt{static{u(this,"OperationElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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 J_&&(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,lr.splitQName)(i.$message).name,o=e.messages[a];o&&(o.postProcess(e),o.element?(e.messages[o.element.$name]=o,this[i.name]=o.element):this[i.name]=o,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]]}}};$e.OperationElement=z_;var Gx=class extends Xt{static{u(this,"PortTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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}};$e.PortTypeElement=Gx;var $x=class extends Xt{static{u(this,"BindingElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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,lr.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 o=i[a];if(o.name!=="operation")continue;o.postProcess(e,"binding"),i.splice(a--,1),o.style||(o.style=s);let l=this.methods[o.$name];l&&(l.style=o.style,l.soapAction=o.soapAction,l.inputSoap=o.input||null,l.outputSoap=o.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}};$e.BindingElement=$x;var Y_=class extends Xt{static{u(this,"PortElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["address","documentation"]),this.location=null}addChild(e){e.name==="address"&&typeof e.$location<"u"&&(this.location=e.$location)}};$e.PortElement=Y_;var Wx=class extends Xt{static{u(this,"ServiceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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,lr.splitQName)(i.$binding).name,o=n[a];o&&(o.postProcess(e),this.ports[i.$name]={location:i.location,binding:o},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}};$e.ServiceElement=Wx;var zx=class extends Xt{static{u(this,"DefinitionsElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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 Xx)(0,lr.merge)(this.schemas,e.schemas);else if(e instanceof Kx)this.messages[e.$name]=e;else if(e.name==="import"){let t=new Fd(e.$namespace,{});t.init(),this.schemas[e.$namespace]=t,this.schemas[e.$namespace].addChild(e)}else e instanceof Gx?this.portTypes[e.$name]=e:e instanceof $x?(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 Wx&&(this.services[e.$name]=e);this.children.pop()}};$e.DefinitionsElement=zx;var I2=class extends Xt{static{u(this,"BodyElement")}};$e.BodyElement=I2;var Jx=class extends Xt{static{u(this,"IncludeElement")}};$e.IncludeElement=Jx;var Yx=class extends Xt{static{u(this,"ImportElement")}};$e.ImportElement=Yx;var $X={all:Hx,any:C2,binding:$x,body:I2,choice:Ud,complexContent:jx,complexType:T2,definitions:zx,documentation:$_,element:Mx,enumeration:G_,extension:N2,fault:Xt,import:Yx,include:Jx,input:K_,message:Kx,operation:z_,output:X_,port:Y_,portType:Gx,restriction:b2,schema:Fd,sequence:Md,service:Wx,simpleContent:qx,simpleType:x2,types:Xx,attribute:Zs};function Lr(r){let e={};for(let t of r)e[t.replace(/^_/,"")]=$X[t]||Xt;return e}u(Lr,"buildAllowedChildren");function Oo(r,...e){for(let t of e)if(t?.[r])return t[r]}u(Oo,"findNs")});var eb=ue(Jn=>{"use strict";var WX=Jn&&Jn.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),zX=Jn&&Jn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),O2=Jn&&Jn.__importStar||(function(){var r=u(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"&&WX(t,e,n[s]);return zX(t,e),t}})(),JX=Jn&&Jn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WSDL=void 0;Jn.trim=Zx;Jn.open_wsdl=rP;var YX=st("assert"),QX=JX(Iy()),ZX=O2(st("fs")),Z_=Gn(),jd=O2(st("path")),D2=O2(M_()),eG=Xv(),tG=j_(),er=Gn(),pl=O2(Q_()),eP=(0,QX.default)("node-soap"),tP="http://www.w3.org/2001/XMLSchema-instance",rG="http://schemas.xmlsoap.org/soap/envelope/";function Zx(r){return r.trim()}u(Zx,"trim");function B2(r){return r&&r.charAt(r.length-1)!==":"?r+":":r}u(B2,"appendColon");function Qx(r){return r&&r.charAt(r.length-1)===":"?r.substring(0,r.length-1):r}u(Qx,"noColonNameSpace");var R2=class{static{u(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,er.stripBom)(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 o=this.services=this.definitions.services;if(o)for(a in o)o[a].postProcess(this.definitions);let l=this.definitions.complexTypes;if(l)for(a in l)l[a].deleteFixedAttrs();let c=this.definitions.bindings;for(let f in c){let p=c[f];typeof p.style>"u"&&(p.style="document");let d=p.methods,g=p.topElements={};for(let m in d)if((d[m].style||p.style)==="document"&&d[m].input){let v=d[m].input.$name,y="";d[m].output&&(y=d[m].output.$name),g[v]={methodName:m,outputName:y}}}this.xmlnsInEnvelope=this._xmlnsMap(),this.callback(i,this)}catch(o){this.callback(o)}})})}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=D2.createStream(!0,null);return e.pipe(t),t}xmlToObject(e,t){let n=typeof t=="function"?{}:D2.parser(!0,null),s=null,i={},o=[{name:null,object:i,schema:{Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}}}],l=new Map,c="soap",f={},p={};if(n.onopentag=g=>{let m=g.name,v=g.attributes,y=(0,er.splitQName)(m).name,S,C=o[o.length-1],w=C.schema,E={},A=!1,b=!1,V={},I=y;if(v.href){let F=v.href.substr(1);p[F]||(p[F]={hrefs:[],obj:null}),p[F].hrefs.push({par:C.object,key:y,obj:V})}v.id&&(p[v.id]||(p[v.id]={hrefs:[],obj:null}));for(S in v){let F=v[S];if(/^xmlns:|^xmlns$/.test(S)){let M=(0,er.splitQName)(S).name;f[M]=F,F===tP&&l.set(M,F),F===rG&&(c=M);continue}A=!0,E[S]=F}for(S in E){let F=(0,er.splitQName)(S);if(F.name==="nil"&&f[F.prefix]===tP&&E[S]&&(E[S].toLowerCase()==="true"||E[S]==="1")){b=!0;break}}if(A&&(V[this.options.attributesKey]=E),!s&&f[c]&&C.name==="Body"&&y!=="Fault"){let F=this.definitions.messages[y];if(!F)try{let M=!1;/Response$/.test(y)?y=y.replace(/Response$/,""):/Request$/.test(y)?(M=!0,y=y.replace(/Request$/,"")):/Solicit$/.test(y)&&(M=!0,y=y.replace(/Solicit$/,""));let se=this.definitions.portTypes,ee=Object.keys(se);for(let ie of ee){let X=se[ie];if(X.methods[y])try{M?y=X.methods[y].input.$name:y=X.methods[y].output.$name,F=this.definitions.messages[y];break}catch{throw new Error(`Failed to lookup message ${y} in methods`)}}if(!F)throw new Error(`Could not find message ${y}`);this.definitions.messages[I]=F}catch(M){this.options.returnFault&&n.onerror(M)}w=F.description(this.definitions),s=I}let D,U;for(let F of l.keys())if(`${F}:type`in E){U=E[`${F}:type`];break}if(U){let F=(0,er.splitQName)(U),M;F.prefix===er.TNS_PREFIX?M=f[F.prefix]||f.xmlns:M=f[F.prefix];let se=this.findSchemaObject(M,F.name);se&&(D=se.description(this.definitions))}w&&w[y+"[]"]&&(y=y+"[]"),o.push({name:I,object:V,schema:D||w&&w[y],id:v.id,nil:b})},n.onclosetag=g=>{let m=o.pop(),v=m.object,y=o[o.length-1],S=y.object,C=y.schema,w=(0,er.splitQName)(g).name;if(typeof m.schema=="string"&&(0,er.splitQName)(m.schema).name==="string"&&typeof v=="object"&&Object.keys(v).length===0&&(v=m.object=this.options.preserveWhitespace&&m.text||""),m.nil===!0)if(this.options.handleNilAsNull)v=null;else return;(0,Z_.isPlainObject)(v)&&!Object.keys(v).length&&(v=null),C&&C[w+"[]"]?(S[w]||(S[w]=[]),S[w].push(v)):w in S?(Array.isArray(S[w])||(S[w]=[S[w]]),S[w].push(v)):S[w]=v,m.id&&(p[m.id].obj=v)},n.oncdata=g=>{let m=g;if(g=Zx(g),!!g.length)if(/<\?xml[\s\S]+\?>/.test(g)){let v=o[o.length-1],y=this.xmlToObject(g);v.object[this.options.attributesKey]?v.object[this.options.valueKey]=y:v.object=y}else n.ontext(m)},n.onerror=g=>{throw n.resume(),{Fault:{faultcode:500,faultstring:"Invalid XML",detail:new Error(g).message,statusCode:500}}},n.ontext=g=>{let m=o[o.length-1],v=g;if(g=Zx(g),!g.length){this.options.preserveWhitespace&&(m.text=(m.text||"")+v);return}let y=(0,er.splitQName)(m.schema).name,S;this.options&&this.options.customDeserializer&&this.options.customDeserializer[y]?S=this.options.customDeserializer[y](g,m):y==="int"||y==="integer"||y==="short"||y==="long"?S=parseInt(g,10):y==="double"||y==="float"||y==="decimal"?S=Number(g):y==="bool"||y==="boolean"?S=g.toLowerCase()==="true"||g==="1":y==="dateTime"||y==="date"?S=new Date(g):(this.options.preserveWhitespace&&(g=v),typeof m.object!="string"?S=g:S=m.object+g),m.object[this.options.attributesKey]?m.object[this.options.valueKey]=S:m.object=S},typeof t=="function"){let g=D2.createStream(!0,null);g.on("opentag",n.onopentag),g.on("closetag",n.onclosetag),g.on("cdata",n.oncdata),g.on("text",n.ontext),e.pipe(g).on("error",m=>{t(m)}).on("end",()=>{let m;try{m=d()}catch(v){return t(v)}t(null,m)});return}return n.write(e).close(),d();function d(){for(let g in p){let m=p[g];for(let v of m.hrefs)Object.assign(v.obj,m.obj)}if(i.Envelope){let g=i.Envelope.Body;if(g&&g.Fault){let m=g.Fault,v=m.faultcode&&m.faultcode.$value,y=m.faultstring&&m.faultstring.$value,S=m.detail&&m.detail.$value;v=v||m.faultcode,y=y||m.faultstring,S=S||m.detail,v=v||m.Code&&`${m.Code.Value}: ${m.Code.Subcode&&m.Code.Subcode.Value}`,y=y||m.Reason&&m.Reason.Text.$value,y=y||m.Reason&&m.Reason.Text,S=S||m.Detail;let C=new Error(v+": "+y+(S?": "+JSON.stringify(S):""));throw C.root=i,C}return i.Envelope}return i}u(d,"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 o=i?this.findSchemaObject(s,i):null;return this.objectToXML(a,null,n,s,!0,null,o)}objectToRpcXML(e,t,n,s,i){let a=[],o=this.definitions,l="_xmlns";n=n||(0,er.findPrefix)(o.xmlns,s),s=s||o.xmlns[n],n=n===er.TNS_PREFIX?"":n+":",a.push(["<",n,e,">"].join(""));for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&c!==l){let f=t[c];if(c===this.options.xmlKey)a.push(this.objectToXML({[c]:f},null,n,s));else{let p=(i?"":n)+c,d=[];if(typeof f=="object"&&Object.prototype.hasOwnProperty.call(f,this.options.attributesKey)){let g=f[this.options.attributesKey];for(let m in g)d.push(" "+m+'="'+g[m]+'"')}a.push(["<",p].concat(d).concat(">").join("")),a.push(typeof f=="object"?this.objectToXML(f,c,n,s):(0,er.xmlEscape)(f)),a.push(["</",p,">"].join(""))}}return a.push(["</",n,e,">"].join("")),a.join("")}isIgnoredNameSpace(e){return this.options.ignoredNamespaces.indexOf(e)>-1}filterOutIgnoredNameSpace(e){let t=Qx(e);return this.isIgnoredNameSpace(t)?"":t}objectToXML(e,t,n,s,i,a,o,l){let c=this.definitions.schemas[s];if(this.options.overrideElementKey&&Object.keys(this.options.overrideElementKey).length>0)for(let w in this.options.overrideElementKey){let E=this.options.overrideElementKey[w];e&&e[w]&&(Object.defineProperty(e,E,Object.getOwnPropertyDescriptor(e,w)),delete e[w])}let f=n?n.parent:void 0;typeof f<"u"&&(n=n.current),f=Qx(f),this.isIgnoredNameSpace(f)&&(f="");let p=!c,d=c&&c.$elementFormDefault==="qualified",g=[],m=(n||d)&&n!==er.TNS_PREFIX,v="";s&&i&&(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes?this.options.overrideRootElement.xmlnsAttributes.forEach(w=>{v+=" "+w.name+'="'+w.value+'"'}):(m&&!this.isIgnoredNameSpace(n)&&(v+=" xmlns:"+n+'="'+s+'"'),(d||p)&&(v+=' xmlns="'+s+'"'))),l?l.pushContext():(l=new tG.NamespaceContext,l.declareNamespace(n,s)),a&&!(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes)&&(v=a);let y="";this.options.overrideRootElement&&i?y=this.options.overrideRootElement.namespace:m&&(d||i||p)&&!this.isIgnoredNameSpace(n)&&(y=n);let S,C;if(Array.isArray(e)){let w="",E=!1,A=/^([^:]+):([^:]+)$/.exec(t);for(A?(w=A[1],t=A[2]):t[0]===":"&&(E=!0,t=t.substr(1)),S=0,C=e.length;S<C;S++){let b=e[S],V=this.processAttributes(b,l),I=w||f||y,D=this.objectToXML(b,t,n,s,!1,null,o,l),U=["<",t,V,v];E||(U=["<",B2(I),t,V,v]),D===""&&this.options.useEmptyTag?(U.push(" />"),g.push(U.join(""))):(U.push(">"),(this.options.namespaceArrayElements||S===0)&&g.push(U.join("")),g.push(D),(this.options.namespaceArrayElements||S===C-1)&&(E?g.push(["</",t,">"].join("")):g.push(["</",B2(I),t,">"].join(""))))}}else if(typeof e=="object"){let w="";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,er.xmlEscape)(e[t]);let E=e[t];if(typeof E>"u")continue;let A=this.processAttributes(E,l),b="",V="",I=!1,D=/^([^:]+):([^:]+)$/.exec(t);if(D?(V=D[1]+":",t=D[2]):t[0]===":"&&(I=!0,t=t.substr(1)),i)b=this.objectToXML(E,t,n,s,!1,null,o,l);else if(this.definitions.schemas)if(c){let F=this.findChildSchemaObject(o,t);if(F&&(F.$type&&F.$type.indexOf("xsd:")===-1||F.$ref||F.$name)){let M="",se="",ee,ie="",X=F.$ref||F.$name;if(X){X=(0,er.splitQName)(X),se=X.name,X.prefix===er.TNS_PREFIX?(ee=F.$targetNamespace,M=l.registerNamespace(ee),this.isIgnoredNameSpace(M)&&(M=n)):(M=X.prefix,this.isIgnoredNameSpace(M)&&(M=n),ee=c.xmlns[M]||this.definitions.xmlns[M]);let Ce=!1;F.$name&&F.targetNamespace===void 0&&(F.$form==="unqualified"?Ce=!0:F.$form==="qualified"?Ce=!1:Ce=c.$elementFormDefault!=="qualified"),Ce&&(M=""),ee&&M&&l.declareNamespace(M,ee)&&(ie=" xmlns:"+M+'="'+ee+'"',v.includes(M)||(w=ie,v+=ie))}let he;if(F.$type){let Ce=(0,er.splitQName)(F.$type),xe=F.$baseNameSpace||Ce.prefix,pe=c.xmlns[xe]||this.definitions.xmlns[xe];ee=pe,pe!=="http://www.w3.org/2001/XMLSchema"&&xe!==er.TNS_PREFIX&&l.addNamespace(xe,pe),he=this.findSchemaType(Ce.name,pe)||F}else he=this.findSchemaObject(ee,se)||F;F.$baseNameSpace&&this.options.ignoreBaseNameSpaces&&(M=n,ee=s),this.options.ignoreBaseNameSpaces&&(M="",ee=""),y=M,Array.isArray(E)?(M={current:M,parent:y},ie=ie&&ie.length?ie:w):ie=null,b=this.objectToXML(E,t,M,ee,!1,ie,he,l)}else e[this.options.attributesKey]&&e[this.options.attributesKey].xsi_type?(V=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(E,t,e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns,!1,null,null,l)):(Array.isArray(E)&&(I?t=":"+t:t=V+t),b=this.objectToXML(E,t,n,s,!1,null,null,l))}else b=this.objectToXML(E,t,n,s,!1,null,null,l);y=Qx(y),m&&!d&&i&&!this.options.overrideRootElement?y=n:this.isIgnoredNameSpace(y)&&(y="");let U=!b&&this.options.useEmptyTag;Array.isArray(E)||g.push(["<",I?"":B2(V||y),t,A,v,E===null?' xsi:nil="true"':"",U?" />":">"].join("")),U||(g.push(b),Array.isArray(E)||g.push(["</",I?"":B2(V||y),t,">"].join("")))}}else e!==void 0&&g.push(this.options.escapeXML?(0,er.xmlEscape)(e):e);return l.popContext(),g.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 o=a.type;a.prefix&&(o=`${a.prefix}:${o}`),n+=` xsi:type="${o}"`,a.xmlns&&(n+=` xmlns:${a.prefix}="${a.xmlns}"`)}else n+=` ${i}="${(0,er.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 c=e.$lookupTypes;for(i=0;i<c.length;i++){let f=c[i];if(f.$name===t){s=f;break}}}let o=e;if(o.$name===t&&o.name==="element"||o.$ref&&(a=(0,er.splitQName)(o.$ref),a.name===t))return o;let l;if(o.$type&&n.length===1){let c=(0,er.splitQName)(o.$type);c.prefix===er.TNS_PREFIX?l=e.$targetNamespace:l=this.definitions.xmlns[c.prefix];let f=this.findSchemaType(c.name,l);if(f)return this.findChildSchemaObject(f,t,n)}if(o.$base&&(!Array.isArray(o.children)||!o.children.length)){let c=(0,er.splitQName)(o.$base);l=e.$targetNamespace,c.prefix!==er.TNS_PREFIX&&(l=this.definitions.xmlns[c.prefix]);let f=this.findSchemaType(c.name,l);if(f)return this.findChildSchemaObject(f,t,n)}if(Array.isArray(o.children)&&o.children.length>0)for(let c of o.children){if(s=this.findChildSchemaObject(c,t,n),s)break;if(c.$base){let f=(0,er.splitQName)(c.$base),p=f.prefix===er.TNS_PREFIX?"":f.prefix;l=c.xmlns[f.prefix]||c.schemaXmlns[f.prefix];let d=this.findSchemaType(f.name,l);if(d&&(s=this.findChildSchemaObject(d,t,n),s)){s.$baseNameSpace=p;break}}}return!s&&o.$name===t?o: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;if(!/^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=jd.resolve(jd.dirname(this.uri),jd.parse(n.location).base):s=jd.resolve(jd.dirname(this.uri),n.location);else if(/^https?:/i.test(n.location))s=n.location;else try{s=new URL(n.location,this.uri||"").toString()}catch{s=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)}nG(s,i,(a,o)=>{if(a)return t(a);if(this._includesWsdl.push(o),o.definitions instanceof pl.DefinitionsElement)(0,Z_.mergeWith)(this.definitions,o.definitions,(l,c)=>l instanceof pl.SchemaElement?l.merge(c):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=D2.parser(!0,null),n=[],s=null,i=null,a=null,o=null,l=this.options;return t.onopentag=c=>{let f=c.name,p=c.attributes,d=n[n.length-1],g=(0,er.splitQName)(f).name;if(g==="schema"&&(o=p),d)try{d.startElement(n,f,p,l,o)}catch(m){if(this.options.strict)throw m;n.push(new pl.Element(f,p,l,o))}else if(g==="definitions")s=new pl.DefinitionsElement(f,p,l),n.push(s);else if(g==="schema")s=new pl.DefinitionsElement("definitions",{},{}),i=new pl.TypesElement("types",{},{}),a=new pl.SchemaElement(f,p,l),i.addChild(a),s.addChild(i),n.push(a);else throw g==="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=c=>{let f=n[n.length-1];(0,YX.ok)(f,"Unmatched close tag: "+c),f.endElement(n,c)},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===er.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}};Jn.WSDL=R2;function nG(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):rP(r,n,s)}u(nG,"open_wsdl_recursive");function rP(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,o=n.wsdl_options,l;return/^<\?xml[^>]*?>/i.test(r)?(l=new R2(r,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):/^https?:/i.test(r)?(eP("Reading url: %s",r),(n.httpClient||new eG.HttpClient(n)).request(r,null,(f,p,d)=>{f?s(f):p&&p.status===200?(l=new R2(d,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):s(new Error("Invalid WSDL URL: "+r+`
63
+ `?(N.line++,N.column=0):N.column++);N.cdata+=R.substring(et,J-1),$==="]"&&(N.state=D.CDATA_ENDING);continue;case D.CDATA_ENDING:$==="]"?N.state=D.CDATA_ENDING_2:(N.cdata+="]"+$,N.state=D.CDATA);continue;case D.CDATA_ENDING_2:$===">"?(N.cdata&&X(N,"oncdata",N.cdata),X(N,"onclosecdata"),N.cdata="",N.state=D.TEXT):$==="]"?N.cdata+="]":(N.cdata+="]]"+$,N.state=D.CDATA);continue;case D.PROC_INST:$==="?"?N.state=D.PROC_INST_ENDING:E($)?N.state=D.PROC_INST_BODY:N.procInstName+=$;continue;case D.PROC_INST_BODY:if(!N.procInstBody&&E($))continue;$==="?"?N.state=D.PROC_INST_ENDING:N.procInstBody+=$;continue;case D.PROC_INST_ENDING:if($===">"){let Er={name:N.procInstName,body:N.procInstBody};ie(N,Er),X(N,"onprocessinginstruction",Er),N.procInstName=N.procInstBody="",N.state=D.TEXT}else N.procInstBody+="?"+$,N.state=D.PROC_INST_BODY;continue;case D.OPEN_TAG:V(S,$)?N.tagName+=$:(fe(N),$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:(E($)||W(N,"Invalid character in tag name"),N.state=D.ATTRIB));continue;case D.OPEN_TAG_SLASH:$===">"?(Le(N,!0),O(N)):(W(N,"Forward-slash in opening tag not followed by >"),N.state=D.ATTRIB);continue;case D.ATTRIB:if(E($))continue;$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:V(y,$)?(N.attribName=$,N.attribValue="",N.state=D.ATTRIB_NAME):W(N,"Invalid attribute name");continue;case D.ATTRIB_NAME:$==="="?N.state=D.ATTRIB_VALUE:$===">"?(W(N,"Attribute without value"),N.attribValue=N.attribName,Ve(N),Le(N)):E($)?N.state=D.ATTRIB_NAME_SAW_WHITE:V(S,$)?N.attribName+=$:W(N,"Invalid attribute name");continue;case D.ATTRIB_NAME_SAW_WHITE:if($==="=")N.state=D.ATTRIB_VALUE;else{if(E($))continue;W(N,"Attribute without value"),N.tag.attributes[N.attribName]="",N.attribValue="",X(N,"onattribute",{name:N.attribName,value:""}),N.attribName="",$===">"?Le(N):V(y,$)?(N.attribName=$,N.state=D.ATTRIB_NAME):(W(N,"Invalid attribute name"),N.state=D.ATTRIB)}continue;case D.ATTRIB_VALUE:if(E($))continue;A($)?(N.q=$,N.state=D.ATTRIB_VALUE_QUOTED):(N.opt.unquotedAttributeValues||xe(N,"Unquoted attribute value"),N.state=D.ATTRIB_VALUE_UNQUOTED,N.attribValue=$);continue;case D.ATTRIB_VALUE_QUOTED:if($!==N.q){$==="&"?N.state=D.ATTRIB_VALUE_ENTITY_Q:N.attribValue+=$;continue}Ve(N),N.q="",N.state=D.ATTRIB_VALUE_CLOSED;continue;case D.ATTRIB_VALUE_CLOSED:E($)?N.state=D.ATTRIB:$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:V(y,$)?(W(N,"No whitespace between attributes"),N.attribName=$,N.attribValue="",N.state=D.ATTRIB_NAME):W(N,"Invalid attribute name");continue;case D.ATTRIB_VALUE_UNQUOTED:if(!b($)){$==="&"?N.state=D.ATTRIB_VALUE_ENTITY_U:N.attribValue+=$;continue}Ve(N),$===">"?Le(N):N.state=D.ATTRIB;continue;case D.CLOSE_TAG:if(N.tagName)$===">"?O(N):V(S,$)?N.tagName+=$:N.script?(N.script+="</"+N.tagName+$,N.tagName="",N.state=D.SCRIPT):(E($)||W(N,"Invalid tagname in closing tag"),N.state=D.CLOSE_TAG_SAW_WHITE);else{if(E($))continue;I(y,$)?N.script?(N.script+="</"+$,N.state=D.SCRIPT):W(N,"Invalid tagname in closing tag."):N.tagName=$}continue;case D.CLOSE_TAG_SAW_WHITE:if(E($))continue;$===">"?O(N):W(N,"Invalid characters in closing tag");continue;case D.TEXT_ENTITY:case D.ATTRIB_VALUE_ENTITY_Q:case D.ATTRIB_VALUE_ENTITY_U:var Gt,Be;switch(N.state){case D.TEXT_ENTITY:Gt=D.TEXT,Be="textNode";break;case D.ATTRIB_VALUE_ENTITY_Q:Gt=D.ATTRIB_VALUE_QUOTED,Be="attribValue";break;case D.ATTRIB_VALUE_ENTITY_U:Gt=D.ATTRIB_VALUE_UNQUOTED,Be="attribValue";break}if($===";"){var ar=B(N);N.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes(ar)?((N.entityCount+=1)>N.opt.maxEntityCount&&xe(N,"Parsed entity count exceeds max entity count"),(N.entityDepth+=1)>N.opt.maxEntityDepth&&xe(N,"Parsed entity depth exceeds max entity depth"),N.entity="",N.state=Gt,N.write(ar),N.entityDepth-=1):(N[Be]+=ar,N.entity="",N.state=Gt)}else V(N.entity.length?w:C,$)?N.entity+=$:(W(N,"Invalid character in entity name"),N[Be]+="&"+N.entity+$,N.entity="",N.state=Gt);continue;default:throw new Error(N,"Unknown state: "+N.state)}return N.position>=N.bufferCheckPosition&&n(N),N}u(_e,"write");String.fromCodePoint||(function(){var R=String.fromCharCode,N=Math.floor,J=u(function(){var $=16384,ge=[],et,Gt,Be=-1,ar=arguments.length;if(!ar)return"";for(var Er="";++Be<ar;){var Jt=Number(arguments[Be]);if(!isFinite(Jt)||Jt<0||Jt>1114111||N(Jt)!==Jt)throw RangeError("Invalid code point: "+Jt);Jt<=65535?ge.push(Jt):(Jt-=65536,et=(Jt>>10)+55296,Gt=Jt%1024+56320,ge.push(et,Gt)),(Be+1===ar||ge.length>$)&&(Er+=R.apply(null,ge),ge.length=0)}return Er},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:J,configurable:!0,writable:!0}):String.fromCodePoint=J})()})(typeof w2>"u"?w2.sax={}:w2)});var j_=ue(S2=>{"use strict";Object.defineProperty(S2,"__esModule",{value:!0});S2.NamespaceContext=void 0;var qX=class{static{u(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}}},HX=class{static{u(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 qX(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}};S2.NamespaceContext=HX});var Q_=ue($e=>{"use strict";var KX=$e&&$e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($e,"__esModule",{value:!0});$e.ImportElement=$e.IncludeElement=$e.BodyElement=$e.DefinitionsElement=$e.ServiceElement=$e.PortElement=$e.BindingElement=$e.PortTypeElement=$e.OperationElement=$e.TypesElement=$e.SchemaElement=$e.DocumentationElement=$e.MessageElement=$e.AllElement=$e.AttributeElement=$e.SequenceElement=$e.SimpleContentElement=$e.ComplexContentElement=$e.ComplexTypeElement=$e.EnumerationElement=$e.ChoiceElement=$e.ExtensionElement=$e.RestrictionElement=$e.SimpleTypeElement=$e.OutputElement=$e.InputElement=$e.AnyElement=$e.ElementElement=$e.UnexpectedElement=$e.Element=void 0;var Ux=st("assert"),XX=KX(Iy()),lr=Gn(),GX=(0,XX.default)("node-soap"),A2={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},Xt=class{static{u(this,"Element")}constructor(e,t,n,s){this.allowedChildren={},this.children=[];let i=(0,lr.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 o=/^xmlns:?(.*)$/.exec(a);o?this.xmlns[o[1]?o[1]:lr.TNS_PREFIX]=t[a]:a==="value"?this[this.valueKey]=t[a]:this["$"+a]=t[a]}for(let a in s){let o=/^xmlns:?(.*)$/.exec(a);o&&o[1]&&(this.schemaXmlns[o[1]]=s[a])}this.$targetNamespace!==void 0&&(this.xmlns[lr.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,lr.splitQName)(t).name];if(a==null&&!this.strict&&(a=q_),a){let o=new a(t,n,s,i);o.init();let l=e[0];l instanceof zx&&(o.definitionsXmlns=l.xmlns),e.push(o)}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]&&((0,lr.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)}};$e.Element=Xt;var q_=class H_ extends Xt{static{u(this,"UnexpectedElement")}startElement(e,t,n,s,i){let a=new H_(t,n,s,i);a.init(),e.push(a)}};$e.UnexpectedElement=q_;var Mx=class extends Xt{static{u(this,"ElementElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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 o=a>1;o&&s&&(s+="[]"),t&&t[lr.TNS_PREFIX]&&(this.$targetNamespace=t[lr.TNS_PREFIX]);let l=this.$type||this.$ref;if(l){l=(0,lr.splitQName)(l);let c=l.name,f=!!Oo(l.prefix,this.definitionsXmlns,e.xmlns)||!!Oo(this.targetNSAlias,this.definitionsXmlns,e.xmlns)||this.forceUseSchemaXmlns,p=Oo(l.prefix,t,this.xmlns,f?this.schemaXmlns:void 0,this.definitionsXmlns,e.xmlns),d=e.schemas[p],g=d&&(this.$type?d.complexTypes[c]||d.types[c]:d.elements[c]),m=this.$type?e.descriptions.types:e.descriptions.elements,v=p?`${p}::${c}`:c;if(p&&e.schemas[p]&&(t=e.schemas[p].xmlns),g&&!(c in A2))if(v in m)if(this.$ref)if(o){let y=c+"[]",S=p?`${p}::${y}`:y;m[S]=m[v],n[y]=m[S]}else n=m[v];else n[s]=m[v];else{let y={};m[v]=y,o&&"maxOccurs"in g&&(g.maxOccurs=this.$maxOccurs),this.$minOccurs&&"minOccurs"in g&&(g.minOccurs=this.$minOccurs);let S=g.description(e,t);if(typeof S=="string")y=S;else{Object.keys(S).forEach(w=>{y[w]=S[w]});let C=S[Zs.Symbol];C&&(y[Zs.Symbol]=C)}this.$ref?n=y:n[s]=y,typeof y=="object"&&(y.targetNSAlias=l.prefix,y.targetNamespace=p),m[v]=y}else n[s]=this.$type}else{let c=this.children;n[s]={};for(let f of c)(f instanceof T2||f instanceof x2)&&(n[s]=f.description(e,t))}return n}};$e.ElementElement=Mx;var C2=class extends Xt{static{u(this,"AnyElement")}};$e.AnyElement=C2;var K_=class extends Xt{static{u(this,"InputElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof I2&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};$e.InputElement=K_;var X_=class extends Xt{static{u(this,"OutputElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof I2&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};$e.OutputElement=X_;var x2=class extends Xt{static{u(this,"SimpleTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["restriction"])}description(e){for(let t of this.children)if(t instanceof b2)return[this.$name,t.description()].filter(Boolean).join("|");return{}}};$e.SimpleTypeElement=x2;var b2=class extends Xt{static{u(this,"RestrictionElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","choice","enumeration","sequence","attribute"])}description(e,t){let n=this.children,s,i=!1,a={};for(let l of n){if(l instanceof Zs){a[l.$name]=l.description(e);continue}!i&&(l instanceof Md||l instanceof Ud)&&(i=!0,s=l.description(e,t))}if(Object.keys(a).length>0&&(s=s??{},s[Zs.Symbol]=a),s&&this.$base){let l=(0,lr.splitQName)(this.$base),c=l.name,f=Oo(l.prefix,t,this.definitionsXmlns,e.xmlns),p=e.schemas[f],d=p&&(p.complexTypes[c]||p.types[c]||p.elements[c]);if(s.getBase=()=>d.description(e,p.xmlns),d){let g=d.description(e,p.xmlns);g[Zs.Symbol]&&(0,lr.defaults)(a,g[Zs.Symbol]),s=(0,lr.defaults)(s,g)}return s}let o=this.children.map(l=>l.description()).join(",");return[this.$base,o].filter(Boolean).join("|")}};$e.RestrictionElement=b2;var N2=class extends Xt{static{u(this,"ExtensionElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","choice","sequence"])}description(e,t){let n={};for(let s of this.children)(s instanceof Md||s instanceof Ud)&&(n=s.description(e,t));if(this.$base){let s=(0,lr.splitQName)(this.$base),i=s.name,a=Oo(s.prefix,t,this.definitionsXmlns,e.xmlns),o=e.schemas[a];if(i in A2)return this.$base;{let l=o&&(o.complexTypes[i]||o.types[i]||o.elements[i]);if(l){let c=l.description(e,o.xmlns);n=typeof c=="string"?c:(0,lr.defaults)(c,n)}}}return n}};$e.ExtensionElement=N2;var Ud=class extends Xt{static{u(this,"ChoiceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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}};$e.ChoiceElement=Ud;var G_=class extends Xt{static{u(this,"EnumerationElement")}description(){return this[this.valueKey]}};$e.EnumerationElement=G_;var T2=class extends Xt{static{u(this,"ComplexTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","annotation","choice","complexContent","sequence","simpleContent","attribute"])}description(e,t){let n={},s=!1,i={},a=this.children||[];for(let o of a){if(o instanceof Zs){i[o.$name]=o.description(e);continue}!s&&(o instanceof Ud||o instanceof Md||o instanceof Hx||o instanceof qx||o instanceof jx)&&(s=!0,n=o.description(e,t))}return Object.keys(i).length>0&&(n[Zs.Symbol]=i),n}};$e.ComplexTypeElement=T2;var jx=class extends Xt{static{u(this,"ComplexContentElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["extension","restriction"])}description(e,t){for(let n of this.children)if(n instanceof N2||n instanceof b2)return n.description(e,t);return{}}};$e.ComplexContentElement=jx;var qx=class extends Xt{static{u(this,"SimpleContentElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["extension"])}description(e,t){for(let n of this.children)if(n instanceof N2)return n.description(e,t);return{}}};$e.SimpleContentElement=qx;var Md=class extends Xt{static{u(this,"SequenceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){if(s instanceof C2)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};$e.SequenceElement=Md;var Zs=class extends Xt{static{u(this,"AttributeElement")}description(e){return{type:this.$type,required:this.$use==="required"}}};$e.AttributeElement=Zs;Zs.Symbol=Symbol("$attributes");var Hx=class extends Xt{static{u(this,"AllElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["choice","element"])}description(e,t){let n={};for(let s of this.children){if(s instanceof C2)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};$e.AllElement=Hx;var Kx=class extends Xt{static{u(this,"MessageElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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,lr.splitQName)(t.$element),a=Oo(i.prefix,this.definitionsXmlns,e.xmlns),o=e.schemas[a];if(this.element=o.elements[i.name],!this.element){GX(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 c of l)s.push(this._getNestedLookupTypeString(c));if(s.length>0){s=s.join("_").split("_").filter(u(function(p){return p!=="^"},"removeEmptyLookupTypes"));let c=e.schemas[this.element.targetNamespace].xmlns;for(let f=0;f<s.length;f++)s[f]=this._createLookupTypeObject(s[f],c)}if(this.element.$lookupTypes=s,this.element.$type){let c=(0,lr.splitQName)(this.element.$type),f=Oo(c.prefix,o.xmlns,this.definitionsXmlns,e.xmlns);if(f&&!(c.name in A2)){o=e.schemas[f];let p=o.complexTypes[c.name]||o.types[c.name]||o.elements[c.name];p&&(this.parts=p.description(e,o.xmlns))}}else{let c=this.element.description(e,o.xmlns);this.parts=c[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,Ux.ok)(i.name==="part","Expected part element");let a=(0,lr.splitQName)(i.$type),o=Oo(a.prefix,this.definitionsXmlns,e.xmlns),l=a.name;typeof e.schemas[o]<"u"?this.parts[i.$name]=e.schemas[o].types[l]||e.schemas[o].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=o),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,lr.splitQName)(e),s=n.prefix,i=n.name.split("#"),a=i[0],o=i[1];return{$namespace:t[s],$type:s+":"+a,$name:o}}_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}};$e.MessageElement=Kx;var $_=class extends Xt{static{u(this,"DocumentationElement")}};$e.DocumentationElement=$_;var Fd=class W_ extends Xt{static{u(this,"SchemaElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["complexType","element","import","include","simpleType"]),this.complexTypes={},this.types={},this.elements={},this.includes=[]}merge(e){return(0,Ux.ok)(e instanceof W_),(0,lr.merge)(this.complexTypes,e.complexTypes),(0,lr.merge)(this.types,e.types),(0,lr.merge)(this.elements,e.elements),(0,lr.merge)(this.xmlns,e.xmlns),(0,lr.merge)(this,(0,lr.pickBy)(e,(t,n)=>n.startsWith("$")&&!Object.hasOwnProperty.call(this,n))),this}addChild(e){if(!(e.$name in A2)){if(e instanceof Jx||e instanceof Yx){let t=e.$schemaLocation||e.$location;t&&this.includes.push({namespace:e.$namespace||e.$targetNamespace||this.$targetNamespace,location:t})}else e instanceof T2?this.complexTypes[e.$name]=e:e instanceof Mx?this.elements[e.$name]=e:e instanceof x2&&(this.types[e.$name]=e);this.children.pop()}}};$e.SchemaElement=Fd;var Xx=class extends Xt{static{u(this,"TypesElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["documentation","schema"]),this.schemas={}}addChild(e){(0,Ux.ok)(e instanceof Fd);let t=e.includes.find(i=>Object.hasOwnProperty.call(i,"namespace")),n=typeof t<"u"&&Object.hasOwnProperty.call(t,"namespace")&&e instanceof Fd?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}};$e.TypesElement=Xx;var z_=class J_ extends Xt{static{u(this,"OperationElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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 J_&&(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,lr.splitQName)(i.$message).name,o=e.messages[a];o&&(o.postProcess(e),o.element?(e.messages[o.element.$name]=o,this[i.name]=o.element):this[i.name]=o,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]]}}};$e.OperationElement=z_;var Gx=class extends Xt{static{u(this,"PortTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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}};$e.PortTypeElement=Gx;var $x=class extends Xt{static{u(this,"BindingElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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,lr.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 o=i[a];if(o.name!=="operation")continue;o.postProcess(e,"binding"),i.splice(a--,1),o.style||(o.style=s);let l=this.methods[o.$name];l&&(l.style=o.style,l.soapAction=o.soapAction,l.inputSoap=o.input||null,l.outputSoap=o.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}};$e.BindingElement=$x;var Y_=class extends Xt{static{u(this,"PortElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["address","documentation"]),this.location=null}addChild(e){e.name==="address"&&typeof e.$location<"u"&&(this.location=e.$location)}};$e.PortElement=Y_;var Wx=class extends Xt{static{u(this,"ServiceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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,lr.splitQName)(i.$binding).name,o=n[a];o&&(o.postProcess(e),this.ports[i.$name]={location:i.location,binding:o},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}};$e.ServiceElement=Wx;var zx=class extends Xt{static{u(this,"DefinitionsElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["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 Xx)(0,lr.merge)(this.schemas,e.schemas);else if(e instanceof Kx)this.messages[e.$name]=e;else if(e.name==="import"){let t=new Fd(e.$namespace,{});t.init(),this.schemas[e.$namespace]=t,this.schemas[e.$namespace].addChild(e)}else e instanceof Gx?this.portTypes[e.$name]=e:e instanceof $x?(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 Wx&&(this.services[e.$name]=e);this.children.pop()}};$e.DefinitionsElement=zx;var I2=class extends Xt{static{u(this,"BodyElement")}};$e.BodyElement=I2;var Jx=class extends Xt{static{u(this,"IncludeElement")}};$e.IncludeElement=Jx;var Yx=class extends Xt{static{u(this,"ImportElement")}};$e.ImportElement=Yx;var $X={all:Hx,any:C2,binding:$x,body:I2,choice:Ud,complexContent:jx,complexType:T2,definitions:zx,documentation:$_,element:Mx,enumeration:G_,extension:N2,fault:Xt,import:Yx,include:Jx,input:K_,message:Kx,operation:z_,output:X_,port:Y_,portType:Gx,restriction:b2,schema:Fd,sequence:Md,service:Wx,simpleContent:qx,simpleType:x2,types:Xx,attribute:Zs};function Lr(r){let e={};for(let t of r)e[t.replace(/^_/,"")]=$X[t]||Xt;return e}u(Lr,"buildAllowedChildren");function Oo(r,...e){for(let t of e)if(t?.[r])return t[r]}u(Oo,"findNs")});var eb=ue(Jn=>{"use strict";var WX=Jn&&Jn.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),zX=Jn&&Jn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),O2=Jn&&Jn.__importStar||(function(){var r=u(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"&&WX(t,e,n[s]);return zX(t,e),t}})(),JX=Jn&&Jn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WSDL=void 0;Jn.trim=Zx;Jn.open_wsdl=rP;var YX=st("assert"),QX=JX(Iy()),ZX=O2(st("fs")),Z_=Gn(),jd=O2(st("path")),D2=O2(M_()),eG=Xv(),tG=j_(),tr=Gn(),pl=O2(Q_()),eP=(0,QX.default)("node-soap"),tP="http://www.w3.org/2001/XMLSchema-instance",rG="http://schemas.xmlsoap.org/soap/envelope/";function Zx(r){return r.trim()}u(Zx,"trim");function B2(r){return r&&r.charAt(r.length-1)!==":"?r+":":r}u(B2,"appendColon");function Qx(r){return r&&r.charAt(r.length-1)===":"?r.substring(0,r.length-1):r}u(Qx,"noColonNameSpace");var R2=class{static{u(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,tr.stripBom)(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 o=this.services=this.definitions.services;if(o)for(a in o)o[a].postProcess(this.definitions);let l=this.definitions.complexTypes;if(l)for(a in l)l[a].deleteFixedAttrs();let c=this.definitions.bindings;for(let f in c){let p=c[f];typeof p.style>"u"&&(p.style="document");let d=p.methods,g=p.topElements={};for(let m in d)if((d[m].style||p.style)==="document"&&d[m].input){let v=d[m].input.$name,y="";d[m].output&&(y=d[m].output.$name),g[v]={methodName:m,outputName:y}}}this.xmlnsInEnvelope=this._xmlnsMap(),this.callback(i,this)}catch(o){this.callback(o)}})})}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=D2.createStream(!0,null);return e.pipe(t),t}xmlToObject(e,t){let n=typeof t=="function"?{}:D2.parser(!0,null),s=null,i={},o=[{name:null,object:i,schema:{Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}}}],l=new Map,c="soap",f={},p={};if(n.onopentag=g=>{let m=g.name,v=g.attributes,y=(0,tr.splitQName)(m).name,S,C=o[o.length-1],w=C.schema,E={},A=!1,b=!1,V={},I=y;if(v.href){let F=v.href.substr(1);p[F]||(p[F]={hrefs:[],obj:null}),p[F].hrefs.push({par:C.object,key:y,obj:V})}v.id&&(p[v.id]||(p[v.id]={hrefs:[],obj:null}));for(S in v){let F=v[S];if(/^xmlns:|^xmlns$/.test(S)){let M=(0,tr.splitQName)(S).name;f[M]=F,F===tP&&l.set(M,F),F===rG&&(c=M);continue}A=!0,E[S]=F}for(S in E){let F=(0,tr.splitQName)(S);if(F.name==="nil"&&f[F.prefix]===tP&&E[S]&&(E[S].toLowerCase()==="true"||E[S]==="1")){b=!0;break}}if(A&&(V[this.options.attributesKey]=E),!s&&f[c]&&C.name==="Body"&&y!=="Fault"){let F=this.definitions.messages[y];if(!F)try{let M=!1;/Response$/.test(y)?y=y.replace(/Response$/,""):/Request$/.test(y)?(M=!0,y=y.replace(/Request$/,"")):/Solicit$/.test(y)&&(M=!0,y=y.replace(/Solicit$/,""));let se=this.definitions.portTypes,ee=Object.keys(se);for(let ie of ee){let X=se[ie];if(X.methods[y])try{M?y=X.methods[y].input.$name:y=X.methods[y].output.$name,F=this.definitions.messages[y];break}catch{throw new Error(`Failed to lookup message ${y} in methods`)}}if(!F)throw new Error(`Could not find message ${y}`);this.definitions.messages[I]=F}catch(M){this.options.returnFault&&n.onerror(M)}w=F.description(this.definitions),s=I}let D,U;for(let F of l.keys())if(`${F}:type`in E){U=E[`${F}:type`];break}if(U){let F=(0,tr.splitQName)(U),M;F.prefix===tr.TNS_PREFIX?M=f[F.prefix]||f.xmlns:M=f[F.prefix];let se=this.findSchemaObject(M,F.name);se&&(D=se.description(this.definitions))}w&&w[y+"[]"]&&(y=y+"[]"),o.push({name:I,object:V,schema:D||w&&w[y],id:v.id,nil:b})},n.onclosetag=g=>{let m=o.pop(),v=m.object,y=o[o.length-1],S=y.object,C=y.schema,w=(0,tr.splitQName)(g).name;if(typeof m.schema=="string"&&(0,tr.splitQName)(m.schema).name==="string"&&typeof v=="object"&&Object.keys(v).length===0&&(v=m.object=this.options.preserveWhitespace&&m.text||""),m.nil===!0)if(this.options.handleNilAsNull)v=null;else return;(0,Z_.isPlainObject)(v)&&!Object.keys(v).length&&(v=null),C&&C[w+"[]"]?(S[w]||(S[w]=[]),S[w].push(v)):w in S?(Array.isArray(S[w])||(S[w]=[S[w]]),S[w].push(v)):S[w]=v,m.id&&(p[m.id].obj=v)},n.oncdata=g=>{let m=g;if(g=Zx(g),!!g.length)if(/<\?xml[\s\S]+\?>/.test(g)){let v=o[o.length-1],y=this.xmlToObject(g);v.object[this.options.attributesKey]?v.object[this.options.valueKey]=y:v.object=y}else n.ontext(m)},n.onerror=g=>{throw n.resume(),{Fault:{faultcode:500,faultstring:"Invalid XML",detail:new Error(g).message,statusCode:500}}},n.ontext=g=>{let m=o[o.length-1],v=g;if(g=Zx(g),!g.length){this.options.preserveWhitespace&&(m.text=(m.text||"")+v);return}let y=(0,tr.splitQName)(m.schema).name,S;this.options&&this.options.customDeserializer&&this.options.customDeserializer[y]?S=this.options.customDeserializer[y](g,m):y==="int"||y==="integer"||y==="short"||y==="long"?S=parseInt(g,10):y==="double"||y==="float"||y==="decimal"?S=Number(g):y==="bool"||y==="boolean"?S=g.toLowerCase()==="true"||g==="1":y==="dateTime"||y==="date"?S=new Date(g):(this.options.preserveWhitespace&&(g=v),typeof m.object!="string"?S=g:S=m.object+g),m.object[this.options.attributesKey]?m.object[this.options.valueKey]=S:m.object=S},typeof t=="function"){let g=D2.createStream(!0,null);g.on("opentag",n.onopentag),g.on("closetag",n.onclosetag),g.on("cdata",n.oncdata),g.on("text",n.ontext),e.pipe(g).on("error",m=>{t(m)}).on("end",()=>{let m;try{m=d()}catch(v){return t(v)}t(null,m)});return}return n.write(e).close(),d();function d(){for(let g in p){let m=p[g];for(let v of m.hrefs)Object.assign(v.obj,m.obj)}if(i.Envelope){let g=i.Envelope.Body;if(g&&g.Fault){let m=g.Fault,v=m.faultcode&&m.faultcode.$value,y=m.faultstring&&m.faultstring.$value,S=m.detail&&m.detail.$value;v=v||m.faultcode,y=y||m.faultstring,S=S||m.detail,v=v||m.Code&&`${m.Code.Value}: ${m.Code.Subcode&&m.Code.Subcode.Value}`,y=y||m.Reason&&m.Reason.Text.$value,y=y||m.Reason&&m.Reason.Text,S=S||m.Detail;let C=new Error(v+": "+y+(S?": "+JSON.stringify(S):""));throw C.root=i,C}return i.Envelope}return i}u(d,"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 o=i?this.findSchemaObject(s,i):null;return this.objectToXML(a,null,n,s,!0,null,o)}objectToRpcXML(e,t,n,s,i){let a=[],o=this.definitions,l="_xmlns";n=n||(0,tr.findPrefix)(o.xmlns,s),s=s||o.xmlns[n],n=n===tr.TNS_PREFIX?"":n+":",a.push(["<",n,e,">"].join(""));for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&c!==l){let f=t[c];if(c===this.options.xmlKey)a.push(this.objectToXML({[c]:f},null,n,s));else{let p=(i?"":n)+c,d=[];if(typeof f=="object"&&Object.prototype.hasOwnProperty.call(f,this.options.attributesKey)){let g=f[this.options.attributesKey];for(let m in g)d.push(" "+m+'="'+g[m]+'"')}a.push(["<",p].concat(d).concat(">").join("")),a.push(typeof f=="object"?this.objectToXML(f,c,n,s):(0,tr.xmlEscape)(f)),a.push(["</",p,">"].join(""))}}return a.push(["</",n,e,">"].join("")),a.join("")}isIgnoredNameSpace(e){return this.options.ignoredNamespaces.indexOf(e)>-1}filterOutIgnoredNameSpace(e){let t=Qx(e);return this.isIgnoredNameSpace(t)?"":t}objectToXML(e,t,n,s,i,a,o,l){let c=this.definitions.schemas[s];if(this.options.overrideElementKey&&Object.keys(this.options.overrideElementKey).length>0)for(let w in this.options.overrideElementKey){let E=this.options.overrideElementKey[w];e&&e[w]&&(Object.defineProperty(e,E,Object.getOwnPropertyDescriptor(e,w)),delete e[w])}let f=n?n.parent:void 0;typeof f<"u"&&(n=n.current),f=Qx(f),this.isIgnoredNameSpace(f)&&(f="");let p=!c,d=c&&c.$elementFormDefault==="qualified",g=[],m=(n||d)&&n!==tr.TNS_PREFIX,v="";s&&i&&(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes?this.options.overrideRootElement.xmlnsAttributes.forEach(w=>{v+=" "+w.name+'="'+w.value+'"'}):(m&&!this.isIgnoredNameSpace(n)&&(v+=" xmlns:"+n+'="'+s+'"'),(d||p)&&(v+=' xmlns="'+s+'"'))),l?l.pushContext():(l=new tG.NamespaceContext,l.declareNamespace(n,s)),a&&!(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes)&&(v=a);let y="";this.options.overrideRootElement&&i?y=this.options.overrideRootElement.namespace:m&&(d||i||p)&&!this.isIgnoredNameSpace(n)&&(y=n);let S,C;if(Array.isArray(e)){let w="",E=!1,A=/^([^:]+):([^:]+)$/.exec(t);for(A?(w=A[1],t=A[2]):t[0]===":"&&(E=!0,t=t.substr(1)),S=0,C=e.length;S<C;S++){let b=e[S],V=this.processAttributes(b,l),I=w||f||y,D=this.objectToXML(b,t,n,s,!1,null,o,l),U=["<",t,V,v];E||(U=["<",B2(I),t,V,v]),D===""&&this.options.useEmptyTag?(U.push(" />"),g.push(U.join(""))):(U.push(">"),(this.options.namespaceArrayElements||S===0)&&g.push(U.join("")),g.push(D),(this.options.namespaceArrayElements||S===C-1)&&(E?g.push(["</",t,">"].join("")):g.push(["</",B2(I),t,">"].join(""))))}}else if(typeof e=="object"){let w="";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,tr.xmlEscape)(e[t]);let E=e[t];if(typeof E>"u")continue;let A=this.processAttributes(E,l),b="",V="",I=!1,D=/^([^:]+):([^:]+)$/.exec(t);if(D?(V=D[1]+":",t=D[2]):t[0]===":"&&(I=!0,t=t.substr(1)),i)b=this.objectToXML(E,t,n,s,!1,null,o,l);else if(this.definitions.schemas)if(c){let F=this.findChildSchemaObject(o,t);if(F&&(F.$type&&F.$type.indexOf("xsd:")===-1||F.$ref||F.$name)){let M="",se="",ee,ie="",X=F.$ref||F.$name;if(X){X=(0,tr.splitQName)(X),se=X.name,X.prefix===tr.TNS_PREFIX?(ee=F.$targetNamespace,M=l.registerNamespace(ee),this.isIgnoredNameSpace(M)&&(M=n)):(M=X.prefix,this.isIgnoredNameSpace(M)&&(M=n),ee=c.xmlns[M]||this.definitions.xmlns[M]);let Ce=!1;F.$name&&F.targetNamespace===void 0&&(F.$form==="unqualified"?Ce=!0:F.$form==="qualified"?Ce=!1:Ce=c.$elementFormDefault!=="qualified"),Ce&&(M=""),ee&&M&&l.declareNamespace(M,ee)&&(ie=" xmlns:"+M+'="'+ee+'"',v.includes(M)||(w=ie,v+=ie))}let he;if(F.$type){let Ce=(0,tr.splitQName)(F.$type),xe=F.$baseNameSpace||Ce.prefix,pe=c.xmlns[xe]||this.definitions.xmlns[xe];ee=pe,pe!=="http://www.w3.org/2001/XMLSchema"&&xe!==tr.TNS_PREFIX&&l.addNamespace(xe,pe),he=this.findSchemaType(Ce.name,pe)||F}else he=this.findSchemaObject(ee,se)||F;F.$baseNameSpace&&this.options.ignoreBaseNameSpaces&&(M=n,ee=s),this.options.ignoreBaseNameSpaces&&(M="",ee=""),y=M,Array.isArray(E)?(M={current:M,parent:y},ie=ie&&ie.length?ie:w):ie=null,b=this.objectToXML(E,t,M,ee,!1,ie,he,l)}else e[this.options.attributesKey]&&e[this.options.attributesKey].xsi_type?(V=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(E,t,e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns,!1,null,null,l)):(Array.isArray(E)&&(I?t=":"+t:t=V+t),b=this.objectToXML(E,t,n,s,!1,null,null,l))}else b=this.objectToXML(E,t,n,s,!1,null,null,l);y=Qx(y),m&&!d&&i&&!this.options.overrideRootElement?y=n:this.isIgnoredNameSpace(y)&&(y="");let U=!b&&this.options.useEmptyTag;Array.isArray(E)||g.push(["<",I?"":B2(V||y),t,A,v,E===null?' xsi:nil="true"':"",U?" />":">"].join("")),U||(g.push(b),Array.isArray(E)||g.push(["</",I?"":B2(V||y),t,">"].join("")))}}else e!==void 0&&g.push(this.options.escapeXML?(0,tr.xmlEscape)(e):e);return l.popContext(),g.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 o=a.type;a.prefix&&(o=`${a.prefix}:${o}`),n+=` xsi:type="${o}"`,a.xmlns&&(n+=` xmlns:${a.prefix}="${a.xmlns}"`)}else n+=` ${i}="${(0,tr.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 c=e.$lookupTypes;for(i=0;i<c.length;i++){let f=c[i];if(f.$name===t){s=f;break}}}let o=e;if(o.$name===t&&o.name==="element"||o.$ref&&(a=(0,tr.splitQName)(o.$ref),a.name===t))return o;let l;if(o.$type&&n.length===1){let c=(0,tr.splitQName)(o.$type);c.prefix===tr.TNS_PREFIX?l=e.$targetNamespace:l=this.definitions.xmlns[c.prefix];let f=this.findSchemaType(c.name,l);if(f)return this.findChildSchemaObject(f,t,n)}if(o.$base&&(!Array.isArray(o.children)||!o.children.length)){let c=(0,tr.splitQName)(o.$base);l=e.$targetNamespace,c.prefix!==tr.TNS_PREFIX&&(l=this.definitions.xmlns[c.prefix]);let f=this.findSchemaType(c.name,l);if(f)return this.findChildSchemaObject(f,t,n)}if(Array.isArray(o.children)&&o.children.length>0)for(let c of o.children){if(s=this.findChildSchemaObject(c,t,n),s)break;if(c.$base){let f=(0,tr.splitQName)(c.$base),p=f.prefix===tr.TNS_PREFIX?"":f.prefix;l=c.xmlns[f.prefix]||c.schemaXmlns[f.prefix];let d=this.findSchemaType(f.name,l);if(d&&(s=this.findChildSchemaObject(d,t,n),s)){s.$baseNameSpace=p;break}}}return!s&&o.$name===t?o: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;if(!/^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=jd.resolve(jd.dirname(this.uri),jd.parse(n.location).base):s=jd.resolve(jd.dirname(this.uri),n.location);else if(/^https?:/i.test(n.location))s=n.location;else try{s=new URL(n.location,this.uri||"").toString()}catch{s=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)}nG(s,i,(a,o)=>{if(a)return t(a);if(this._includesWsdl.push(o),o.definitions instanceof pl.DefinitionsElement)(0,Z_.mergeWith)(this.definitions,o.definitions,(l,c)=>l instanceof pl.SchemaElement?l.merge(c):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=D2.parser(!0,null),n=[],s=null,i=null,a=null,o=null,l=this.options;return t.onopentag=c=>{let f=c.name,p=c.attributes,d=n[n.length-1],g=(0,tr.splitQName)(f).name;if(g==="schema"&&(o=p),d)try{d.startElement(n,f,p,l,o)}catch(m){if(this.options.strict)throw m;n.push(new pl.Element(f,p,l,o))}else if(g==="definitions")s=new pl.DefinitionsElement(f,p,l),n.push(s);else if(g==="schema")s=new pl.DefinitionsElement("definitions",{},{}),i=new pl.TypesElement("types",{},{}),a=new pl.SchemaElement(f,p,l),i.addChild(a),s.addChild(i),n.push(a);else throw g==="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=c=>{let f=n[n.length-1];(0,YX.ok)(f,"Unmatched close tag: "+c),f.endElement(n,c)},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===tr.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}};Jn.WSDL=R2;function nG(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):rP(r,n,s)}u(nG,"open_wsdl_recursive");function rP(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,o=n.wsdl_options,l;return/^<\?xml[^>]*?>/i.test(r)?(l=new R2(r,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):/^https?:/i.test(r)?(eP("Reading url: %s",r),(n.httpClient||new eG.HttpClient(n)).request(r,null,(f,p,d)=>{f?s(f):p&&p.status===200?(l=new R2(d,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):s(new Error("Invalid WSDL URL: "+r+`
64
64
 
65
65
  \r Code: `+p.status+`
66
66
 
@@ -74,14 +74,14 @@ Char: `+O.c),B=new Error(B),O.error=B,U(O,"onerror",B),O}u(ee,"error");function
74
74
  Actual: `+O.attribValue);else if(K==="xmlns"&&O.attribValue!==g)X(O,"xmlns: prefix must be bound to "+g+`
75
75
  Actual: `+O.attribValue);else{var _e=O.tag,R=O.tags[O.tags.length-1]||O;_e.ns===R.ns&&(_e.ns=Object.create(R.ns)),_e.ns[K]=O.attribValue}O.attribList.push([O.attribName,O.attribValue])}else O.tag.attributes[O.attribName]=O.attribValue,F(O,"onattribute",{name:O.attribName,value:O.attribValue});O.attribName=O.attribValue=""}u(xe,"attrib");function pe(O,B){if(O.opt.xmlns){var Q=O.tag,K=Ce(O.tagName);Q.prefix=K.prefix,Q.local=K.local,Q.uri=Q.ns[K.prefix]||"",Q.prefix&&!Q.uri&&(X(O,"Unbound namespace prefix: "+JSON.stringify(O.tagName)),Q.uri=K.prefix);var _e=O.tags[O.tags.length-1]||O;Q.ns&&_e.ns!==Q.ns&&Object.keys(Q.ns).forEach(function(Jt){F(O,"onopennamespace",{prefix:Jt,uri:Q.ns[Jt]})});for(var R=0,N=O.attribList.length;R<N;R++){var J=O.attribList[R],$=J[0],ge=J[1],et=Ce($,!0),Gt=et.prefix,Be=et.local,ar=Gt===""?"":Q.ns[Gt]||"",Er={name:$,value:ge,prefix:Gt,local:Be,uri:ar};Gt&&Gt!=="xmlns"&&!ar&&(X(O,"Unbound namespace prefix: "+JSON.stringify(Gt)),Er.uri=Gt),O.tag.attributes[$]=Er,F(O,"onattribute",Er)}O.attribList.length=0}O.tag.isSelfClosing=!!B,O.sawRoot=!0,O.tags.push(O.tag),F(O,"onopentag",O.tag),B||(!O.noscript&&O.tagName.toLowerCase()==="script"?O.state=I.SCRIPT:O.state=I.TEXT,O.tag=null,O.tagName=""),O.attribName=O.attribValue="",O.attribList.length=0}u(pe,"openTag");function W(O){if(!O.tagName){X(O,"Weird empty close tag."),O.textNode+="</>",O.state=I.TEXT;return}if(O.script){if(O.tagName!=="script"){O.script+="</"+O.tagName+">",O.tagName="",O.state=I.SCRIPT;return}F(O,"onscript",O.script),O.script=""}var B=O.tags.length,Q=O.tagName;O.strict||(Q=Q[O.looseCase]());for(var K=Q;B--;){var _e=O.tags[B];if(_e.name!==K)X(O,"Unexpected close tag");else break}if(B<0){X(O,"Unmatched closing tag: "+O.tagName),O.textNode+="</"+O.tagName+">",O.state=I.TEXT;return}O.tagName=Q;for(var R=O.tags.length;R-- >B;){var N=O.tag=O.tags.pop();O.tagName=O.tag.name,F(O,"onclosetag",O.tagName);var J={};for(var $ in N.ns)J[$]=N.ns[$];var ge=O.tags[O.tags.length-1]||O;O.opt.xmlns&&N.ns!==ge.ns&&Object.keys(N.ns).forEach(function(et){var Gt=N.ns[et];F(O,"onclosenamespace",{prefix:et,uri:Gt})})}B===0&&(O.closedRoot=!0),O.tagName=O.attribValue=O.attribName="",O.attribList.length=0,O.state=I.TEXT}u(W,"closeTag");function fe(O){var B=O.entity,Q=B.toLowerCase(),K,_e="";return O.ENTITIES[B]?O.ENTITIES[B]:O.ENTITIES[Q]?O.ENTITIES[Q]:(B=Q,B.charAt(0)==="#"&&(B.charAt(1)==="x"?(B=B.slice(2),K=parseInt(B,16),_e=K.toString(16)):(B=B.slice(1),K=parseInt(B,10),_e=K.toString(10))),B=B.replace(/^0+/,""),isNaN(K)||_e.toLowerCase()!==B?(X(O,"Invalid character entity"),"&"+O.entity+";"):String.fromCodePoint(K))}u(fe,"parseEntity");function Ie(O,B){B==="<"?(O.state=I.OPEN_WAKA,O.startTagPosition=O.position):w(B)||(X(O,"Non-whitespace before first tag."),O.textNode=B,O.state=I.TEXT)}u(Ie,"beginWhiteSpace");function Ve(O,B){var Q="";return B<O.length&&(Q=O.charAt(B)),Q}u(Ve,"charAt");function Le(O){var B=this;if(this.error)throw this.error;if(B.closed)return ee(B,"Cannot write after close. Assign an onready handler.");if(O===null)return ie(B);typeof O=="object"&&(O=O.toString());for(var Q=0,K="";K=Ve(O,Q++),B.c=K,!!K;)switch(B.trackPosition&&(B.position++,K===`
76
76
  `?(B.line++,B.column=0):B.column++),B.state){case I.BEGIN:if(B.state=I.BEGIN_WHITESPACE,K==="\uFEFF")continue;Ie(B,K);continue;case I.BEGIN_WHITESPACE:Ie(B,K);continue;case I.TEXT:if(B.sawRoot&&!B.closedRoot){for(var _e=Q-1;K&&K!=="<"&&K!=="&";)K=Ve(O,Q++),K&&B.trackPosition&&(B.position++,K===`
77
- `?(B.line++,B.column=0):B.column++);B.textNode+=O.substring(_e,Q-1)}K==="<"&&!(B.sawRoot&&B.closedRoot&&!B.strict)?(B.state=I.OPEN_WAKA,B.startTagPosition=B.position):(!w(K)&&(!B.sawRoot||B.closedRoot)&&X(B,"Text data outside of root node."),K==="&"?B.state=I.TEXT_ENTITY:B.textNode+=K);continue;case I.SCRIPT:K==="<"?B.state=I.SCRIPT_ENDING:B.script+=K;continue;case I.SCRIPT_ENDING:K==="/"?B.state=I.CLOSE_TAG:(B.script+="<"+K,B.state=I.SCRIPT);continue;case I.OPEN_WAKA:if(K==="!")B.state=I.SGML_DECL,B.sgmlDecl="";else if(!w(K))if(b(v,K))B.state=I.OPEN_TAG,B.tagName=K;else if(K==="/")B.state=I.CLOSE_TAG,B.tagName="";else if(K==="?")B.state=I.PROC_INST,B.procInstName=B.procInstBody="";else{if(X(B,"Unencoded <"),B.startTagPosition+1<B.position){var R=B.position-B.startTagPosition;K=new Array(R).join(" ")+K}B.textNode+="<"+K,B.state=I.TEXT}continue;case I.SGML_DECL:if(B.sgmlDecl+K==="--"){B.state=I.COMMENT,B.comment="",B.sgmlDecl="";continue}B.doctype&&B.doctype!==!0&&B.sgmlDecl?(B.state=I.DOCTYPE_DTD,B.doctype+="<!"+B.sgmlDecl+K,B.sgmlDecl=""):(B.sgmlDecl+K).toUpperCase()===f?(F(B,"onopencdata"),B.state=I.CDATA,B.sgmlDecl="",B.cdata=""):(B.sgmlDecl+K).toUpperCase()===p?(B.state=I.DOCTYPE,(B.doctype||B.sawRoot)&&X(B,"Inappropriately located doctype declaration"),B.doctype="",B.sgmlDecl=""):K===">"?(F(B,"onsgmldeclaration",B.sgmlDecl),B.sgmlDecl="",B.state=I.TEXT):(E(K)&&(B.state=I.SGML_DECL_QUOTED),B.sgmlDecl+=K);continue;case I.SGML_DECL_QUOTED:K===B.q&&(B.state=I.SGML_DECL,B.q=""),B.sgmlDecl+=K;continue;case I.DOCTYPE:K===">"?(B.state=I.TEXT,F(B,"ondoctype",B.doctype),B.doctype=!0):(B.doctype+=K,K==="["?B.state=I.DOCTYPE_DTD:E(K)&&(B.state=I.DOCTYPE_QUOTED,B.q=K));continue;case I.DOCTYPE_QUOTED:B.doctype+=K,K===B.q&&(B.q="",B.state=I.DOCTYPE);continue;case I.DOCTYPE_DTD:K==="]"?(B.doctype+=K,B.state=I.DOCTYPE):K==="<"?(B.state=I.OPEN_WAKA,B.startTagPosition=B.position):E(K)?(B.doctype+=K,B.state=I.DOCTYPE_DTD_QUOTED,B.q=K):B.doctype+=K;continue;case I.DOCTYPE_DTD_QUOTED:B.doctype+=K,K===B.q&&(B.state=I.DOCTYPE_DTD,B.q="");continue;case I.COMMENT:K==="-"?B.state=I.COMMENT_ENDING:B.comment+=K;continue;case I.COMMENT_ENDING:K==="-"?(B.state=I.COMMENT_ENDED,B.comment=se(B.opt,B.comment),B.comment&&F(B,"oncomment",B.comment),B.comment=""):(B.comment+="-"+K,B.state=I.COMMENT);continue;case I.COMMENT_ENDED:K!==">"?(X(B,"Malformed comment"),B.comment+="--"+K,B.state=I.COMMENT):B.doctype&&B.doctype!==!0?B.state=I.DOCTYPE_DTD:B.state=I.TEXT;continue;case I.CDATA:K==="]"?B.state=I.CDATA_ENDING:B.cdata+=K;continue;case I.CDATA_ENDING:K==="]"?B.state=I.CDATA_ENDING_2:(B.cdata+="]"+K,B.state=I.CDATA);continue;case I.CDATA_ENDING_2:K===">"?(B.cdata&&F(B,"oncdata",B.cdata),F(B,"onclosecdata"),B.cdata="",B.state=I.TEXT):K==="]"?B.cdata+="]":(B.cdata+="]]"+K,B.state=I.CDATA);continue;case I.PROC_INST:K==="?"?B.state=I.PROC_INST_ENDING:w(K)?B.state=I.PROC_INST_BODY:B.procInstName+=K;continue;case I.PROC_INST_BODY:if(!B.procInstBody&&w(K))continue;K==="?"?B.state=I.PROC_INST_ENDING:B.procInstBody+=K;continue;case I.PROC_INST_ENDING:K===">"?(F(B,"onprocessinginstruction",{name:B.procInstName,body:B.procInstBody}),B.procInstName=B.procInstBody="",B.state=I.TEXT):(B.procInstBody+="?"+K,B.state=I.PROC_INST_BODY);continue;case I.OPEN_TAG:b(y,K)?B.tagName+=K:(he(B),K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:(w(K)||X(B,"Invalid character in tag name"),B.state=I.ATTRIB));continue;case I.OPEN_TAG_SLASH:K===">"?(pe(B,!0),W(B)):(X(B,"Forward-slash in opening tag not followed by >"),B.state=I.ATTRIB);continue;case I.ATTRIB:if(w(K))continue;K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:b(v,K)?(B.attribName=K,B.attribValue="",B.state=I.ATTRIB_NAME):X(B,"Invalid attribute name");continue;case I.ATTRIB_NAME:K==="="?B.state=I.ATTRIB_VALUE:K===">"?(X(B,"Attribute without value"),B.attribValue=B.attribName,xe(B),pe(B)):w(K)?B.state=I.ATTRIB_NAME_SAW_WHITE:b(y,K)?B.attribName+=K:X(B,"Invalid attribute name");continue;case I.ATTRIB_NAME_SAW_WHITE:if(K==="=")B.state=I.ATTRIB_VALUE;else{if(w(K))continue;X(B,"Attribute without value"),B.tag.attributes[B.attribName]="",B.attribValue="",F(B,"onattribute",{name:B.attribName,value:""}),B.attribName="",K===">"?pe(B):b(v,K)?(B.attribName=K,B.state=I.ATTRIB_NAME):(X(B,"Invalid attribute name"),B.state=I.ATTRIB)}continue;case I.ATTRIB_VALUE:if(w(K))continue;E(K)?(B.q=K,B.state=I.ATTRIB_VALUE_QUOTED):(B.opt.unquotedAttributeValues||ee(B,"Unquoted attribute value"),B.state=I.ATTRIB_VALUE_UNQUOTED,B.attribValue=K);continue;case I.ATTRIB_VALUE_QUOTED:if(K!==B.q){K==="&"?B.state=I.ATTRIB_VALUE_ENTITY_Q:B.attribValue+=K;continue}xe(B),B.q="",B.state=I.ATTRIB_VALUE_CLOSED;continue;case I.ATTRIB_VALUE_CLOSED:w(K)?B.state=I.ATTRIB:K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:b(v,K)?(X(B,"No whitespace between attributes"),B.attribName=K,B.attribValue="",B.state=I.ATTRIB_NAME):X(B,"Invalid attribute name");continue;case I.ATTRIB_VALUE_UNQUOTED:if(!A(K)){K==="&"?B.state=I.ATTRIB_VALUE_ENTITY_U:B.attribValue+=K;continue}xe(B),K===">"?pe(B):B.state=I.ATTRIB;continue;case I.CLOSE_TAG:if(B.tagName)K===">"?W(B):b(y,K)?B.tagName+=K:B.script?(B.script+="</"+B.tagName,B.tagName="",B.state=I.SCRIPT):(w(K)||X(B,"Invalid tagname in closing tag"),B.state=I.CLOSE_TAG_SAW_WHITE);else{if(w(K))continue;V(v,K)?B.script?(B.script+="</"+K,B.state=I.SCRIPT):X(B,"Invalid tagname in closing tag."):B.tagName=K}continue;case I.CLOSE_TAG_SAW_WHITE:if(w(K))continue;K===">"?W(B):X(B,"Invalid characters in closing tag");continue;case I.TEXT_ENTITY:case I.ATTRIB_VALUE_ENTITY_Q:case I.ATTRIB_VALUE_ENTITY_U:var N,J;switch(B.state){case I.TEXT_ENTITY:N=I.TEXT,J="textNode";break;case I.ATTRIB_VALUE_ENTITY_Q:N=I.ATTRIB_VALUE_QUOTED,J="attribValue";break;case I.ATTRIB_VALUE_ENTITY_U:N=I.ATTRIB_VALUE_UNQUOTED,J="attribValue";break}if(K===";"){var $=fe(B);B.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes($)?(B.entity="",B.state=N,B.write($)):(B[J]+=$,B.entity="",B.state=N)}else b(B.entity.length?C:S,K)?B.entity+=K:(X(B,"Invalid character in entity name"),B[J]+="&"+B.entity+K,B.entity="",B.state=N);continue;default:throw new Error(B,"Unknown state: "+B.state)}return B.position>=B.bufferCheckPosition&&n(B),B}u(Le,"write");String.fromCodePoint||(function(){var O=String.fromCharCode,B=Math.floor,Q=u(function(){var K=16384,_e=[],R,N,J=-1,$=arguments.length;if(!$)return"";for(var ge="";++J<$;){var et=Number(arguments[J]);if(!isFinite(et)||et<0||et>1114111||B(et)!==et)throw RangeError("Invalid code point: "+et);et<=65535?_e.push(et):(et-=65536,R=(et>>10)+55296,N=et%1024+56320,_e.push(R,N)),(J+1===$||_e.length>K)&&(ge+=O.apply(null,_e),_e.length=0)}return ge},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:Q,configurable:!0,writable:!0}):String.fromCodePoint=Q})()})(typeof z2>"u"?z2.sax={}:z2)});var L4=ue(hb=>{"use strict";(function(){"use strict";hb.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(hb)});var pb=ue(dl=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),dl.normalize=function(e){return e.toLowerCase()},dl.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},dl.stripPrefix=function(e){return e.replace(r,"")},dl.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},dl.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(dl)});var V4=ue(ga=>{"use strict";(function(){"use strict";var r,e,t,n,s,i,a,o,l,c=u(function(d,g){return function(){return d.apply(g,arguments)}},"bind"),f=u(function(d,g){for(var m in g)p.call(g,m)&&(d[m]=g[m]);function v(){this.constructor=d}return u(v,"ctor"),v.prototype=g.prototype,d.prototype=new v,d.__super__=g.prototype,d},"extend"),p={}.hasOwnProperty;o=k4(),n=st("events"),r=L4(),a=pb(),l=st("timers").setImmediate,e=P2().defaults,s=u(function(d){return typeof d=="object"&&d!=null&&Object.keys(d).length===0},"isEmpty"),i=u(function(d,g,m){var v,y,S;for(v=0,y=d.length;v<y;v++)S=d[v],g=S(g,m);return g},"processItem"),t=u(function(d,g,m){var v;return v=Object.create(null),v.value=m,v.writable=!0,v.enumerable=!0,v.configurable=!0,Object.defineProperty(d,g,v)},"defineProperty"),ga.Parser=(function(d){f(g,d);function g(m){this.parseStringPromise=c(this.parseStringPromise,this),this.parseString=c(this.parseString,this),this.reset=c(this.reset,this),this.assignOrPush=c(this.assignOrPush,this),this.processAsync=c(this.processAsync,this);var v,y,S;if(!(this instanceof ga.Parser))return new ga.Parser(m);this.options={},y=e["0.2"];for(v in y)p.call(y,v)&&(S=y[v],this.options[v]=S);for(v in m)p.call(m,v)&&(S=m[v],this.options[v]=S);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 u(g,"Parser"),g.prototype.processAsync=function(){var m,v;try{return this.remaining.length<=this.options.chunkSize?(m=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(m),this.saxParser.close()):(m=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(m),l(this.processAsync))}catch(y){if(v=y,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(v)}},g.prototype.assignOrPush=function(m,v,y){return v in m?(m[v]instanceof Array||t(m,v,[m[v]]),m[v].push(y)):this.options.explicitArray?t(m,v,[y]):t(m,v,y)},g.prototype.reset=function(){var m,v,y,S;return this.removeAllListeners(),this.saxParser=o.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(C){return function(w){if(C.saxParser.resume(),!C.saxParser.errThrown)return C.saxParser.errThrown=!0,C.emit("error",w)}})(this),this.saxParser.onend=(function(C){return function(){if(!C.saxParser.ended)return C.saxParser.ended=!0,C.emit("end",C.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,S=[],m=this.options.attrkey,v=this.options.charkey,this.saxParser.onopentag=(function(C){return function(w){var E,A,b,V,I;if(b={},b[v]="",!C.options.ignoreAttrs){I=w.attributes;for(E in I)p.call(I,E)&&(!(m in b)&&!C.options.mergeAttrs&&(b[m]={}),A=C.options.attrValueProcessors?i(C.options.attrValueProcessors,w.attributes[E],E):w.attributes[E],V=C.options.attrNameProcessors?i(C.options.attrNameProcessors,E):E,C.options.mergeAttrs?C.assignOrPush(b,V,A):t(b[m],V,A))}return b["#name"]=C.options.tagNameProcessors?i(C.options.tagNameProcessors,w.name):w.name,C.options.xmlns&&(b[C.options.xmlnskey]={uri:w.uri,local:w.local}),S.push(b)}})(this),this.saxParser.onclosetag=(function(C){return function(){var w,E,A,b,V,I,D,U,F,M;if(I=S.pop(),V=I["#name"],(!C.options.explicitChildren||!C.options.preserveChildrenOrder)&&delete I["#name"],I.cdata===!0&&(w=I.cdata,delete I.cdata),F=S[S.length-1],I[v].match(/^\s*$/)&&!w?(E=I[v],delete I[v]):(C.options.trim&&(I[v]=I[v].trim()),C.options.normalize&&(I[v]=I[v].replace(/\s{2,}/g," ").trim()),I[v]=C.options.valueProcessors?i(C.options.valueProcessors,I[v],V):I[v],Object.keys(I).length===1&&v in I&&!C.EXPLICIT_CHARKEY&&(I=I[v])),s(I)&&(typeof C.options.emptyTag=="function"?I=C.options.emptyTag():I=C.options.emptyTag!==""?C.options.emptyTag:E),C.options.validator!=null&&(M="/"+(function(){var se,ee,ie;for(ie=[],se=0,ee=S.length;se<ee;se++)b=S[se],ie.push(b["#name"]);return ie})().concat(V).join("/"),(function(){var se;try{return I=C.options.validator(M,F&&F[V],I)}catch(ee){return se=ee,C.emit("error",se)}})()),C.options.explicitChildren&&!C.options.mergeAttrs&&typeof I=="object"){if(!C.options.preserveChildrenOrder)b={},C.options.attrkey in I&&(b[C.options.attrkey]=I[C.options.attrkey],delete I[C.options.attrkey]),!C.options.charsAsChildren&&C.options.charkey in I&&(b[C.options.charkey]=I[C.options.charkey],delete I[C.options.charkey]),Object.getOwnPropertyNames(I).length>0&&(b[C.options.childkey]=I),I=b;else if(F){F[C.options.childkey]=F[C.options.childkey]||[],D={};for(A in I)p.call(I,A)&&t(D,A,I[A]);F[C.options.childkey].push(D),delete I["#name"],Object.keys(I).length===1&&v in I&&!C.EXPLICIT_CHARKEY&&(I=I[v])}}return S.length>0?C.assignOrPush(F,V,I):(C.options.explicitRoot&&(U=I,I={},t(I,V,U)),C.resultObject=I,C.saxParser.ended=!0,C.emit("end",C.resultObject))}})(this),y=(function(C){return function(w){var E,A;if(A=S[S.length-1],A)return A[v]+=w,C.options.explicitChildren&&C.options.preserveChildrenOrder&&C.options.charsAsChildren&&(C.options.includeWhiteChars||w.replace(/\\n/g,"").trim()!=="")&&(A[C.options.childkey]=A[C.options.childkey]||[],E={"#name":"__text__"},E[v]=w,C.options.normalize&&(E[v]=E[v].replace(/\s{2,}/g," ").trim()),A[C.options.childkey].push(E)),A}})(this),this.saxParser.ontext=y,this.saxParser.oncdata=(function(C){return function(w){var E;if(E=y(w),E)return E.cdata=!0}})(this)},g.prototype.parseString=function(m,v){var y;v!=null&&typeof v=="function"&&(this.on("end",function(S){return this.reset(),v(null,S)}),this.on("error",function(S){return this.reset(),v(S)}));try{return m=m.toString(),m.trim()===""?(this.emit("end",null),!0):(m=r.stripBOM(m),this.options.async?(this.remaining=m,l(this.processAsync),this.saxParser):this.saxParser.write(m).close())}catch(S){if(y=S,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw y}else return this.emit("error",y),this.saxParser.errThrown=!0}},g.prototype.parseStringPromise=function(m){return new Promise((function(v){return function(y,S){return v.parseString(m,function(C,w){return C?S(C):y(w)})}})(this))},g})(n),ga.parseString=function(d,g,m){var v,y,S;return m!=null?(typeof m=="function"&&(v=m),typeof g=="object"&&(y=g)):(typeof g=="function"&&(v=g),y={}),S=new ga.Parser(y),S.parseString(d,v)},ga.parseStringPromise=function(d,g){var m,v;return typeof g=="object"&&(m=g),v=new ga.Parser(m),v.parseStringPromise(d)}}).call(ga)});var F4=ue(ya=>{"use strict";(function(){"use strict";var r,e,t,n,s=u(function(a,o){for(var l in o)i.call(o,l)&&(a[l]=o[l]);function c(){this.constructor=a}return u(c,"ctor"),c.prototype=o.prototype,a.prototype=new c,a.__super__=o.prototype,a},"extend"),i={}.hasOwnProperty;e=P2(),r=P4(),t=V4(),n=pb(),ya.defaults=e.defaults,ya.processors=n,ya.ValidationError=(function(a){s(o,a);function o(l){this.message=l}return u(o,"ValidationError"),o})(Error),ya.Builder=r.Builder,ya.Parser=t.Parser,ya.parseString=t.parseString,ya.parseStringPromise=t.parseStringPromise}).call(ya)});var tf=ue(Sn=>{"use strict";function IJ(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(ef(r,n)){var s=r[n];if(e.call(void 0,s,n,r))return s}}u(IJ,"find");function I0(r,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(r=e.create(null,e.getOwnPropertyDescriptors(r))),e&&typeof e.freeze=="function"?e.freeze(r):r}u(I0,"freeze");function ef(r,e){return Object.prototype.hasOwnProperty.call(r,e)}u(ef,"hasOwn");function DJ(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)ef(e,t)&&(r[t]=e[t]);return r}u(DJ,"assign");var b5=I0({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function BJ(r){return ef(b5,r.toLowerCase())}u(BJ,"isHTMLBooleanAttribute");var N5=I0({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function RJ(r){return ef(N5,r.toLowerCase())}u(RJ,"isHTMLVoidElement");var uy=I0({script:!1,style:!1,textarea:!0,title:!0});function OJ(r){var e=r.toLowerCase();return ef(uy,e)&&!uy[e]}u(OJ,"isHTMLRawTextElement");function _J(r){var e=r.toLowerCase();return ef(uy,e)&&uy[e]}u(_J,"isHTMLEscapableRawTextElement");function T5(r){return r===ly.HTML}u(T5,"isHTMLMimeType");function PJ(r){return T5(r)||r===ly.XML_XHTML_APPLICATION}u(PJ,"hasDefaultHTMLNamespace");var ly=I0({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),kJ=Object.keys(ly).map(function(r){return ly[r]});function LJ(r){return kJ.indexOf(r)>-1}u(LJ,"isValidMimeType");var VJ=I0({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Sn.assign=DJ;Sn.find=IJ;Sn.freeze=I0;Sn.HTML_BOOLEAN_ATTRIBUTES=b5;Sn.HTML_RAW_TEXT_ELEMENTS=uy;Sn.HTML_VOID_ELEMENTS=N5;Sn.hasDefaultHTMLNamespace=PJ;Sn.hasOwn=ef;Sn.isHTMLBooleanAttribute=BJ;Sn.isHTMLRawTextElement=OJ;Sn.isHTMLEscapableRawTextElement=_J;Sn.isHTMLMimeType=T5;Sn.isHTMLVoidElement=RJ;Sn.isValidMimeType=LJ;Sn.MIME_TYPE=ly;Sn.NAMESPACE=VJ});var dy=ue(py=>{"use strict";var FJ=tf();function D5(r,e){r.prototype=Object.create(Error.prototype,{constructor:{value:r},name:{value:r.name,enumerable:!0,writable:e}})}u(D5,"extendError");var fy=FJ.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),B5=Object.keys(fy);function R5(r){return typeof r=="number"&&r>=1&&r<=25}u(R5,"isValidDomExceptionCode");function UJ(r){return typeof r=="string"&&r.substring(r.length-fy.Error.length)===fy.Error}u(UJ,"endsWithError");function hy(r,e){R5(r)?(this.name=B5[r],this.message=e||""):(this.message=r,this.name=UJ(e)?e:fy.Error),Error.captureStackTrace&&Error.captureStackTrace(this,hy)}u(hy,"DOMException");D5(hy,!0);Object.defineProperties(hy.prototype,{code:{enumerable:!0,get:u(function(){var r=B5.indexOf(this.name);return R5(r)?r:0},"get")}});var O5={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},$T=Object.entries(O5);for(cy=0;cy<$T.length;cy++)I5=$T[cy][0],hy[I5]=$T[cy][1];var I5,cy;function WT(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,WT)}u(WT,"ParseError");D5(WT);py.DOMException=hy;py.DOMExceptionName=fy;py.ExceptionCode=O5;py.ParseError=WT});var tI=ue(vt=>{"use strict";function U5(r){try{typeof r!="function"&&(r=RegExp);var e=new r("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}u(U5,"detectUnicodeSupport");var R0=U5();function Hu(r){if(r.source[0]!=="[")throw new Error(r+" can not be used with chars");return r.source.slice(1,r.source.lastIndexOf("]"))}u(Hu,"chars");function D0(r,e){if(r.source[0]!=="[")throw new Error("/"+r.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(r.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+r.source+"/");if(e==="-"&&r.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+r.source+"/");return new RegExp(r.source.replace(e,""),R0?"u":"")}u(D0,"chars_without");function Tt(r){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var n=typeof t=="string";if(n&&e===void 0&&t==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?t:t.source}).join(""),R0?"mu":"m")}u(Tt,"reg");function ct(r){if(arguments.length===0)throw new Error("no parameters provided");return Tt.apply(ct,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}u(ct,"regg");var MJ="\uFFFD",Ku=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;R0&&(Ku=Tt("[",Hu(Ku),"\\u{10000}-\\u{10FFFF}","]"));var jJ=new RegExp("[^"+Hu(Ku)+"]",R0?"u":""),JT=/[\x20\x09\x0D\x0A]/,qJ=Hu(JT),tr=Tt(JT,"+"),Tr=Tt(JT,"*"),my=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;R0&&(my=Tt("[",Hu(my),"\\u{10000}-\\u{10FFFF}","]"));var HJ=Hu(my),YT=Tt("[",HJ,Hu(/[-.0-9\xB7]/),Hu(/[\u0300-\u036F\u203F-\u2040]/),"]"),qs=Tt(my,YT,"*"),_5=Tt(YT,"+"),KJ=Tt("&",qs,";"),XJ=ct(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),gy=ct(KJ,"|",XJ),yy=Tt("%",qs,";"),QT=ct(Tt('"',ct(/[^%&"]/,"|",yy,"|",gy),"*",'"'),"|",Tt("'",ct(/[^%&']/,"|",yy,"|",gy),"*","'")),GJ=ct('"',ct(/[^<&"]/,"|",gy),"*",'"',"|","'",ct(/[^<&']/,"|",gy),"*","'"),$J=D0(my,":"),WJ=D0(YT,":"),P5=Tt($J,WJ,"*"),vy=Tt(P5,ct(":",P5),"?"),zJ=Tt("^",vy,"$"),JJ=Tt("(",vy,")"),B0=ct(/"[^"]*"|'[^']*'/),YJ=Tt(/^<\?/,"(",qs,")",ct(tr,"(",Ku,"*?)"),"?",/\?>/),k5=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Ey=ct('"',k5,'*"',"|","'",D0(k5,"'"),"*'"),M5="<!--",j5="-->",QJ=Tt(M5,ct(D0(Ku,"-"),"|",Tt("-",D0(Ku,"-"))),"*",j5),L5="#PCDATA",ZJ=ct(Tt(/\(/,Tr,L5,ct(Tr,/\|/,Tr,vy),"*",Tr,/\)\*/),"|",Tt(/\(/,Tr,L5,Tr,/\)/)),eY=/[?*+]?/,tY=Tt(/\([^>]+\)/,eY),rY=ct("EMPTY","|","ANY","|",ZJ,"|",tY),nY="<!ELEMENT",sY=Tt(nY,tr,ct(vy,"|",yy),tr,ct(rY,"|",yy),Tr,">"),iY=Tt("NOTATION",tr,/\(/,Tr,qs,ct(Tr,/\|/,Tr,qs),"*",Tr,/\)/),aY=Tt(/\(/,Tr,_5,ct(Tr,/\|/,Tr,_5),"*",Tr,/\)/),oY=ct(iY,"|",aY),uY=ct(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",oY),lY=ct(/#REQUIRED|#IMPLIED/,"|",ct(ct("#FIXED",tr),"?",GJ)),cY=ct(tr,qs,tr,uY,tr,lY),fY="<!ATTLIST",hY=Tt(fY,tr,qs,cY,"*",Tr,">"),zT="about:legacy-compat",pY=ct('"'+zT+'"',"|","'"+zT+"'"),ZT="SYSTEM",KS="PUBLIC",XS=ct(ct(ZT,tr,B0),"|",ct(KS,tr,Ey,tr,B0)),dY=Tt("^",ct(ct(ZT,tr,"(?<SystemLiteralOnly>",B0,")"),"|",ct(KS,tr,"(?<PubidLiteral>",Ey,")",tr,"(?<SystemLiteral>",B0,")"))),mY=Tt("^",Ey,"$"),gY=Tt("^",B0,"$"),yY=ct(tr,"NDATA",tr,qs),vY=ct(QT,"|",ct(XS,yY,"?")),q5="<!ENTITY",EY=Tt(q5,tr,qs,tr,vY,Tr,">"),wY=ct(QT,"|",XS),SY=Tt(q5,tr,"%",tr,qs,tr,wY,Tr,">"),AY=ct(EY,"|",SY),CY=Tt(KS,tr,Ey),xY=Tt("<!NOTATION",tr,qs,tr,ct(XS,"|",CY),Tr,">"),eI=Tt(Tr,"=",Tr),V5=/1[.]\d+/,bY=Tt(tr,"version",eI,ct("'",V5,"'","|",'"',V5,'"')),F5=/[A-Za-z][-A-Za-z0-9._]*/,NY=ct(tr,"encoding",eI,ct('"',F5,'"',"|","'",F5,"'")),TY=ct(tr,"standalone",eI,ct("'",ct("yes","|","no"),"'","|",'"',ct("yes","|","no"),'"')),IY=Tt(/^<\?xml/,bY,NY,"?",TY,"?",Tr,/\?>/),DY="<!DOCTYPE",BY="<![CDATA[",RY="]]>",OY=/<!\[CDATA\[/,_Y=/\]\]>/,PY=Tt(Ku,"*?",_Y),kY=Tt(OY,PY);vt.chars=Hu;vt.chars_without=D0;vt.detectUnicodeSupport=U5;vt.reg=Tt;vt.regg=ct;vt.ABOUT_LEGACY_COMPAT=zT;vt.ABOUT_LEGACY_COMPAT_SystemLiteral=pY;vt.AttlistDecl=hY;vt.CDATA_START=BY;vt.CDATA_END=RY;vt.CDSect=kY;vt.Char=Ku;vt.Comment=QJ;vt.COMMENT_START=M5;vt.COMMENT_END=j5;vt.DOCTYPE_DECL_START=DY;vt.elementdecl=sY;vt.EntityDecl=AY;vt.EntityValue=QT;vt.ExternalID=XS;vt.ExternalID_match=dY;vt.Name=qs;vt.NotationDecl=xY;vt.Reference=gy;vt.PEReference=yy;vt.PI=YJ;vt.PUBLIC=KS;vt.PubidLiteral=Ey;vt.PubidLiteral_match=mY;vt.QName=vy;vt.QName_exact=zJ;vt.QName_group=JJ;vt.S=tr;vt.SChar_s=qJ;vt.S_OPT=Tr;vt.SYSTEM=ZT;vt.SystemLiteral=B0;vt.SystemLiteral_match=gY;vt.InvalidChar=jJ;vt.UNICODE_REPLACEMENT_CHARACTER=MJ;vt.UNICODE_SUPPORT=R0;vt.XMLDecl=IY});var lI=ue(kr=>{"use strict";var Xs=tf(),Zi=Xs.find,LY=Xs.hasDefaultHTMLNamespace,_0=Xs.hasOwn,VY=Xs.isHTMLMimeType,FY=Xs.isHTMLRawTextElement,UY=Xs.isHTMLVoidElement,wy=Xs.MIME_TYPE,ea=Xs.NAMESPACE,Un=Symbol(),z5=dy(),We=z5.DOMException,Hs=z5.DOMExceptionName,An=tI();function ss(r){if(r!==Un)throw new TypeError("Illegal constructor")}u(ss,"checkSymbol");function MY(r){return r!==""}u(MY,"notEmptyString");function jY(r){return r?r.split(/[\t\n\f\r ]+/).filter(MY):[]}u(jY,"splitOnASCIIWhitespace");function qY(r,e){return _0(r,e)||(r[e]=!0),r}u(qY,"orderedSetReducer");function H5(r){if(!r)return[];var e=jY(r);return Object.keys(e.reduce(qY,{}))}u(H5,"toOrderedSet");function HY(r){return function(e){return r&&r.indexOf(e)!==-1}}u(HY,"arrayIncludes");function J5(r){if(!An.QName_exact.test(r))throw new We(We.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+r+'"')}u(J5,"validateQualifiedName");function nI(r,e){J5(e),r=r||null;var t=null,n=e;if(e.indexOf(":")>=0){var s=e.split(":");t=s[0],n=s[1]}if(t!==null&&r===null)throw new We(We.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(t==="xml"&&r!==Xs.NAMESPACE.XML)throw new We(We.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((t==="xmlns"||e==="xmlns")&&r!==Xs.NAMESPACE.XMLNS)throw new We(We.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(r===Xs.NAMESPACE.XMLNS&&t!=="xmlns"&&e!=="xmlns")throw new We(We.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[r,t,n]}u(nI,"validateAndExtract");function L0(r,e){for(var t in r)_0(r,t)&&(e[t]=r[t])}u(L0,"copy");function is(r,e){var t=r.prototype;if(!(t instanceof e)){let n=function(){};u(n,"t"),n.prototype=e.prototype,n=new n,L0(t,n),r.prototype=t=n}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}u(is,"_extends");var as={},Ks=as.ELEMENT_NODE=1,P0=as.ATTRIBUTE_NODE=2,WS=as.TEXT_NODE=3,Y5=as.CDATA_SECTION_NODE=4,Q5=as.ENTITY_REFERENCE_NODE=5,KY=as.ENTITY_NODE=6,sI=as.PROCESSING_INSTRUCTION_NODE=7,iI=as.COMMENT_NODE=8,O0=as.DOCUMENT_NODE=9,Z5=as.DOCUMENT_TYPE_NODE=10,Xu=as.DOCUMENT_FRAGMENT_NODE=11,XY=as.NOTATION_NODE=12,Pr=Xs.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function eL(r,e){if(e.length<r.length)return eL(e,r);var t=null;for(var n in r){if(r[n]!==e[n])return t;t=r[n]}return t}u(eL,"commonAncestor");function K5(r){return r.guid||(r.guid=Math.random()),r.guid}u(K5,"docGUID");function Jr(){}u(Jr,"NodeList");Jr.prototype={length:0,item:u(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:u(function(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var t=[],n=0;n<this.length;n++)uI(this[n],t,null,e);return t.join("")},"toString"),filter:u(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:u(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};Jr.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:u(function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},"next"),return:u(function(){return{done:!0}},"return")}};function Qi(r,e){this._node=r,this._refresh=e,JS(this)}u(Qi,"LiveNodeList");function JS(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(hL(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)_0(r,n)&&delete r[n];L0(t,r),r._inc=e}}u(JS,"_updateLiveList");Qi.prototype.item=function(r){return JS(this),this[r]||null};is(Qi,Jr);function k0(){}u(k0,"NamedNodeMap");function tL(r,e){for(var t=0;t<r.length;){if(r[t]===e)return t;t++}}u(tL,"_findNodeIndex");function GY(r,e,t,n){if(n?e[tL(e,n)]=t:(e[e.length]=t,e.length++),r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&sL(s,r,n),$Y(s,r,t))}}u(GY,"_addNamedNode");function X5(r,e,t){var n=tL(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&&sL(i,r,t),t.ownerElement=null}}}u(X5,"_removeNamedNode");k0.prototype={length:0,item:Jr.prototype.item,getNamedItem:u(function(r){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());for(var e=0;e<this.length;){var t=this[e];if(t.nodeName===r)return t;e++}return null},"getNamedItem"),setNamedItem:u(function(r){var e=r.ownerElement;if(e&&e!==this._ownerElement)throw new We(We.INUSE_ATTRIBUTE_ERR);var t=this.getNamedItemNS(r.namespaceURI,r.localName);return t===r?r:(GY(this._ownerElement,this,r,t),t)},"setNamedItem"),setNamedItemNS:u(function(r){return this.setNamedItem(r)},"setNamedItemNS"),removeNamedItem:u(function(r){var e=this.getNamedItem(r);if(!e)throw new We(We.NOT_FOUND_ERR,r);return X5(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:u(function(r,e){var t=this.getNamedItemNS(r,e);if(!t)throw new We(We.NOT_FOUND_ERR,r?r+" : "+e:e);return X5(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:u(function(r,e){r||(r=null);for(var t=0;t<this.length;){var n=this[t];if(n.localName===e&&n.namespaceURI===r)return n;t++}return null},"getNamedItemNS")};k0.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:u(function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},"next"),return:u(function(){return{done:!0}},"return")}};function rL(){}u(rL,"DOMImplementation");rL.prototype={hasFeature:u(function(r,e){return!0},"hasFeature"),createDocument:u(function(r,e,t){var n=wy.XML_APPLICATION;r===ea.HTML?n=wy.XML_XHTML_APPLICATION:r===ea.SVG&&(n=wy.XML_SVG_IMAGE);var s=new Ja(Un,{contentType:n});if(s.implementation=this,s.childNodes=new Jr,s.doctype=t||null,t&&s.appendChild(t),e){var i=s.createElementNS(r,e);s.appendChild(i)}return s},"createDocument"),createDocumentType:u(function(r,e,t,n){J5(r);var s=new ZS(Un);return s.name=r,s.nodeName=r,s.publicId=e||"",s.systemId=t||"",s.internalSubset=n||"",s.childNodes=new Jr,s},"createDocumentType"),createHTMLDocument:u(function(r){var e=new Ja(Un,{contentType:wy.HTML});if(e.implementation=this,e.childNodes=new Jr,r!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var t=e.createElement("html");e.appendChild(t);var n=e.createElement("head");if(t.appendChild(n),typeof r=="string"){var s=e.createElement("title");s.appendChild(e.createTextNode(r)),n.appendChild(s)}t.appendChild(e.createElement("body"))}return e},"createHTMLDocument")};function Ft(r){ss(r)}u(Ft,"Node");Ft.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var r=this.getRootNode();return r&&r.nodeType===r.DOCUMENT_NODE},contains:u(function(r){if(!r)return!1;var e=r;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},"contains"),getRootNode:u(function(r){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},"getRootNode"),isEqualNode:u(function(r){if(!r)return!1;for(var e=[{node:this,other:r}];e.length>0;){var t=e.pop(),n=t.node,s=t.other;if(n.nodeType!==s.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==s.name||n.publicId!==s.publicId||n.systemId!==s.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==s.namespaceURI||n.prefix!==s.prefix||n.localName!==s.localName||n.attributes.length!==s.attributes.length)return!1;for(var i=0;i<n.attributes.length;i++){var a=n.attributes.item(i),o=s.getAttributeNodeNS(a.namespaceURI,a.localName);if(!o)return!1;e.push({node:a,other:o})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==s.namespaceURI||n.localName!==s.localName||n.value!==s.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==s.target||n.data!==s.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==s.data)return!1;break}if(n.childNodes.length!==s.childNodes.length)return!1;for(var i=n.childNodes.length-1;i>=0;i--)e.push({node:n.childNodes[i],other:s.childNodes[i]})}return!0},"isEqualNode"),isSameNode:u(function(r){return this===r},"isSameNode"),insertBefore:u(function(r,e){return zS(this,r,e)},"insertBefore"),replaceChild:u(function(r,e){zS(this,r,e,uL),e&&this.removeChild(e)},"replaceChild"),removeChild:u(function(r){return aL(this,r)},"removeChild"),appendChild:u(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:u(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:u(function(r){return fL(this.ownerDocument||this,this,r)},"cloneNode"),normalize:u(function(){Cn(this,null,{enter:u(function(r){for(var e=r.firstChild;e;){var t=e.nextSibling;t!==null&&t.nodeType===WS&&e.nodeType===WS?(r.removeChild(t),e.appendData(t.data)):e=t}return!0},"enter")})},"normalize"),isSupported:u(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),lookupPrefix:u(function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(_0(t,n)&&t[n]===r)return n}e=e.nodeType==P0?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:u(function(r){for(var e=this;e;){var t=e._nsMap;if(t&&_0(t,r))return t[r];e=e.nodeType==P0?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:u(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace"),compareDocumentPosition:u(function(r){if(this===r)return 0;var e=r,t=this,n=null,s=null;if(e instanceof rf&&(n=e,e=n.ownerElement),t instanceof rf&&(s=t,t=s.ownerElement,n&&e&&t===e))for(var i=0,a;a=t.attributes[i];i++){if(a===n)return Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+Pr.DOCUMENT_POSITION_PRECEDING;if(a===s)return Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+Pr.DOCUMENT_POSITION_FOLLOWING}if(!e||!t||t.ownerDocument!==e.ownerDocument)return Pr.DOCUMENT_POSITION_DISCONNECTED+Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(K5(t.ownerDocument)>K5(e.ownerDocument)?Pr.DOCUMENT_POSITION_FOLLOWING:Pr.DOCUMENT_POSITION_PRECEDING);if(s&&e===t)return Pr.DOCUMENT_POSITION_CONTAINS+Pr.DOCUMENT_POSITION_PRECEDING;if(n&&e===t)return Pr.DOCUMENT_POSITION_CONTAINED_BY+Pr.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!s&&l===t)return Pr.DOCUMENT_POSITION_CONTAINED_BY+Pr.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var c=[],f=t.parentNode;f;){if(!n&&f===e)return Pr.DOCUMENT_POSITION_CONTAINS+Pr.DOCUMENT_POSITION_PRECEDING;c.push(f),f=f.parentNode}c.reverse();var p=eL(o,c);for(var d in p.childNodes){var g=p.childNodes[d];if(g===t)return Pr.DOCUMENT_POSITION_FOLLOWING;if(g===e)return Pr.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(g)>=0)return Pr.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(g)>=0)return Pr.DOCUMENT_POSITION_PRECEDING}return 0},"compareDocumentPosition")};function nL(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}u(nL,"_xmlEncoder");L0(as,Ft);L0(as,Ft.prototype);L0(Pr,Ft);L0(Pr,Ft.prototype);function $S(r,e){Cn(r,null,{enter:u(function(t){return e(t)?Cn.STOP:!0},"enter")})}u($S,"_visitNode");function Cn(r,e,t){for(var n=[{node:r,context:e,phase:Cn.ENTER}];n.length>0;){var s=n.pop();if(s.phase===Cn.ENTER){var i=t.enter(s.node,s.context);if(i===Cn.STOP)return Cn.STOP;if(n.push({node:s.node,context:i,phase:Cn.EXIT}),i==null)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:i,phase:Cn.ENTER}),a=a.previousSibling}else t.exit&&t.exit(s.node,s.context)}}u(Cn,"walkDOM");Cn.STOP=Symbol("walkDOM.STOP");Cn.ENTER=0;Cn.EXIT=1;function Ja(r,e){ss(r);var t=e||{};this.ownerDocument=this,this.contentType=t.contentType||wy.XML_APPLICATION,this.type=VY(this.contentType)?"html":"xml"}u(Ja,"Document");function $Y(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===ea.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}u($Y,"_onAddAttribute");function sL(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===ea.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}u(sL,"_onRemoveAttribute");function iL(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t&&!t.nextSibling)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]}}}u(iL,"_onUpdateChild");function aL(r,e){if(r!==e.parentNode)throw new We(We.NOT_FOUND_ERR,"child's parent is not parent");var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,iL(r.ownerDocument,r),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}u(aL,"_removeChild");function WY(r){return r&&(r.nodeType===Ft.DOCUMENT_NODE||r.nodeType===Ft.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ft.ELEMENT_NODE)}u(WY,"hasValidParentNodeType");function zY(r){return r&&(r.nodeType===Ft.CDATA_SECTION_NODE||r.nodeType===Ft.COMMENT_NODE||r.nodeType===Ft.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ft.DOCUMENT_TYPE_NODE||r.nodeType===Ft.ELEMENT_NODE||r.nodeType===Ft.PROCESSING_INSTRUCTION_NODE||r.nodeType===Ft.TEXT_NODE)}u(zY,"hasInsertableNodeType");function Gu(r){return r&&r.nodeType===Ft.DOCUMENT_TYPE_NODE}u(Gu,"isDocTypeNode");function za(r){return r&&r.nodeType===Ft.ELEMENT_NODE}u(za,"isElementNode");function oL(r){return r&&r.nodeType===Ft.TEXT_NODE}u(oL,"isTextNode");function G5(r,e){var t=r.childNodes||[];if(Zi(t,za)||Gu(e))return!1;var n=Zi(t,Gu);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}u(G5,"isElementInsertionPossible");function $5(r,e){var t=r.childNodes||[];function n(i){return za(i)&&i!==e}if(u(n,"hasElementChildThatIsNotChild"),Zi(t,n))return!1;var s=Zi(t,Gu);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}u($5,"isElementReplacementPossible");function JY(r,e,t){if(!WY(r))throw new We(We.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new We(We.NOT_FOUND_ERR,"child not in parent");if(!zY(e)||Gu(e)&&r.nodeType!==Ft.DOCUMENT_NODE)throw new We(We.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}u(JY,"assertPreInsertionValidity1to5");function YY(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ft.DOCUMENT_FRAGMENT_NODE){var i=s.filter(za);if(i.length>1||Zi(s,oL))throw new We(We.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!G5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(za(e)&&!G5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Gu(e)){if(Zi(n,Gu))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Zi(n,za);if(t&&n.indexOf(a)<n.indexOf(t))throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!t&&a)throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}u(YY,"assertPreInsertionValidityInDocument");function uL(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ft.DOCUMENT_FRAGMENT_NODE){var i=s.filter(za);if(i.length>1||Zi(s,oL))throw new We(We.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!$5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(za(e)&&!$5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Gu(e)){let o=function(l){return Gu(l)&&l!==t};if(u(o,"hasDoctypeChildThatIsNotChild"),Zi(n,o))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Zi(n,za);if(t&&n.indexOf(a)<n.indexOf(t))throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}u(uL,"assertPreReplacementValidityInDocument");function zS(r,e,t,n){JY(r,e,t),r.nodeType===Ft.DOCUMENT_NODE&&(n||YY)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===Xu){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var o=t?t.previousSibling:r.lastChild;i.previousSibling=o,a.nextSibling=t,o?o.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do i.parentNode=r;while(i!==a&&(i=i.nextSibling));return iL(r.ownerDocument||r,r,e),e.nodeType==Xu&&(e.firstChild=e.lastChild=null),e}u(zS,"_insertBefore");Ja.prototype={implementation:null,nodeName:"#document",nodeType:O0,doctype:null,documentElement:null,_inc:1,insertBefore:u(function(r,e){if(r.nodeType===Xu){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return zS(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===Ks&&(this.documentElement=r),r},"insertBefore"),removeChild:u(function(r){var e=aL(this,r);return e===this.documentElement&&(this.documentElement=null),e},"removeChild"),replaceChild:u(function(r,e){zS(this,r,e,uL),r.ownerDocument=this,e&&this.removeChild(e),za(r)&&(this.documentElement=r)},"replaceChild"),importNode:u(function(r,e){return QY(this,r,e)},"importNode"),getElementById:u(function(r){var e=null;return $S(this.documentElement,function(t){if(t.nodeType==Ks&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),createElement:u(function(r){var e=new Ya(Un);e.ownerDocument=this,this.type==="html"&&(r=r.toLowerCase()),LY(this.contentType)&&(e.namespaceURI=ea.HTML),e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new Jr;var t=e.attributes=new k0;return t._ownerElement=e,e},"createElement"),createDocumentFragment:u(function(){var r=new F0(Un);return r.ownerDocument=this,r.childNodes=new Jr,r},"createDocumentFragment"),createTextNode:u(function(r){var e=new Sy(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createTextNode"),createComment:u(function(r){var e=new YS(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createComment"),createCDATASection:u(function(r){if(r.indexOf("]]>")!==-1)throw new We(We.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new QS(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:u(function(r,e){var t=new tA(Un);return t.ownerDocument=this,t.childNodes=new Jr,t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:u(function(r){if(!An.QName_exact.test(r))throw new We(We.INVALID_CHARACTER_ERR,'invalid character in name "'+r+'"');return this.type==="html"&&(r=r.toLowerCase()),this._createAttribute(r)},"createAttribute"),_createAttribute:u(function(r){var e=new rf(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"_createAttribute"),createEntityReference:u(function(r){if(!An.Name.test(r))throw new We(We.INVALID_CHARACTER_ERR,'not a valid xml name "'+r+'"');if(this.type==="html")throw new We("document is an html document",Hs.NotSupportedError);var e=new eA(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.nodeName=r,e},"createEntityReference"),createElementNS:u(function(r,e){var t=nI(r,e),n=new Ya(Un),s=n.attributes=new k0;return n.childNodes=new Jr,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],s._ownerElement=n,n},"createElementNS"),createAttributeNS:u(function(r,e){var t=nI(r,e),n=new rf(Un);return n.ownerDocument=this,n.childNodes=new Jr,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],n},"createAttributeNS")};is(Ja,Ft);function Ya(r){ss(r),this._nsMap=Object.create(null)}u(Ya,"Element");Ya.prototype={nodeType:Ks,attributes:null,getQualifiedName:u(function(){return this.prefix?this.prefix+":"+this.localName:this.localName},"getQualifiedName"),_isInHTMLDocumentAndNamespace:u(function(){return this.ownerDocument.type==="html"&&this.namespaceURI===ea.HTML},"_isInHTMLDocumentAndNamespace"),hasAttributes:u(function(){return!!(this.attributes&&this.attributes.length)},"hasAttributes"),hasAttribute:u(function(r){return!!this.getAttributeNode(r)},"hasAttribute"),getAttribute:u(function(r){var e=this.getAttributeNode(r);return e?e.value:null},"getAttribute"),getAttributeNode:u(function(r){return this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase()),this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:u(function(r,e){this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());var t=this.getAttributeNode(r);t?t.value=t.nodeValue=""+e:(t=this.ownerDocument._createAttribute(r),t.value=t.nodeValue=""+e,this.setAttributeNode(t))},"setAttribute"),removeAttribute:u(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),setAttributeNode:u(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:u(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:u(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:u(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);return t?t.value:null},"getAttributeNS"),setAttributeNS:u(function(r,e,t){var n=nI(r,e),s=n[2],i=this.getAttributeNodeNS(r,s);i?i.value=i.nodeValue=""+t:(i=this.ownerDocument.createAttributeNS(r,e),i.value=i.nodeValue=""+t,this.setAttributeNode(i))},"setAttributeNS"),getAttributeNodeNS:u(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByClassName:u(function(r){var e=H5(r);return new Qi(this,function(t){var n=[];return e.length>0&&$S(t,function(s){if(s!==t&&s.nodeType===Ks){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var o=H5(i);a=e.every(HY(o))}a&&n.push(s)}}}),n})},"getElementsByClassName"),getElementsByTagName:u(function(r){var e=(this.nodeType===O0?this:this.ownerDocument).type==="html",t=r.toLowerCase();return new Qi(this,function(n){var s=[];return $S(n,function(i){if(!(i===n||i.nodeType!==Ks))if(r==="*")s.push(i);else{var a=i.getQualifiedName(),o=e&&i.namespaceURI===ea.HTML?t:r;a===o&&s.push(i)}}),s})},"getElementsByTagName"),getElementsByTagNameNS:u(function(r,e){return new Qi(this,function(t){var n=[];return $S(t,function(s){s!==t&&s.nodeType===Ks&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Ja.prototype.getElementsByClassName=Ya.prototype.getElementsByClassName;Ja.prototype.getElementsByTagName=Ya.prototype.getElementsByTagName;Ja.prototype.getElementsByTagNameNS=Ya.prototype.getElementsByTagNameNS;is(Ya,Ft);function rf(r){ss(r),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}u(rf,"Attr");rf.prototype.nodeType=P0;is(rf,Ft);function V0(r){ss(r)}u(V0,"CharacterData");V0.prototype={data:"",substringData:u(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:u(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:u(function(r,e){this.replaceData(r,0,e)},"insertData"),deleteData:u(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:u(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")};is(V0,Ft);function Sy(r){ss(r)}u(Sy,"Text");Sy.prototype={nodeName:"#text",nodeType:WS,splitText:u(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")};is(Sy,V0);function YS(r){ss(r)}u(YS,"Comment");YS.prototype={nodeName:"#comment",nodeType:iI};is(YS,V0);function QS(r){ss(r)}u(QS,"CDATASection");QS.prototype={nodeName:"#cdata-section",nodeType:Y5};is(QS,Sy);function ZS(r){ss(r)}u(ZS,"DocumentType");ZS.prototype.nodeType=Z5;is(ZS,Ft);function aI(r){ss(r)}u(aI,"Notation");aI.prototype.nodeType=XY;is(aI,Ft);function oI(r){ss(r)}u(oI,"Entity");oI.prototype.nodeType=KY;is(oI,Ft);function eA(r){ss(r)}u(eA,"EntityReference");eA.prototype.nodeType=Q5;is(eA,Ft);function F0(r){ss(r)}u(F0,"DocumentFragment");F0.prototype.nodeName="#document-fragment";F0.prototype.nodeType=Xu;is(F0,Ft);function tA(r){ss(r)}u(tA,"ProcessingInstruction");tA.prototype.nodeType=sI;is(tA,V0);function lL(){}u(lL,"XMLSerializer");lL.prototype.serializeToString=function(r,e){return cL.call(r,e)};Ft.prototype.toString=cL;function cL(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r!=null?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var t=[],n=this.nodeType===O0&&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 uI(this,t,a,e),t.join("")}u(cL,"nodeSerializeToString");function W5(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===ea.XML||s===ea.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}u(W5,"needNamespaceDefine");function GS(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,nL),'"')}u(GS,"addSerializedAttribute");function uI(r,e,t,n){t||(t=[]);var s=n.nodeFilter,i=n.requireWellFormed,a=n.splitCDATASections,o=r.nodeType===O0?r:r.ownerDocument,l=o.type==="html";Cn(r,{ns:t},{enter:u(function(c,f){var p=f.ns;if(s)if(c=s(c),c){if(typeof c=="string")return e.push(c),null}else return null;switch(c.nodeType){case Ks:var d=c.attributes,g=d.length,m=c.tagName,v=m;if(!l&&!c.prefix&&c.namespaceURI){for(var y,S=0;S<d.length;S++)if(d.item(S).name==="xmlns"){y=d.item(S).value;break}if(!y)for(var C=p.length-1;C>=0;C--){var w=p[C];if(w.prefix===""&&w.namespace===c.namespaceURI){y=w.namespace;break}}if(y!==c.namespaceURI)for(var C=p.length-1;C>=0;C--){var w=p[C];if(w.namespace===c.namespaceURI){w.prefix&&(v=w.prefix+":"+m);break}}}e.push("<",v);for(var E=p.slice(),A=0;A<g;A++){var b=d.item(A);b.prefix=="xmlns"?E.push({prefix:b.localName,namespace:b.value}):b.nodeName=="xmlns"&&E.push({prefix:"",namespace:b.value})}for(var A=0;A<g;A++){var b=d.item(A);if(W5(b,l,E)){var V=b.prefix||"",I=b.namespaceURI;GS(e,V?"xmlns:"+V:"xmlns",I),E.push({prefix:V,namespace:I})}var D=s?s(b):b;D&&(typeof D=="string"?e.push(D):GS(e,D.name,D.value))}if(m===v&&W5(c,l,E)){var U=c.prefix||"",I=c.namespaceURI;GS(e,U?"xmlns:"+U:"xmlns",I),E.push({prefix:U,namespace:I})}var F=!c.firstChild;if(F&&(l||c.namespaceURI===ea.HTML)&&(F=UY(m)),F)return e.push("/>"),null;if(e.push(">"),l&&FY(m)){for(var M=c.firstChild;M;)M.data?e.push(M.data):uI(M,e,E.slice(),n),M=M.nextSibling;return e.push("</",v,">"),null}return{ns:E,tag:v};case O0:case Xu:if(i&&c.nodeType===O0&&c.documentElement==null)throw new We("The Document has no documentElement",Hs.InvalidStateError);return{ns:p};case P0:return GS(e,c.name,c.value),null;case WS:if(i&&An.InvalidChar.test(c.data))throw new We("The Text node data contains characters outside the XML Char production",Hs.InvalidStateError);return e.push(c.data.replace(/[<&>]/g,nL)),null;case Y5:if(i&&c.data.indexOf("]]>")!==-1)throw new We('The CDATASection data contains "]]>"',Hs.InvalidStateError);return a?e.push(An.CDATA_START,c.data.replace(/]]>/g,"]]]]><![CDATA[>"),An.CDATA_END):e.push(An.CDATA_START,c.data,An.CDATA_END),null;case iI:if(i){if(An.InvalidChar.test(c.data))throw new We("The comment node data contains characters outside the XML Char production",Hs.InvalidStateError);if(c.data.indexOf("--")!==-1||c.data[c.data.length-1]==="-")throw new We('The comment node data contains "--" or ends with "-"',Hs.InvalidStateError)}return e.push(An.COMMENT_START,c.data,An.COMMENT_END),null;case Z5:var se=c.publicId,ee=c.systemId;if(i){if(se&&!An.PubidLiteral_match.test(se))throw new We("DocumentType publicId is not a valid PubidLiteral",Hs.InvalidStateError);if(ee&&ee!=="."&&!An.SystemLiteral_match.test(ee))throw new We("DocumentType systemId is not a valid SystemLiteral",Hs.InvalidStateError);if(c.internalSubset&&c.internalSubset.indexOf("]>")!==-1)throw new We('DocumentType internalSubset contains "]>"',Hs.InvalidStateError)}return e.push(An.DOCTYPE_DECL_START," ",c.name),se?(e.push(" ",An.PUBLIC," ",se),ee&&ee!=="."&&e.push(" ",ee)):ee&&ee!=="."&&e.push(" ",An.SYSTEM," ",ee),c.internalSubset&&e.push(" [",c.internalSubset,"]"),e.push(">"),null;case sI:if(i){if(c.target.indexOf(":")!==-1||c.target.toLowerCase()==="xml")throw new We("The ProcessingInstruction target is not well-formed",Hs.InvalidStateError);if(An.InvalidChar.test(c.data))throw new We("The ProcessingInstruction data contains characters outside the XML Char production",Hs.InvalidStateError);if(c.data.indexOf("?>")!==-1)throw new We('The ProcessingInstruction data contains "?>"',Hs.InvalidStateError)}return e.push("<?",c.target," ",c.data,"?>"),null;case Q5:return e.push("&",c.nodeName,";"),null;default:return e.push("??",c.nodeName),null}},"enter"),exit:u(function(c,f){f&&f.tag&&e.push("</",f.tag,">")},"exit")})}u(uI,"serializeToString");function QY(r,e,t){var n;return Cn(e,null,{enter:u(function(s,i){var a=s.cloneNode(!1);a.ownerDocument=r,a.parentNode=null,i===null?n=a:i.appendChild(a);var o=s.nodeType===P0||t;return o?a:null},"enter")}),n}u(QY,"importNode");function fL(r,e,t){var n;return Cn(e,null,{enter:u(function(s,i){var a=new s.constructor(Un);for(var o in s)if(_0(s,o)){var l=s[o];typeof l!="object"&&l!=a[o]&&(a[o]=l)}s.childNodes&&(a.childNodes=new Jr),a.ownerDocument=r;var c=t;switch(a.nodeType){case Ks:var f=s.attributes,p=a.attributes=new k0,d=f.length;p._ownerElement=a;for(var g=0;g<d;g++)a.setAttributeNode(fL(r,f.item(g),!0));break;case P0:c=!0}return i!==null?i.appendChild(a):n=a,c?a:null},"enter")}),n}u(fL,"cloneNode");function hL(r,e,t){r[e]=t}u(hL,"__set__");function rI(r){for(var e=[],t=r.firstChild;t;)t.nodeType===Ks&&e.push(t),t=t.nextSibling;return e}u(rI,"childrenRefresh");try{Object.defineProperty&&(Object.defineProperty(Qi.prototype,"length",{get:u(function(){return JS(this),this.$$length},"get")}),Object.defineProperty(Ft.prototype,"textContent",{get:u(function(){if(this.nodeType===Ks||this.nodeType===Xu){var r=[];return Cn(this,null,{enter:u(function(e){if(e.nodeType===Ks||e.nodeType===Xu)return!0;if(e.nodeType===sI||e.nodeType===iI)return null;r.push(e.nodeValue)},"enter")}),r.join("")}return this.nodeValue},"get"),set:u(function(r){switch(this.nodeType){case Ks:case Xu:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}},"set")}),Object.defineProperty(Ya.prototype,"children",{get:u(function(){return new Qi(this,rI)},"get")}),Object.defineProperty(Ja.prototype,"children",{get:u(function(){return new Qi(this,rI)},"get")}),Object.defineProperty(F0.prototype,"children",{get:u(function(){return new Qi(this,rI)},"get")}),hL=u(function(r,e,t){r["$$"+e]=t},"__set__"))}catch{}kr._updateLiveList=JS;kr.Attr=rf;kr.CDATASection=QS;kr.CharacterData=V0;kr.Comment=YS;kr.Document=Ja;kr.DocumentFragment=F0;kr.DocumentType=ZS;kr.DOMImplementation=rL;kr.Element=Ya;kr.Entity=oI;kr.EntityReference=eA;kr.LiveNodeList=Qi;kr.NamedNodeMap=k0;kr.Node=Ft;kr.NodeList=Jr;kr.Notation=aI;kr.Text=Sy;kr.ProcessingInstruction=tA;kr.walkDOM=Cn;kr.XMLSerializer=lL});var dL=ue(Ay=>{"use strict";var pL=tf().freeze;Ay.XML_ENTITIES=pL({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Ay.HTML_ENTITIES=pL({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:`
77
+ `?(B.line++,B.column=0):B.column++);B.textNode+=O.substring(_e,Q-1)}K==="<"&&!(B.sawRoot&&B.closedRoot&&!B.strict)?(B.state=I.OPEN_WAKA,B.startTagPosition=B.position):(!w(K)&&(!B.sawRoot||B.closedRoot)&&X(B,"Text data outside of root node."),K==="&"?B.state=I.TEXT_ENTITY:B.textNode+=K);continue;case I.SCRIPT:K==="<"?B.state=I.SCRIPT_ENDING:B.script+=K;continue;case I.SCRIPT_ENDING:K==="/"?B.state=I.CLOSE_TAG:(B.script+="<"+K,B.state=I.SCRIPT);continue;case I.OPEN_WAKA:if(K==="!")B.state=I.SGML_DECL,B.sgmlDecl="";else if(!w(K))if(b(v,K))B.state=I.OPEN_TAG,B.tagName=K;else if(K==="/")B.state=I.CLOSE_TAG,B.tagName="";else if(K==="?")B.state=I.PROC_INST,B.procInstName=B.procInstBody="";else{if(X(B,"Unencoded <"),B.startTagPosition+1<B.position){var R=B.position-B.startTagPosition;K=new Array(R).join(" ")+K}B.textNode+="<"+K,B.state=I.TEXT}continue;case I.SGML_DECL:if(B.sgmlDecl+K==="--"){B.state=I.COMMENT,B.comment="",B.sgmlDecl="";continue}B.doctype&&B.doctype!==!0&&B.sgmlDecl?(B.state=I.DOCTYPE_DTD,B.doctype+="<!"+B.sgmlDecl+K,B.sgmlDecl=""):(B.sgmlDecl+K).toUpperCase()===f?(F(B,"onopencdata"),B.state=I.CDATA,B.sgmlDecl="",B.cdata=""):(B.sgmlDecl+K).toUpperCase()===p?(B.state=I.DOCTYPE,(B.doctype||B.sawRoot)&&X(B,"Inappropriately located doctype declaration"),B.doctype="",B.sgmlDecl=""):K===">"?(F(B,"onsgmldeclaration",B.sgmlDecl),B.sgmlDecl="",B.state=I.TEXT):(E(K)&&(B.state=I.SGML_DECL_QUOTED),B.sgmlDecl+=K);continue;case I.SGML_DECL_QUOTED:K===B.q&&(B.state=I.SGML_DECL,B.q=""),B.sgmlDecl+=K;continue;case I.DOCTYPE:K===">"?(B.state=I.TEXT,F(B,"ondoctype",B.doctype),B.doctype=!0):(B.doctype+=K,K==="["?B.state=I.DOCTYPE_DTD:E(K)&&(B.state=I.DOCTYPE_QUOTED,B.q=K));continue;case I.DOCTYPE_QUOTED:B.doctype+=K,K===B.q&&(B.q="",B.state=I.DOCTYPE);continue;case I.DOCTYPE_DTD:K==="]"?(B.doctype+=K,B.state=I.DOCTYPE):K==="<"?(B.state=I.OPEN_WAKA,B.startTagPosition=B.position):E(K)?(B.doctype+=K,B.state=I.DOCTYPE_DTD_QUOTED,B.q=K):B.doctype+=K;continue;case I.DOCTYPE_DTD_QUOTED:B.doctype+=K,K===B.q&&(B.state=I.DOCTYPE_DTD,B.q="");continue;case I.COMMENT:K==="-"?B.state=I.COMMENT_ENDING:B.comment+=K;continue;case I.COMMENT_ENDING:K==="-"?(B.state=I.COMMENT_ENDED,B.comment=se(B.opt,B.comment),B.comment&&F(B,"oncomment",B.comment),B.comment=""):(B.comment+="-"+K,B.state=I.COMMENT);continue;case I.COMMENT_ENDED:K!==">"?(X(B,"Malformed comment"),B.comment+="--"+K,B.state=I.COMMENT):B.doctype&&B.doctype!==!0?B.state=I.DOCTYPE_DTD:B.state=I.TEXT;continue;case I.CDATA:K==="]"?B.state=I.CDATA_ENDING:B.cdata+=K;continue;case I.CDATA_ENDING:K==="]"?B.state=I.CDATA_ENDING_2:(B.cdata+="]"+K,B.state=I.CDATA);continue;case I.CDATA_ENDING_2:K===">"?(B.cdata&&F(B,"oncdata",B.cdata),F(B,"onclosecdata"),B.cdata="",B.state=I.TEXT):K==="]"?B.cdata+="]":(B.cdata+="]]"+K,B.state=I.CDATA);continue;case I.PROC_INST:K==="?"?B.state=I.PROC_INST_ENDING:w(K)?B.state=I.PROC_INST_BODY:B.procInstName+=K;continue;case I.PROC_INST_BODY:if(!B.procInstBody&&w(K))continue;K==="?"?B.state=I.PROC_INST_ENDING:B.procInstBody+=K;continue;case I.PROC_INST_ENDING:K===">"?(F(B,"onprocessinginstruction",{name:B.procInstName,body:B.procInstBody}),B.procInstName=B.procInstBody="",B.state=I.TEXT):(B.procInstBody+="?"+K,B.state=I.PROC_INST_BODY);continue;case I.OPEN_TAG:b(y,K)?B.tagName+=K:(he(B),K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:(w(K)||X(B,"Invalid character in tag name"),B.state=I.ATTRIB));continue;case I.OPEN_TAG_SLASH:K===">"?(pe(B,!0),W(B)):(X(B,"Forward-slash in opening tag not followed by >"),B.state=I.ATTRIB);continue;case I.ATTRIB:if(w(K))continue;K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:b(v,K)?(B.attribName=K,B.attribValue="",B.state=I.ATTRIB_NAME):X(B,"Invalid attribute name");continue;case I.ATTRIB_NAME:K==="="?B.state=I.ATTRIB_VALUE:K===">"?(X(B,"Attribute without value"),B.attribValue=B.attribName,xe(B),pe(B)):w(K)?B.state=I.ATTRIB_NAME_SAW_WHITE:b(y,K)?B.attribName+=K:X(B,"Invalid attribute name");continue;case I.ATTRIB_NAME_SAW_WHITE:if(K==="=")B.state=I.ATTRIB_VALUE;else{if(w(K))continue;X(B,"Attribute without value"),B.tag.attributes[B.attribName]="",B.attribValue="",F(B,"onattribute",{name:B.attribName,value:""}),B.attribName="",K===">"?pe(B):b(v,K)?(B.attribName=K,B.state=I.ATTRIB_NAME):(X(B,"Invalid attribute name"),B.state=I.ATTRIB)}continue;case I.ATTRIB_VALUE:if(w(K))continue;E(K)?(B.q=K,B.state=I.ATTRIB_VALUE_QUOTED):(B.opt.unquotedAttributeValues||ee(B,"Unquoted attribute value"),B.state=I.ATTRIB_VALUE_UNQUOTED,B.attribValue=K);continue;case I.ATTRIB_VALUE_QUOTED:if(K!==B.q){K==="&"?B.state=I.ATTRIB_VALUE_ENTITY_Q:B.attribValue+=K;continue}xe(B),B.q="",B.state=I.ATTRIB_VALUE_CLOSED;continue;case I.ATTRIB_VALUE_CLOSED:w(K)?B.state=I.ATTRIB:K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:b(v,K)?(X(B,"No whitespace between attributes"),B.attribName=K,B.attribValue="",B.state=I.ATTRIB_NAME):X(B,"Invalid attribute name");continue;case I.ATTRIB_VALUE_UNQUOTED:if(!A(K)){K==="&"?B.state=I.ATTRIB_VALUE_ENTITY_U:B.attribValue+=K;continue}xe(B),K===">"?pe(B):B.state=I.ATTRIB;continue;case I.CLOSE_TAG:if(B.tagName)K===">"?W(B):b(y,K)?B.tagName+=K:B.script?(B.script+="</"+B.tagName,B.tagName="",B.state=I.SCRIPT):(w(K)||X(B,"Invalid tagname in closing tag"),B.state=I.CLOSE_TAG_SAW_WHITE);else{if(w(K))continue;V(v,K)?B.script?(B.script+="</"+K,B.state=I.SCRIPT):X(B,"Invalid tagname in closing tag."):B.tagName=K}continue;case I.CLOSE_TAG_SAW_WHITE:if(w(K))continue;K===">"?W(B):X(B,"Invalid characters in closing tag");continue;case I.TEXT_ENTITY:case I.ATTRIB_VALUE_ENTITY_Q:case I.ATTRIB_VALUE_ENTITY_U:var N,J;switch(B.state){case I.TEXT_ENTITY:N=I.TEXT,J="textNode";break;case I.ATTRIB_VALUE_ENTITY_Q:N=I.ATTRIB_VALUE_QUOTED,J="attribValue";break;case I.ATTRIB_VALUE_ENTITY_U:N=I.ATTRIB_VALUE_UNQUOTED,J="attribValue";break}if(K===";"){var $=fe(B);B.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes($)?(B.entity="",B.state=N,B.write($)):(B[J]+=$,B.entity="",B.state=N)}else b(B.entity.length?C:S,K)?B.entity+=K:(X(B,"Invalid character in entity name"),B[J]+="&"+B.entity+K,B.entity="",B.state=N);continue;default:throw new Error(B,"Unknown state: "+B.state)}return B.position>=B.bufferCheckPosition&&n(B),B}u(Le,"write");String.fromCodePoint||(function(){var O=String.fromCharCode,B=Math.floor,Q=u(function(){var K=16384,_e=[],R,N,J=-1,$=arguments.length;if(!$)return"";for(var ge="";++J<$;){var et=Number(arguments[J]);if(!isFinite(et)||et<0||et>1114111||B(et)!==et)throw RangeError("Invalid code point: "+et);et<=65535?_e.push(et):(et-=65536,R=(et>>10)+55296,N=et%1024+56320,_e.push(R,N)),(J+1===$||_e.length>K)&&(ge+=O.apply(null,_e),_e.length=0)}return ge},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:Q,configurable:!0,writable:!0}):String.fromCodePoint=Q})()})(typeof z2>"u"?z2.sax={}:z2)});var L4=ue(hb=>{"use strict";(function(){"use strict";hb.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(hb)});var pb=ue(dl=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),dl.normalize=function(e){return e.toLowerCase()},dl.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},dl.stripPrefix=function(e){return e.replace(r,"")},dl.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},dl.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(dl)});var V4=ue(ga=>{"use strict";(function(){"use strict";var r,e,t,n,s,i,a,o,l,c=u(function(d,g){return function(){return d.apply(g,arguments)}},"bind"),f=u(function(d,g){for(var m in g)p.call(g,m)&&(d[m]=g[m]);function v(){this.constructor=d}return u(v,"ctor"),v.prototype=g.prototype,d.prototype=new v,d.__super__=g.prototype,d},"extend"),p={}.hasOwnProperty;o=k4(),n=st("events"),r=L4(),a=pb(),l=st("timers").setImmediate,e=P2().defaults,s=u(function(d){return typeof d=="object"&&d!=null&&Object.keys(d).length===0},"isEmpty"),i=u(function(d,g,m){var v,y,S;for(v=0,y=d.length;v<y;v++)S=d[v],g=S(g,m);return g},"processItem"),t=u(function(d,g,m){var v;return v=Object.create(null),v.value=m,v.writable=!0,v.enumerable=!0,v.configurable=!0,Object.defineProperty(d,g,v)},"defineProperty"),ga.Parser=(function(d){f(g,d);function g(m){this.parseStringPromise=c(this.parseStringPromise,this),this.parseString=c(this.parseString,this),this.reset=c(this.reset,this),this.assignOrPush=c(this.assignOrPush,this),this.processAsync=c(this.processAsync,this);var v,y,S;if(!(this instanceof ga.Parser))return new ga.Parser(m);this.options={},y=e["0.2"];for(v in y)p.call(y,v)&&(S=y[v],this.options[v]=S);for(v in m)p.call(m,v)&&(S=m[v],this.options[v]=S);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 u(g,"Parser"),g.prototype.processAsync=function(){var m,v;try{return this.remaining.length<=this.options.chunkSize?(m=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(m),this.saxParser.close()):(m=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(m),l(this.processAsync))}catch(y){if(v=y,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(v)}},g.prototype.assignOrPush=function(m,v,y){return v in m?(m[v]instanceof Array||t(m,v,[m[v]]),m[v].push(y)):this.options.explicitArray?t(m,v,[y]):t(m,v,y)},g.prototype.reset=function(){var m,v,y,S;return this.removeAllListeners(),this.saxParser=o.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(C){return function(w){if(C.saxParser.resume(),!C.saxParser.errThrown)return C.saxParser.errThrown=!0,C.emit("error",w)}})(this),this.saxParser.onend=(function(C){return function(){if(!C.saxParser.ended)return C.saxParser.ended=!0,C.emit("end",C.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,S=[],m=this.options.attrkey,v=this.options.charkey,this.saxParser.onopentag=(function(C){return function(w){var E,A,b,V,I;if(b={},b[v]="",!C.options.ignoreAttrs){I=w.attributes;for(E in I)p.call(I,E)&&(!(m in b)&&!C.options.mergeAttrs&&(b[m]={}),A=C.options.attrValueProcessors?i(C.options.attrValueProcessors,w.attributes[E],E):w.attributes[E],V=C.options.attrNameProcessors?i(C.options.attrNameProcessors,E):E,C.options.mergeAttrs?C.assignOrPush(b,V,A):t(b[m],V,A))}return b["#name"]=C.options.tagNameProcessors?i(C.options.tagNameProcessors,w.name):w.name,C.options.xmlns&&(b[C.options.xmlnskey]={uri:w.uri,local:w.local}),S.push(b)}})(this),this.saxParser.onclosetag=(function(C){return function(){var w,E,A,b,V,I,D,U,F,M;if(I=S.pop(),V=I["#name"],(!C.options.explicitChildren||!C.options.preserveChildrenOrder)&&delete I["#name"],I.cdata===!0&&(w=I.cdata,delete I.cdata),F=S[S.length-1],I[v].match(/^\s*$/)&&!w?(E=I[v],delete I[v]):(C.options.trim&&(I[v]=I[v].trim()),C.options.normalize&&(I[v]=I[v].replace(/\s{2,}/g," ").trim()),I[v]=C.options.valueProcessors?i(C.options.valueProcessors,I[v],V):I[v],Object.keys(I).length===1&&v in I&&!C.EXPLICIT_CHARKEY&&(I=I[v])),s(I)&&(typeof C.options.emptyTag=="function"?I=C.options.emptyTag():I=C.options.emptyTag!==""?C.options.emptyTag:E),C.options.validator!=null&&(M="/"+(function(){var se,ee,ie;for(ie=[],se=0,ee=S.length;se<ee;se++)b=S[se],ie.push(b["#name"]);return ie})().concat(V).join("/"),(function(){var se;try{return I=C.options.validator(M,F&&F[V],I)}catch(ee){return se=ee,C.emit("error",se)}})()),C.options.explicitChildren&&!C.options.mergeAttrs&&typeof I=="object"){if(!C.options.preserveChildrenOrder)b={},C.options.attrkey in I&&(b[C.options.attrkey]=I[C.options.attrkey],delete I[C.options.attrkey]),!C.options.charsAsChildren&&C.options.charkey in I&&(b[C.options.charkey]=I[C.options.charkey],delete I[C.options.charkey]),Object.getOwnPropertyNames(I).length>0&&(b[C.options.childkey]=I),I=b;else if(F){F[C.options.childkey]=F[C.options.childkey]||[],D={};for(A in I)p.call(I,A)&&t(D,A,I[A]);F[C.options.childkey].push(D),delete I["#name"],Object.keys(I).length===1&&v in I&&!C.EXPLICIT_CHARKEY&&(I=I[v])}}return S.length>0?C.assignOrPush(F,V,I):(C.options.explicitRoot&&(U=I,I={},t(I,V,U)),C.resultObject=I,C.saxParser.ended=!0,C.emit("end",C.resultObject))}})(this),y=(function(C){return function(w){var E,A;if(A=S[S.length-1],A)return A[v]+=w,C.options.explicitChildren&&C.options.preserveChildrenOrder&&C.options.charsAsChildren&&(C.options.includeWhiteChars||w.replace(/\\n/g,"").trim()!=="")&&(A[C.options.childkey]=A[C.options.childkey]||[],E={"#name":"__text__"},E[v]=w,C.options.normalize&&(E[v]=E[v].replace(/\s{2,}/g," ").trim()),A[C.options.childkey].push(E)),A}})(this),this.saxParser.ontext=y,this.saxParser.oncdata=(function(C){return function(w){var E;if(E=y(w),E)return E.cdata=!0}})(this)},g.prototype.parseString=function(m,v){var y;v!=null&&typeof v=="function"&&(this.on("end",function(S){return this.reset(),v(null,S)}),this.on("error",function(S){return this.reset(),v(S)}));try{return m=m.toString(),m.trim()===""?(this.emit("end",null),!0):(m=r.stripBOM(m),this.options.async?(this.remaining=m,l(this.processAsync),this.saxParser):this.saxParser.write(m).close())}catch(S){if(y=S,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw y}else return this.emit("error",y),this.saxParser.errThrown=!0}},g.prototype.parseStringPromise=function(m){return new Promise((function(v){return function(y,S){return v.parseString(m,function(C,w){return C?S(C):y(w)})}})(this))},g})(n),ga.parseString=function(d,g,m){var v,y,S;return m!=null?(typeof m=="function"&&(v=m),typeof g=="object"&&(y=g)):(typeof g=="function"&&(v=g),y={}),S=new ga.Parser(y),S.parseString(d,v)},ga.parseStringPromise=function(d,g){var m,v;return typeof g=="object"&&(m=g),v=new ga.Parser(m),v.parseStringPromise(d)}}).call(ga)});var F4=ue(ya=>{"use strict";(function(){"use strict";var r,e,t,n,s=u(function(a,o){for(var l in o)i.call(o,l)&&(a[l]=o[l]);function c(){this.constructor=a}return u(c,"ctor"),c.prototype=o.prototype,a.prototype=new c,a.__super__=o.prototype,a},"extend"),i={}.hasOwnProperty;e=P2(),r=P4(),t=V4(),n=pb(),ya.defaults=e.defaults,ya.processors=n,ya.ValidationError=(function(a){s(o,a);function o(l){this.message=l}return u(o,"ValidationError"),o})(Error),ya.Builder=r.Builder,ya.Parser=t.Parser,ya.parseString=t.parseString,ya.parseStringPromise=t.parseStringPromise}).call(ya)});var tf=ue(Sn=>{"use strict";function IJ(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(ef(r,n)){var s=r[n];if(e.call(void 0,s,n,r))return s}}u(IJ,"find");function I0(r,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(r=e.create(null,e.getOwnPropertyDescriptors(r))),e&&typeof e.freeze=="function"?e.freeze(r):r}u(I0,"freeze");function ef(r,e){return Object.prototype.hasOwnProperty.call(r,e)}u(ef,"hasOwn");function DJ(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)ef(e,t)&&(r[t]=e[t]);return r}u(DJ,"assign");var b5=I0({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function BJ(r){return ef(b5,r.toLowerCase())}u(BJ,"isHTMLBooleanAttribute");var N5=I0({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function RJ(r){return ef(N5,r.toLowerCase())}u(RJ,"isHTMLVoidElement");var uy=I0({script:!1,style:!1,textarea:!0,title:!0});function OJ(r){var e=r.toLowerCase();return ef(uy,e)&&!uy[e]}u(OJ,"isHTMLRawTextElement");function _J(r){var e=r.toLowerCase();return ef(uy,e)&&uy[e]}u(_J,"isHTMLEscapableRawTextElement");function T5(r){return r===ly.HTML}u(T5,"isHTMLMimeType");function PJ(r){return T5(r)||r===ly.XML_XHTML_APPLICATION}u(PJ,"hasDefaultHTMLNamespace");var ly=I0({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),kJ=Object.keys(ly).map(function(r){return ly[r]});function LJ(r){return kJ.indexOf(r)>-1}u(LJ,"isValidMimeType");var VJ=I0({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Sn.assign=DJ;Sn.find=IJ;Sn.freeze=I0;Sn.HTML_BOOLEAN_ATTRIBUTES=b5;Sn.HTML_RAW_TEXT_ELEMENTS=uy;Sn.HTML_VOID_ELEMENTS=N5;Sn.hasDefaultHTMLNamespace=PJ;Sn.hasOwn=ef;Sn.isHTMLBooleanAttribute=BJ;Sn.isHTMLRawTextElement=OJ;Sn.isHTMLEscapableRawTextElement=_J;Sn.isHTMLMimeType=T5;Sn.isHTMLVoidElement=RJ;Sn.isValidMimeType=LJ;Sn.MIME_TYPE=ly;Sn.NAMESPACE=VJ});var dy=ue(py=>{"use strict";var FJ=tf();function D5(r,e){r.prototype=Object.create(Error.prototype,{constructor:{value:r},name:{value:r.name,enumerable:!0,writable:e}})}u(D5,"extendError");var fy=FJ.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),B5=Object.keys(fy);function R5(r){return typeof r=="number"&&r>=1&&r<=25}u(R5,"isValidDomExceptionCode");function UJ(r){return typeof r=="string"&&r.substring(r.length-fy.Error.length)===fy.Error}u(UJ,"endsWithError");function hy(r,e){R5(r)?(this.name=B5[r],this.message=e||""):(this.message=r,this.name=UJ(e)?e:fy.Error),Error.captureStackTrace&&Error.captureStackTrace(this,hy)}u(hy,"DOMException");D5(hy,!0);Object.defineProperties(hy.prototype,{code:{enumerable:!0,get:u(function(){var r=B5.indexOf(this.name);return R5(r)?r:0},"get")}});var O5={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},$T=Object.entries(O5);for(cy=0;cy<$T.length;cy++)I5=$T[cy][0],hy[I5]=$T[cy][1];var I5,cy;function WT(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,WT)}u(WT,"ParseError");D5(WT);py.DOMException=hy;py.DOMExceptionName=fy;py.ExceptionCode=O5;py.ParseError=WT});var tI=ue(vt=>{"use strict";function U5(r){try{typeof r!="function"&&(r=RegExp);var e=new r("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}u(U5,"detectUnicodeSupport");var R0=U5();function Hu(r){if(r.source[0]!=="[")throw new Error(r+" can not be used with chars");return r.source.slice(1,r.source.lastIndexOf("]"))}u(Hu,"chars");function D0(r,e){if(r.source[0]!=="[")throw new Error("/"+r.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(r.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+r.source+"/");if(e==="-"&&r.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+r.source+"/");return new RegExp(r.source.replace(e,""),R0?"u":"")}u(D0,"chars_without");function Tt(r){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var n=typeof t=="string";if(n&&e===void 0&&t==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?t:t.source}).join(""),R0?"mu":"m")}u(Tt,"reg");function ct(r){if(arguments.length===0)throw new Error("no parameters provided");return Tt.apply(ct,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}u(ct,"regg");var MJ="\uFFFD",Ku=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;R0&&(Ku=Tt("[",Hu(Ku),"\\u{10000}-\\u{10FFFF}","]"));var jJ=new RegExp("[^"+Hu(Ku)+"]",R0?"u":""),JT=/[\x20\x09\x0D\x0A]/,qJ=Hu(JT),rr=Tt(JT,"+"),Tr=Tt(JT,"*"),my=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;R0&&(my=Tt("[",Hu(my),"\\u{10000}-\\u{10FFFF}","]"));var HJ=Hu(my),YT=Tt("[",HJ,Hu(/[-.0-9\xB7]/),Hu(/[\u0300-\u036F\u203F-\u2040]/),"]"),qs=Tt(my,YT,"*"),_5=Tt(YT,"+"),KJ=Tt("&",qs,";"),XJ=ct(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),gy=ct(KJ,"|",XJ),yy=Tt("%",qs,";"),QT=ct(Tt('"',ct(/[^%&"]/,"|",yy,"|",gy),"*",'"'),"|",Tt("'",ct(/[^%&']/,"|",yy,"|",gy),"*","'")),GJ=ct('"',ct(/[^<&"]/,"|",gy),"*",'"',"|","'",ct(/[^<&']/,"|",gy),"*","'"),$J=D0(my,":"),WJ=D0(YT,":"),P5=Tt($J,WJ,"*"),vy=Tt(P5,ct(":",P5),"?"),zJ=Tt("^",vy,"$"),JJ=Tt("(",vy,")"),B0=ct(/"[^"]*"|'[^']*'/),YJ=Tt(/^<\?/,"(",qs,")",ct(rr,"(",Ku,"*?)"),"?",/\?>/),k5=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Ey=ct('"',k5,'*"',"|","'",D0(k5,"'"),"*'"),M5="<!--",j5="-->",QJ=Tt(M5,ct(D0(Ku,"-"),"|",Tt("-",D0(Ku,"-"))),"*",j5),L5="#PCDATA",ZJ=ct(Tt(/\(/,Tr,L5,ct(Tr,/\|/,Tr,vy),"*",Tr,/\)\*/),"|",Tt(/\(/,Tr,L5,Tr,/\)/)),eY=/[?*+]?/,tY=Tt(/\([^>]+\)/,eY),rY=ct("EMPTY","|","ANY","|",ZJ,"|",tY),nY="<!ELEMENT",sY=Tt(nY,rr,ct(vy,"|",yy),rr,ct(rY,"|",yy),Tr,">"),iY=Tt("NOTATION",rr,/\(/,Tr,qs,ct(Tr,/\|/,Tr,qs),"*",Tr,/\)/),aY=Tt(/\(/,Tr,_5,ct(Tr,/\|/,Tr,_5),"*",Tr,/\)/),oY=ct(iY,"|",aY),uY=ct(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",oY),lY=ct(/#REQUIRED|#IMPLIED/,"|",ct(ct("#FIXED",rr),"?",GJ)),cY=ct(rr,qs,rr,uY,rr,lY),fY="<!ATTLIST",hY=Tt(fY,rr,qs,cY,"*",Tr,">"),zT="about:legacy-compat",pY=ct('"'+zT+'"',"|","'"+zT+"'"),ZT="SYSTEM",KS="PUBLIC",XS=ct(ct(ZT,rr,B0),"|",ct(KS,rr,Ey,rr,B0)),dY=Tt("^",ct(ct(ZT,rr,"(?<SystemLiteralOnly>",B0,")"),"|",ct(KS,rr,"(?<PubidLiteral>",Ey,")",rr,"(?<SystemLiteral>",B0,")"))),mY=Tt("^",Ey,"$"),gY=Tt("^",B0,"$"),yY=ct(rr,"NDATA",rr,qs),vY=ct(QT,"|",ct(XS,yY,"?")),q5="<!ENTITY",EY=Tt(q5,rr,qs,rr,vY,Tr,">"),wY=ct(QT,"|",XS),SY=Tt(q5,rr,"%",rr,qs,rr,wY,Tr,">"),AY=ct(EY,"|",SY),CY=Tt(KS,rr,Ey),xY=Tt("<!NOTATION",rr,qs,rr,ct(XS,"|",CY),Tr,">"),eI=Tt(Tr,"=",Tr),V5=/1[.]\d+/,bY=Tt(rr,"version",eI,ct("'",V5,"'","|",'"',V5,'"')),F5=/[A-Za-z][-A-Za-z0-9._]*/,NY=ct(rr,"encoding",eI,ct('"',F5,'"',"|","'",F5,"'")),TY=ct(rr,"standalone",eI,ct("'",ct("yes","|","no"),"'","|",'"',ct("yes","|","no"),'"')),IY=Tt(/^<\?xml/,bY,NY,"?",TY,"?",Tr,/\?>/),DY="<!DOCTYPE",BY="<![CDATA[",RY="]]>",OY=/<!\[CDATA\[/,_Y=/\]\]>/,PY=Tt(Ku,"*?",_Y),kY=Tt(OY,PY);vt.chars=Hu;vt.chars_without=D0;vt.detectUnicodeSupport=U5;vt.reg=Tt;vt.regg=ct;vt.ABOUT_LEGACY_COMPAT=zT;vt.ABOUT_LEGACY_COMPAT_SystemLiteral=pY;vt.AttlistDecl=hY;vt.CDATA_START=BY;vt.CDATA_END=RY;vt.CDSect=kY;vt.Char=Ku;vt.Comment=QJ;vt.COMMENT_START=M5;vt.COMMENT_END=j5;vt.DOCTYPE_DECL_START=DY;vt.elementdecl=sY;vt.EntityDecl=AY;vt.EntityValue=QT;vt.ExternalID=XS;vt.ExternalID_match=dY;vt.Name=qs;vt.NotationDecl=xY;vt.Reference=gy;vt.PEReference=yy;vt.PI=YJ;vt.PUBLIC=KS;vt.PubidLiteral=Ey;vt.PubidLiteral_match=mY;vt.QName=vy;vt.QName_exact=zJ;vt.QName_group=JJ;vt.S=rr;vt.SChar_s=qJ;vt.S_OPT=Tr;vt.SYSTEM=ZT;vt.SystemLiteral=B0;vt.SystemLiteral_match=gY;vt.InvalidChar=jJ;vt.UNICODE_REPLACEMENT_CHARACTER=MJ;vt.UNICODE_SUPPORT=R0;vt.XMLDecl=IY});var lI=ue(kr=>{"use strict";var Xs=tf(),Zi=Xs.find,LY=Xs.hasDefaultHTMLNamespace,_0=Xs.hasOwn,VY=Xs.isHTMLMimeType,FY=Xs.isHTMLRawTextElement,UY=Xs.isHTMLVoidElement,wy=Xs.MIME_TYPE,ea=Xs.NAMESPACE,Un=Symbol(),z5=dy(),We=z5.DOMException,Hs=z5.DOMExceptionName,An=tI();function ss(r){if(r!==Un)throw new TypeError("Illegal constructor")}u(ss,"checkSymbol");function MY(r){return r!==""}u(MY,"notEmptyString");function jY(r){return r?r.split(/[\t\n\f\r ]+/).filter(MY):[]}u(jY,"splitOnASCIIWhitespace");function qY(r,e){return _0(r,e)||(r[e]=!0),r}u(qY,"orderedSetReducer");function H5(r){if(!r)return[];var e=jY(r);return Object.keys(e.reduce(qY,{}))}u(H5,"toOrderedSet");function HY(r){return function(e){return r&&r.indexOf(e)!==-1}}u(HY,"arrayIncludes");function J5(r){if(!An.QName_exact.test(r))throw new We(We.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+r+'"')}u(J5,"validateQualifiedName");function nI(r,e){J5(e),r=r||null;var t=null,n=e;if(e.indexOf(":")>=0){var s=e.split(":");t=s[0],n=s[1]}if(t!==null&&r===null)throw new We(We.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(t==="xml"&&r!==Xs.NAMESPACE.XML)throw new We(We.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((t==="xmlns"||e==="xmlns")&&r!==Xs.NAMESPACE.XMLNS)throw new We(We.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(r===Xs.NAMESPACE.XMLNS&&t!=="xmlns"&&e!=="xmlns")throw new We(We.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[r,t,n]}u(nI,"validateAndExtract");function L0(r,e){for(var t in r)_0(r,t)&&(e[t]=r[t])}u(L0,"copy");function is(r,e){var t=r.prototype;if(!(t instanceof e)){let n=function(){};u(n,"t"),n.prototype=e.prototype,n=new n,L0(t,n),r.prototype=t=n}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}u(is,"_extends");var as={},Ks=as.ELEMENT_NODE=1,P0=as.ATTRIBUTE_NODE=2,WS=as.TEXT_NODE=3,Y5=as.CDATA_SECTION_NODE=4,Q5=as.ENTITY_REFERENCE_NODE=5,KY=as.ENTITY_NODE=6,sI=as.PROCESSING_INSTRUCTION_NODE=7,iI=as.COMMENT_NODE=8,O0=as.DOCUMENT_NODE=9,Z5=as.DOCUMENT_TYPE_NODE=10,Xu=as.DOCUMENT_FRAGMENT_NODE=11,XY=as.NOTATION_NODE=12,Pr=Xs.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function eL(r,e){if(e.length<r.length)return eL(e,r);var t=null;for(var n in r){if(r[n]!==e[n])return t;t=r[n]}return t}u(eL,"commonAncestor");function K5(r){return r.guid||(r.guid=Math.random()),r.guid}u(K5,"docGUID");function Jr(){}u(Jr,"NodeList");Jr.prototype={length:0,item:u(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:u(function(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var t=[],n=0;n<this.length;n++)uI(this[n],t,null,e);return t.join("")},"toString"),filter:u(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:u(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};Jr.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:u(function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},"next"),return:u(function(){return{done:!0}},"return")}};function Qi(r,e){this._node=r,this._refresh=e,JS(this)}u(Qi,"LiveNodeList");function JS(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(hL(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)_0(r,n)&&delete r[n];L0(t,r),r._inc=e}}u(JS,"_updateLiveList");Qi.prototype.item=function(r){return JS(this),this[r]||null};is(Qi,Jr);function k0(){}u(k0,"NamedNodeMap");function tL(r,e){for(var t=0;t<r.length;){if(r[t]===e)return t;t++}}u(tL,"_findNodeIndex");function GY(r,e,t,n){if(n?e[tL(e,n)]=t:(e[e.length]=t,e.length++),r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&sL(s,r,n),$Y(s,r,t))}}u(GY,"_addNamedNode");function X5(r,e,t){var n=tL(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&&sL(i,r,t),t.ownerElement=null}}}u(X5,"_removeNamedNode");k0.prototype={length:0,item:Jr.prototype.item,getNamedItem:u(function(r){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());for(var e=0;e<this.length;){var t=this[e];if(t.nodeName===r)return t;e++}return null},"getNamedItem"),setNamedItem:u(function(r){var e=r.ownerElement;if(e&&e!==this._ownerElement)throw new We(We.INUSE_ATTRIBUTE_ERR);var t=this.getNamedItemNS(r.namespaceURI,r.localName);return t===r?r:(GY(this._ownerElement,this,r,t),t)},"setNamedItem"),setNamedItemNS:u(function(r){return this.setNamedItem(r)},"setNamedItemNS"),removeNamedItem:u(function(r){var e=this.getNamedItem(r);if(!e)throw new We(We.NOT_FOUND_ERR,r);return X5(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:u(function(r,e){var t=this.getNamedItemNS(r,e);if(!t)throw new We(We.NOT_FOUND_ERR,r?r+" : "+e:e);return X5(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:u(function(r,e){r||(r=null);for(var t=0;t<this.length;){var n=this[t];if(n.localName===e&&n.namespaceURI===r)return n;t++}return null},"getNamedItemNS")};k0.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:u(function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},"next"),return:u(function(){return{done:!0}},"return")}};function rL(){}u(rL,"DOMImplementation");rL.prototype={hasFeature:u(function(r,e){return!0},"hasFeature"),createDocument:u(function(r,e,t){var n=wy.XML_APPLICATION;r===ea.HTML?n=wy.XML_XHTML_APPLICATION:r===ea.SVG&&(n=wy.XML_SVG_IMAGE);var s=new Ja(Un,{contentType:n});if(s.implementation=this,s.childNodes=new Jr,s.doctype=t||null,t&&s.appendChild(t),e){var i=s.createElementNS(r,e);s.appendChild(i)}return s},"createDocument"),createDocumentType:u(function(r,e,t,n){J5(r);var s=new ZS(Un);return s.name=r,s.nodeName=r,s.publicId=e||"",s.systemId=t||"",s.internalSubset=n||"",s.childNodes=new Jr,s},"createDocumentType"),createHTMLDocument:u(function(r){var e=new Ja(Un,{contentType:wy.HTML});if(e.implementation=this,e.childNodes=new Jr,r!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var t=e.createElement("html");e.appendChild(t);var n=e.createElement("head");if(t.appendChild(n),typeof r=="string"){var s=e.createElement("title");s.appendChild(e.createTextNode(r)),n.appendChild(s)}t.appendChild(e.createElement("body"))}return e},"createHTMLDocument")};function Ut(r){ss(r)}u(Ut,"Node");Ut.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var r=this.getRootNode();return r&&r.nodeType===r.DOCUMENT_NODE},contains:u(function(r){if(!r)return!1;var e=r;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},"contains"),getRootNode:u(function(r){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},"getRootNode"),isEqualNode:u(function(r){if(!r)return!1;for(var e=[{node:this,other:r}];e.length>0;){var t=e.pop(),n=t.node,s=t.other;if(n.nodeType!==s.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==s.name||n.publicId!==s.publicId||n.systemId!==s.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==s.namespaceURI||n.prefix!==s.prefix||n.localName!==s.localName||n.attributes.length!==s.attributes.length)return!1;for(var i=0;i<n.attributes.length;i++){var a=n.attributes.item(i),o=s.getAttributeNodeNS(a.namespaceURI,a.localName);if(!o)return!1;e.push({node:a,other:o})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==s.namespaceURI||n.localName!==s.localName||n.value!==s.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==s.target||n.data!==s.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==s.data)return!1;break}if(n.childNodes.length!==s.childNodes.length)return!1;for(var i=n.childNodes.length-1;i>=0;i--)e.push({node:n.childNodes[i],other:s.childNodes[i]})}return!0},"isEqualNode"),isSameNode:u(function(r){return this===r},"isSameNode"),insertBefore:u(function(r,e){return zS(this,r,e)},"insertBefore"),replaceChild:u(function(r,e){zS(this,r,e,uL),e&&this.removeChild(e)},"replaceChild"),removeChild:u(function(r){return aL(this,r)},"removeChild"),appendChild:u(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:u(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:u(function(r){return fL(this.ownerDocument||this,this,r)},"cloneNode"),normalize:u(function(){Cn(this,null,{enter:u(function(r){for(var e=r.firstChild;e;){var t=e.nextSibling;t!==null&&t.nodeType===WS&&e.nodeType===WS?(r.removeChild(t),e.appendData(t.data)):e=t}return!0},"enter")})},"normalize"),isSupported:u(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),lookupPrefix:u(function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(_0(t,n)&&t[n]===r)return n}e=e.nodeType==P0?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:u(function(r){for(var e=this;e;){var t=e._nsMap;if(t&&_0(t,r))return t[r];e=e.nodeType==P0?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:u(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace"),compareDocumentPosition:u(function(r){if(this===r)return 0;var e=r,t=this,n=null,s=null;if(e instanceof rf&&(n=e,e=n.ownerElement),t instanceof rf&&(s=t,t=s.ownerElement,n&&e&&t===e))for(var i=0,a;a=t.attributes[i];i++){if(a===n)return Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+Pr.DOCUMENT_POSITION_PRECEDING;if(a===s)return Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+Pr.DOCUMENT_POSITION_FOLLOWING}if(!e||!t||t.ownerDocument!==e.ownerDocument)return Pr.DOCUMENT_POSITION_DISCONNECTED+Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(K5(t.ownerDocument)>K5(e.ownerDocument)?Pr.DOCUMENT_POSITION_FOLLOWING:Pr.DOCUMENT_POSITION_PRECEDING);if(s&&e===t)return Pr.DOCUMENT_POSITION_CONTAINS+Pr.DOCUMENT_POSITION_PRECEDING;if(n&&e===t)return Pr.DOCUMENT_POSITION_CONTAINED_BY+Pr.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!s&&l===t)return Pr.DOCUMENT_POSITION_CONTAINED_BY+Pr.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var c=[],f=t.parentNode;f;){if(!n&&f===e)return Pr.DOCUMENT_POSITION_CONTAINS+Pr.DOCUMENT_POSITION_PRECEDING;c.push(f),f=f.parentNode}c.reverse();var p=eL(o,c);for(var d in p.childNodes){var g=p.childNodes[d];if(g===t)return Pr.DOCUMENT_POSITION_FOLLOWING;if(g===e)return Pr.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(g)>=0)return Pr.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(g)>=0)return Pr.DOCUMENT_POSITION_PRECEDING}return 0},"compareDocumentPosition")};function nL(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}u(nL,"_xmlEncoder");L0(as,Ut);L0(as,Ut.prototype);L0(Pr,Ut);L0(Pr,Ut.prototype);function $S(r,e){Cn(r,null,{enter:u(function(t){return e(t)?Cn.STOP:!0},"enter")})}u($S,"_visitNode");function Cn(r,e,t){for(var n=[{node:r,context:e,phase:Cn.ENTER}];n.length>0;){var s=n.pop();if(s.phase===Cn.ENTER){var i=t.enter(s.node,s.context);if(i===Cn.STOP)return Cn.STOP;if(n.push({node:s.node,context:i,phase:Cn.EXIT}),i==null)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:i,phase:Cn.ENTER}),a=a.previousSibling}else t.exit&&t.exit(s.node,s.context)}}u(Cn,"walkDOM");Cn.STOP=Symbol("walkDOM.STOP");Cn.ENTER=0;Cn.EXIT=1;function Ja(r,e){ss(r);var t=e||{};this.ownerDocument=this,this.contentType=t.contentType||wy.XML_APPLICATION,this.type=VY(this.contentType)?"html":"xml"}u(Ja,"Document");function $Y(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===ea.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}u($Y,"_onAddAttribute");function sL(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===ea.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}u(sL,"_onRemoveAttribute");function iL(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t&&!t.nextSibling)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]}}}u(iL,"_onUpdateChild");function aL(r,e){if(r!==e.parentNode)throw new We(We.NOT_FOUND_ERR,"child's parent is not parent");var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,iL(r.ownerDocument,r),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}u(aL,"_removeChild");function WY(r){return r&&(r.nodeType===Ut.DOCUMENT_NODE||r.nodeType===Ut.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ut.ELEMENT_NODE)}u(WY,"hasValidParentNodeType");function zY(r){return r&&(r.nodeType===Ut.CDATA_SECTION_NODE||r.nodeType===Ut.COMMENT_NODE||r.nodeType===Ut.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ut.DOCUMENT_TYPE_NODE||r.nodeType===Ut.ELEMENT_NODE||r.nodeType===Ut.PROCESSING_INSTRUCTION_NODE||r.nodeType===Ut.TEXT_NODE)}u(zY,"hasInsertableNodeType");function Gu(r){return r&&r.nodeType===Ut.DOCUMENT_TYPE_NODE}u(Gu,"isDocTypeNode");function za(r){return r&&r.nodeType===Ut.ELEMENT_NODE}u(za,"isElementNode");function oL(r){return r&&r.nodeType===Ut.TEXT_NODE}u(oL,"isTextNode");function G5(r,e){var t=r.childNodes||[];if(Zi(t,za)||Gu(e))return!1;var n=Zi(t,Gu);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}u(G5,"isElementInsertionPossible");function $5(r,e){var t=r.childNodes||[];function n(i){return za(i)&&i!==e}if(u(n,"hasElementChildThatIsNotChild"),Zi(t,n))return!1;var s=Zi(t,Gu);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}u($5,"isElementReplacementPossible");function JY(r,e,t){if(!WY(r))throw new We(We.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new We(We.NOT_FOUND_ERR,"child not in parent");if(!zY(e)||Gu(e)&&r.nodeType!==Ut.DOCUMENT_NODE)throw new We(We.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}u(JY,"assertPreInsertionValidity1to5");function YY(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ut.DOCUMENT_FRAGMENT_NODE){var i=s.filter(za);if(i.length>1||Zi(s,oL))throw new We(We.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!G5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(za(e)&&!G5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Gu(e)){if(Zi(n,Gu))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Zi(n,za);if(t&&n.indexOf(a)<n.indexOf(t))throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!t&&a)throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}u(YY,"assertPreInsertionValidityInDocument");function uL(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ut.DOCUMENT_FRAGMENT_NODE){var i=s.filter(za);if(i.length>1||Zi(s,oL))throw new We(We.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!$5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(za(e)&&!$5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Gu(e)){let o=function(l){return Gu(l)&&l!==t};if(u(o,"hasDoctypeChildThatIsNotChild"),Zi(n,o))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Zi(n,za);if(t&&n.indexOf(a)<n.indexOf(t))throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}u(uL,"assertPreReplacementValidityInDocument");function zS(r,e,t,n){JY(r,e,t),r.nodeType===Ut.DOCUMENT_NODE&&(n||YY)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===Xu){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var o=t?t.previousSibling:r.lastChild;i.previousSibling=o,a.nextSibling=t,o?o.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do i.parentNode=r;while(i!==a&&(i=i.nextSibling));return iL(r.ownerDocument||r,r,e),e.nodeType==Xu&&(e.firstChild=e.lastChild=null),e}u(zS,"_insertBefore");Ja.prototype={implementation:null,nodeName:"#document",nodeType:O0,doctype:null,documentElement:null,_inc:1,insertBefore:u(function(r,e){if(r.nodeType===Xu){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return zS(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===Ks&&(this.documentElement=r),r},"insertBefore"),removeChild:u(function(r){var e=aL(this,r);return e===this.documentElement&&(this.documentElement=null),e},"removeChild"),replaceChild:u(function(r,e){zS(this,r,e,uL),r.ownerDocument=this,e&&this.removeChild(e),za(r)&&(this.documentElement=r)},"replaceChild"),importNode:u(function(r,e){return QY(this,r,e)},"importNode"),getElementById:u(function(r){var e=null;return $S(this.documentElement,function(t){if(t.nodeType==Ks&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),createElement:u(function(r){var e=new Ya(Un);e.ownerDocument=this,this.type==="html"&&(r=r.toLowerCase()),LY(this.contentType)&&(e.namespaceURI=ea.HTML),e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new Jr;var t=e.attributes=new k0;return t._ownerElement=e,e},"createElement"),createDocumentFragment:u(function(){var r=new F0(Un);return r.ownerDocument=this,r.childNodes=new Jr,r},"createDocumentFragment"),createTextNode:u(function(r){var e=new Sy(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createTextNode"),createComment:u(function(r){var e=new YS(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createComment"),createCDATASection:u(function(r){if(r.indexOf("]]>")!==-1)throw new We(We.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new QS(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:u(function(r,e){var t=new tA(Un);return t.ownerDocument=this,t.childNodes=new Jr,t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:u(function(r){if(!An.QName_exact.test(r))throw new We(We.INVALID_CHARACTER_ERR,'invalid character in name "'+r+'"');return this.type==="html"&&(r=r.toLowerCase()),this._createAttribute(r)},"createAttribute"),_createAttribute:u(function(r){var e=new rf(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"_createAttribute"),createEntityReference:u(function(r){if(!An.Name.test(r))throw new We(We.INVALID_CHARACTER_ERR,'not a valid xml name "'+r+'"');if(this.type==="html")throw new We("document is an html document",Hs.NotSupportedError);var e=new eA(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.nodeName=r,e},"createEntityReference"),createElementNS:u(function(r,e){var t=nI(r,e),n=new Ya(Un),s=n.attributes=new k0;return n.childNodes=new Jr,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],s._ownerElement=n,n},"createElementNS"),createAttributeNS:u(function(r,e){var t=nI(r,e),n=new rf(Un);return n.ownerDocument=this,n.childNodes=new Jr,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],n},"createAttributeNS")};is(Ja,Ut);function Ya(r){ss(r),this._nsMap=Object.create(null)}u(Ya,"Element");Ya.prototype={nodeType:Ks,attributes:null,getQualifiedName:u(function(){return this.prefix?this.prefix+":"+this.localName:this.localName},"getQualifiedName"),_isInHTMLDocumentAndNamespace:u(function(){return this.ownerDocument.type==="html"&&this.namespaceURI===ea.HTML},"_isInHTMLDocumentAndNamespace"),hasAttributes:u(function(){return!!(this.attributes&&this.attributes.length)},"hasAttributes"),hasAttribute:u(function(r){return!!this.getAttributeNode(r)},"hasAttribute"),getAttribute:u(function(r){var e=this.getAttributeNode(r);return e?e.value:null},"getAttribute"),getAttributeNode:u(function(r){return this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase()),this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:u(function(r,e){this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());var t=this.getAttributeNode(r);t?t.value=t.nodeValue=""+e:(t=this.ownerDocument._createAttribute(r),t.value=t.nodeValue=""+e,this.setAttributeNode(t))},"setAttribute"),removeAttribute:u(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),setAttributeNode:u(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:u(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:u(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:u(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);return t?t.value:null},"getAttributeNS"),setAttributeNS:u(function(r,e,t){var n=nI(r,e),s=n[2],i=this.getAttributeNodeNS(r,s);i?i.value=i.nodeValue=""+t:(i=this.ownerDocument.createAttributeNS(r,e),i.value=i.nodeValue=""+t,this.setAttributeNode(i))},"setAttributeNS"),getAttributeNodeNS:u(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByClassName:u(function(r){var e=H5(r);return new Qi(this,function(t){var n=[];return e.length>0&&$S(t,function(s){if(s!==t&&s.nodeType===Ks){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var o=H5(i);a=e.every(HY(o))}a&&n.push(s)}}}),n})},"getElementsByClassName"),getElementsByTagName:u(function(r){var e=(this.nodeType===O0?this:this.ownerDocument).type==="html",t=r.toLowerCase();return new Qi(this,function(n){var s=[];return $S(n,function(i){if(!(i===n||i.nodeType!==Ks))if(r==="*")s.push(i);else{var a=i.getQualifiedName(),o=e&&i.namespaceURI===ea.HTML?t:r;a===o&&s.push(i)}}),s})},"getElementsByTagName"),getElementsByTagNameNS:u(function(r,e){return new Qi(this,function(t){var n=[];return $S(t,function(s){s!==t&&s.nodeType===Ks&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Ja.prototype.getElementsByClassName=Ya.prototype.getElementsByClassName;Ja.prototype.getElementsByTagName=Ya.prototype.getElementsByTagName;Ja.prototype.getElementsByTagNameNS=Ya.prototype.getElementsByTagNameNS;is(Ya,Ut);function rf(r){ss(r),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}u(rf,"Attr");rf.prototype.nodeType=P0;is(rf,Ut);function V0(r){ss(r)}u(V0,"CharacterData");V0.prototype={data:"",substringData:u(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:u(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:u(function(r,e){this.replaceData(r,0,e)},"insertData"),deleteData:u(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:u(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")};is(V0,Ut);function Sy(r){ss(r)}u(Sy,"Text");Sy.prototype={nodeName:"#text",nodeType:WS,splitText:u(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")};is(Sy,V0);function YS(r){ss(r)}u(YS,"Comment");YS.prototype={nodeName:"#comment",nodeType:iI};is(YS,V0);function QS(r){ss(r)}u(QS,"CDATASection");QS.prototype={nodeName:"#cdata-section",nodeType:Y5};is(QS,Sy);function ZS(r){ss(r)}u(ZS,"DocumentType");ZS.prototype.nodeType=Z5;is(ZS,Ut);function aI(r){ss(r)}u(aI,"Notation");aI.prototype.nodeType=XY;is(aI,Ut);function oI(r){ss(r)}u(oI,"Entity");oI.prototype.nodeType=KY;is(oI,Ut);function eA(r){ss(r)}u(eA,"EntityReference");eA.prototype.nodeType=Q5;is(eA,Ut);function F0(r){ss(r)}u(F0,"DocumentFragment");F0.prototype.nodeName="#document-fragment";F0.prototype.nodeType=Xu;is(F0,Ut);function tA(r){ss(r)}u(tA,"ProcessingInstruction");tA.prototype.nodeType=sI;is(tA,V0);function lL(){}u(lL,"XMLSerializer");lL.prototype.serializeToString=function(r,e){return cL.call(r,e)};Ut.prototype.toString=cL;function cL(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r!=null?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var t=[],n=this.nodeType===O0&&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 uI(this,t,a,e),t.join("")}u(cL,"nodeSerializeToString");function W5(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===ea.XML||s===ea.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}u(W5,"needNamespaceDefine");function GS(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,nL),'"')}u(GS,"addSerializedAttribute");function uI(r,e,t,n){t||(t=[]);var s=n.nodeFilter,i=n.requireWellFormed,a=n.splitCDATASections,o=r.nodeType===O0?r:r.ownerDocument,l=o.type==="html";Cn(r,{ns:t},{enter:u(function(c,f){var p=f.ns;if(s)if(c=s(c),c){if(typeof c=="string")return e.push(c),null}else return null;switch(c.nodeType){case Ks:var d=c.attributes,g=d.length,m=c.tagName,v=m;if(!l&&!c.prefix&&c.namespaceURI){for(var y,S=0;S<d.length;S++)if(d.item(S).name==="xmlns"){y=d.item(S).value;break}if(!y)for(var C=p.length-1;C>=0;C--){var w=p[C];if(w.prefix===""&&w.namespace===c.namespaceURI){y=w.namespace;break}}if(y!==c.namespaceURI)for(var C=p.length-1;C>=0;C--){var w=p[C];if(w.namespace===c.namespaceURI){w.prefix&&(v=w.prefix+":"+m);break}}}e.push("<",v);for(var E=p.slice(),A=0;A<g;A++){var b=d.item(A);b.prefix=="xmlns"?E.push({prefix:b.localName,namespace:b.value}):b.nodeName=="xmlns"&&E.push({prefix:"",namespace:b.value})}for(var A=0;A<g;A++){var b=d.item(A);if(W5(b,l,E)){var V=b.prefix||"",I=b.namespaceURI;GS(e,V?"xmlns:"+V:"xmlns",I),E.push({prefix:V,namespace:I})}var D=s?s(b):b;D&&(typeof D=="string"?e.push(D):GS(e,D.name,D.value))}if(m===v&&W5(c,l,E)){var U=c.prefix||"",I=c.namespaceURI;GS(e,U?"xmlns:"+U:"xmlns",I),E.push({prefix:U,namespace:I})}var F=!c.firstChild;if(F&&(l||c.namespaceURI===ea.HTML)&&(F=UY(m)),F)return e.push("/>"),null;if(e.push(">"),l&&FY(m)){for(var M=c.firstChild;M;)M.data?e.push(M.data):uI(M,e,E.slice(),n),M=M.nextSibling;return e.push("</",v,">"),null}return{ns:E,tag:v};case O0:case Xu:if(i&&c.nodeType===O0&&c.documentElement==null)throw new We("The Document has no documentElement",Hs.InvalidStateError);return{ns:p};case P0:return GS(e,c.name,c.value),null;case WS:if(i&&An.InvalidChar.test(c.data))throw new We("The Text node data contains characters outside the XML Char production",Hs.InvalidStateError);return e.push(c.data.replace(/[<&>]/g,nL)),null;case Y5:if(i&&c.data.indexOf("]]>")!==-1)throw new We('The CDATASection data contains "]]>"',Hs.InvalidStateError);return a?e.push(An.CDATA_START,c.data.replace(/]]>/g,"]]]]><![CDATA[>"),An.CDATA_END):e.push(An.CDATA_START,c.data,An.CDATA_END),null;case iI:if(i){if(An.InvalidChar.test(c.data))throw new We("The comment node data contains characters outside the XML Char production",Hs.InvalidStateError);if(c.data.indexOf("--")!==-1||c.data[c.data.length-1]==="-")throw new We('The comment node data contains "--" or ends with "-"',Hs.InvalidStateError)}return e.push(An.COMMENT_START,c.data,An.COMMENT_END),null;case Z5:var se=c.publicId,ee=c.systemId;if(i){if(se&&!An.PubidLiteral_match.test(se))throw new We("DocumentType publicId is not a valid PubidLiteral",Hs.InvalidStateError);if(ee&&ee!=="."&&!An.SystemLiteral_match.test(ee))throw new We("DocumentType systemId is not a valid SystemLiteral",Hs.InvalidStateError);if(c.internalSubset&&c.internalSubset.indexOf("]>")!==-1)throw new We('DocumentType internalSubset contains "]>"',Hs.InvalidStateError)}return e.push(An.DOCTYPE_DECL_START," ",c.name),se?(e.push(" ",An.PUBLIC," ",se),ee&&ee!=="."&&e.push(" ",ee)):ee&&ee!=="."&&e.push(" ",An.SYSTEM," ",ee),c.internalSubset&&e.push(" [",c.internalSubset,"]"),e.push(">"),null;case sI:if(i){if(c.target.indexOf(":")!==-1||c.target.toLowerCase()==="xml")throw new We("The ProcessingInstruction target is not well-formed",Hs.InvalidStateError);if(An.InvalidChar.test(c.data))throw new We("The ProcessingInstruction data contains characters outside the XML Char production",Hs.InvalidStateError);if(c.data.indexOf("?>")!==-1)throw new We('The ProcessingInstruction data contains "?>"',Hs.InvalidStateError)}return e.push("<?",c.target," ",c.data,"?>"),null;case Q5:return e.push("&",c.nodeName,";"),null;default:return e.push("??",c.nodeName),null}},"enter"),exit:u(function(c,f){f&&f.tag&&e.push("</",f.tag,">")},"exit")})}u(uI,"serializeToString");function QY(r,e,t){var n;return Cn(e,null,{enter:u(function(s,i){var a=s.cloneNode(!1);a.ownerDocument=r,a.parentNode=null,i===null?n=a:i.appendChild(a);var o=s.nodeType===P0||t;return o?a:null},"enter")}),n}u(QY,"importNode");function fL(r,e,t){var n;return Cn(e,null,{enter:u(function(s,i){var a=new s.constructor(Un);for(var o in s)if(_0(s,o)){var l=s[o];typeof l!="object"&&l!=a[o]&&(a[o]=l)}s.childNodes&&(a.childNodes=new Jr),a.ownerDocument=r;var c=t;switch(a.nodeType){case Ks:var f=s.attributes,p=a.attributes=new k0,d=f.length;p._ownerElement=a;for(var g=0;g<d;g++)a.setAttributeNode(fL(r,f.item(g),!0));break;case P0:c=!0}return i!==null?i.appendChild(a):n=a,c?a:null},"enter")}),n}u(fL,"cloneNode");function hL(r,e,t){r[e]=t}u(hL,"__set__");function rI(r){for(var e=[],t=r.firstChild;t;)t.nodeType===Ks&&e.push(t),t=t.nextSibling;return e}u(rI,"childrenRefresh");try{Object.defineProperty&&(Object.defineProperty(Qi.prototype,"length",{get:u(function(){return JS(this),this.$$length},"get")}),Object.defineProperty(Ut.prototype,"textContent",{get:u(function(){if(this.nodeType===Ks||this.nodeType===Xu){var r=[];return Cn(this,null,{enter:u(function(e){if(e.nodeType===Ks||e.nodeType===Xu)return!0;if(e.nodeType===sI||e.nodeType===iI)return null;r.push(e.nodeValue)},"enter")}),r.join("")}return this.nodeValue},"get"),set:u(function(r){switch(this.nodeType){case Ks:case Xu:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}},"set")}),Object.defineProperty(Ya.prototype,"children",{get:u(function(){return new Qi(this,rI)},"get")}),Object.defineProperty(Ja.prototype,"children",{get:u(function(){return new Qi(this,rI)},"get")}),Object.defineProperty(F0.prototype,"children",{get:u(function(){return new Qi(this,rI)},"get")}),hL=u(function(r,e,t){r["$$"+e]=t},"__set__"))}catch{}kr._updateLiveList=JS;kr.Attr=rf;kr.CDATASection=QS;kr.CharacterData=V0;kr.Comment=YS;kr.Document=Ja;kr.DocumentFragment=F0;kr.DocumentType=ZS;kr.DOMImplementation=rL;kr.Element=Ya;kr.Entity=oI;kr.EntityReference=eA;kr.LiveNodeList=Qi;kr.NamedNodeMap=k0;kr.Node=Ut;kr.NodeList=Jr;kr.Notation=aI;kr.Text=Sy;kr.ProcessingInstruction=tA;kr.walkDOM=Cn;kr.XMLSerializer=lL});var dL=ue(Ay=>{"use strict";var pL=tf().freeze;Ay.XML_ENTITIES=pL({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Ay.HTML_ENTITIES=pL({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:`
78
78
  `,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"});Ay.entityMap=Ay.HTML_ENTITIES});var bL=ue(nA=>{"use strict";var q0=tf(),Et=tI(),EL=dy(),ZY=q0.isHTMLEscapableRawTextElement,eQ=q0.isHTMLMimeType,tQ=q0.isHTMLRawTextElement,Ny=q0.hasOwn,mL=q0.NAMESPACE,gL=EL.ParseError,rQ=EL.DOMException,Cy=0,$u=1,U0=2,xy=3,M0=4,j0=5,by=6,rA=7;function wL(){}u(wL,"XMLReader");wL.prototype={parse:u(function(r,e,t){var n=this.domBuilder;n.startDocument(),SL(e,e=Object.create(null)),nQ(r,e,t,n,this.errorHandler),n.endDocument()},"parse")};var cI=/&#?\w+;?/g;function nQ(r,e,t,n,s){var i=eQ(n.mimeType);r.indexOf(Et.UNICODE_REPLACEMENT_CHARACTER)>=0&&s.warning("Unicode replacement character detected, source encoding issues?");function a(xe){if(xe>65535){xe-=65536;var pe=55296+(xe>>10),W=56320+(xe&1023);return String.fromCharCode(pe,W)}else return String.fromCharCode(xe)}u(a,"fixedFromCharCode");function o(xe){var pe=xe[xe.length-1]===";"?xe:xe+";";if(!i&&pe!==xe)return s.error("EntityRef: expecting ;"),xe;var W=Et.Reference.exec(pe);if(!W||W[0].length!==pe.length)return s.error("entity not matching Reference production: "+xe),xe;var fe=pe.slice(1,-1);return Ny(t,fe)?t[fe]:fe.charAt(0)==="#"?a(parseInt(fe.substring(1).replace("x","0x"))):(s.error("entity not found:"+xe),xe)}u(o,"entityReplacer");function l(xe){if(xe>y){var pe=r.substring(y,xe).replace(cI,o);d&&g(y),n.characters(pe,0,xe-y),y=xe}}u(l,"appendText");var c=0,f=0,p=/\r\n?|\n|$/g,d=n.locator;function g(xe,pe){for(;xe>=f&&(pe=p.exec(r));)c=f,f=pe.index+pe[0].length,d.lineNumber++;d.columnNumber=xe-c+1}u(g,"position");for(var m=[{currentNSMap:e}],v=[],y=0;;){try{var S=r.indexOf("<",y);if(S<0){if(!i&&v.length>0)return s.fatalError("unclosed xml tag(s): "+v.join(", "));if(!r.substring(y).match(/^\s*$/)){var C=n.doc,w=C.createTextNode(r.substring(y));if(C.documentElement)return s.error("Extra content at the end of the document");C.appendChild(w),n.currentElement=w}return}if(S>y){var E=r.substring(y,S);!i&&v.length===0&&(E=E.replace(new RegExp(Et.S_OPT.source,"g"),""),E&&s.error("Unexpected content outside root element: '"+E+"'")),l(S)}switch(r.charAt(S+1)){case"/":var ee=r.indexOf(">",S+2),A=r.substring(S+2,ee>0?ee:void 0);if(!A)return s.fatalError("end tag name missing");var b=ee>0&&Et.reg("^",Et.QName_group,Et.S_OPT,"$").exec(A);if(!b)return s.fatalError('end tag name contains invalid characters: "'+A+'"');if(!n.currentElement&&!n.doc.documentElement)return;var V=v[v.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(V!==b[1]){var I=b[1].toLowerCase();if(!i||V.toLowerCase()!==I)return s.fatalError('Opening and ending tag mismatch: "'+V+'" != "'+A+'"')}var D=m.pop();v.pop();var U=D.localNSMap;if(n.endElement(D.uri,D.localName,V),U)for(var F in U)Ny(U,F)&&n.endPrefixMapping(F);ee++;break;case"?":d&&g(S),ee=oQ(r,S,n,s);break;case"!":d&&g(S),ee=CL(r,S,n,s,i);break;default:d&&g(S);var M=new xL,se=m[m.length-1].currentNSMap,ee=sQ(r,S,M,se,o,s,i),ie=M.length;if(M.closed||(i&&q0.isHTMLVoidElement(M.tagName)?M.closed=!0:v.push(M.tagName)),d&&ie){for(var X=yL(d,{}),he=0;he<ie;he++){var Ce=M[he];g(Ce.offset),Ce.locator=yL(d,{})}n.locator=X,vL(M,n,se)&&m.push(M),n.locator=d}else vL(M,n,se)&&m.push(M);i&&!M.closed?ee=iQ(r,ee,M.tagName,o,n):ee++}}catch(xe){if(xe instanceof gL)throw xe;if(xe instanceof rQ)throw new gL(xe.name+": "+xe.message,n.locator,xe);s.error("element parse error: "+xe),ee=-1}ee>y?y=ee:l(Math.max(S,y)+1)}}u(nQ,"parse");function yL(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}u(yL,"copyLocator");function sQ(r,e,t,n,s,i,a){function o(g,m,v){if(Ny(t.attributeNames,g))return i.fatalError("Attribute "+g+" redefined");if(!a&&m.indexOf("<")>=0)return i.fatalError("Unescaped '<' not allowed in attributes values");t.addValue(g,m.replace(/[\t\n\r]/g," ").replace(cI,s),v)}u(o,"addAttribute");for(var l,c,f=++e,p=Cy;;){var d=r.charAt(f);switch(d){case"=":if(p===$u)l=r.slice(e,f),p=xy;else if(p===U0)p=xy;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(p===xy||p===$u)if(p===$u&&(i.warning('attribute value must after "="'),l=r.slice(e,f)),e=f+1,f=r.indexOf(d,e),f>0)c=r.slice(e,f),o(l,c,e-1),p=j0;else throw new Error("attribute value no end '"+d+"' match");else if(p==M0)c=r.slice(e,f),o(l,c,e),i.warning('attribute "'+l+'" missed start quot('+d+")!!"),e=f+1,p=j0;else throw new Error('attribute value must after "="');break;case"/":switch(p){case Cy:t.setTagName(r.slice(e,f));case j0:case by:case rA:p=rA,t.closed=!0;case M0:case $u:break;case U0:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),p==Cy&&t.setTagName(r.slice(e,f)),f;case">":switch(p){case Cy:t.setTagName(r.slice(e,f));case j0:case by:case rA:break;case M0:case $u:c=r.slice(e,f),c.slice(-1)==="/"&&(t.closed=!0,c=c.slice(0,-1));case U0:p===U0&&(c=l),p==M0?(i.warning('attribute "'+c+'" missed quot(")!'),o(l,c,e)):(a||i.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),o(c,c,e));break;case xy:if(!a)return i.fatalError(`AttValue: ' or " expected`)}return f;case"\x80":d=" ";default:if(d<=" ")switch(p){case Cy:t.setTagName(r.slice(e,f)),p=by;break;case $u:l=r.slice(e,f),p=U0;break;case M0:var c=r.slice(e,f);i.warning('attribute "'+c+'" missed quot(")!!'),o(l,c,e);case j0:p=by;break}else switch(p){case U0:a||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,e),e=f,p=$u;break;case j0:i.warning('attribute space is required"'+l+'"!!');case by:p=$u,e=f;break;case xy:p=M0,e=f;break;case rA:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}u(sQ,"parseElementStartPart");function vL(r,e,t){for(var n=r.tagName,s=null,p=r.length;p--;){var i=r[p],a=i.qName,o=i.value,d=a.indexOf(":");if(d>0)var l=i.prefix=a.slice(0,d),c=a.slice(d+1),f=l==="xmlns"&&c;else c=a,l=null,f=a==="xmlns"&&"";i.localName=c,f!==!1&&(s==null&&(s=Object.create(null),SL(t,t=Object.create(null))),t[f]=s[f]=o,i.uri=mL.XMLNS,e.startPrefixMapping(f,o))}for(var p=r.length;p--;)i=r[p],i.prefix&&(i.prefix==="xml"&&(i.uri=mL.XML),i.prefix!=="xmlns"&&(i.uri=t[i.prefix]));var d=n.indexOf(":");d>0?(l=r.prefix=n.slice(0,d),c=r.localName=n.slice(d+1)):(l=null,c=r.localName=n);var g=r.uri=t[l||""];if(e.startElement(g,c,n,r),r.closed){if(e.endElement(g,c,n),s)for(l in s)Ny(s,l)&&e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=s,!0}u(vL,"appendElement");function iQ(r,e,t,n,s){var i=ZY(t);if(i||tQ(t)){var a=r.indexOf("</"+t+">",e),o=r.substring(e+1,a);return i&&(o=o.replace(cI,n)),s.characters(o,0,o.length),a}return e+1}u(iQ,"parseHtmlSpecialContent");function SL(r,e){for(var t in r)Ny(r,t)&&(e[t]=r[t])}u(SL,"_copy");function AL(r,e){var t=e;function n(f){return f=f||0,r.charAt(t+f)}u(n,"char");function s(f){f=f||1,t+=f}u(s,"skip");function i(){for(var f=0;t<r.length;){var p=n();if(p!==" "&&p!==`
79
79
  `&&p!==" "&&p!=="\r")return f;f++,s()}return-1}u(i,"skipBlanks");function a(){return r.substring(t)}u(a,"substringFromIndex");function o(f){return r.substring(t,t+f.length)===f}u(o,"substringStartsWith");function l(f){return r.substring(t,t+f.length).toUpperCase()===f.toUpperCase()}u(l,"substringStartsWithCaseInsensitive");function c(f){var p=Et.reg("^",f),d=p.exec(a());return d?(s(d[0].length),d[0]):null}return u(c,"getMatch"),{char:n,getIndex:u(function(){return t},"getIndex"),getMatch:c,getSource:u(function(){return r},"getSource"),skip:s,skipBlanks:i,substringFromIndex:a,substringStartsWith:o,substringStartsWithCaseInsensitive:l}}u(AL,"parseUtils");function aQ(r,e){function t(o,l){var c=Et.PI.exec(o.substringFromIndex());return c?c[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(c[0].length),c[0]):l.fatalError("processing instruction is not well-formed at position "+o.getIndex())}u(t,"parsePI");var n=r.getSource();if(r.char()==="["){r.skip(1);for(var s=r.getIndex();r.getIndex()<n.length;){if(r.skipBlanks(),r.char()==="]"){var i=n.substring(s,r.getIndex());return r.skip(1),i}var a=null;if(r.char()==="<"&&r.char(1)==="!")switch(r.char(2)){case"E":r.char(3)==="L"?a=r.getMatch(Et.elementdecl):r.char(3)==="N"&&(a=r.getMatch(Et.EntityDecl));break;case"A":a=r.getMatch(Et.AttlistDecl);break;case"N":a=r.getMatch(Et.NotationDecl);break;case"-":a=r.getMatch(Et.Comment);break}else if(r.char()==="<"&&r.char(1)==="?")a=t(r,e);else if(r.char()==="%")a=r.getMatch(Et.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!a)return e.fatalError("Error in internal subset at position "+r.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}u(aQ,"parseDoctypeInternalSubset");function CL(r,e,t,n,s){var i=AL(r,e);switch(s?i.char(2).toUpperCase():i.char(2)){case"-":var a=i.getMatch(Et.Comment);return a?(t.comment(a,Et.COMMENT_START.length,a.length-Et.COMMENT_START.length-Et.COMMENT_END.length),i.getIndex()):n.fatalError("comment is not well-formed at position "+i.getIndex());case"[":var o=i.getMatch(Et.CDSect);return o?!s&&!t.currentElement?n.fatalError("CDATA outside of element"):(t.startCDATA(),t.characters(o,Et.CDATA_START.length,o.length-Et.CDATA_START.length-Et.CDATA_END.length),t.endCDATA(),i.getIndex()):n.fatalError("Invalid CDATA starting at position "+e);case"D":{if(t.doc&&t.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+i.getIndex());if(s?!i.substringStartsWithCaseInsensitive(Et.DOCTYPE_DECL_START):!i.substringStartsWith(Et.DOCTYPE_DECL_START))return n.fatalError("Expected "+Et.DOCTYPE_DECL_START+" at position "+i.getIndex());if(i.skip(Et.DOCTYPE_DECL_START.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+Et.DOCTYPE_DECL_START+" at position "+i.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=i.getMatch(Et.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+i.getIndex());if(s&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+i.getIndex()),i.skipBlanks(),i.substringStartsWith(Et.PUBLIC)||i.substringStartsWith(Et.SYSTEM)){var c=Et.ExternalID_match.exec(i.substringFromIndex());if(!c)return n.fatalError("doctype external id is not well-formed at position "+i.getIndex());c.groups.SystemLiteralOnly!==void 0?l.systemId=c.groups.SystemLiteralOnly:(l.systemId=c.groups.SystemLiteral,l.publicId=c.groups.PubidLiteral),i.skip(c[0].length)}else if(s&&i.substringStartsWithCaseInsensitive(Et.SYSTEM)){if(i.skip(Et.SYSTEM.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+Et.SYSTEM+" at position "+i.getIndex());if(l.systemId=i.getMatch(Et.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+Et.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+Et.SYSTEM+" at position "+i.getIndex())}return s&&l.systemId&&!Et.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+i.getIndex()),s||(i.skipBlanks(),l.internalSubset=aQ(i,n)),i.skipBlanks(),i.char()!==">"?n.fatalError("doctype not terminated with > at position "+i.getIndex()):(i.skip(1),t.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),t.endDTD(),i.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}u(CL,"parseDoctypeCommentOrCData");function oQ(r,e,t,n){var s=r.substring(e).match(Et.PI);if(!s)return n.fatalError("Invalid processing instruction starting at position "+e);if(s[1].toLowerCase()==="xml"){if(e>0)return n.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!Et.XMLDecl.test(r.substring(e)))return n.fatalError("xml declaration is not well-formed")}return t.processingInstruction(s[1],s[2]),e+s[0].length}u(oQ,"parseProcessingInstruction");function xL(){this.attributeNames=Object.create(null)}u(xL,"ElementAttributes");xL.prototype={setTagName:u(function(r){if(!Et.QName_exact.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},"setTagName"),addValue:u(function(r,e,t){if(!Et.QName_exact.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:u(function(r){return this[r].localName},"getLocalName"),getLocator:u(function(r){return this[r].locator},"getLocator"),getQName:u(function(r){return this[r].qName},"getQName"),getURI:u(function(r){return this[r].uri},"getURI"),getValue:u(function(r){return this[r].value},"getValue")};nA.XMLReader=wL;nA.parseUtils=AL;nA.parseDoctypeCommentOrCData=CL});var OL=ue(K0=>{"use strict";var nf=tf(),uQ=lI(),lQ=dy(),NL=dL(),cQ=bL(),fQ=uQ.DOMImplementation,hQ=nf.hasDefaultHTMLNamespace,pQ=nf.isHTMLMimeType,dQ=nf.isValidMimeType,DL=nf.MIME_TYPE,fI=nf.NAMESPACE,TL=lQ.ParseError,mQ=cQ.XMLReader;function BL(r){return r.replace(/\r[\n\u0085]/g,`
80
80
  `).replace(/[\r\u0085\u2028\u2029]/g,`
81
81
  `)}u(BL,"normalizeLineEndings");function RL(r){if(r=r||{},r.locator===void 0&&(r.locator=!0),this.assign=r.assign||nf.assign,this.domHandler=r.domHandler||iA,this.onError=r.onError||r.errorHandler,r.errorHandler&&typeof r.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");r.errorHandler&&r.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=r.normalizeLineEndings||BL,this.locator=!!r.locator,this.xmlns=this.assign(Object.create(null),r.xmlns)}u(RL,"DOMParser");RL.prototype.parseFromString=function(r,e){if(!dQ(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var t=this.assign(Object.create(null),this.xmlns),n=NL.XML_ENTITIES,s=t[""]||null;hQ(e)?(n=NL.HTML_ENTITIES,s=fI.HTML):e===DL.XML_SVG_IMAGE&&(s=fI.SVG),t[""]=s,t.xml=t.xml||fI.XML;var i=new this.domHandler({mimeType:e,defaultNamespace:s,onError:this.onError}),a=this.locator?{}:void 0;this.locator&&i.setDocumentLocator(a);var o=new mQ;o.errorHandler=i,o.domBuilder=i;var l=!nf.isHTMLMimeType(e);return l&&typeof r!="string"&&o.errorHandler.fatalError("source is not a string"),o.parse(this.normalizeLineEndings(String(r)),t,n),i.doc.documentElement||o.errorHandler.fatalError("missing root element"),i.doc};function iA(r){var e=r||{};this.mimeType=e.mimeType||DL.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}u(iA,"DOMHandler");function H0(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}u(H0,"position");iA.prototype={startDocument:u(function(){var r=new fQ;this.doc=pQ(this.mimeType)?r.createHTMLDocument(!1):r.createDocument(this.defaultNamespace,"")},"startDocument"),startElement:u(function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;sA(this,i),this.currentElement=i,this.locator&&H0(this.locator,i);for(var o=0;o<a;o++){var r=n.getURI(o),l=n.getValue(o),t=n.getQName(o),c=s.createAttributeNS(r,t);this.locator&&H0(n.getLocator(o),c),c.value=c.nodeValue=l,i.setAttributeNode(c)}},"startElement"),endElement:u(function(r,e,t){this.currentElement=this.currentElement.parentNode},"endElement"),startPrefixMapping:u(function(r,e){},"startPrefixMapping"),endPrefixMapping:u(function(r){},"endPrefixMapping"),processingInstruction:u(function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&H0(this.locator,t),sA(this,t)},"processingInstruction"),ignorableWhitespace:u(function(r,e,t){},"ignorableWhitespace"),characters:u(function(r,e,t){if(r=IL.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&&H0(this.locator,n)}},"characters"),skippedEntity:u(function(r){},"skippedEntity"),endDocument:u(function(){this.doc.normalize()},"endDocument"),setDocumentLocator:u(function(r){r&&(r.lineNumber=0),this.locator=r},"setDocumentLocator"),comment:u(function(r,e,t){r=IL.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&H0(this.locator,n),sA(this,n)},"comment"),startCDATA:u(function(){this.cdata=!0},"startCDATA"),endCDATA:u(function(){this.cdata=!1},"endCDATA"),startDTD:u(function(r,e,t,n){var s=this.doc.implementation;if(s&&s.createDocumentType){var i=s.createDocumentType(r,e,t,n);this.locator&&H0(this.locator,i),sA(this,i),this.doc.doctype=i}},"startDTD"),reportError:u(function(r,e){if(typeof this.onError=="function")try{this.onError(r,e,this)}catch(t){throw new TL("Reporting "+r+' "'+e+'" caused '+t,this.locator)}else console.error("[xmldom "+r+"] "+e,gQ(this.locator))},"reportError"),warning:u(function(r){this.reportError("warning",r)},"warning"),error:u(function(r){this.reportError("error",r)},"error"),fatalError:u(function(r){throw this.reportError("fatalError",r),new TL(r,this.locator)},"fatalError")};function gQ(r){if(r)return`
82
- @#[line:`+r.lineNumber+",col:"+r.columnNumber+"]"}u(gQ,"_locator");function IL(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}u(IL,"_toString");"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){iA.prototype[r]=function(){return null}});function sA(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}u(sA,"appendElement");function yQ(r){if(r==="error")throw"onErrorStopParsing"}u(yQ,"onErrorStopParsing");function vQ(){throw"onWarningStopParsing"}u(vQ,"onWarningStopParsing");K0.__DOMHandler=iA;K0.DOMParser=RL;K0.normalizeLineEndings=BL;K0.onErrorStopParsing=yQ;K0.onWarningStopParsing=vQ});var _L=ue(Ut=>{"use strict";var X0=tf();Ut.assign=X0.assign;Ut.hasDefaultHTMLNamespace=X0.hasDefaultHTMLNamespace;Ut.isHTMLMimeType=X0.isHTMLMimeType;Ut.isValidMimeType=X0.isValidMimeType;Ut.MIME_TYPE=X0.MIME_TYPE;Ut.NAMESPACE=X0.NAMESPACE;var aA=dy();Ut.DOMException=aA.DOMException;Ut.DOMExceptionName=aA.DOMExceptionName;Ut.ExceptionCode=aA.ExceptionCode;Ut.ParseError=aA.ParseError;var Yr=lI();Ut.Attr=Yr.Attr;Ut.CDATASection=Yr.CDATASection;Ut.CharacterData=Yr.CharacterData;Ut.Comment=Yr.Comment;Ut.Document=Yr.Document;Ut.DocumentFragment=Yr.DocumentFragment;Ut.DocumentType=Yr.DocumentType;Ut.DOMImplementation=Yr.DOMImplementation;Ut.Element=Yr.Element;Ut.Entity=Yr.Entity;Ut.EntityReference=Yr.EntityReference;Ut.LiveNodeList=Yr.LiveNodeList;Ut.NamedNodeMap=Yr.NamedNodeMap;Ut.Node=Yr.Node;Ut.NodeList=Yr.NodeList;Ut.Notation=Yr.Notation;Ut.ProcessingInstruction=Yr.ProcessingInstruction;Ut.Text=Yr.Text;Ut.XMLSerializer=Yr.XMLSerializer;var oA=OL();Ut.DOMParser=oA.DOMParser;Ut.normalizeLineEndings=oA.normalizeLineEndings;Ut.onErrorStopParsing=oA.onErrorStopParsing;Ut.onWarningStopParsing=oA.onWarningStopParsing});var lA="http://www.w3.org/2000/09/xmldsig#",gI="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",cA=(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})({}),eo=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),fA=(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 Qt={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"},NQ=Object.keys(Qt);var IQ={Production:"1",Homolog:"2"};var SV={[Qt.AC]:"America/Rio_Branco",[Qt.AL]:"America/Maceio",[Qt.AM]:"America/Manaus",[Qt.AP]:"America/Belem",[Qt.BA]:"America/Bahia",[Qt.CE]:"America/Fortaleza",[Qt.DF]:"America/Sao_Paulo",[Qt.ES]:"America/Sao_Paulo",[Qt.GO]:"America/Sao_Paulo",[Qt.MA]:"America/Fortaleza",[Qt.MG]:"America/Sao_Paulo",[Qt.MS]:"America/Campo_Grande",[Qt.MT]:"America/Cuiaba",[Qt.PA]:"America/Belem",[Qt.PB]:"America/Fortaleza",[Qt.PE]:"America/Recife",[Qt.PI]:"America/Fortaleza",[Qt.PR]:"America/Sao_Paulo",[Qt.RJ]:"America/Sao_Paulo",[Qt.RN]:"America/Fortaleza",[Qt.RO]:"America/Porto_Velho",[Qt.RR]:"America/Boa_Vista",[Qt.RS]:"America/Sao_Paulo",[Qt.SC]:"America/Sao_Paulo",[Qt.SE]:"America/Maceio",[Qt.SP]:"America/Sao_Paulo",[Qt.TO]:"America/Araguaina"};var Mt=class extends Error{static{u(this,"NFeTsError")}};var Dy=class extends Mt{static{u(this,"TransmissionError")}},W0=class extends Dy{static{u(this,"TransmissionHostNotFoundError")}},uf=class extends Dy{static{u(this,"TransmissionTimeoutError")}};var yI=class extends Mt{static{u(this,"ValidationError")}};var z0={includeComments:!1,exclusive:!0};var hA=u(r=>{throw new Mt("Didn't expect to get here")},"unreachable");var lf=class{static{u(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=eo.SHA1,s=z0){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=s}assemble(e,t,n){let s=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:lA},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:s}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:gI}},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:lA},...e},{rootName:"SignedInfo"}),this.canonical);return 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 eo.SHA256:return fA.SHA256;case eo.SHA1:return fA.SHA1;default:return hA(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case eo.SHA256:return cA.RSA_SHA256;case eo.SHA1:return cA.RSA_SHA1;default:return hA(this.algorithm)}}};var pA=class{static{u(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},By=class{static{u(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},rr=u(r=>new pA(r),"left"),Hr=u(r=>r===void 0?new By(void 0):new By(r),"right");var vI=class extends lf{static{u(this,"EntitySigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{certificate:a}=n;if(!e[s])return rr(new Mt(`Node ${String(s)} not found`));let o=await this.toolkit.build(this.ns(e,s),{headless:!0,rootName:String(s),renderOpts:{pretty:!1}}),l=this.signedInfo(o,i),c=await this.signOrLeft(l,n);if(c.isLeft())return c;let f=e;return f.Signature=this.assemble(l,c.value,a),Hr(f)}ns(e,t){let n=e.$?.xmlns,{$:s,...i}=e[t],{xmlns:a,...o}=s??{};return{$:{xmlns:n,...o},...i}}};var EI=class extends lf{static{u(this,"XmlSigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{certificate:a}=n,o=this.toolkit.getNode(e,s);if(!o)return rr(new Mt(`Node ${s} not found`));let l=this.signedInfo(o,i),c=await this.signOrLeft(l,n);if(c.isLeft())return c;let f=await this.toolkit.build(this.assemble(l,c.value,a),{rootName:"Signature"});return Hr(this.toolkit.appendNode(e,f))}};import"reflect-metadata";import{validateSync as CV}from"class-validator";import"reflect-metadata";var J0="__SkipValidation__",xZ=u(()=>(r,e)=>{Reflect.defineMetadata(J0,!0,r,e.toString())},"SkipValidation"),bZ=u(()=>r=>{Reflect.defineMetadata(J0,!0,r)},"SkipAllValidations");import{plainToInstance as AV}from"class-transformer";var Ry=u(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&Ry(t)},"clearEmptyValues"),wI=u((r,e,t={})=>{let n=AV(e,r);return t.clearEmptyValues&&Ry(n),n},"plainToInstance");var SI="__ValidateErrors__",AI=u((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(AI(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"),kZ=u(r=>(e,t,n)=>{let s=n.value;n.value=function(...i){let a=Reflect.getMetadata(J0,this.constructor);if(Reflect.getMetadata(J0,this.constructor.prototype,t.toString())===!0||a===!0)return s?.apply(this,i);let[l,...c]=i;if(!l)return s?.apply(this,i);let f=wI(l,r),p=CV(f,{whitelist:!0});if(Ry(f),p.length){let d=Reflect.getMetadata(SI,this)??[];Reflect.defineMetadata(SI,d.concat(AI(p,s?.name)),this)}return s?.apply(this,[f,...c])}},"Validates");import"reflect-metadata";var cf=9e15,so=1e9,dA="0123456789abcdef",Py="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ky="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",mA={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-cf,maxE:cf,crypto:!1},NI,ra,ft=!0,Vy="[DecimalError] ",no=Vy+"Invalid argument: ",TI=Vy+"Precision limit exceeded",II=Vy+"crypto unavailable",DI="[object Decimal]",xn=Math.floor,Kr=Math.pow,xV=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,bV=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,NV=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,BI=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ws=1e7,it=7,TV=9007199254740991,IV=Py.length-1,gA=ky.length-1,Se={toStringTag:DI};Se.absoluteValue=Se.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),Qe(r)};Se.ceil=function(){return Qe(new this.constructor(this),this.e+1,2)};Se.clampedTo=Se.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(no+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};Se.comparedTo=Se.cmp=function(r){var e,t,n,s,i=this,a=i.d,o=(r=new i.constructor(r)).d,l=i.s,c=r.s;if(!a||!o)return!l||!c?NaN:l!==c?l:a===o?0:!a^l<0?1:-1;if(!a[0]||!o[0])return a[0]?l:o[0]?-c:0;if(l!==c)return l;if(i.e!==r.e)return i.e>r.e^l<0?1:-1;for(n=a.length,s=o.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==o[e])return a[e]>o[e]^l<0?1:-1;return n===s?0:n>s^l<0?1:-1};Se.cosine=Se.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())+it,n.rounding=1,t=DV(n,kI(n,t)),n.precision=r,n.rounding=e,Qe(ra==2||ra==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};Se.cubeRoot=Se.cbrt=function(){var r,e,t,n,s,i,a,o,l,c,f=this,p=f.constructor;if(!f.isFinite()||f.isZero())return new p(f);for(ft=!1,i=f.s*Kr(f.s*f,1/3),!i||Math.abs(i)==1/0?(t=hn(f.d),r=f.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=Kr(t,1/3),r=xn((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 p(t),n.s=f.s):n=new p(i.toString()),a=(r=p.precision)+3;;)if(o=n,l=o.times(o).times(o),c=l.plus(f),n=or(c.plus(f).times(o),c.plus(l),a+2,1),hn(o.d).slice(0,a)===(t=hn(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(Qe(o,r+1,0),o.times(o).times(o).eq(f))){n=o;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Qe(n,r+1,1),e=!n.times(n).times(n).eq(f));break}return ft=!0,Qe(n,r,p.rounding,e)};Se.decimalPlaces=Se.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-xn(this.e/it))*it,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};Se.dividedBy=Se.div=function(r){return or(this,new this.constructor(r))};Se.dividedToIntegerBy=Se.divToInt=function(r){var e=this,t=e.constructor;return Qe(or(e,new t(r),0,1,1),t.precision,t.rounding)};Se.equals=Se.eq=function(r){return this.cmp(r)===0};Se.floor=function(){return Qe(new this.constructor(this),this.e+1,3)};Se.greaterThan=Se.gt=function(r){return this.cmp(r)>0};Se.greaterThanOrEqualTo=Se.gte=function(r){var e=this.cmp(r);return e==1||e===0};Se.hyperbolicCosine=Se.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,o=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return o;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/Uy(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=ff(a,1,i.times(e),new a(1),!0);for(var l,c=r,f=new a(8);c--;)l=i.times(i),i=o.minus(l.times(f.minus(l.times(f))));return Qe(i,a.precision=t,a.rounding=n,!0)};Se.hyperbolicSine=Se.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=ff(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/Uy(5,r)),s=ff(i,2,s,s,!0);for(var a,o=new i(5),l=new i(16),c=new i(20);r--;)a=s.times(s),s=s.times(o.plus(a.times(l.times(a).plus(c))))}return i.precision=e,i.rounding=t,Qe(s,e,t,!0)};Se.hyperbolicTangent=Se.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,or(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};Se.inverseCosine=Se.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()?mi(e,n,s):new e(0):new e(NaN):r.isZero()?mi(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))};Se.inverseHyperbolicCosine=Se.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,ft=!1,t=t.times(t).minus(1).sqrt().plus(t),ft=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};Se.inverseHyperbolicSine=Se.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,ft=!1,t=t.times(t).plus(1).sqrt().plus(t),ft=!0,n.precision=r,n.rounding=e,t.ln())};Se.inverseHyperbolicTangent=Se.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?Qe(new i(s),r,e,!0):(i.precision=t=n-s.e,s=or(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)};Se.inverseSine=Se.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=mi(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)))};Se.inverseTangent=Se.atan=function(){var r,e,t,n,s,i,a,o,l,c=this,f=c.constructor,p=f.precision,d=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&p+4<=gA)return a=mi(f,p+4,d).times(.25),a.s=c.s,a}else{if(!c.s)return new f(NaN);if(p+4<=gA)return a=mi(f,p+4,d).times(.5),a.s=c.s,a}for(f.precision=o=p+10,f.rounding=1,t=Math.min(28,o/it+2|0),r=t;r;--r)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(ft=!1,e=Math.ceil(o/it),n=1,l=c.times(c),a=new f(c),s=c;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)),ft=!0,Qe(a,f.precision=p,f.rounding=d,!0)};Se.isFinite=function(){return!!this.d};Se.isInteger=Se.isInt=function(){return!!this.d&&xn(this.e/it)>this.d.length-2};Se.isNaN=function(){return!this.s};Se.isNegative=Se.isNeg=function(){return this.s<0};Se.isPositive=Se.isPos=function(){return this.s>0};Se.isZero=function(){return!!this.d&&this.d[0]===0};Se.lessThan=Se.lt=function(r){return this.cmp(r)<0};Se.lessThanOrEqualTo=Se.lte=function(r){return this.cmp(r)<1};Se.logarithm=Se.log=function(r){var e,t,n,s,i,a,o,l,c=this,f=c.constructor,p=f.precision,d=f.rounding,g=5;if(r==null)r=new f(10),e=!0;else{if(r=new f(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new f(NaN);e=r.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new f(t&&!t[0]?-1/0:c.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(ft=!1,o=p+g,a=ro(c,o),n=e?Ly(f,o+10):ro(r,o),l=or(a,n,o,1),Y0(l.d,s=p,d))do if(o+=10,a=ro(c,o),n=e?Ly(f,o+10):ro(r,o),l=or(a,n,o,1),!i){+hn(l.d).slice(s+1,s+15)+1==1e14&&(l=Qe(l,p+1,0));break}while(Y0(l.d,s+=10,d));return ft=!0,Qe(l,p,d)};Se.minus=Se.sub=function(r){var e,t,n,s,i,a,o,l,c,f,p,d,g=this,m=g.constructor;if(r=new m(r),!g.d||!r.d)return!g.s||!r.s?r=new m(NaN):g.d?r.s=-r.s:r=new m(r.d||g.s!==r.s?g:NaN),r;if(g.s!=r.s)return r.s=-r.s,g.plus(r);if(c=g.d,d=r.d,o=m.precision,l=m.rounding,!c[0]||!d[0]){if(d[0])r.s=-r.s;else if(c[0])r=new m(g);else return new m(l===3?-0:0);return ft?Qe(r,o,l):r}if(t=xn(r.e/it),f=xn(g.e/it),c=c.slice(),i=f-t,i){for(p=i<0,p?(e=c,i=-i,a=d.length):(e=d,t=f,a=c.length),n=Math.max(Math.ceil(o/it),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=c.length,a=d.length,p=n<a,p&&(a=n),n=0;n<a;n++)if(c[n]!=d[n]){p=c[n]<d[n];break}i=0}for(p&&(e=c,c=d,d=e,r.s=-r.s),a=c.length,n=d.length-a;n>0;--n)c[a++]=0;for(n=d.length;n>i;){if(c[--n]<d[n]){for(s=n;s&&c[--s]===0;)c[s]=Ws-1;--c[s],c[n]+=Ws}c[n]-=d[n]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--t;return c[0]?(r.d=c,r.e=Fy(c,t),ft?Qe(r,o,l):r):new m(l===3?-0:0)};Se.modulo=Se.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]?Qe(new n(t),n.precision,n.rounding):(ft=!1,n.modulo==9?(e=or(t,r.abs(),0,3,1),e.s*=r.s):e=or(t,r,0,n.modulo,1),e=e.times(r),ft=!0,t.minus(e))};Se.naturalExponential=Se.exp=function(){return yA(this)};Se.naturalLogarithm=Se.ln=function(){return ro(this)};Se.negated=Se.neg=function(){var r=new this.constructor(this);return r.s=-r.s,Qe(r)};Se.plus=Se.add=function(r){var e,t,n,s,i,a,o,l,c,f,p=this,d=p.constructor;if(r=new d(r),!p.d||!r.d)return!p.s||!r.s?r=new d(NaN):p.d||(r=new d(r.d||p.s===r.s?p:NaN)),r;if(p.s!=r.s)return r.s=-r.s,p.minus(r);if(c=p.d,f=r.d,o=d.precision,l=d.rounding,!c[0]||!f[0])return f[0]||(r=new d(p)),ft?Qe(r,o,l):r;if(i=xn(p.e/it),n=xn(r.e/it),c=c.slice(),s=i-n,s){for(s<0?(t=c,s=-s,a=f.length):(t=f,n=i,a=c.length),i=Math.ceil(o/it),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=c.length,s=f.length,a-s<0&&(s=a,t=f,f=c,c=t),e=0;s;)e=(c[--s]=c[s]+f[s]+e)/Ws|0,c[s]%=Ws;for(e&&(c.unshift(e),++n),a=c.length;c[--a]==0;)c.pop();return r.d=c,r.e=Fy(c,n),ft?Qe(r,o,l):r};Se.precision=Se.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(no+r);return t.d?(e=RI(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Se.round=function(){var r=this,e=r.constructor;return Qe(new e(r),r.e+1,e.rounding)};Se.sine=Se.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())+it,n.rounding=1,t=RV(n,kI(n,t)),n.precision=r,n.rounding=e,Qe(ra>2?t.neg():t,r,e,!0)):new n(NaN)};Se.squareRoot=Se.sqrt=function(){var r,e,t,n,s,i,a=this,o=a.d,l=a.e,c=a.s,f=a.constructor;if(c!==1||!o||!o[0])return new f(!c||c<0&&(!o||o[0])?NaN:o?a:1/0);for(ft=!1,c=Math.sqrt(+a),c==0||c==1/0?(e=hn(o),(e.length+l)%2==0&&(e+="0"),c=Math.sqrt(e),l=xn((l+1)/2)-(l<0||l%2),c==1/0?e="5e"+l:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new f(e)):n=new f(c.toString()),t=(l=f.precision)+3;;)if(i=n,n=i.plus(or(a,i,t+2,1)).times(.5),hn(i.d).slice(0,t)===(e=hn(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(Qe(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")&&(Qe(n,l+1,1),r=!n.times(n).eq(a));break}return ft=!0,Qe(n,l,f.rounding,r)};Se.tangent=Se.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=or(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,Qe(ra==2||ra==4?t.neg():t,r,e,!0)):new n(NaN)};Se.times=Se.mul=function(r){var e,t,n,s,i,a,o,l,c,f=this,p=f.constructor,d=f.d,g=(r=new p(r)).d;if(r.s*=f.s,!d||!d[0]||!g||!g[0])return new p(!r.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?r.s/0:r.s*0);for(t=xn(f.e/it)+xn(r.e/it),l=d.length,c=g.length,l<c&&(i=d,d=g,g=i,a=l,l=c,c=a),i=[],a=l+c,n=a;n--;)i.push(0);for(n=c;--n>=0;){for(e=0,s=l+n;s>n;)o=i[s]+g[n]*d[s-n-1]+e,i[s--]=o%Ws|0,e=o/Ws|0;i[s]=(i[s]+e)%Ws|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=Fy(i,t),ft?Qe(r,p.precision,p.rounding):r};Se.toBinary=function(r,e){return vA(this,2,r,e)};Se.toDecimalPlaces=Se.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(jn(r,0,so),e===void 0?e=n.rounding:jn(e,0,8),Qe(t,r+t.e+1,e))};Se.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=gi(n,!0):(jn(r,0,so),e===void 0?e=s.rounding:jn(e,0,8),n=Qe(new s(n),r+1,e),t=gi(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Se.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=gi(s):(jn(r,0,so),e===void 0?e=i.rounding:jn(e,0,8),n=Qe(new i(s),r+s.e+1,e),t=gi(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Se.toFraction=function(r){var e,t,n,s,i,a,o,l,c,f,p,d,g=this,m=g.d,v=g.constructor;if(!m)return new v(g);if(c=t=new v(1),n=l=new v(0),e=new v(n),i=e.e=RI(m)-g.e-1,a=i%it,e.d[0]=Kr(10,a<0?it+a:a),r==null)r=i>0?e:c;else{if(o=new v(r),!o.isInt()||o.lt(c))throw Error(no+o);r=o.gt(e)?i>0?e:c:o}for(ft=!1,o=new v(hn(m)),f=v.precision,v.precision=i=m.length*it*2;p=or(o,e,0,1,1),s=t.plus(p.times(n)),s.cmp(r)!=1;)t=n,n=s,s=c,c=l.plus(p.times(s)),l=s,s=e,e=o.minus(p.times(s)),o=s;return s=or(r.minus(t),n,0,1,1),l=l.plus(s.times(c)),t=t.plus(s.times(n)),l.s=c.s=g.s,d=or(c,n,i,1).minus(g).abs().cmp(or(l,t,i,1).minus(g).abs())<1?[c,n]:[l,t],v.precision=f,ft=!0,d};Se.toHexadecimal=Se.toHex=function(r,e){return vA(this,16,r,e)};Se.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:jn(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]?(ft=!1,t=or(t,r,0,e,1).times(r),ft=!0,Qe(t)):(r.s=t.s,t=r),t};Se.toNumber=function(){return+this};Se.toOctal=function(r,e){return vA(this,8,r,e)};Se.toPower=Se.pow=function(r){var e,t,n,s,i,a,o=this,l=o.constructor,c=+(r=new l(r));if(!o.d||!r.d||!o.d[0]||!r.d[0])return new l(Kr(+o,c));if(o=new l(o),o.eq(1))return o;if(n=l.precision,i=l.rounding,r.eq(1))return Qe(o,n,i);if(e=xn(r.e/it),e>=r.d.length-1&&(t=c<0?-c:c)<=TV)return s=OI(l,o,t,n),r.s<0?new l(1).div(s):Qe(s,n,i);if(a=o.s,a<0){if(e<r.d.length-1)return new l(NaN);if((r.d[e]&1)==0&&(a=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=a,o}return t=Kr(+o,c),e=t==0||!isFinite(t)?xn(c*(Math.log("0."+hn(o.d))/Math.LN10+o.e+1)):new l(t+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(ft=!1,l.rounding=o.s=1,t=Math.min(12,(e+"").length),s=yA(r.times(ro(o,n+t)),n),s.d&&(s=Qe(s,n+5,1),Y0(s.d,n,i)&&(e=n+10,s=Qe(yA(r.times(ro(o,e+t)),e),e+5,1),+hn(s.d).slice(n+1,n+15)+1==1e14&&(s=Qe(s,n+1,0)))),s.s=a,ft=!0,l.rounding=i,Qe(s,n,i))};Se.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=gi(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(jn(r,1,so),e===void 0?e=s.rounding:jn(e,0,8),n=Qe(new s(n),r,e),t=gi(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};Se.toSignificantDigits=Se.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(jn(r,1,so),e===void 0?e=n.rounding:jn(e,0,8)),Qe(new n(t),r,e)};Se.toString=function(){var r=this,e=r.constructor,t=gi(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};Se.truncated=Se.trunc=function(){return Qe(new this.constructor(this),this.e+1,1)};Se.valueOf=Se.toJSON=function(){var r=this,e=r.constructor,t=gi(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function hn(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=it-n.length,t&&(i+=to(t)),i+=n;a=r[e],n=a+"",t=it-n.length,t&&(i+=to(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}u(hn,"digitsToString");function jn(r,e,t){if(r!==~~r||r<e||r>t)throw Error(no+r)}u(jn,"checkInt32");function Y0(r,e,t,n){var s,i,a,o;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=it,s=0):(s=Math.ceil((e+1)/it),e%=it),i=Kr(10,it-e),o=r[s]%i|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),a=t<4&&o==99999||t>3&&o==49999||o==5e4||o==0):a=(t<4&&o+1==i||t>3&&o+1==i/2)&&(r[s+1]/i/100|0)==Kr(10,e-2)-1||(o==i/2||o==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),a=(n||t<4)&&o==9999||!n&&t>3&&o==4999):a=((n||t<4)&&o+1==i||!n&&t>3&&o+1==i/2)&&(r[s+1]/i/1e3|0)==Kr(10,e-3)-1,a}u(Y0,"checkRoundingDigits");function Oy(r,e,t){for(var n,s=[0],i,a=0,o=r.length;a<o;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=dA.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()}u(Oy,"convertBase");function DV(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/Uy(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=ff(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}u(DV,"cosine");var or=(function(){function r(n,s,i){var a,o=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+o,n[l]=a%i|0,o=a/i|0;return o&&n.unshift(o),n}u(r,"multiplyInteger");function e(n,s,i,a){var o,l;if(i!=a)l=i>a?1:-1;else for(o=l=0;o<i;o++)if(n[o]!=s[o]){l=n[o]>s[o]?1:-1;break}return l}u(e,"compare");function t(n,s,i,a){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return u(t,"subtract"),function(n,s,i,a,o,l){var c,f,p,d,g,m,v,y,S,C,w,E,A,b,V,I,D,U,F,M,se=n.constructor,ee=n.s==s.s?1:-1,ie=n.d,X=s.d;if(!ie||!ie[0]||!X||!X[0])return new se(!n.s||!s.s||(ie?X&&ie[0]==X[0]:!X)?NaN:ie&&ie[0]==0||!X?ee*0:ee/0);for(l?(g=1,f=n.e-s.e):(l=Ws,g=it,f=xn(n.e/g)-xn(s.e/g)),F=X.length,D=ie.length,S=new se(ee),C=S.d=[],p=0;X[p]==(ie[p]||0);p++);if(X[p]>(ie[p]||0)&&f--,i==null?(b=i=se.precision,a=se.rounding):o?b=i+(n.e-s.e)+1:b=i,b<0)C.push(1),m=!0;else{if(b=b/g+2|0,p=0,F==1){for(d=0,X=X[0],b++;(p<D||d)&&b--;p++)V=d*l+(ie[p]||0),C[p]=V/X|0,d=V%X|0;m=d||p<D}else{for(d=l/(X[0]+1)|0,d>1&&(X=r(X,d,l),ie=r(ie,d,l),F=X.length,D=ie.length),I=F,w=ie.slice(0,F),E=w.length;E<F;)w[E++]=0;M=X.slice(),M.unshift(0),U=X[0],X[1]>=l/2&&++U;do d=0,c=e(X,w,F,E),c<0?(A=w[0],F!=E&&(A=A*l+(w[1]||0)),d=A/U|0,d>1?(d>=l&&(d=l-1),v=r(X,d,l),y=v.length,E=w.length,c=e(v,w,y,E),c==1&&(d--,t(v,F<y?M:X,y,l))):(d==0&&(c=d=1),v=X.slice()),y=v.length,y<E&&v.unshift(0),t(w,v,E,l),c==-1&&(E=w.length,c=e(X,w,F,E),c<1&&(d++,t(w,F<E?M:X,E,l))),E=w.length):c===0&&(d++,w=[0]),C[p++]=d,c&&w[0]?w[E++]=ie[I]||0:(w=[ie[I]],E=1);while((I++<D||w[0]!==void 0)&&b--);m=w[0]!==void 0}C[0]||C.shift()}if(g==1)S.e=f,NI=m;else{for(p=1,d=C[0];d>=10;d/=10)p++;S.e=p+f*g-1,Qe(S,o?i+S.e+1:i,a,m)}return S}})();function Qe(r,e,t,n){var s,i,a,o,l,c,f,p,d,g=r.constructor;e:if(e!=null){if(p=r.d,!p)return r;for(s=1,o=p[0];o>=10;o/=10)s++;if(i=e-s,i<0)i+=it,a=e,f=p[d=0],l=f/Kr(10,s-a-1)%10|0;else if(d=Math.ceil((i+1)/it),o=p.length,d>=o)if(n){for(;o++<=d;)p.push(0);f=l=0,s=1,i%=it,a=i-it+1}else break e;else{for(f=o=p[d],s=1;o>=10;o/=10)s++;i%=it,a=i-it+s,l=a<0?0:f/Kr(10,s-a-1)%10|0}if(n=n||e<0||p[d+1]!==void 0||(a<0?f:f%Kr(10,s-a-1)),c=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?f/Kr(10,s-a):0:p[d-1])%10&1||t==(r.s<0?8:7)),e<1||!p[0])return p.length=0,c?(e-=r.e+1,p[0]=Kr(10,(it-e%it)%it),r.e=-e||0):p[0]=r.e=0,r;if(i==0?(p.length=d,o=1,d--):(p.length=d+1,o=Kr(10,it-i),p[d]=a>0?(f/Kr(10,s-a)%Kr(10,a)|0)*o:0),c)for(;;)if(d==0){for(i=1,a=p[0];a>=10;a/=10)i++;for(a=p[0]+=o,o=1;a>=10;a/=10)o++;i!=o&&(r.e++,p[0]==Ws&&(p[0]=1));break}else{if(p[d]+=o,p[d]!=Ws)break;p[d--]=0,o=1}for(i=p.length;p[--i]===0;)p.pop()}return ft&&(r.e>g.maxE?(r.d=null,r.e=NaN):r.e<g.minE&&(r.e=0,r.d=[0])),r}u(Qe,"finalise");function gi(r,e,t){if(!r.isFinite())return PI(r);var n,s=r.e,i=hn(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+to(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+to(-s-1)+i,t&&(n=t-a)>0&&(i+=to(n))):s>=a?(i+=to(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+to(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=to(n))),i}u(gi,"finiteToString");function Fy(r,e){var t=r[0];for(e*=it;t>=10;t/=10)e++;return e}u(Fy,"getBase10Exponent");function Ly(r,e,t){if(e>IV)throw ft=!0,t&&(r.precision=t),Error(TI);return Qe(new r(Py),e,1,!0)}u(Ly,"getLn10");function mi(r,e,t){if(e>gA)throw Error(TI);return Qe(new r(ky),e,t,!0)}u(mi,"getPi");function RI(r){var e=r.length-1,t=e*it+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}u(RI,"getPrecision");function to(r){for(var e="";r--;)e+="0";return e}u(to,"getZeroString");function OI(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/it+4);for(ft=!1;;){if(t%2&&(i=i.times(e),xI(i.d,a)&&(s=!0)),t=xn(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),xI(e.d,a)}return ft=!0,i}u(OI,"intPow");function CI(r){return r.d[r.d.length-1]&1}u(CI,"isOdd");function _I(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}u(_I,"maxOrMin");function yA(r,e){var t,n,s,i,a,o,l,c=0,f=0,p=0,d=r.constructor,g=d.rounding,m=d.precision;if(!r.d||!r.d[0]||r.e>17)return new d(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(ft=!1,l=m):l=e,o=new d(.03125);r.e>-2;)r=r.times(o),p+=5;for(n=Math.log(Kr(2,p))/Math.LN10*2+5|0,l+=n,t=i=a=new d(1),d.precision=l;;){if(i=Qe(i.times(r),l,1),t=t.times(++f),o=a.plus(or(i,t,l,1)),hn(o.d).slice(0,l)===hn(a.d).slice(0,l)){for(s=p;s--;)a=Qe(a.times(a),l,1);if(e==null)if(c<3&&Y0(a.d,l-n,g,c))d.precision=l+=10,t=i=o=new d(1),f=0,c++;else return Qe(a,d.precision=m,g,ft=!0);else return d.precision=m,a}a=o}}u(yA,"naturalExponential");function ro(r,e){var t,n,s,i,a,o,l,c,f,p,d,g=1,m=10,v=r,y=v.d,S=v.constructor,C=S.rounding,w=S.precision;if(v.s<0||!y||!y[0]||!v.e&&y[0]==1&&y.length==1)return new S(y&&!y[0]?-1/0:v.s!=1?NaN:y?0:v);if(e==null?(ft=!1,f=w):f=e,S.precision=f+=m,t=hn(y),n=t.charAt(0),Math.abs(i=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(r),t=hn(v.d),n=t.charAt(0),g++;i=v.e,n>1?(v=new S("0."+t),i++):v=new S(n+"."+t.slice(1))}else return c=Ly(S,f+2,w).times(i+""),v=ro(new S(n+"."+t.slice(1)),f-m).plus(c),S.precision=w,e==null?Qe(v,w,C,ft=!0):v;for(p=v,l=a=v=or(v.minus(1),v.plus(1),f,1),d=Qe(v.times(v),f,1),s=3;;){if(a=Qe(a.times(d),f,1),c=l.plus(or(a,new S(s),f,1)),hn(c.d).slice(0,f)===hn(l.d).slice(0,f))if(l=l.times(2),i!==0&&(l=l.plus(Ly(S,f+2,w).times(i+""))),l=or(l,new S(g),f,1),e==null)if(Y0(l.d,f-m,C,o))S.precision=f+=m,c=a=v=or(p.minus(1),p.plus(1),f,1),d=Qe(v.times(v),f,1),s=o=1;else return Qe(l,S.precision=w,C,ft=!0);else return S.precision=w,l;l=c,s+=2}}u(ro,"naturalLogarithm");function PI(r){return String(r.s*r.s/0)}u(PI,"nonFiniteToString");function _y(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)%it,t<0&&(n+=it),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=it;n<s;)r.d.push(+e.slice(n,n+=it));e=e.slice(n),n=it-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),ft&&(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}u(_y,"parseDecimal");function BV(r,e){var t,n,s,i,a,o,l,c,f;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),BI.test(e))return _y(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(bV.test(e))t=16,e=e.toLowerCase();else if(xV.test(e))t=2;else if(NV.test(e))t=8;else throw Error(no+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(".",""),o=e.length,i=o-i,s=OI(n,new n(t),i,i*2)),c=Oy(e,t,Ws),f=c.length-1,i=f;c[i]===0;--i)c.pop();return i<0?new n(r.s*0):(r.e=Fy(c,f),r.d=c,ft=!1,a&&(r=or(r,s,o*4)),l&&(r=r.times(Math.abs(l)<54?Kr(2,l):hf.pow(2,l))),ft=!0,r)}u(BV,"parseOther");function RV(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:ff(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/Uy(5,t)),e=ff(r,2,e,e);for(var s,i=new r(5),a=new r(16),o=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(o))));return e}u(RV,"sine");function ff(r,e,t,n,s){var i,a,o,l,c=1,f=r.precision,p=Math.ceil(f/it);for(ft=!1,l=t.times(t),o=new r(n);;){if(a=or(o.times(l),new r(e++*e++),f,1),o=s?n.plus(a):n.minus(a),n=or(a.times(l),new r(e++*e++),f,1),a=o.plus(n),a.d[p]!==void 0){for(i=p;a.d[i]===o.d[i]&&i--;);if(i==-1)break}i=o,o=n,n=a,a=i,c++}return ft=!0,a.d.length=p+1,a}u(ff,"taylorSeries");function Uy(r,e){for(var t=r;--e;)t*=r;return t}u(Uy,"tinyPow");function kI(r,e){var t,n=e.s<0,s=mi(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return ra=n?4:1,e;if(t=e.divToInt(s),t.isZero())ra=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return ra=CI(t)?n?2:3:n?4:1,e;ra=CI(t)?n?1:4:n?3:2}return e.minus(s).abs()}u(kI,"toLessThanHalfPi");function vA(r,e,t,n){var s,i,a,o,l,c,f,p,d,g=r.constructor,m=t!==void 0;if(m?(jn(t,1,so),n===void 0?n=g.rounding:jn(n,0,8)):(t=g.precision,n=g.rounding),!r.isFinite())f=PI(r);else{for(f=gi(r),a=f.indexOf("."),m?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(f=f.replace(".",""),d=new g(1),d.e=f.length-a,d.d=Oy(gi(d),10,s),d.e=d.d.length),p=Oy(f,10,s),i=l=p.length;p[--l]==0;)p.pop();if(!p[0])f=m?"0p+0":"0";else{if(a<0?i--:(r=new g(r),r.d=p,r.e=i,r=or(r,d,t,n,0,s),p=r.d,i=r.e,c=NI),a=p[t],o=s/2,c=c||p[t+1]!==void 0,c=n<4?(a!==void 0||c)&&(n===0||n===(r.s<0?3:2)):a>o||a===o&&(n===4||c||n===6&&p[t-1]&1||n===(r.s<0?8:7)),p.length=t,c)for(;++p[--t]>s-1;)p[t]=0,t||(++i,p.unshift(1));for(l=p.length;!p[l-1];--l);for(a=0,f="";a<l;a++)f+=dA.charAt(p[a]);if(m){if(l>1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)f+="0";for(p=Oy(f,s,e),l=p.length;!p[l-1];--l);for(a=1,f="1.";a<l;a++)f+=dA.charAt(p[a])}else f=f.charAt(0)+"."+f.slice(1);f=f+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)f="0"+f;f="0."+f}else if(++i>l)for(i-=l;i--;)f+="0";else i<l&&(f=f.slice(0,i)+"."+f.slice(i))}f=(e==16?"0x":e==2?"0b":e==8?"0o":"")+f}return r.s<0?"-"+f:f}u(vA,"toStringBinary");function xI(r,e){if(r.length>e)return r.length=e,!0}u(xI,"truncate");function OV(r){return new this(r).abs()}u(OV,"abs");function _V(r){return new this(r).acos()}u(_V,"acos");function PV(r){return new this(r).acosh()}u(PV,"acosh");function kV(r,e){return new this(r).plus(e)}u(kV,"add");function LV(r){return new this(r).asin()}u(LV,"asin");function VV(r){return new this(r).asinh()}u(VV,"asinh");function FV(r){return new this(r).atan()}u(FV,"atan");function UV(r){return new this(r).atanh()}u(UV,"atanh");function MV(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=mi(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?mi(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=mi(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(or(r,e,i,1)),e=mi(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(or(r,e,i,1)),t}u(MV,"atan2");function jV(r){return new this(r).cbrt()}u(jV,"cbrt");function qV(r){return Qe(r=new this(r),r.e+1,2)}u(qV,"ceil");function HV(r,e,t){return new this(r).clamp(e,t)}u(HV,"clamp");function KV(r){if(!r||typeof r!="object")throw Error(Vy+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,so,"rounding",0,8,"toExpNeg",-cf,0,"toExpPos",0,cf,"maxE",0,cf,"minE",-cf,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=mA[t]),(n=r[t])!==void 0)if(xn(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(no+t+": "+n);if(t="crypto",s&&(this[t]=mA[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(II);else this[t]=!1;else throw Error(no+t+": "+n);return this}u(KV,"config");function XV(r){return new this(r).cos()}u(XV,"cos");function GV(r){return new this(r).cosh()}u(GV,"cosh");function LI(r){var e,t,n;function s(i){var a,o,l,c=this;if(!(c instanceof s))return new s(i);if(c.constructor=s,bI(i)){c.s=i.s,ft?!i.d||i.e>s.maxE?(c.e=NaN,c.d=null):i.e<s.minE?(c.e=0,c.d=[0]):(c.e=i.e,c.d=i.d.slice()):(c.e=i.e,c.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){c.s=1/i<0?-1:1,c.e=0,c.d=[0];return}if(i<0?(i=-i,c.s=-1):c.s=1,i===~~i&&i<1e7){for(a=0,o=i;o>=10;o/=10)a++;ft?a>s.maxE?(c.e=NaN,c.d=null):a<s.minE?(c.e=0,c.d=[0]):(c.e=a,c.d=[i]):(c.e=a,c.d=[i]);return}if(i*0!==0){i||(c.s=NaN),c.e=NaN,c.d=null;return}return _y(c,i.toString())}if(l==="string")return(o=i.charCodeAt(0))===45?(i=i.slice(1),c.s=-1):(o===43&&(i=i.slice(1)),c.s=1),BI.test(i)?_y(c,i):BV(c,i);if(l==="bigint")return i<0?(i=-i,c.s=-1):c.s=1,_y(c,i.toString());throw Error(no+i)}if(u(s,"Decimal"),s.prototype=Se,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=KV,s.clone=LI,s.isDecimal=bI,s.abs=OV,s.acos=_V,s.acosh=PV,s.add=kV,s.asin=LV,s.asinh=VV,s.atan=FV,s.atanh=UV,s.atan2=MV,s.cbrt=jV,s.ceil=qV,s.clamp=HV,s.cos=XV,s.cosh=GV,s.div=$V,s.exp=WV,s.floor=zV,s.hypot=JV,s.ln=YV,s.log=QV,s.log10=e6,s.log2=ZV,s.max=t6,s.min=r6,s.mod=n6,s.mul=s6,s.pow=i6,s.random=a6,s.round=o6,s.sign=u6,s.sin=l6,s.sinh=c6,s.sqrt=f6,s.sub=h6,s.sum=p6,s.tan=d6,s.tanh=m6,s.trunc=g6,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}u(LI,"clone");function $V(r,e){return new this(r).div(e)}u($V,"div");function WV(r){return new this(r).exp()}u(WV,"exp");function zV(r){return Qe(r=new this(r),r.e+1,3)}u(zV,"floor");function JV(){var r,e,t=new this(0);for(ft=!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 ft=!0,new this(1/0);t=e}return ft=!0,t.sqrt()}u(JV,"hypot");function bI(r){return r instanceof hf||r&&r.toStringTag===DI||!1}u(bI,"isDecimalInstance");function YV(r){return new this(r).ln()}u(YV,"ln");function QV(r,e){return new this(r).log(e)}u(QV,"log");function ZV(r){return new this(r).log(2)}u(ZV,"log2");function e6(r){return new this(r).log(10)}u(e6,"log10");function t6(){return _I(this,arguments,-1)}u(t6,"max");function r6(){return _I(this,arguments,1)}u(r6,"min");function n6(r,e){return new this(r).mod(e)}u(n6,"mod");function s6(r,e){return new this(r).mul(e)}u(s6,"mul");function i6(r,e){return new this(r).pow(e)}u(i6,"pow");function a6(r){var e,t,n,s,i=0,a=new this(1),o=[];if(r===void 0?r=this.precision:jn(r,1,so),n=Math.ceil(r/it),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]:o[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):(o.push(s%1e7),i+=4);i=n/4}else throw Error(II);else for(;i<n;)o[i++]=Math.random()*1e7|0;for(n=o[--i],r%=it,n&&r&&(s=Kr(10,it-r),o[i]=(n/s|0)*s);o[i]===0;i--)o.pop();if(i<0)t=0,o=[0];else{for(t=-1;o[0]===0;t-=it)o.shift();for(n=1,s=o[0];s>=10;s/=10)n++;n<it&&(t-=it-n)}return a.e=t,a.d=o,a}u(a6,"random");function o6(r){return Qe(r=new this(r),r.e+1,this.rounding)}u(o6,"round");function u6(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}u(u6,"sign");function l6(r){return new this(r).sin()}u(l6,"sin");function c6(r){return new this(r).sinh()}u(c6,"sinh");function f6(r){return new this(r).sqrt()}u(f6,"sqrt");function h6(r,e){return new this(r).sub(e)}u(h6,"sub");function p6(){var r=0,e=arguments,t=new this(e[r]);for(ft=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return ft=!0,Qe(t,this.precision,this.rounding)}u(p6,"sum");function d6(r){return new this(r).tan()}u(d6,"tan");function m6(r){return new this(r).tanh()}u(m6,"tanh");function g6(r){return Qe(r=new this(r),r.e+1,1)}u(g6,"trunc");Se[Symbol.for("nodejs.util.inspect.custom")]=Se.toString;Se[Symbol.toStringTag]="Decimal";var hf=Se.constructor=LI(mA);Py=new hf(Py);ky=new hf(ky);var pf=class r extends hf{static{u(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)}};import y6 from"pdfkit";var VI=class r{static{u(this,"PdfkitPdfBuilder")}defaults={autoFirstPage:!1};doc=new y6(this.defaults);constructor(e){e&&this.configure(e)}static new(e){return new r(e)}configure(e){return this.doc.options={...this.doc.options,...e},this}pipe(e){return this.doc.pipe(e),this}end(){return this.doc.end()}restore(){return this.doc.restore(),this}save(){return this.doc.save(),this}stroke(e){return this.doc.stroke(e),this}page(e){return this.doc.addPage(e),this}table(e){return this.doc.table(e),this}text(e,t){let{x:n,y:s,...i}=t??{};return n||s?(this.doc.text(e,n,s,i),this):(this.doc.text(e,t),this)}fontSize(e){return this.doc.fontSize(e),this}font(e,t,n){return typeof t=="string"?(this.doc.font(e,t,n),this):typeof t=="number"?(this.doc.font(e,t),this):(this.doc.font(e),this)}image(e,t,n,s){return typeof t=="number"&&typeof n=="number"?(this.doc.image(e,t,n,s),this):(this.doc.image(e,t),this)}rect(e,t,n,s){return this.doc.rect(e,t,n,s),this}path(e){return this.doc.path(e),this}translate(e,t){return this.doc.translate(e,t),this}scale(e,t){return this.doc.scale(e,t),this}fill(e,t){return this.doc.fill(e,t),this}pageWidth(){return this.doc.page.width}pageHeight(){return this.doc.page.height}heightOfString(e,t){return this.doc.heightOfString(e,t)}widthOfString(e,t){return this.doc.widthOfString(e,t)}pageMargins(){return this.doc.page.margins}currentLineHeight(e){return this.doc.currentLineHeight(e)}x(){return this.doc.x}y(){return this.doc.y}moveDown(e){return this.doc.moveDown(e),this}row(e,...t){let n,s;typeof e=="function"?(n={},s=[e,...t]):(n=e??{},s=t),n.columns??=1;let i=this.y(),a=n.right??0,o=n.left??0,l=n.gap??0,c=this.pageWidth(),f=c-o-a-l*(n.columns-1);n.size??=Array(n.columns).fill(12/n.columns);let p=[];for(let d=0;d<n.columns;d++){let g=n.size[d]/12;p[d]=f*g}for(let d=0,g=o;d<n.columns;d++){let m=d===n.columns-1,v=p[d];if(m&&n.columns>1){let C=c-a-g;C>0&&Math.abs(C-v)>.01&&(v=C)}let y={y:i,x:g,width:v};s[d](y),g+=v,l>0&&!m&&(g+=l)}return this}};var FI=class{static{u(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 vo=Ty(eR(),1);import g9 from"os";import lR from"fs";import y9 from"path";import dd from"crypto";var r9=u(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),cs=u(r=>typeof r=="string"?rr(new Mt(r)):r instanceof Error?rr(new Mt(r.message,{cause:r.cause})):r9(r)?rr(new Mt(r.message)):rr(new Mt("unexpected error")),"leftFromError");var vv=class{static{u(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};import{arch as u9,platform as oR}from"os";import{dirname as l9,join as c9,resolve as f9,normalize as h9,delimiter as p9}from"path";import{resolve as rR}from"path";import{createRequire as tR}from"module";import{fileURLToPath as n9,pathToFileURL as s9}from"url";var i9=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Df,nR=u(()=>{if(Df!==void 0)return Df;if(i9){Df=void 0;return}try{Df=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Df=void 0}return Df},"getImportMetaUrl"),sR=u(()=>{if(typeof st<"u")return st;let r=nR();if(r)return tR(r);let e=s9(rR(process.cwd(),"package.json")).href;return tR(e)},"getRequireFn"),iR=u(()=>{if(typeof __filename<"u")return __filename;let r=nR();return r?n9(r):rR(process.cwd())},"getCurrentFile");import{dirname as Ev,resolve as nl}from"path";import{existsSync as Bf}from"fs";var aR=u(()=>typeof process<"u"&&typeof process.versions<"u"&&"electron"in process.versions,"isElectron"),a9=u(()=>{if(!aR())return null;try{let e=st("electron").app;if(e?.getAppPath&&typeof e.getAppPath=="function")return{getAppPath:e.getAppPath}}catch{}return null},"getElectronApp"),o9=u(()=>{if(!aR())return null;let r=process;if(r.resourcesPath)return r.resourcesPath;let e=a9();if(e)try{let t=e.getAppPath();if(typeof t=="string")return Ev(t.replace(/\.asar$/,""))}catch{}return null},"getElectronResourcesPath"),SC=u((r,{onFound:e,onNotFound:t})=>{let n=o9();if(n){let c=nl(n,"node_modules","nfets",r);if(Bf(c))return e(c);let f=nl(n,"app.asar.unpacked","node_modules","nfets",r);if(Bf(f))return e(f)}let s=iR(),i=s.includes(".asar")?process.cwd():s,a=nl(i,"../../../../"),o=nl(a,r);if(Bf(o))return e(o);let l=i;for(let c=0;c<5;c++){let f=nl(l,r);if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}l=i;for(let c=0;c<5;c++){let f=nl(l,"node_modules","nfets",r);if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}l=i;for(let c=0;c<5;c++){let f=nl(l,r.replace(/^build\//,"Release/"));if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}return t()},"search");var d9=u(r=>{let e=r.replace(/^\\\\\?\\/,"");return f9(h9(e))},"normalizePath"),m9=u(r=>{oR()==="win32"&&(process.env.PATH=`${l9(r)}${p9}${process.env.PATH}`)},"addAddonDirToPath"),AC=u(r=>{let e=d9(r);return m9(e),sR()(e)},"exportRequireModule"),Rf=u(r=>{if(r=`${r}.node`,process.env.NFETS_ADDONS_DIR)return AC(c9(process.env.NFETS_ADDONS_DIR,r));let e=`${oR()}-${u9()}`;try{return SC(`build/addons/${e}/${r}`,{onFound:u(t=>AC(t),"onFound"),onNotFound:u(()=>{throw new Error(`Addon ${e}/${r} not found`)},"onNotFound")})}catch{return SC(`build/Release/${r}`,{onFound:u(t=>AC(t),"onFound"),onNotFound:u(()=>{throw new Error(`Addon ${e}/${r} not found`)},"onNotFound")})}},"addon");var yo=class{static{u(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
83
- `).reduce((i,a)=>{let[o,l]=a.split("=").map(c=>c.trim());return!o||!l?i:i.set(o,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"),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 o=i[0].subarray(-4),l=o.subarray(-2);o[0]===48?l=o:o[1]===48&&(l=o.subarray(-3));let c=Buffer.concat([l,n,i[1]]),f=this.length(c),p=n.length,d=c.subarray(2+p,2+p+f),g=d.length-l.length-2;if(g<=0||g>d.length)return;let v=d.subarray(-g).toString("utf8");return v.substring(Buffer.from(v).findIndex((y,S)=>v.charCodeAt(S)>=32&&v.charCodeAt(S)<=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 wv=class{static{u(this,"WincryptSignerRepository")}async sign(e,t,n){try{let s=Rf("wincrypt_certificate_store"),i=new yo,{CN:a}=i.extractCertificateInfo(t.certificate),o=await s.sign(a??"",Buffer.from(e),n),l=Buffer.from(o).toString("base64");return await Promise.resolve(Hr(l))}catch(s){return Promise.resolve(cs(s))}}};import uR from"crypto";var Sv=class{static{u(this,"CryptoSignerRepository")}async sign(e,t,n){try{if(!t.privateKey)return rr(new Mt("Certificate private key not found"));let i=uR.sign(n,Buffer.from(e),{key:t.privateKey,padding:uR.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(Hr(i))}catch(s){return Promise.resolve(cs(s))}}};var cR=class{static{u(this,"NativeCertificateRepository")}httpClient;cache;signer;constructor(e,t=new vv,n=g9.platform()==="win32"?new wv:new Sv){this.httpClient=e,this.cache=t,this.signer=n}async read(e){try{let{password:t,pfxPathOrBase64:n,publicCertDerBase64:s}=e,i=s?.trim(),a=n?.trim();if(i&&a)return rr(new Mt("Use either pfxPathOrBase64 or publicCertDerBase64, not both"));if(i)try{let S=Buffer.from(i,"base64"),C=new dd.X509Certificate(S);return Hr({ca:[],password:t,certificate:C,privateKey:void 0})}catch(S){return cs(S)}if(!a)return rr(new Mt("Certificate path (pfxPathOrBase64) is required"));let o=await this.getPfxBuffer({...e,pfxPathOrBase64:a});if(o.isLeft())return o;let l=vo.default.asn1.fromDer(o.value.toString("binary")),c=vo.default.pkcs12.pkcs12FromAsn1(l,t),{certBag:f}=vo.default.pki.oids,d=c.getBags({bagType:f})[f];if(!d?.length)return rr(new Mt("Cannot read certificate"));let[{cert:g},...m]=d;if(!g)return rr(new Mt("Issuer Certificate not found"));let v=m.reduce((S,{cert:C})=>(C&&S.push(new dd.X509Certificate(vo.default.pki.certificateToPem(C))),S),[]),y=new dd.X509Certificate(vo.default.pki.certificateToPem(g));return Hr({ca:v,password:t,certificate:y,privateKey:this.getPrivateKey(c)})}catch(t){return cs(t)}}getPrivateKey(e){let{pkcs8ShroudedKeyBag:t}=vo.default.pki.oids,s=e.getBags({bagType:t})[t]?.[0]?.key;if(s)return dd.createPrivateKey(vo.default.pki.privateKeyToPem(s))}async sign(e,t,n=eo.SHA1){return this.signer.sign(e,t,n)}getCertificateInfo(e){return new yo().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"})}catch{throw new Mt("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 Hr(i);if(y9.isAbsolute(t)||lR.existsSync(t))return this.hitBufferOnCache(s,lR.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 cs(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return dd.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),Hr(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};import RG from"os";import CC from"dayjs";import v9 from"dayjs/plugin/utc.js";import E9 from"dayjs/plugin/timezone.js";CC.extend(v9);CC.extend(E9);var Of=CC;var dP=Ty(lP(),1);import{constants as OG}from"crypto";import{Agent as nb}from"https";var wG=new Set(["ENOTFOUND","EAI_AGAIN","EAI_FAIL","EAI_NONAME"]),SG=new Set(["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNABORTED"]),AG=u(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessage"),CG=u(r=>{if(!r||typeof r!="object"||!("code"in r))return;let{code:e}=r;return typeof e=="string"?e:void 0},"getCode"),xG=u(r=>{if(!r||typeof r!="object"||!("hostname"in r))return;let{hostname:e}=r;return typeof e=="string"?e:void 0},"getHostname"),tb=u(r=>{if(typeof r=="string")return r;if(r instanceof Error||AG(r))return r.message},"getMessage"),cP=u(r=>{let e=r.toLowerCase();return e.includes("timeout")||e.includes("timed out")||e.includes("time-out")||e.includes("read econnreset")},"isTimeoutMessage"),bG=u(r=>/getaddrinfo\s+ENOTFOUND/i.test(r)||/\bENOTFOUND\b/i.test(r),"isHostNotFoundMessage"),NG=u(r=>{let e=[],t=new Set,n=r;for(;n!=null&&!t.has(n);){if(t.add(n),e.push(n),n instanceof AggregateError)for(let i of n.errors)t.has(i)||e.push(i);n=n instanceof Error?n.cause:void 0}return e},"collectErrorChain"),qd=u(r=>r instanceof Error?{cause:r}:void 0,"errorOptions"),TG=u(r=>{let e=NG(r),t=tb(r)??e.map(tb).find(n=>!!n);for(let n of e){let s=CG(n);if(s&&wG.has(s))return rr(new W0(t??`Host not found (${xG(n)??s})`,qd(r)));if(s&&SG.has(s))return rr(new uf(t??"Transmission timeout",qd(r)));let i=tb(n);if(i&&cP(i))return rr(new uf(i,qd(r)))}return t?bG(t)?rr(new W0(t,qd(r))):cP(t)?rr(new uf(t,qd(r))):cs(r):cs(r)},"mapTransmissionError"),fP=u(r=>TG(r),"leftFromTransmissionError");var IG=/Ã[\u0080-\u00BF]/;function DG(r){if(!IG.test(r))return r;let e=Buffer.from(r,"latin1").toString("utf8");return e.includes("\uFFFD")?r:e}u(DG,"fixUtf8Mojibake");function rb(r){if(typeof r=="string")return DG(r);if(Array.isArray(r))return r.map(e=>rb(e));if(r!==null&&typeof r=="object"){let e={};for(let[t,n]of Object.entries(r))e[t]=rb(n);return e}return r}u(rb,"normalizeValue");function hP(r){return rb(r)}u(hP,"normalizeTransmissionStrings");import BG from"os";var _2=class r{static{u(this,"WinHttpClient")}certificate;interceptors={request:{use:u(()=>0,"use"),eject:u(()=>{},"eject"),clear:u(()=>{},"clear")},response:{use:u(()=>0,"use"),eject:u(()=>{},"eject"),clear:u(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(BG.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
84
- `).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=Rf("winhttp_ssl_client"),{CN:i}=new yo().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var pP=class{static{u(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}validateCertificatePeriod(){if(!this.certificate)return Hr(void 0);let{certificate:e}=this.certificate,t=new Date;return t>new Date(e.validTo)?rr(new Mt(`Certificado expirado (${Of(e.validTo).format("DD/MM/YYYY")}). Renove o certificado.`)):t<new Date(e.validFrom)?rr(new Mt(`O certificado ainda n\xE3o est\xE1 v\xE1lido (${Of(e.validFrom).format("DD/MM/YYYY")}).`)):Hr(void 0)}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:OG.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new nb({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new nb({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new nb({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(e){let t=mI.create({timeout:e.timeout});return t.defaults.httpsAgent=this.httpsAgent,t}request(e){if(RG.platform()==="win32")try{return this.certificate?_2.create(this.certificate):this.getDefaultRequest({timeout:e.timeout})}catch{return this.getDefaultRequest({timeout:e.timeout})}return this.getDefaultRequest({timeout:e.timeout})}async send(e){let t=this.validateCertificatePeriod();if(t.isLeft())return t;try{let n=this.request({timeout:e.timeout}),s=await(0,dP.createClientAsync)(`${e.url}?wsdl`,{request:n,attributesKey:"$",wsdl_options:{request:n,timeout:e.timeout},forceSoap12Headers:!0});e.payload.$={xmlns:s.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),a=this.toolkit.getFirstNode(i)??"",o=e.xsd,l=await this.toolkit.validate(a,o);if(l.isLeft())return l;let[c]=await s[`${e.method}Async`]({_xml:i},{request:n,timeout:e.timeout});return Hr(hP(c))}catch(n){return fP(n)}}};var _G=Rf("xml_validator"),mP=_G;var wQ=Ty(F4(),1);import EQ from"crypto";var U4="application/xml";var gt;(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"})(gt||(gt={}));function PG(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}u(PG,"SelectNodesEx");function kG(r,e){let t=eh("xpath").select;return t(e,r)}u(kG,"SelectNodesNode");var M4=typeof self<"u"?PG:kG;function Xd(r){r=r.replace(/\r\n/g,`
82
+ @#[line:`+r.lineNumber+",col:"+r.columnNumber+"]"}u(gQ,"_locator");function IL(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}u(IL,"_toString");"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){iA.prototype[r]=function(){return null}});function sA(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}u(sA,"appendElement");function yQ(r){if(r==="error")throw"onErrorStopParsing"}u(yQ,"onErrorStopParsing");function vQ(){throw"onWarningStopParsing"}u(vQ,"onWarningStopParsing");K0.__DOMHandler=iA;K0.DOMParser=RL;K0.normalizeLineEndings=BL;K0.onErrorStopParsing=yQ;K0.onWarningStopParsing=vQ});var _L=ue(Mt=>{"use strict";var X0=tf();Mt.assign=X0.assign;Mt.hasDefaultHTMLNamespace=X0.hasDefaultHTMLNamespace;Mt.isHTMLMimeType=X0.isHTMLMimeType;Mt.isValidMimeType=X0.isValidMimeType;Mt.MIME_TYPE=X0.MIME_TYPE;Mt.NAMESPACE=X0.NAMESPACE;var aA=dy();Mt.DOMException=aA.DOMException;Mt.DOMExceptionName=aA.DOMExceptionName;Mt.ExceptionCode=aA.ExceptionCode;Mt.ParseError=aA.ParseError;var Yr=lI();Mt.Attr=Yr.Attr;Mt.CDATASection=Yr.CDATASection;Mt.CharacterData=Yr.CharacterData;Mt.Comment=Yr.Comment;Mt.Document=Yr.Document;Mt.DocumentFragment=Yr.DocumentFragment;Mt.DocumentType=Yr.DocumentType;Mt.DOMImplementation=Yr.DOMImplementation;Mt.Element=Yr.Element;Mt.Entity=Yr.Entity;Mt.EntityReference=Yr.EntityReference;Mt.LiveNodeList=Yr.LiveNodeList;Mt.NamedNodeMap=Yr.NamedNodeMap;Mt.Node=Yr.Node;Mt.NodeList=Yr.NodeList;Mt.Notation=Yr.Notation;Mt.ProcessingInstruction=Yr.ProcessingInstruction;Mt.Text=Yr.Text;Mt.XMLSerializer=Yr.XMLSerializer;var oA=OL();Mt.DOMParser=oA.DOMParser;Mt.normalizeLineEndings=oA.normalizeLineEndings;Mt.onErrorStopParsing=oA.onErrorStopParsing;Mt.onWarningStopParsing=oA.onWarningStopParsing});var lA="http://www.w3.org/2000/09/xmldsig#",gI="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",cA=(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})({}),eo=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),fA=(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 Qt={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"},NQ=Object.keys(Qt);var IQ={Production:"1",Homolog:"2"};var SV={[Qt.AC]:"America/Rio_Branco",[Qt.AL]:"America/Maceio",[Qt.AM]:"America/Manaus",[Qt.AP]:"America/Belem",[Qt.BA]:"America/Bahia",[Qt.CE]:"America/Fortaleza",[Qt.DF]:"America/Sao_Paulo",[Qt.ES]:"America/Sao_Paulo",[Qt.GO]:"America/Sao_Paulo",[Qt.MA]:"America/Fortaleza",[Qt.MG]:"America/Sao_Paulo",[Qt.MS]:"America/Campo_Grande",[Qt.MT]:"America/Cuiaba",[Qt.PA]:"America/Belem",[Qt.PB]:"America/Fortaleza",[Qt.PE]:"America/Recife",[Qt.PI]:"America/Fortaleza",[Qt.PR]:"America/Sao_Paulo",[Qt.RJ]:"America/Sao_Paulo",[Qt.RN]:"America/Fortaleza",[Qt.RO]:"America/Porto_Velho",[Qt.RR]:"America/Boa_Vista",[Qt.RS]:"America/Sao_Paulo",[Qt.SC]:"America/Sao_Paulo",[Qt.SE]:"America/Maceio",[Qt.SP]:"America/Sao_Paulo",[Qt.TO]:"America/Araguaina"};var kt=class extends Error{static{u(this,"NFeTsError")}};var Dy=class extends kt{static{u(this,"TransmissionError")}},W0=class extends Dy{static{u(this,"TransmissionHostNotFoundError")}},uf=class extends Dy{static{u(this,"TransmissionTimeoutError")}};var yI=class extends kt{static{u(this,"ValidationError")}};var z0={includeComments:!1,exclusive:!0};var hA=u(r=>{throw new kt("Didn't expect to get here")},"unreachable");var lf=class{static{u(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=eo.SHA1,s=z0){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=s}assemble(e,t,n){let s=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:lA},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:s}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:gI}},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:lA},...e},{rootName:"SignedInfo"}),this.canonical);return 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 eo.SHA256:return fA.SHA256;case eo.SHA1:return fA.SHA1;default:return hA(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case eo.SHA256:return cA.RSA_SHA256;case eo.SHA1:return cA.RSA_SHA1;default:return hA(this.algorithm)}}};var pA=class{static{u(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},By=class{static{u(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},Zt=u(r=>new pA(r),"left"),Hr=u(r=>r===void 0?new By(void 0):new By(r),"right");var vI=class extends lf{static{u(this,"EntitySigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{certificate:a}=n;if(!e[s])return Zt(new kt(`Node ${String(s)} not found`));let o=await this.toolkit.build(this.ns(e,s),{headless:!0,rootName:String(s),renderOpts:{pretty:!1}}),l=this.signedInfo(o,i),c=await this.signOrLeft(l,n);if(c.isLeft())return c;let f=e;return f.Signature=this.assemble(l,c.value,a),Hr(f)}ns(e,t){let n=e.$?.xmlns,{$:s,...i}=e[t],{xmlns:a,...o}=s??{};return{$:{xmlns:n,...o},...i}}};var EI=class extends lf{static{u(this,"XmlSigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{certificate:a}=n,o=this.toolkit.getNode(e,s);if(!o)return Zt(new kt(`Node ${s} not found`));let l=this.signedInfo(o,i),c=await this.signOrLeft(l,n);if(c.isLeft())return c;let f=await this.toolkit.build(this.assemble(l,c.value,a),{rootName:"Signature"});return Hr(this.toolkit.appendNode(e,f))}};import"reflect-metadata";import{validateSync as CV}from"class-validator";import"reflect-metadata";var J0="__SkipValidation__",xZ=u(()=>(r,e)=>{Reflect.defineMetadata(J0,!0,r,e.toString())},"SkipValidation"),bZ=u(()=>r=>{Reflect.defineMetadata(J0,!0,r)},"SkipAllValidations");import{plainToInstance as AV}from"class-transformer";var Ry=u(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&Ry(t)},"clearEmptyValues"),wI=u((r,e,t={})=>{let n=AV(e,r);return t.clearEmptyValues&&Ry(n),n},"plainToInstance");var SI="__ValidateErrors__",AI=u((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(AI(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"),kZ=u(r=>(e,t,n)=>{let s=n.value;n.value=function(...i){let a=Reflect.getMetadata(J0,this.constructor);if(Reflect.getMetadata(J0,this.constructor.prototype,t.toString())===!0||a===!0)return s?.apply(this,i);let[l,...c]=i;if(!l)return s?.apply(this,i);let f=wI(l,r),p=CV(f,{whitelist:!0});if(Ry(f),p.length){let d=Reflect.getMetadata(SI,this)??[];Reflect.defineMetadata(SI,d.concat(AI(p,s?.name)),this)}return s?.apply(this,[f,...c])}},"Validates");import"reflect-metadata";var cf=9e15,so=1e9,dA="0123456789abcdef",Py="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ky="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",mA={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-cf,maxE:cf,crypto:!1},NI,ra,ft=!0,Vy="[DecimalError] ",no=Vy+"Invalid argument: ",TI=Vy+"Precision limit exceeded",II=Vy+"crypto unavailable",DI="[object Decimal]",xn=Math.floor,Kr=Math.pow,xV=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,bV=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,NV=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,BI=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ws=1e7,it=7,TV=9007199254740991,IV=Py.length-1,gA=ky.length-1,Se={toStringTag:DI};Se.absoluteValue=Se.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),Qe(r)};Se.ceil=function(){return Qe(new this.constructor(this),this.e+1,2)};Se.clampedTo=Se.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(no+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};Se.comparedTo=Se.cmp=function(r){var e,t,n,s,i=this,a=i.d,o=(r=new i.constructor(r)).d,l=i.s,c=r.s;if(!a||!o)return!l||!c?NaN:l!==c?l:a===o?0:!a^l<0?1:-1;if(!a[0]||!o[0])return a[0]?l:o[0]?-c:0;if(l!==c)return l;if(i.e!==r.e)return i.e>r.e^l<0?1:-1;for(n=a.length,s=o.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==o[e])return a[e]>o[e]^l<0?1:-1;return n===s?0:n>s^l<0?1:-1};Se.cosine=Se.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())+it,n.rounding=1,t=DV(n,kI(n,t)),n.precision=r,n.rounding=e,Qe(ra==2||ra==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};Se.cubeRoot=Se.cbrt=function(){var r,e,t,n,s,i,a,o,l,c,f=this,p=f.constructor;if(!f.isFinite()||f.isZero())return new p(f);for(ft=!1,i=f.s*Kr(f.s*f,1/3),!i||Math.abs(i)==1/0?(t=hn(f.d),r=f.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=Kr(t,1/3),r=xn((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 p(t),n.s=f.s):n=new p(i.toString()),a=(r=p.precision)+3;;)if(o=n,l=o.times(o).times(o),c=l.plus(f),n=or(c.plus(f).times(o),c.plus(l),a+2,1),hn(o.d).slice(0,a)===(t=hn(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(Qe(o,r+1,0),o.times(o).times(o).eq(f))){n=o;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Qe(n,r+1,1),e=!n.times(n).times(n).eq(f));break}return ft=!0,Qe(n,r,p.rounding,e)};Se.decimalPlaces=Se.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-xn(this.e/it))*it,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};Se.dividedBy=Se.div=function(r){return or(this,new this.constructor(r))};Se.dividedToIntegerBy=Se.divToInt=function(r){var e=this,t=e.constructor;return Qe(or(e,new t(r),0,1,1),t.precision,t.rounding)};Se.equals=Se.eq=function(r){return this.cmp(r)===0};Se.floor=function(){return Qe(new this.constructor(this),this.e+1,3)};Se.greaterThan=Se.gt=function(r){return this.cmp(r)>0};Se.greaterThanOrEqualTo=Se.gte=function(r){var e=this.cmp(r);return e==1||e===0};Se.hyperbolicCosine=Se.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,o=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return o;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/Uy(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=ff(a,1,i.times(e),new a(1),!0);for(var l,c=r,f=new a(8);c--;)l=i.times(i),i=o.minus(l.times(f.minus(l.times(f))));return Qe(i,a.precision=t,a.rounding=n,!0)};Se.hyperbolicSine=Se.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=ff(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/Uy(5,r)),s=ff(i,2,s,s,!0);for(var a,o=new i(5),l=new i(16),c=new i(20);r--;)a=s.times(s),s=s.times(o.plus(a.times(l.times(a).plus(c))))}return i.precision=e,i.rounding=t,Qe(s,e,t,!0)};Se.hyperbolicTangent=Se.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,or(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};Se.inverseCosine=Se.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()?mi(e,n,s):new e(0):new e(NaN):r.isZero()?mi(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))};Se.inverseHyperbolicCosine=Se.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,ft=!1,t=t.times(t).minus(1).sqrt().plus(t),ft=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};Se.inverseHyperbolicSine=Se.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,ft=!1,t=t.times(t).plus(1).sqrt().plus(t),ft=!0,n.precision=r,n.rounding=e,t.ln())};Se.inverseHyperbolicTangent=Se.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?Qe(new i(s),r,e,!0):(i.precision=t=n-s.e,s=or(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)};Se.inverseSine=Se.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=mi(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)))};Se.inverseTangent=Se.atan=function(){var r,e,t,n,s,i,a,o,l,c=this,f=c.constructor,p=f.precision,d=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&p+4<=gA)return a=mi(f,p+4,d).times(.25),a.s=c.s,a}else{if(!c.s)return new f(NaN);if(p+4<=gA)return a=mi(f,p+4,d).times(.5),a.s=c.s,a}for(f.precision=o=p+10,f.rounding=1,t=Math.min(28,o/it+2|0),r=t;r;--r)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(ft=!1,e=Math.ceil(o/it),n=1,l=c.times(c),a=new f(c),s=c;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)),ft=!0,Qe(a,f.precision=p,f.rounding=d,!0)};Se.isFinite=function(){return!!this.d};Se.isInteger=Se.isInt=function(){return!!this.d&&xn(this.e/it)>this.d.length-2};Se.isNaN=function(){return!this.s};Se.isNegative=Se.isNeg=function(){return this.s<0};Se.isPositive=Se.isPos=function(){return this.s>0};Se.isZero=function(){return!!this.d&&this.d[0]===0};Se.lessThan=Se.lt=function(r){return this.cmp(r)<0};Se.lessThanOrEqualTo=Se.lte=function(r){return this.cmp(r)<1};Se.logarithm=Se.log=function(r){var e,t,n,s,i,a,o,l,c=this,f=c.constructor,p=f.precision,d=f.rounding,g=5;if(r==null)r=new f(10),e=!0;else{if(r=new f(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new f(NaN);e=r.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new f(t&&!t[0]?-1/0:c.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(ft=!1,o=p+g,a=ro(c,o),n=e?Ly(f,o+10):ro(r,o),l=or(a,n,o,1),Y0(l.d,s=p,d))do if(o+=10,a=ro(c,o),n=e?Ly(f,o+10):ro(r,o),l=or(a,n,o,1),!i){+hn(l.d).slice(s+1,s+15)+1==1e14&&(l=Qe(l,p+1,0));break}while(Y0(l.d,s+=10,d));return ft=!0,Qe(l,p,d)};Se.minus=Se.sub=function(r){var e,t,n,s,i,a,o,l,c,f,p,d,g=this,m=g.constructor;if(r=new m(r),!g.d||!r.d)return!g.s||!r.s?r=new m(NaN):g.d?r.s=-r.s:r=new m(r.d||g.s!==r.s?g:NaN),r;if(g.s!=r.s)return r.s=-r.s,g.plus(r);if(c=g.d,d=r.d,o=m.precision,l=m.rounding,!c[0]||!d[0]){if(d[0])r.s=-r.s;else if(c[0])r=new m(g);else return new m(l===3?-0:0);return ft?Qe(r,o,l):r}if(t=xn(r.e/it),f=xn(g.e/it),c=c.slice(),i=f-t,i){for(p=i<0,p?(e=c,i=-i,a=d.length):(e=d,t=f,a=c.length),n=Math.max(Math.ceil(o/it),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=c.length,a=d.length,p=n<a,p&&(a=n),n=0;n<a;n++)if(c[n]!=d[n]){p=c[n]<d[n];break}i=0}for(p&&(e=c,c=d,d=e,r.s=-r.s),a=c.length,n=d.length-a;n>0;--n)c[a++]=0;for(n=d.length;n>i;){if(c[--n]<d[n]){for(s=n;s&&c[--s]===0;)c[s]=Ws-1;--c[s],c[n]+=Ws}c[n]-=d[n]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--t;return c[0]?(r.d=c,r.e=Fy(c,t),ft?Qe(r,o,l):r):new m(l===3?-0:0)};Se.modulo=Se.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]?Qe(new n(t),n.precision,n.rounding):(ft=!1,n.modulo==9?(e=or(t,r.abs(),0,3,1),e.s*=r.s):e=or(t,r,0,n.modulo,1),e=e.times(r),ft=!0,t.minus(e))};Se.naturalExponential=Se.exp=function(){return yA(this)};Se.naturalLogarithm=Se.ln=function(){return ro(this)};Se.negated=Se.neg=function(){var r=new this.constructor(this);return r.s=-r.s,Qe(r)};Se.plus=Se.add=function(r){var e,t,n,s,i,a,o,l,c,f,p=this,d=p.constructor;if(r=new d(r),!p.d||!r.d)return!p.s||!r.s?r=new d(NaN):p.d||(r=new d(r.d||p.s===r.s?p:NaN)),r;if(p.s!=r.s)return r.s=-r.s,p.minus(r);if(c=p.d,f=r.d,o=d.precision,l=d.rounding,!c[0]||!f[0])return f[0]||(r=new d(p)),ft?Qe(r,o,l):r;if(i=xn(p.e/it),n=xn(r.e/it),c=c.slice(),s=i-n,s){for(s<0?(t=c,s=-s,a=f.length):(t=f,n=i,a=c.length),i=Math.ceil(o/it),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=c.length,s=f.length,a-s<0&&(s=a,t=f,f=c,c=t),e=0;s;)e=(c[--s]=c[s]+f[s]+e)/Ws|0,c[s]%=Ws;for(e&&(c.unshift(e),++n),a=c.length;c[--a]==0;)c.pop();return r.d=c,r.e=Fy(c,n),ft?Qe(r,o,l):r};Se.precision=Se.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(no+r);return t.d?(e=RI(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Se.round=function(){var r=this,e=r.constructor;return Qe(new e(r),r.e+1,e.rounding)};Se.sine=Se.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())+it,n.rounding=1,t=RV(n,kI(n,t)),n.precision=r,n.rounding=e,Qe(ra>2?t.neg():t,r,e,!0)):new n(NaN)};Se.squareRoot=Se.sqrt=function(){var r,e,t,n,s,i,a=this,o=a.d,l=a.e,c=a.s,f=a.constructor;if(c!==1||!o||!o[0])return new f(!c||c<0&&(!o||o[0])?NaN:o?a:1/0);for(ft=!1,c=Math.sqrt(+a),c==0||c==1/0?(e=hn(o),(e.length+l)%2==0&&(e+="0"),c=Math.sqrt(e),l=xn((l+1)/2)-(l<0||l%2),c==1/0?e="5e"+l:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new f(e)):n=new f(c.toString()),t=(l=f.precision)+3;;)if(i=n,n=i.plus(or(a,i,t+2,1)).times(.5),hn(i.d).slice(0,t)===(e=hn(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(Qe(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")&&(Qe(n,l+1,1),r=!n.times(n).eq(a));break}return ft=!0,Qe(n,l,f.rounding,r)};Se.tangent=Se.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=or(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,Qe(ra==2||ra==4?t.neg():t,r,e,!0)):new n(NaN)};Se.times=Se.mul=function(r){var e,t,n,s,i,a,o,l,c,f=this,p=f.constructor,d=f.d,g=(r=new p(r)).d;if(r.s*=f.s,!d||!d[0]||!g||!g[0])return new p(!r.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?r.s/0:r.s*0);for(t=xn(f.e/it)+xn(r.e/it),l=d.length,c=g.length,l<c&&(i=d,d=g,g=i,a=l,l=c,c=a),i=[],a=l+c,n=a;n--;)i.push(0);for(n=c;--n>=0;){for(e=0,s=l+n;s>n;)o=i[s]+g[n]*d[s-n-1]+e,i[s--]=o%Ws|0,e=o/Ws|0;i[s]=(i[s]+e)%Ws|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=Fy(i,t),ft?Qe(r,p.precision,p.rounding):r};Se.toBinary=function(r,e){return vA(this,2,r,e)};Se.toDecimalPlaces=Se.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(jn(r,0,so),e===void 0?e=n.rounding:jn(e,0,8),Qe(t,r+t.e+1,e))};Se.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=gi(n,!0):(jn(r,0,so),e===void 0?e=s.rounding:jn(e,0,8),n=Qe(new s(n),r+1,e),t=gi(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Se.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=gi(s):(jn(r,0,so),e===void 0?e=i.rounding:jn(e,0,8),n=Qe(new i(s),r+s.e+1,e),t=gi(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Se.toFraction=function(r){var e,t,n,s,i,a,o,l,c,f,p,d,g=this,m=g.d,v=g.constructor;if(!m)return new v(g);if(c=t=new v(1),n=l=new v(0),e=new v(n),i=e.e=RI(m)-g.e-1,a=i%it,e.d[0]=Kr(10,a<0?it+a:a),r==null)r=i>0?e:c;else{if(o=new v(r),!o.isInt()||o.lt(c))throw Error(no+o);r=o.gt(e)?i>0?e:c:o}for(ft=!1,o=new v(hn(m)),f=v.precision,v.precision=i=m.length*it*2;p=or(o,e,0,1,1),s=t.plus(p.times(n)),s.cmp(r)!=1;)t=n,n=s,s=c,c=l.plus(p.times(s)),l=s,s=e,e=o.minus(p.times(s)),o=s;return s=or(r.minus(t),n,0,1,1),l=l.plus(s.times(c)),t=t.plus(s.times(n)),l.s=c.s=g.s,d=or(c,n,i,1).minus(g).abs().cmp(or(l,t,i,1).minus(g).abs())<1?[c,n]:[l,t],v.precision=f,ft=!0,d};Se.toHexadecimal=Se.toHex=function(r,e){return vA(this,16,r,e)};Se.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:jn(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]?(ft=!1,t=or(t,r,0,e,1).times(r),ft=!0,Qe(t)):(r.s=t.s,t=r),t};Se.toNumber=function(){return+this};Se.toOctal=function(r,e){return vA(this,8,r,e)};Se.toPower=Se.pow=function(r){var e,t,n,s,i,a,o=this,l=o.constructor,c=+(r=new l(r));if(!o.d||!r.d||!o.d[0]||!r.d[0])return new l(Kr(+o,c));if(o=new l(o),o.eq(1))return o;if(n=l.precision,i=l.rounding,r.eq(1))return Qe(o,n,i);if(e=xn(r.e/it),e>=r.d.length-1&&(t=c<0?-c:c)<=TV)return s=OI(l,o,t,n),r.s<0?new l(1).div(s):Qe(s,n,i);if(a=o.s,a<0){if(e<r.d.length-1)return new l(NaN);if((r.d[e]&1)==0&&(a=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=a,o}return t=Kr(+o,c),e=t==0||!isFinite(t)?xn(c*(Math.log("0."+hn(o.d))/Math.LN10+o.e+1)):new l(t+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(ft=!1,l.rounding=o.s=1,t=Math.min(12,(e+"").length),s=yA(r.times(ro(o,n+t)),n),s.d&&(s=Qe(s,n+5,1),Y0(s.d,n,i)&&(e=n+10,s=Qe(yA(r.times(ro(o,e+t)),e),e+5,1),+hn(s.d).slice(n+1,n+15)+1==1e14&&(s=Qe(s,n+1,0)))),s.s=a,ft=!0,l.rounding=i,Qe(s,n,i))};Se.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=gi(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(jn(r,1,so),e===void 0?e=s.rounding:jn(e,0,8),n=Qe(new s(n),r,e),t=gi(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};Se.toSignificantDigits=Se.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(jn(r,1,so),e===void 0?e=n.rounding:jn(e,0,8)),Qe(new n(t),r,e)};Se.toString=function(){var r=this,e=r.constructor,t=gi(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};Se.truncated=Se.trunc=function(){return Qe(new this.constructor(this),this.e+1,1)};Se.valueOf=Se.toJSON=function(){var r=this,e=r.constructor,t=gi(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function hn(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=it-n.length,t&&(i+=to(t)),i+=n;a=r[e],n=a+"",t=it-n.length,t&&(i+=to(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}u(hn,"digitsToString");function jn(r,e,t){if(r!==~~r||r<e||r>t)throw Error(no+r)}u(jn,"checkInt32");function Y0(r,e,t,n){var s,i,a,o;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=it,s=0):(s=Math.ceil((e+1)/it),e%=it),i=Kr(10,it-e),o=r[s]%i|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),a=t<4&&o==99999||t>3&&o==49999||o==5e4||o==0):a=(t<4&&o+1==i||t>3&&o+1==i/2)&&(r[s+1]/i/100|0)==Kr(10,e-2)-1||(o==i/2||o==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),a=(n||t<4)&&o==9999||!n&&t>3&&o==4999):a=((n||t<4)&&o+1==i||!n&&t>3&&o+1==i/2)&&(r[s+1]/i/1e3|0)==Kr(10,e-3)-1,a}u(Y0,"checkRoundingDigits");function Oy(r,e,t){for(var n,s=[0],i,a=0,o=r.length;a<o;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=dA.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()}u(Oy,"convertBase");function DV(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/Uy(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=ff(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}u(DV,"cosine");var or=(function(){function r(n,s,i){var a,o=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+o,n[l]=a%i|0,o=a/i|0;return o&&n.unshift(o),n}u(r,"multiplyInteger");function e(n,s,i,a){var o,l;if(i!=a)l=i>a?1:-1;else for(o=l=0;o<i;o++)if(n[o]!=s[o]){l=n[o]>s[o]?1:-1;break}return l}u(e,"compare");function t(n,s,i,a){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return u(t,"subtract"),function(n,s,i,a,o,l){var c,f,p,d,g,m,v,y,S,C,w,E,A,b,V,I,D,U,F,M,se=n.constructor,ee=n.s==s.s?1:-1,ie=n.d,X=s.d;if(!ie||!ie[0]||!X||!X[0])return new se(!n.s||!s.s||(ie?X&&ie[0]==X[0]:!X)?NaN:ie&&ie[0]==0||!X?ee*0:ee/0);for(l?(g=1,f=n.e-s.e):(l=Ws,g=it,f=xn(n.e/g)-xn(s.e/g)),F=X.length,D=ie.length,S=new se(ee),C=S.d=[],p=0;X[p]==(ie[p]||0);p++);if(X[p]>(ie[p]||0)&&f--,i==null?(b=i=se.precision,a=se.rounding):o?b=i+(n.e-s.e)+1:b=i,b<0)C.push(1),m=!0;else{if(b=b/g+2|0,p=0,F==1){for(d=0,X=X[0],b++;(p<D||d)&&b--;p++)V=d*l+(ie[p]||0),C[p]=V/X|0,d=V%X|0;m=d||p<D}else{for(d=l/(X[0]+1)|0,d>1&&(X=r(X,d,l),ie=r(ie,d,l),F=X.length,D=ie.length),I=F,w=ie.slice(0,F),E=w.length;E<F;)w[E++]=0;M=X.slice(),M.unshift(0),U=X[0],X[1]>=l/2&&++U;do d=0,c=e(X,w,F,E),c<0?(A=w[0],F!=E&&(A=A*l+(w[1]||0)),d=A/U|0,d>1?(d>=l&&(d=l-1),v=r(X,d,l),y=v.length,E=w.length,c=e(v,w,y,E),c==1&&(d--,t(v,F<y?M:X,y,l))):(d==0&&(c=d=1),v=X.slice()),y=v.length,y<E&&v.unshift(0),t(w,v,E,l),c==-1&&(E=w.length,c=e(X,w,F,E),c<1&&(d++,t(w,F<E?M:X,E,l))),E=w.length):c===0&&(d++,w=[0]),C[p++]=d,c&&w[0]?w[E++]=ie[I]||0:(w=[ie[I]],E=1);while((I++<D||w[0]!==void 0)&&b--);m=w[0]!==void 0}C[0]||C.shift()}if(g==1)S.e=f,NI=m;else{for(p=1,d=C[0];d>=10;d/=10)p++;S.e=p+f*g-1,Qe(S,o?i+S.e+1:i,a,m)}return S}})();function Qe(r,e,t,n){var s,i,a,o,l,c,f,p,d,g=r.constructor;e:if(e!=null){if(p=r.d,!p)return r;for(s=1,o=p[0];o>=10;o/=10)s++;if(i=e-s,i<0)i+=it,a=e,f=p[d=0],l=f/Kr(10,s-a-1)%10|0;else if(d=Math.ceil((i+1)/it),o=p.length,d>=o)if(n){for(;o++<=d;)p.push(0);f=l=0,s=1,i%=it,a=i-it+1}else break e;else{for(f=o=p[d],s=1;o>=10;o/=10)s++;i%=it,a=i-it+s,l=a<0?0:f/Kr(10,s-a-1)%10|0}if(n=n||e<0||p[d+1]!==void 0||(a<0?f:f%Kr(10,s-a-1)),c=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?f/Kr(10,s-a):0:p[d-1])%10&1||t==(r.s<0?8:7)),e<1||!p[0])return p.length=0,c?(e-=r.e+1,p[0]=Kr(10,(it-e%it)%it),r.e=-e||0):p[0]=r.e=0,r;if(i==0?(p.length=d,o=1,d--):(p.length=d+1,o=Kr(10,it-i),p[d]=a>0?(f/Kr(10,s-a)%Kr(10,a)|0)*o:0),c)for(;;)if(d==0){for(i=1,a=p[0];a>=10;a/=10)i++;for(a=p[0]+=o,o=1;a>=10;a/=10)o++;i!=o&&(r.e++,p[0]==Ws&&(p[0]=1));break}else{if(p[d]+=o,p[d]!=Ws)break;p[d--]=0,o=1}for(i=p.length;p[--i]===0;)p.pop()}return ft&&(r.e>g.maxE?(r.d=null,r.e=NaN):r.e<g.minE&&(r.e=0,r.d=[0])),r}u(Qe,"finalise");function gi(r,e,t){if(!r.isFinite())return PI(r);var n,s=r.e,i=hn(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+to(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+to(-s-1)+i,t&&(n=t-a)>0&&(i+=to(n))):s>=a?(i+=to(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+to(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=to(n))),i}u(gi,"finiteToString");function Fy(r,e){var t=r[0];for(e*=it;t>=10;t/=10)e++;return e}u(Fy,"getBase10Exponent");function Ly(r,e,t){if(e>IV)throw ft=!0,t&&(r.precision=t),Error(TI);return Qe(new r(Py),e,1,!0)}u(Ly,"getLn10");function mi(r,e,t){if(e>gA)throw Error(TI);return Qe(new r(ky),e,t,!0)}u(mi,"getPi");function RI(r){var e=r.length-1,t=e*it+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}u(RI,"getPrecision");function to(r){for(var e="";r--;)e+="0";return e}u(to,"getZeroString");function OI(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/it+4);for(ft=!1;;){if(t%2&&(i=i.times(e),xI(i.d,a)&&(s=!0)),t=xn(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),xI(e.d,a)}return ft=!0,i}u(OI,"intPow");function CI(r){return r.d[r.d.length-1]&1}u(CI,"isOdd");function _I(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}u(_I,"maxOrMin");function yA(r,e){var t,n,s,i,a,o,l,c=0,f=0,p=0,d=r.constructor,g=d.rounding,m=d.precision;if(!r.d||!r.d[0]||r.e>17)return new d(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(ft=!1,l=m):l=e,o=new d(.03125);r.e>-2;)r=r.times(o),p+=5;for(n=Math.log(Kr(2,p))/Math.LN10*2+5|0,l+=n,t=i=a=new d(1),d.precision=l;;){if(i=Qe(i.times(r),l,1),t=t.times(++f),o=a.plus(or(i,t,l,1)),hn(o.d).slice(0,l)===hn(a.d).slice(0,l)){for(s=p;s--;)a=Qe(a.times(a),l,1);if(e==null)if(c<3&&Y0(a.d,l-n,g,c))d.precision=l+=10,t=i=o=new d(1),f=0,c++;else return Qe(a,d.precision=m,g,ft=!0);else return d.precision=m,a}a=o}}u(yA,"naturalExponential");function ro(r,e){var t,n,s,i,a,o,l,c,f,p,d,g=1,m=10,v=r,y=v.d,S=v.constructor,C=S.rounding,w=S.precision;if(v.s<0||!y||!y[0]||!v.e&&y[0]==1&&y.length==1)return new S(y&&!y[0]?-1/0:v.s!=1?NaN:y?0:v);if(e==null?(ft=!1,f=w):f=e,S.precision=f+=m,t=hn(y),n=t.charAt(0),Math.abs(i=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(r),t=hn(v.d),n=t.charAt(0),g++;i=v.e,n>1?(v=new S("0."+t),i++):v=new S(n+"."+t.slice(1))}else return c=Ly(S,f+2,w).times(i+""),v=ro(new S(n+"."+t.slice(1)),f-m).plus(c),S.precision=w,e==null?Qe(v,w,C,ft=!0):v;for(p=v,l=a=v=or(v.minus(1),v.plus(1),f,1),d=Qe(v.times(v),f,1),s=3;;){if(a=Qe(a.times(d),f,1),c=l.plus(or(a,new S(s),f,1)),hn(c.d).slice(0,f)===hn(l.d).slice(0,f))if(l=l.times(2),i!==0&&(l=l.plus(Ly(S,f+2,w).times(i+""))),l=or(l,new S(g),f,1),e==null)if(Y0(l.d,f-m,C,o))S.precision=f+=m,c=a=v=or(p.minus(1),p.plus(1),f,1),d=Qe(v.times(v),f,1),s=o=1;else return Qe(l,S.precision=w,C,ft=!0);else return S.precision=w,l;l=c,s+=2}}u(ro,"naturalLogarithm");function PI(r){return String(r.s*r.s/0)}u(PI,"nonFiniteToString");function _y(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)%it,t<0&&(n+=it),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=it;n<s;)r.d.push(+e.slice(n,n+=it));e=e.slice(n),n=it-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),ft&&(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}u(_y,"parseDecimal");function BV(r,e){var t,n,s,i,a,o,l,c,f;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),BI.test(e))return _y(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(bV.test(e))t=16,e=e.toLowerCase();else if(xV.test(e))t=2;else if(NV.test(e))t=8;else throw Error(no+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(".",""),o=e.length,i=o-i,s=OI(n,new n(t),i,i*2)),c=Oy(e,t,Ws),f=c.length-1,i=f;c[i]===0;--i)c.pop();return i<0?new n(r.s*0):(r.e=Fy(c,f),r.d=c,ft=!1,a&&(r=or(r,s,o*4)),l&&(r=r.times(Math.abs(l)<54?Kr(2,l):hf.pow(2,l))),ft=!0,r)}u(BV,"parseOther");function RV(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:ff(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/Uy(5,t)),e=ff(r,2,e,e);for(var s,i=new r(5),a=new r(16),o=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(o))));return e}u(RV,"sine");function ff(r,e,t,n,s){var i,a,o,l,c=1,f=r.precision,p=Math.ceil(f/it);for(ft=!1,l=t.times(t),o=new r(n);;){if(a=or(o.times(l),new r(e++*e++),f,1),o=s?n.plus(a):n.minus(a),n=or(a.times(l),new r(e++*e++),f,1),a=o.plus(n),a.d[p]!==void 0){for(i=p;a.d[i]===o.d[i]&&i--;);if(i==-1)break}i=o,o=n,n=a,a=i,c++}return ft=!0,a.d.length=p+1,a}u(ff,"taylorSeries");function Uy(r,e){for(var t=r;--e;)t*=r;return t}u(Uy,"tinyPow");function kI(r,e){var t,n=e.s<0,s=mi(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return ra=n?4:1,e;if(t=e.divToInt(s),t.isZero())ra=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return ra=CI(t)?n?2:3:n?4:1,e;ra=CI(t)?n?1:4:n?3:2}return e.minus(s).abs()}u(kI,"toLessThanHalfPi");function vA(r,e,t,n){var s,i,a,o,l,c,f,p,d,g=r.constructor,m=t!==void 0;if(m?(jn(t,1,so),n===void 0?n=g.rounding:jn(n,0,8)):(t=g.precision,n=g.rounding),!r.isFinite())f=PI(r);else{for(f=gi(r),a=f.indexOf("."),m?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(f=f.replace(".",""),d=new g(1),d.e=f.length-a,d.d=Oy(gi(d),10,s),d.e=d.d.length),p=Oy(f,10,s),i=l=p.length;p[--l]==0;)p.pop();if(!p[0])f=m?"0p+0":"0";else{if(a<0?i--:(r=new g(r),r.d=p,r.e=i,r=or(r,d,t,n,0,s),p=r.d,i=r.e,c=NI),a=p[t],o=s/2,c=c||p[t+1]!==void 0,c=n<4?(a!==void 0||c)&&(n===0||n===(r.s<0?3:2)):a>o||a===o&&(n===4||c||n===6&&p[t-1]&1||n===(r.s<0?8:7)),p.length=t,c)for(;++p[--t]>s-1;)p[t]=0,t||(++i,p.unshift(1));for(l=p.length;!p[l-1];--l);for(a=0,f="";a<l;a++)f+=dA.charAt(p[a]);if(m){if(l>1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)f+="0";for(p=Oy(f,s,e),l=p.length;!p[l-1];--l);for(a=1,f="1.";a<l;a++)f+=dA.charAt(p[a])}else f=f.charAt(0)+"."+f.slice(1);f=f+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)f="0"+f;f="0."+f}else if(++i>l)for(i-=l;i--;)f+="0";else i<l&&(f=f.slice(0,i)+"."+f.slice(i))}f=(e==16?"0x":e==2?"0b":e==8?"0o":"")+f}return r.s<0?"-"+f:f}u(vA,"toStringBinary");function xI(r,e){if(r.length>e)return r.length=e,!0}u(xI,"truncate");function OV(r){return new this(r).abs()}u(OV,"abs");function _V(r){return new this(r).acos()}u(_V,"acos");function PV(r){return new this(r).acosh()}u(PV,"acosh");function kV(r,e){return new this(r).plus(e)}u(kV,"add");function LV(r){return new this(r).asin()}u(LV,"asin");function VV(r){return new this(r).asinh()}u(VV,"asinh");function FV(r){return new this(r).atan()}u(FV,"atan");function UV(r){return new this(r).atanh()}u(UV,"atanh");function MV(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=mi(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?mi(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=mi(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(or(r,e,i,1)),e=mi(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(or(r,e,i,1)),t}u(MV,"atan2");function jV(r){return new this(r).cbrt()}u(jV,"cbrt");function qV(r){return Qe(r=new this(r),r.e+1,2)}u(qV,"ceil");function HV(r,e,t){return new this(r).clamp(e,t)}u(HV,"clamp");function KV(r){if(!r||typeof r!="object")throw Error(Vy+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,so,"rounding",0,8,"toExpNeg",-cf,0,"toExpPos",0,cf,"maxE",0,cf,"minE",-cf,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=mA[t]),(n=r[t])!==void 0)if(xn(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(no+t+": "+n);if(t="crypto",s&&(this[t]=mA[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(II);else this[t]=!1;else throw Error(no+t+": "+n);return this}u(KV,"config");function XV(r){return new this(r).cos()}u(XV,"cos");function GV(r){return new this(r).cosh()}u(GV,"cosh");function LI(r){var e,t,n;function s(i){var a,o,l,c=this;if(!(c instanceof s))return new s(i);if(c.constructor=s,bI(i)){c.s=i.s,ft?!i.d||i.e>s.maxE?(c.e=NaN,c.d=null):i.e<s.minE?(c.e=0,c.d=[0]):(c.e=i.e,c.d=i.d.slice()):(c.e=i.e,c.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){c.s=1/i<0?-1:1,c.e=0,c.d=[0];return}if(i<0?(i=-i,c.s=-1):c.s=1,i===~~i&&i<1e7){for(a=0,o=i;o>=10;o/=10)a++;ft?a>s.maxE?(c.e=NaN,c.d=null):a<s.minE?(c.e=0,c.d=[0]):(c.e=a,c.d=[i]):(c.e=a,c.d=[i]);return}if(i*0!==0){i||(c.s=NaN),c.e=NaN,c.d=null;return}return _y(c,i.toString())}if(l==="string")return(o=i.charCodeAt(0))===45?(i=i.slice(1),c.s=-1):(o===43&&(i=i.slice(1)),c.s=1),BI.test(i)?_y(c,i):BV(c,i);if(l==="bigint")return i<0?(i=-i,c.s=-1):c.s=1,_y(c,i.toString());throw Error(no+i)}if(u(s,"Decimal"),s.prototype=Se,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=KV,s.clone=LI,s.isDecimal=bI,s.abs=OV,s.acos=_V,s.acosh=PV,s.add=kV,s.asin=LV,s.asinh=VV,s.atan=FV,s.atanh=UV,s.atan2=MV,s.cbrt=jV,s.ceil=qV,s.clamp=HV,s.cos=XV,s.cosh=GV,s.div=$V,s.exp=WV,s.floor=zV,s.hypot=JV,s.ln=YV,s.log=QV,s.log10=e6,s.log2=ZV,s.max=t6,s.min=r6,s.mod=n6,s.mul=s6,s.pow=i6,s.random=a6,s.round=o6,s.sign=u6,s.sin=l6,s.sinh=c6,s.sqrt=f6,s.sub=h6,s.sum=p6,s.tan=d6,s.tanh=m6,s.trunc=g6,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}u(LI,"clone");function $V(r,e){return new this(r).div(e)}u($V,"div");function WV(r){return new this(r).exp()}u(WV,"exp");function zV(r){return Qe(r=new this(r),r.e+1,3)}u(zV,"floor");function JV(){var r,e,t=new this(0);for(ft=!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 ft=!0,new this(1/0);t=e}return ft=!0,t.sqrt()}u(JV,"hypot");function bI(r){return r instanceof hf||r&&r.toStringTag===DI||!1}u(bI,"isDecimalInstance");function YV(r){return new this(r).ln()}u(YV,"ln");function QV(r,e){return new this(r).log(e)}u(QV,"log");function ZV(r){return new this(r).log(2)}u(ZV,"log2");function e6(r){return new this(r).log(10)}u(e6,"log10");function t6(){return _I(this,arguments,-1)}u(t6,"max");function r6(){return _I(this,arguments,1)}u(r6,"min");function n6(r,e){return new this(r).mod(e)}u(n6,"mod");function s6(r,e){return new this(r).mul(e)}u(s6,"mul");function i6(r,e){return new this(r).pow(e)}u(i6,"pow");function a6(r){var e,t,n,s,i=0,a=new this(1),o=[];if(r===void 0?r=this.precision:jn(r,1,so),n=Math.ceil(r/it),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]:o[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):(o.push(s%1e7),i+=4);i=n/4}else throw Error(II);else for(;i<n;)o[i++]=Math.random()*1e7|0;for(n=o[--i],r%=it,n&&r&&(s=Kr(10,it-r),o[i]=(n/s|0)*s);o[i]===0;i--)o.pop();if(i<0)t=0,o=[0];else{for(t=-1;o[0]===0;t-=it)o.shift();for(n=1,s=o[0];s>=10;s/=10)n++;n<it&&(t-=it-n)}return a.e=t,a.d=o,a}u(a6,"random");function o6(r){return Qe(r=new this(r),r.e+1,this.rounding)}u(o6,"round");function u6(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}u(u6,"sign");function l6(r){return new this(r).sin()}u(l6,"sin");function c6(r){return new this(r).sinh()}u(c6,"sinh");function f6(r){return new this(r).sqrt()}u(f6,"sqrt");function h6(r,e){return new this(r).sub(e)}u(h6,"sub");function p6(){var r=0,e=arguments,t=new this(e[r]);for(ft=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return ft=!0,Qe(t,this.precision,this.rounding)}u(p6,"sum");function d6(r){return new this(r).tan()}u(d6,"tan");function m6(r){return new this(r).tanh()}u(m6,"tanh");function g6(r){return Qe(r=new this(r),r.e+1,1)}u(g6,"trunc");Se[Symbol.for("nodejs.util.inspect.custom")]=Se.toString;Se[Symbol.toStringTag]="Decimal";var hf=Se.constructor=LI(mA);Py=new hf(Py);ky=new hf(ky);var pf=class r extends hf{static{u(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)}};import y6 from"pdfkit";var VI=class r{static{u(this,"PdfkitPdfBuilder")}defaults={autoFirstPage:!1};doc=new y6(this.defaults);constructor(e){e&&this.configure(e)}static new(e){return new r(e)}configure(e){return this.doc.options={...this.doc.options,...e},this}pipe(e){return this.doc.pipe(e),this}end(){return this.doc.end()}restore(){return this.doc.restore(),this}save(){return this.doc.save(),this}stroke(e){return this.doc.stroke(e),this}page(e){return this.doc.addPage(e),this}table(e){return this.doc.table(e),this}text(e,t){let{x:n,y:s,...i}=t??{};return n||s?(this.doc.text(e,n,s,i),this):(this.doc.text(e,t),this)}fontSize(e){return this.doc.fontSize(e),this}font(e,t,n){return typeof t=="string"?(this.doc.font(e,t,n),this):typeof t=="number"?(this.doc.font(e,t),this):(this.doc.font(e),this)}image(e,t,n,s){return typeof t=="number"&&typeof n=="number"?(this.doc.image(e,t,n,s),this):(this.doc.image(e,t),this)}rect(e,t,n,s){return this.doc.rect(e,t,n,s),this}path(e){return this.doc.path(e),this}translate(e,t){return this.doc.translate(e,t),this}scale(e,t){return this.doc.scale(e,t),this}fill(e,t){return this.doc.fill(e,t),this}pageWidth(){return this.doc.page.width}pageHeight(){return this.doc.page.height}heightOfString(e,t){return this.doc.heightOfString(e,t)}widthOfString(e,t){return this.doc.widthOfString(e,t)}pageMargins(){return this.doc.page.margins}currentLineHeight(e){return this.doc.currentLineHeight(e)}x(){return this.doc.x}y(){return this.doc.y}moveDown(e){return this.doc.moveDown(e),this}row(e,...t){let n,s;typeof e=="function"?(n={},s=[e,...t]):(n=e??{},s=t),n.columns??=1;let i=this.y(),a=n.right??0,o=n.left??0,l=n.gap??0,c=this.pageWidth(),f=c-o-a-l*(n.columns-1);n.size??=Array(n.columns).fill(12/n.columns);let p=[];for(let d=0;d<n.columns;d++){let g=n.size[d]/12;p[d]=f*g}for(let d=0,g=o;d<n.columns;d++){let m=d===n.columns-1,v=p[d];if(m&&n.columns>1){let C=c-a-g;C>0&&Math.abs(C-v)>.01&&(v=C)}let y={y:i,x:g,width:v};s[d](y),g+=v,l>0&&!m&&(g+=l)}return this}};var FI=class{static{u(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 vo=Ty(eR(),1);import g9 from"os";import lR from"fs";import y9 from"path";import dd from"crypto";var r9=u(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),cs=u(r=>typeof r=="string"?Zt(new kt(r)):r instanceof Error?Zt(new kt(r.message,{cause:r.cause})):r9(r)?Zt(new kt(r.message)):Zt(new kt("unexpected error")),"leftFromError");var vv=class{static{u(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};import{arch as u9,platform as oR}from"os";import{dirname as l9,join as c9,resolve as f9,normalize as h9,delimiter as p9}from"path";import{resolve as rR}from"path";import{createRequire as tR}from"module";import{fileURLToPath as n9,pathToFileURL as s9}from"url";var i9=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Df,nR=u(()=>{if(Df!==void 0)return Df;if(i9){Df=void 0;return}try{Df=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Df=void 0}return Df},"getImportMetaUrl"),sR=u(()=>{if(typeof st<"u")return st;let r=nR();if(r)return tR(r);let e=s9(rR(process.cwd(),"package.json")).href;return tR(e)},"getRequireFn"),iR=u(()=>{if(typeof __filename<"u")return __filename;let r=nR();return r?n9(r):rR(process.cwd())},"getCurrentFile");import{dirname as Ev,resolve as nl}from"path";import{existsSync as Bf}from"fs";var aR=u(()=>typeof process<"u"&&typeof process.versions<"u"&&"electron"in process.versions,"isElectron"),a9=u(()=>{if(!aR())return null;try{let e=st("electron").app;if(e?.getAppPath&&typeof e.getAppPath=="function")return{getAppPath:e.getAppPath}}catch{}return null},"getElectronApp"),o9=u(()=>{if(!aR())return null;let r=process;if(r.resourcesPath)return r.resourcesPath;let e=a9();if(e)try{let t=e.getAppPath();if(typeof t=="string")return Ev(t.replace(/\.asar$/,""))}catch{}return null},"getElectronResourcesPath"),SC=u((r,{onFound:e,onNotFound:t})=>{let n=o9();if(n){let c=nl(n,"node_modules","nfets",r);if(Bf(c))return e(c);let f=nl(n,"app.asar.unpacked","node_modules","nfets",r);if(Bf(f))return e(f)}let s=iR(),i=s.includes(".asar")?process.cwd():s,a=nl(i,"../../../../"),o=nl(a,r);if(Bf(o))return e(o);let l=i;for(let c=0;c<5;c++){let f=nl(l,r);if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}l=i;for(let c=0;c<5;c++){let f=nl(l,"node_modules","nfets",r);if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}l=i;for(let c=0;c<5;c++){let f=nl(l,r.replace(/^build\//,"Release/"));if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}return t()},"search");var d9=u(r=>{let e=r.replace(/^\\\\\?\\/,"");return f9(h9(e))},"normalizePath"),m9=u(r=>{oR()==="win32"&&(process.env.PATH=`${l9(r)}${p9}${process.env.PATH}`)},"addAddonDirToPath"),AC=u(r=>{let e=d9(r);return m9(e),sR()(e)},"exportRequireModule"),Rf=u(r=>{if(r=`${r}.node`,process.env.NFETS_ADDONS_DIR)return AC(c9(process.env.NFETS_ADDONS_DIR,r));let e=`${oR()}-${u9()}`;try{return SC(`build/addons/${e}/${r}`,{onFound:u(t=>AC(t),"onFound"),onNotFound:u(()=>{throw new Error(`Addon ${e}/${r} not found`)},"onNotFound")})}catch{return SC(`build/Release/${r}`,{onFound:u(t=>AC(t),"onFound"),onNotFound:u(()=>{throw new Error(`Addon ${e}/${r} not found`)},"onNotFound")})}},"addon");var yo=class{static{u(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
83
+ `).reduce((i,a)=>{let[o,l]=a.split("=").map(c=>c.trim());return!o||!l?i:i.set(o,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"),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 o=i[0].subarray(-4),l=o.subarray(-2);o[0]===48?l=o:o[1]===48&&(l=o.subarray(-3));let c=Buffer.concat([l,n,i[1]]),f=this.length(c),p=n.length,d=c.subarray(2+p,2+p+f),g=d.length-l.length-2;if(g<=0||g>d.length)return;let v=d.subarray(-g).toString("utf8");return v.substring(Buffer.from(v).findIndex((y,S)=>v.charCodeAt(S)>=32&&v.charCodeAt(S)<=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 wv=class{static{u(this,"WincryptSignerRepository")}async sign(e,t,n){try{let s=Rf("wincrypt_certificate_store"),i=new yo,{CN:a}=i.extractCertificateInfo(t.certificate),o=await s.sign(a??"",Buffer.from(e),n),l=Buffer.from(o).toString("base64");return await Promise.resolve(Hr(l))}catch(s){return Promise.resolve(cs(s))}}};import uR from"crypto";var Sv=class{static{u(this,"CryptoSignerRepository")}async sign(e,t,n){try{if(!t.privateKey)return Zt(new kt("Certificate private key not found"));let i=uR.sign(n,Buffer.from(e),{key:t.privateKey,padding:uR.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(Hr(i))}catch(s){return Promise.resolve(cs(s))}}};var cR=class{static{u(this,"NativeCertificateRepository")}httpClient;cache;signer;constructor(e,t=new vv,n=g9.platform()==="win32"?new wv:new Sv){this.httpClient=e,this.cache=t,this.signer=n}async read(e){try{let{password:t,pfxPathOrBase64:n,publicCertDerBase64:s}=e,i=s?.trim(),a=n?.trim();if(i&&a)return Zt(new kt("Use either pfxPathOrBase64 or publicCertDerBase64, not both"));if(i)try{let S=Buffer.from(i,"base64"),C=new dd.X509Certificate(S);return Hr({ca:[],password:t,certificate:C,privateKey:void 0})}catch(S){return cs(S)}if(!a)return Zt(new kt("Certificate path (pfxPathOrBase64) is required"));let o=await this.getPfxBuffer({...e,pfxPathOrBase64:a});if(o.isLeft())return o;let l=vo.default.asn1.fromDer(o.value.toString("binary")),c=vo.default.pkcs12.pkcs12FromAsn1(l,t),{certBag:f}=vo.default.pki.oids,d=c.getBags({bagType:f})[f];if(!d?.length)return Zt(new kt("Cannot read certificate"));let[{cert:g},...m]=d;if(!g)return Zt(new kt("Issuer Certificate not found"));let v=m.reduce((S,{cert:C})=>(C&&S.push(new dd.X509Certificate(vo.default.pki.certificateToPem(C))),S),[]),y=new dd.X509Certificate(vo.default.pki.certificateToPem(g));return Hr({ca:v,password:t,certificate:y,privateKey:this.getPrivateKey(c)})}catch(t){return cs(t)}}getPrivateKey(e){let{pkcs8ShroudedKeyBag:t}=vo.default.pki.oids,s=e.getBags({bagType:t})[t]?.[0]?.key;if(s)return dd.createPrivateKey(vo.default.pki.privateKeyToPem(s))}async sign(e,t,n=eo.SHA1){return this.signer.sign(e,t,n)}getCertificateInfo(e){return new yo().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"})}catch{throw new kt("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 Hr(i);if(y9.isAbsolute(t)||lR.existsSync(t))return this.hitBufferOnCache(s,lR.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 cs(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return dd.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),Hr(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};import RG from"os";import CC from"dayjs";import v9 from"dayjs/plugin/utc.js";import E9 from"dayjs/plugin/timezone.js";CC.extend(v9);CC.extend(E9);var Of=CC;var dP=Ty(lP(),1);import{constants as OG}from"crypto";import{Agent as nb}from"https";var wG=new Set(["ENOTFOUND","EAI_AGAIN","EAI_FAIL","EAI_NONAME"]),SG=new Set(["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNABORTED"]),AG=u(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessage"),CG=u(r=>{if(!r||typeof r!="object"||!("code"in r))return;let{code:e}=r;return typeof e=="string"?e:void 0},"getCode"),xG=u(r=>{if(!r||typeof r!="object"||!("hostname"in r))return;let{hostname:e}=r;return typeof e=="string"?e:void 0},"getHostname"),tb=u(r=>{if(typeof r=="string")return r;if(r instanceof Error||AG(r))return r.message},"getMessage"),cP=u(r=>{let e=r.toLowerCase();return e.includes("timeout")||e.includes("timed out")||e.includes("time-out")||e.includes("read econnreset")},"isTimeoutMessage"),bG=u(r=>/getaddrinfo\s+ENOTFOUND/i.test(r)||/\bENOTFOUND\b/i.test(r),"isHostNotFoundMessage"),NG=u(r=>{let e=[],t=new Set,n=r;for(;n!=null&&!t.has(n);){if(t.add(n),e.push(n),n instanceof AggregateError)for(let i of n.errors)t.has(i)||e.push(i);n=n instanceof Error?n.cause:void 0}return e},"collectErrorChain"),qd=u(r=>r instanceof Error?{cause:r}:void 0,"errorOptions"),TG=u(r=>{let e=NG(r),t=tb(r)??e.map(tb).find(n=>!!n);for(let n of e){let s=CG(n);if(s&&wG.has(s))return Zt(new W0(t??`Host not found (${xG(n)??s})`,qd(r)));if(s&&SG.has(s))return Zt(new uf(t??"Transmission timeout",qd(r)));let i=tb(n);if(i&&cP(i))return Zt(new uf(i,qd(r)))}return t?bG(t)?Zt(new W0(t,qd(r))):cP(t)?Zt(new uf(t,qd(r))):cs(r):cs(r)},"mapTransmissionError"),fP=u(r=>TG(r),"leftFromTransmissionError");var IG=/Ã[\u0080-\u00BF]/;function DG(r){if(!IG.test(r))return r;let e=Buffer.from(r,"latin1").toString("utf8");return e.includes("\uFFFD")?r:e}u(DG,"fixUtf8Mojibake");function rb(r){if(typeof r=="string")return DG(r);if(Array.isArray(r))return r.map(e=>rb(e));if(r!==null&&typeof r=="object"){let e={};for(let[t,n]of Object.entries(r))e[t]=rb(n);return e}return r}u(rb,"normalizeValue");function hP(r){return rb(r)}u(hP,"normalizeTransmissionStrings");import BG from"os";var _2=class r{static{u(this,"WinHttpClient")}certificate;interceptors={request:{use:u(()=>0,"use"),eject:u(()=>{},"eject"),clear:u(()=>{},"clear")},response:{use:u(()=>0,"use"),eject:u(()=>{},"eject"),clear:u(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(BG.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
84
+ `).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=Rf("winhttp_ssl_client"),{CN:i}=new yo().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var pP=class{static{u(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}validateCertificatePeriod(){if(!this.certificate)return Hr(void 0);let{certificate:e}=this.certificate,t=new Date;return t>new Date(e.validTo)?Zt(new kt(`Certificado expirado (${Of(e.validTo).format("DD/MM/YYYY")}). Renove o certificado.`)):t<new Date(e.validFrom)?Zt(new kt(`O certificado ainda n\xE3o est\xE1 v\xE1lido (${Of(e.validFrom).format("DD/MM/YYYY")}).`)):Hr(void 0)}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:OG.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new nb({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new nb({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new nb({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(e){let t=mI.create({timeout:e.timeout});return t.defaults.httpsAgent=this.httpsAgent,t}request(e){if(RG.platform()==="win32")try{return this.certificate?_2.create(this.certificate):this.getDefaultRequest({timeout:e.timeout})}catch{return this.getDefaultRequest({timeout:e.timeout})}return this.getDefaultRequest({timeout:e.timeout})}async send(e){let t=this.validateCertificatePeriod();if(t.isLeft())return t;try{let n=this.request({timeout:e.timeout}),s=await(0,dP.createClientAsync)(`${e.url}?wsdl`,{request:n,endpoint:e.url,attributesKey:"$",wsdl_options:{request:n,timeout:e.timeout},forceSoap12Headers:!0});e.payload.$={xmlns:s.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),a=this.toolkit.getFirstNode(i)??"",o=e.xsd,l=await this.toolkit.validate(a,o);if(l.isLeft())return l;let c=`${e.method}Async`;if(typeof s[c]!="function"){let p=Object.keys(s).filter(d=>d.endsWith("Async"));return Zt(new kt(`M\xE9todo SOAP "${c}" n\xE3o encontrado em ${e.url}. Dispon\xEDveis: ${p.join(", ")||"nenhum"}`))}let[f]=await s[c]({_xml:i},{request:n,timeout:e.timeout});return Hr(hP(f))}catch(n){return fP(n)}}};var _G=Rf("xml_validator"),mP=_G;var wQ=Ty(F4(),1);import EQ from"crypto";var U4="application/xml";var gt;(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"})(gt||(gt={}));function PG(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}u(PG,"SelectNodesEx");function kG(r,e){let t=eh("xpath").select;return t(e,r)}u(kG,"SelectNodesNode");var M4=typeof self<"u"?PG:kG;function Xd(r){r=r.replace(/\r\n/g,`
85
85
  `).replace(/\r/g,`
86
86
  `);let e;return typeof DOMParser<"u"?e=DOMParser:e=eh("DOMParser"),new e().parseFromString(r,U4)}u(Xd,"Parse");function Zf(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=eh("XMLSerializer"),new e().serializeToString(r)}u(Zf,"Stringify");function J2(r,e){let t=M4(r,e);return t&&t.length>0?t[0]:null}u(J2,"SelectSingleNode");function j4(r,e){return r&&r.nodeType===e}u(j4,"isNodeType");function ps(r){return j4(r,gt.Element)}u(ps,"isElement");function ml(r){return j4(r,gt.Document)}u(ml,"isDocument");var q4=new Map;function H4(r){for(let e in r)q4.set(e,r[e])}u(H4,"setNodeDependencies");function eh(r){let e=q4.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}u(eh,"getNodeDependency");var Gd="element",$d="attribute",Y2="content";var LG=1e9;function db(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}u(db,"assign");function yt(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=db({},t.items)),t.target=e}}u(yt,"XmlElement");function Nt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=db({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||LG,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,o=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||o||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:Gd},X4(e,s,r)}}u(Nt,"XmlChildElement");function pr(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=db({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=$d,X4(e,s,r)}}u(pr,"XmlAttribute");function X4(r,e,t){let n=`_${e}`,s={set:u(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:u(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)}u(X4,"defineProperty");var ko=class r{static{u(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 VG(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}u(VG,"printf");function FG(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}u(FG,"padNum");var De=class{static{u(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=VG(Fr[e],...t);this.message=`${this.prefix}${FG(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},ye;(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"})(ye||(ye={}));var Fr={};Fr[ye.NONE]="No description";Fr[ye.NULL_REFERENCE]="Null reference";Fr[ye.NULL_PARAM]="'%1' has empty '%2' object";Fr[ye.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";Fr[ye.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";Fr[ye.METHOD_NOT_IMPLEMENTED]="Method is not implemented";Fr[ye.METHOD_NOT_SUPPORTED]="Method is not supported";Fr[ye.PARAM_REQUIRED]="Required parameter is missing '%1'";Fr[ye.CONVERTER_UNSUPPORTED]="Converter is not supported";Fr[ye.ELEMENT_MALFORMED]="Malformed element '%1'";Fr[ye.ELEMENT_MISSING]="Element '%1' is missing in '%2'";Fr[ye.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";Fr[ye.CONTENT_MISSING]="Content is missing in '%1'";Fr[ye.CRYPTOGRAPHIC]="Cryptographic error: %1";Fr[ye.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";Fr[ye.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";Fr[ye.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";Fr[ye.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";Fr[ye.XML_EXCEPTION]="XML exception: %1";Fr[ye.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var zt=class{static{u(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 De(ye.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 De(ye.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 De(ye.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 De(ye.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 Os={get:u(r=>{if(r)return zt.ToBase64(r)},"get"),set:u(r=>zt.FromBase64(r),"set")},Wd={get:u(r=>r?r.toString():"0","get"),set:u(r=>Number(r),"set")};var UG="xml_root",Yn=class r{static{u(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 De(ye.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 De(ye.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return ml(e)&&(n=e.getElementById(t)),n==null&&(n=J2(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=J2(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=J2(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=UG,t=null,n=null){if(n&&!t)throw new De(ye.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let o=`${s}${e}`;return Xd(`<${o}${a}></${o}>`)}static GetChildren(e,t,n){e=ml(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];ps(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=ml(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(ps(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(ps(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new De(ye.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 o in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,o))continue;let l=t[o],c=i.items[o];switch(c.type){case Y2:{let f=c,p=f.converter?f.converter.get(l):l;if(f.required&&p==null)throw new De(ye.CONTENT_MISSING,a);(f.defaultValue!==l||f.required)&&(s.textContent=p);break}case $d:{let f=c,p=f.converter?f.converter.get(l):l;if(f.required&&p==null)throw new De(ye.ATTRIBUTE_MISSING,f.localName,a);(f.defaultValue!==l||f.required)&&(f.namespaceURI?s.setAttributeNS(f.namespaceURI,f.localName||"",p):s.setAttribute(f.localName||"",p));break}case Gd:{let f=c,p=null;if(f.parser){if(f.required&&!l||f.minOccurs&&!l.Count){let d=l?.localName||f.localName;throw new De(ye.ELEMENT_MISSING,d,a)}l&&(p=l.GetXml(l.element===void 0&&(f.required||l.Count)))}else{let d=f.converter?f.converter.get(l):l;if(f.required&&d===void 0)throw new De(ye.ELEMENT_MISSING,f.localName,a);if(l!==f.defaultValue||f.required)if(f.namespaceURI?p=n.createElementNS(f.namespaceURI,`${f.prefix?f.prefix+":":""}${f.localName}`):p=n.createElement(`${f.prefix?f.prefix+":":""}${f.localName}`),Array.isArray(d))for(let g of d){let m=g instanceof r?g.GetXml(!0):g;m!==null&&p&&p.appendChild(m)}else if(d instanceof r){let g=d.GetXml(!0);g&&p&&p.appendChild(g)}else p&&(p.textContent=d)}if(p)if(f.noRoot){let d=[];for(let v=0;v<p.childNodes.length;v++){let y=p.childNodes.item(v);ps(y)&&d.push(y)}let g=f.minOccurs||0,m=f.maxOccurs||1/0;if(d.length<g||d.length>m)throw new De(ye.COLLECTION_LIMIT,l.localName,i.localName);d.forEach(v=>s.appendChild(v.cloneNode(!0)))}else{if(p.childNodes.length<(f.minOccurs||0)||p.childNodes.length>(f.maxOccurs||1/0))throw new De(ye.COLLECTION_LIMIT,l.localName,i.localName);s.appendChild(p)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Xd(e).documentElement:t=e,!t)throw new De(ye.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new De(ye.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let o=s.items[a];switch(o.type){case Y2:{let l=o;if(l.required&&!t.textContent)throw new De(ye.CONTENT_MISSING,i);if(!t.textContent)n[a]=l.defaultValue;else{let c=l.converter?l.converter.set(t.textContent):t.textContent;n[a]=c}break}case $d:{let l=o,c,f;if(!l.localName)throw new De(ye.PARAM_REQUIRED,"localName");if(l.namespaceURI?(c=t.hasAttributeNS.bind(t,l.namespaceURI,l.localName),f=t.getAttributeNS.bind(t,l.namespaceURI,l.localName)):(c=t.hasAttribute.bind(t,l.localName),f=t.getAttribute.bind(t,l.localName)),l.required&&!c())throw new De(ye.ATTRIBUTE_MISSING,l.localName,i);if(!c())n[a]=l.defaultValue;else{let p=f(),d=l.converter&&p?l.converter.set(p):p;n[a]=d}break}case Gd:{let l=o;if(l.noRoot){if(!l.parser)throw new De(ye.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser'`);let f=new l.parser;if(!(f instanceof th))throw new De(ye.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);f.OnLoadXml(t),delete f.element;let p=l.minOccurs||0,d=l.maxOccurs||1/0;if(f.Count<p||f.Count>d)throw new De(ye.COLLECTION_LIMIT,l.parser.localName,i);n[a]=f;continue}let c=null;for(let f=0;f<t.childNodes.length;f++){let p=t.childNodes.item(f);if(!ps(p))continue;let d=p;if(d.localName===l.localName&&d.namespaceURI==l.namespaceURI){c=d;break}}if(l.required&&!c)throw new De(ye.ELEMENT_MISSING,l.parser?l.parser.localName:l.localName,i);if(l.parser){if(c){let f=new l.parser;f.localName=l.localName,f.namespaceURI=l.namespaceURI,n[a]=f,f.LoadXml(c)}}else if(!c)n[a]=l.defaultValue;else{let f=c.textContent||"",p=l.converter?l.converter.set(f):f;n[a]=p}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Zf(e):""}GetElement(e,t=!0){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new De(ye.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 o=this.CreateDocument();if(o)e=o;else throw new De(ye.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 th=class extends Yn{static{u(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 ko(this.GetIterator().map(e))}Filter(e){return new ko(this.GetIterator().filter(e))}Sort(e){return new ko(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 De(ye.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(!(ps(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 rh=class extends ko{static{u(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 MG="[object ArrayBuffer]",Ye=class yb{static{u(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===MG}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=yb.toUint8Array(e),s=yb.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 o=this.toUint8Array(a);s.set(o,i),i+=o.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},gb="string",jG=/^[0-9a-f\s]+$/i,qG=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,HG=/^[a-zA-Z0-9-_]+$/,G4=class{static{u(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=Ye.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},Li=class{static{u(this,"Utf16Converter")}static toString(e,t=!1){let n=Ye.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let o=s.getUint16(a,t);i+=String.fromCharCode(o)}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}},at=class nh{static{u(this,"Convert")}static isHex(e){return typeof e===gb&&jG.test(e)}static isBase64(e){return typeof e===gb&&qG.test(e)}static isBase64Url(e){return typeof e===gb&&HG.test(e)}static ToString(e,t="utf8"){let n=Ye.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 Li.toString(n,!0);case"utf16":case"utf16be":return Li.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 Li.fromString(e,!0);case"utf16":case"utf16be":return Li.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=Ye.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(!nh.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(!nh.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=nh.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return G4.fromString(e);case"utf16":case"utf16be":return Li.fromString(e);case"utf16le":case"usc2":return Li.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=nh.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return G4.toString(e);case"utf16":case"utf16be":return Li.toString(e);case"utf16le":case"usc2":return Li.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=Ye.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=Ye.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(!nh.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 Li.toString(e,t)}static FromUtf16String(e,t=!1){return Li.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,"")||""}};at.DEFAULT_UTF8_ENCODING="utf8";function T(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}u(T,"getParametersValue");function Q2(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()}u(Q2,"bufferToHexCodes");function va(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}u(va,"utilFromBase");function ei(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let o=1;o<8;o++){if(r<a){let l;if(n<0)l=new ArrayBuffer(o),i=o;else{if(n<o)return new ArrayBuffer(0);l=new ArrayBuffer(n),i=n}let c=new Uint8Array(l);for(let f=o-1;f>=0;f--){let p=Math.pow(2,f*e);c[i-f-1]=Math.floor(s/p),s-=c[i-f-1]*p}return l}a*=Math.pow(2,e)}return new ArrayBuffer(0)}u(ei,"utilToBase");function gl(...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}u(gl,"utilConcatBuf");function Z2(...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}u(Z2,"utilConcatView");function vb(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let o=r[0]===255&&r[1]&128,l=r[0]===0&&(r[1]&128)===0;(o||l)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let o=0;o<this.valueHex.byteLength;o++)t[o]=0;t[0]=r[0]&128;let n=va(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let o=0;o<this.valueHex.byteLength;o++)i[o]=r[o];return i[0]&=127,va(i,8)-n}u(vb,"utilDecodeTC");function W4(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,o=ei(a,8,n),l=new Uint8Array(o);return l[0]|=128,o}let s=ei(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),o=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let l=0;l<a.byteLength;l++)i[l+1]=o[l];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}u(W4,"utilEncodeTC");function Lo(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}u(Lo,"isEqualBuffer");function Qn(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)}u(Qn,"padNumber");var z4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",J4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function eE(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,o="",l=e?J4:z4;if(n){let c=0;for(let f=0;f<r.length;f++)if(r.charCodeAt(f)!==0){c=f;break}r=r.slice(c)}for(;s<r.length;){let c=r.charCodeAt(s++);s>=r.length&&(i=1);let f=r.charCodeAt(s++);s>=r.length&&(a=1);let p=r.charCodeAt(s++),d=c>>2,g=(c&3)<<4|f>>4,m=(f&15)<<2|p>>6,v=p&63;i===1?m=v=64:a===1&&(v=64),t?m===64?o+=`${l.charAt(d)}${l.charAt(g)}`:v===64?o+=`${l.charAt(d)}${l.charAt(g)}${l.charAt(m)}`:o+=`${l.charAt(d)}${l.charAt(g)}${l.charAt(m)}${l.charAt(v)}`:o+=`${l.charAt(d)}${l.charAt(g)}${l.charAt(m)}${l.charAt(v)}`}return o}u(eE,"toBase64");function sh(r,e=!1,t=!1){let n=e?J4:z4;function s(l){for(let c=0;c<64;c++)if(n.charAt(c)===l)return c;return 64}u(s,"indexOf");function i(l){return l===64?0:l}u(i,"test");let a=0,o="";for(;a<r.length;){let l=s(r.charAt(a++)),c=a>=r.length?0:s(r.charAt(a++)),f=a>=r.length?0:s(r.charAt(a++)),p=a>=r.length?0:s(r.charAt(a++)),d=i(l)<<2|i(c)>>4,g=(i(c)&15)<<4|i(f)>>2,m=(i(f)&3)<<6|i(p);o+=String.fromCharCode(d),f!==64&&(o+=String.fromCharCode(g)),p!==64&&(o+=String.fromCharCode(m))}if(t){let l=o.length,c=-1;for(let f=l-1;f>=0;f--)if(o.charCodeAt(f)!==0){c=f;break}c!==-1?o=o.slice(0,c+1):o=""}return o}u(sh,"fromBase64");function zd(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}u(zd,"arrayBufferToString");function yl(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}u(yl,"stringToArrayBuffer");var KG=Math.log(2);function Y4(r){let e=Math.log(r)/KG,t=Math.floor(e),n=Math.round(e);return t===n?t:n}u(Y4,"nearestPowerOf2");function we(r,e){for(let t of e)delete r[t]}u(we,"clearProps");function tE(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}u(tE,"assertBigInt");function Ab(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}u(Ab,"concat");function Ea(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)}u(Ea,"checkBufferParams");var Cb=class{static{u(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Ab(this.items)}},Jd=[new Uint8Array([1])],Z4="0123456789",Eb="name",ek="valueHexView",XG="isHexOnly",GG="idBlock",$G="tagClass",WG="tagNumber",zG="isConstructed",JG="fromBER",YG="toBER",QG="local",Zn="",Vi=new ArrayBuffer(0),rE=new Uint8Array(0),Qd="EndOfContent",rk="OCTET STRING",nk="BIT STRING";function wa(r){var e;return e=class extends r{static{u(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?Ye.toUint8Array(i.valueHex):rE}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!Ea(this,a,s,i))return-1;let o=s+i;return this.valueHexView=a.subarray(s,o),this.valueHexView.length?(this.blockLength=i,o):(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",Vi)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:at.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}u(wa,"HexBlock");var vl=class{static{u(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=Zn,warnings:n=[],valueBeforeDecode:s=rE}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=Ye.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:at.ToHex(this.valueBeforeDecodeView)}}};vl.NAME="baseBlock";var es=class extends vl{static{u(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'")}};es.NAME="valueBlock";var sk=class extends wa(vl){static{u(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?Ye.toUint8Array(e.valueHex):rE,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",Vi}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=ei(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,o=new Uint8Array(a+1);if(o[0]=t|31,!e){for(let l=0;l<a-1;l++)o[l+1]=i[l]|128;o[a]=i[a-1]}return o.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=Ye.toUint8Array(e);if(!Ea(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 o=i[0]&31;if(o!==31)this.tagNumber=o,this.blockLength=1;else{let l=1,c=this.valueHexView=new Uint8Array(255),f=255;for(;i[l]&128;){if(c[l-1]=i[l]&127,l++,l>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(l===f){f+=255;let d=new Uint8Array(f);for(let g=0;g<c.length;g++)d[g]=c[g];c=this.valueHexView=new Uint8Array(f)}}this.blockLength=l+1,c[l-1]=i[l]&127;let p=new Uint8Array(l);for(let d=0;d<l;d++)p[d]=c[d];c=this.valueHexView=new Uint8Array(l),c.set(p),this.blockLength<=9?this.tagNumber=va(c,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}}};sk.NAME="identificationBlock";var ik=class extends vl{static{u(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=Ye.toUint8Array(e);if(!Ea(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 o=t+1,l=s.subarray(o,o+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=va(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=ei(this.length,8);if(s.byteLength>127)return this.error="Too big length",Vi;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}}};ik.NAME="lengthBlock";var Ge={},Vn=class extends vl{static{u(this,"BaseBlock")}constructor({name:e=Zn,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new sk(s),this.lenBlock=new ik(s),this.valueBlock=i?new i(s):new es(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 Cb;t||ak(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?Vi: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():at.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=at.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 Lo(t,n)}};Vn.NAME="BaseBlock";function ak(r){var e;if(r instanceof Ge.Constructed)for(let t of r.valueBlock.value)ak(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}u(ak,"prepareIndefiniteForm");var ok=class extends Vn{static{u(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Zn,...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}'`}};ok.NAME="BaseStringBlock";var uk=class extends wa(es){static{u(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};uk.NAME="PrimitiveValueBlock";var lk,Ze=class extends Vn{static{u(this,"Primitive")}constructor(e={}){super(e,uk),this.idBlock.isConstructed=!1}};lk=Ze;Ge.Primitive=lk;Ze.NAME="PRIMITIVE";function ZG(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}u(ZG,"localChangeType");function Zd(r,e=0,t=r.length){let n=e,s=new Vn({},es),i=new vl;if(!Ea(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 o=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),o===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=o,t-=s.idBlock.blockLength,o=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),o===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=o,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=Vn;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=Ge.EndOfContent;break;case 1:l=Ge.Boolean;break;case 2:l=Ge.Integer;break;case 3:l=Ge.BitString;break;case 4:l=Ge.OctetString;break;case 5:l=Ge.Null;break;case 6:l=Ge.ObjectIdentifier;break;case 10:l=Ge.Enumerated;break;case 12:l=Ge.Utf8String;break;case 13:l=Ge.RelativeObjectIdentifier;break;case 14:l=Ge.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:l=Ge.Sequence;break;case 17:l=Ge.Set;break;case 18:l=Ge.NumericString;break;case 19:l=Ge.PrintableString;break;case 20:l=Ge.TeletexString;break;case 21:l=Ge.VideotexString;break;case 22:l=Ge.IA5String;break;case 23:l=Ge.UTCTime;break;case 24:l=Ge.GeneralizedTime;break;case 25:l=Ge.GraphicString;break;case 26:l=Ge.VisibleString;break;case 27:l=Ge.GeneralString;break;case 28:l=Ge.UniversalString;break;case 29:l=Ge.CharacterString;break;case 30:l=Ge.BmpString;break;case 31:l=Ge.DATE;break;case 32:l=Ge.TimeOfDay;break;case 33:l=Ge.DateTime;break;case 34:l=Ge.Duration;break;default:{let c=s.idBlock.isConstructed?new Ge.Constructed:new Ge.Primitive;c.idBlock=s.idBlock,c.lenBlock=s.lenBlock,c.warnings=s.warnings,s=c}}break;case 2:case 3:case 4:default:l=s.idBlock.isConstructed?Ge.Constructed:Ge.Primitive}return s=ZG(s,l),o=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:o,result:s}}u(Zd,"localFromBER");function Ar(r){if(!r.byteLength){let e=new Vn({},es);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Zd(Ye.toUint8Array(r).slice(),0,r.byteLength)}u(Ar,"fromBER");function e$(r,e){return r?1:e}u(e$,"checkLen");var Vo=class extends es{static{u(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=Ye.toUint8Array(e);if(!Ea(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(;e$(this.isIndefiniteForm,n)>0;){let a=Zd(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===Qd)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Qd?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new Cb;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?Vi:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Vo.NAME="ConstructedValueBlock";var ck,re=class extends Vn{static{u(this,"Constructed")}constructor(e={}){super(e,Vo),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
87
  `).map(s=>` ${s}`).join(`
@@ -92,8 +92,8 @@ ${e.join(`
92
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===vs.AfterDocElement?this.result.push(`
93
93
  <?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,gt.ProcessingInstruction))),this.state===vs.BeforeDocElement?this.result.push(`?>
94
94
  `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===vs.BeforeDocElement&&(this.state=vs.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===vs.BeforeDocElement&&(this.state=vs.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(!GT(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let f={prefix:a.prefix,namespace:a.namespaceURI};t.push(f),this.visibleNamespaces.Add(f),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let f={prefix:a.prefix,namespace:a.nodeValue};t.push(f),this.visibleNamespaces.Add(f),n++}let o=null,l;(l=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(o=l[1]);let c=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,o)){let f=S5(e,o);if(f>1)c=!1;else if(f===0)continue}if(!this.IsNamespaceRendered(o,a.nodeValue)&&c){let f={prefix:o,namespace:a.nodeValue};t.push(f),this.visibleNamespaces.Add(f),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(EJ);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];GT(s)||t.push(s)}t.sort(wJ),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,gt.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===gt.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===gt.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===gt.Attribute?n.push("&quot;"):i===" "&&t===gt.Attribute?n.push("&#x9;"):i===`
95
- `&&t===gt.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case gt.Text:case gt.CDATA:case gt.SignificantWhitespace:case gt.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 EJ(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}u(EJ,"XmlDsigC14NTransformNamespacesComparer");function wJ(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}u(wJ,"XmlDsigC14NTransformAttributesComparer");function S5(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(!GT(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===gt.Element){let a=S5(s,e,t);if(s.nodeType===gt.Element&&a)return++t+a}return t}u(S5,"IsNamespaceUsed");function GT(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===gt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}u(GT,"IsNamespaceNode");var jS=class extends Ms{static{u(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element||n.nodeName===oe.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case oe.ElementNames.RSAPSSParams:s=pi;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};jS=Oe([yt({localName:"Other"})],jS);var Gi=class extends Sr{static{u(this,"SignatureMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:""}),ze("design:type",String)],Gi.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.HMACOutputLength,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Wd}),ze("design:type",Number)],Gi.prototype,"HMACOutputLength",void 0);Oe([Nt({parser:jS,noRoot:!0,minOccurs:0}),ze("design:type",jS)],Gi.prototype,"Any",void 0);Gi=Oe([yt({localName:oe.ElementNames.SignatureMethod})],Gi);var g0=class extends Sr{static{u(this,"CanonicalizationMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:oe.DefaultCanonMethod}),ze("design:type",String)],g0.prototype,"Algorithm",void 0);g0=Oe([yt({localName:oe.ElementNames.CanonicalizationMethod})],g0);var y0=class extends Sr{static{u(this,"DataObject")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],y0.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.MimeType,defaultValue:""}),ze("design:type",String)],y0.prototype,"MimeType",void 0);Oe([pr({localName:oe.AttributeNames.Encoding,defaultValue:""}),ze("design:type",String)],y0.prototype,"Encoding",void 0);y0=Oe([yt({localName:oe.ElementNames.Object})],y0);var sy=class extends Ms{static{u(this,"DataObjects")}};sy=Oe([yt({localName:"xmldsig_objects",parser:y0})],sy);var Bn=class extends Sr{static{u(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new De(ye.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new De(ye.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};Oe([pr({localName:oe.AttributeNames.Algorithm,defaultValue:""}),ze("design:type",String)],Bn.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.XPath,defaultValue:""}),ze("design:type",String)],Bn.prototype,"XPath",void 0);Bn=Oe([yt({localName:oe.ElementNames.Transform})],Bn);var Xa=class extends Bn{static{u(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return zt.FromString(this.innerXml.textContent||"","base64")}};var $i=class extends Bn{static{u(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Xi(!1,!1)}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Wi=class extends $i{static{u(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Xi(!0,!1)}};var Ga=class extends Bn{static{u(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)ps(e)&&e.localName===oe.ElementNames.Signature&&e.namespaceURI===oe.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var zi=class extends Bn{static{u(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Xi(!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 De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},Ji=class extends zi{static{u(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Xi(!0,!0)}};function A5(r){return r.parentNode?A5(r.parentNode):r}u(A5,"lookupParentNode");var v0=class extends Bn{static{u(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");this.Filter(A5(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:eh("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})`,o=typeof self>"u"?eh("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:u(c=>i.lookupNamespaceURI(c),"lookupNamespaceURI")},o.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};Oe([Nt({localName:oe.ElementNames.XPath,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],v0.prototype,"XPath",void 0);var E0=class extends Ms{static{u(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return zc(t,Ga);case oe.AlgorithmNamespaces.XmlDsigC14NTransform:return zc(t,$i);case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return zc(t,Wi);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:return zc(t,zi);case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return zc(t,Ji);case oe.AlgorithmNamespaces.XmlDsigBase64Transform:return zc(t,Xa);case oe.AlgorithmNamespaces.XmlDsigXPathTransform:return zc(t,v0);default:try{let n=iy.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new De(ye.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};E0=Oe([yt({localName:oe.ElementNames.Transforms,parser:Bn})],E0);function zc(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}u(zc,"ChangeTransform");var Yi=class extends Sr{static{u(this,"Reference")}constructor(e){super(),this.DigestMethod=new js,e&&(this.Uri=e)}};Oe([pr({defaultValue:""}),ze("design:type",String)],Yi.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.URI}),ze("design:type",String)],Yi.prototype,"Uri",void 0);Oe([pr({localName:oe.AttributeNames.Type,defaultValue:""}),ze("design:type",String)],Yi.prototype,"Type",void 0);Oe([Nt({parser:E0}),ze("design:type",E0)],Yi.prototype,"Transforms",void 0);Oe([Nt({required:!0,parser:js}),ze("design:type",js)],Yi.prototype,"DigestMethod",void 0);Oe([Nt({required:!0,localName:oe.ElementNames.DigestValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Os}),ze("design:type",Uint8Array)],Yi.prototype,"DigestValue",void 0);Yi=Oe([yt({localName:oe.ElementNames.Reference}),ze("design:paramtypes",[String])],Yi);var w0=class extends Ms{static{u(this,"References")}};w0=Oe([yt({localName:"References",parser:Yi})],w0);var $a=class extends Sr{static{u(this,"SignedInfo")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],$a.prototype,"Id",void 0);Oe([Nt({parser:g0,required:!0}),ze("design:type",g0)],$a.prototype,"CanonicalizationMethod",void 0);Oe([Nt({parser:Gi,required:!0}),ze("design:type",Gi)],$a.prototype,"SignatureMethod",void 0);Oe([Nt({parser:w0,minOccurs:1,noRoot:!0}),ze("design:type",w0)],$a.prototype,"References",void 0);$a=Oe([yt({localName:oe.ElementNames.SignedInfo})],$a);var x0="http://www.w3.org/2001/04/xmldsig-more#",b0="ecdsa",Jc=class extends Yn{static{u(this,"EcdsaPublicKey")}};Oe([Nt({localName:oe.ElementNames.X,namespaceURI:x0,prefix:b0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"X",void 0);Oe([Nt({localName:oe.ElementNames.Y,namespaceURI:x0,prefix:b0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"Y",void 0);Jc=Oe([yt({localName:oe.ElementNames.PublicKey,namespaceURI:x0,prefix:b0})],Jc);var S0=class extends Yn{static{u(this,"NamedCurve")}};Oe([pr({localName:oe.AttributeNames.URI,required:!0}),ze("design:type",String)],S0.prototype,"Uri",void 0);S0=Oe([yt({localName:oe.ElementNames.NamedCurve,namespaceURI:x0,prefix:b0})],S0);var A0=class extends Yn{static{u(this,"DomainParameters")}};Oe([Nt({parser:S0}),ze("design:type",S0)],A0.prototype,"NamedCurve",void 0);A0=Oe([yt({localName:oe.ElementNames.DomainParameters,namespaceURI:x0,prefix:b0})],A0);var C0=class extends ys{static{u(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=oe.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Ha.toUpperCase()}get NamedCurve(){return x5(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new De(ye.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await qr.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new Jc,this.PublicKey.X=zt.FromString(t.x||"","base64url"),this.PublicKey.Y=zt.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new A0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new S0),this.DomainParameters.NamedCurve.Uri=x5(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=zt.ToBase64Url(this.PublicKey.X),n=zt.ToBase64Url(this.PublicKey.Y),s=SJ(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await qr.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};Oe([Nt({parser:A0}),ze("design:type",A0)],C0.prototype,"DomainParameters",void 0);Oe([Nt({parser:Jc,required:!0}),ze("design:type",Jc)],C0.prototype,"PublicKey",void 0);C0=Oe([yt({localName:oe.ElementNames.ECDSAKeyValue,namespaceURI:x0,prefix:b0})],C0);function x5(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 De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve")}u(x5,"GetNamedCurveOid");function SJ(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 De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}u(SJ,"GetNamedCurveFromOid");var AJ=class extends Map{static{u(this,"KeyInfoClauseRegistry")}},ju=new AJ;ju.set(oe.ElementNames.RSAKeyValue,p0);ju.set(oe.ElementNames.ECDSAKeyValue,C0);var qS=class{static{u(this,"KeyInfoClauseFactory")}static create(e){let t=ju.get(e);if(!t)throw new De(ye.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var ay=class extends ys{static{u(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 ju)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new De(ye.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new De(ye.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(ps(n))try{let s=n.localName,i=qS.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new De(ye.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};ay=Oe([yt({localName:oe.ElementNames.KeyValue}),ze("design:paramtypes",[ys])],ay);var CJ={"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"}},N0=class{static{u(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 qr.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()===Ha){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=CJ[i.toString()],o=a?a.short:null;n.push(`${o||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Ar(this.raw.buffer);this.simpl=new Dn({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var HS=class extends Sr{static{u(this,"X509IssuerSerial")}};Oe([Nt({localName:oe.ElementNames.X509IssuerName,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509IssuerName",void 0);Oe([Nt({localName:oe.ElementNames.X509SerialNumber,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509SerialNumber",void 0);HS=Oe([yt({localName:oe.ElementNames.X509IssuerSerial})],HS);var Yc;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(Yc||(Yc={}));var T0=class extends ys{static{u(this,"KeyInfoX509Data")}constructor(e,t=Yc.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new N0(e));else if(e instanceof N0)switch(t){case Yc.None:case Yc.EndCertOnly:this.AddCertificate(e);break;case Yc.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case Yc.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new De(ye.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new De(ye.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 De(ye.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new De(ye.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=zt.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(oe.NamespaceURI,n+oe.ElementNames.X509IssuerSerial),a=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let o=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SerialNumber);o.textContent=s.serialNumber,i.appendChild(o),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SKI);i.textContent=zt.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509Certificate);i.textContent=zt.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509CRL);s.textContent=zt.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(oe.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Sr.GetChild(s,oe.ElementNames.X509IssuerName,oe.NamespaceURI,!0),a=Sr.GetChild(s,oe.ElementNames.X509SerialNumber,oe.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(oe.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(oe.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(oe.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddCertificate(new N0(i))}});let n=this.GetChild(oe.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=zt.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};T0=Oe([yt({localName:oe.ElementNames.X509Data}),ze("design:paramtypes",[Object,Object])],T0);var oy=class extends ys{static{u(this,"SPKIData")}async importKey(e){let t=await qr.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 qr.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};Oe([Nt({localName:oe.ElementNames.SPKIexp,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os}),ze("design:type",Object)],oy.prototype,"SPKIexp",void 0);oy=Oe([yt({localName:oe.ElementNames.SPKIData})],oy);var Qc=class extends Ms{static{u(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element)continue;let s=null;switch(n.localName){case oe.ElementNames.KeyValue:s=ay;break;case oe.ElementNames.X509Data:s=T0;break;case oe.ElementNames.SPKIData:s=oy;break;case oe.ElementNames.KeyName:case oe.ElementNames.RetrievalMethod:case oe.ElementNames.PGPData:case oe.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],Qc.prototype,"Id",void 0);Qc=Oe([yt({localName:oe.ElementNames.KeyInfo})],Qc);var qu=class extends Sr{static{u(this,"Signature")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],qu.prototype,"Id",void 0);Oe([Nt({parser:$a,required:!0}),ze("design:type",$a)],qu.prototype,"SignedInfo",void 0);Oe([Nt({localName:oe.ElementNames.SignatureValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os,defaultValue:null}),ze("design:type",Object)],qu.prototype,"SignatureValue",void 0);Oe([Nt({parser:Qc}),ze("design:type",Qc)],qu.prototype,"KeyInfo",void 0);Oe([Nt({parser:sy,noRoot:!0}),ze("design:type",sy)],qu.prototype,"ObjectList",void 0);qu=Oe([yt({localName:oe.ElementNames.Signature})],qu);var bJ=class extends Map{static{u(this,"AlgorithmRegistry")}},Rt=new bJ;Rt.set(RS,{type:"signature",algorithm:l0});Rt.set(OS,{type:"signature",algorithm:c0});Rt.set(_S,{type:"signature",algorithm:f0});Rt.set(PS,{type:"signature",algorithm:h0});Rt.set(RS,{type:"signature",algorithm:l0});Rt.set(OS,{type:"signature",algorithm:c0});Rt.set(_S,{type:"signature",algorithm:f0});Rt.set(PS,{type:"signature",algorithm:h0});Rt.set(jT,{type:"signature",algorithm:LS});Rt.set(qT,{type:"signature",algorithm:VS});Rt.set(HT,{type:"signature",algorithm:FS});Rt.set(KT,{type:"signature",algorithm:US});Rt.set(XT,{type:"signature",algorithm:MS});Rt.set(bS,{type:"signature",algorithm:s0});Rt.set(NS,{type:"signature",algorithm:i0});Rt.set(TS,{type:"signature",algorithm:a0});Rt.set(IS,{type:"signature",algorithm:o0});Rt.set(bS.toUpperCase(),{type:"signature",algorithm:s0});Rt.set(NS.toUpperCase(),{type:"signature",algorithm:i0});Rt.set(TS.toUpperCase(),{type:"signature",algorithm:a0});Rt.set(IS.toUpperCase(),{type:"signature",algorithm:o0});Rt.set(kT,{type:"signature",algorithm:ey});Rt.set(LT,{type:"signature",algorithm:ty});Rt.set(VT,{type:"signature",algorithm:ry});Rt.set(FT,{type:"signature",algorithm:ny});Rt.set(e0,{type:"hash",algorithm:AS});Rt.set(t0,{type:"hash",algorithm:Z1});Rt.set(r0,{type:"hash",algorithm:CS});Rt.set(n0,{type:"hash",algorithm:xS});var Zc=class{static{u(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="hash"&&t===e)return new s;throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}};var NJ=class extends Map{static{u(this,"TransformRegistry")}},Wa=new NJ;Wa.set(oe.AlgorithmNamespaces.XmlDsigBase64Transform,Xa);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NTransform,$i);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Wi);Wa.set(oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Ga);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NTransform,zi);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,Ji);var iy=class{static{u(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new De(ye.PARAM_REQUIRED,"name");let t=Wa.get(e);if(t)return new t;let n;switch(e){case oe.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Xa;break;case oe.AlgorithmNamespaces.XmlDsigC14NTransform:n=new $i;break;case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Wi;break;case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Ga;break;case oe.AlgorithmNamespaces.XmlDsigXPathTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigXsltTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new zi;break;case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new Ji;break;case oe.AlgorithmNamespaces.XmlDecryptionTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);default:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return Zc.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return Zc.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return Zc.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}),Zc.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Gi;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){Rt.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){Rt.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){ju.set(e,t)}static RegisterTransform(e,t){Wa.set(e,t)}};var sf=Ty(_L(),1);var PL={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var kL={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var LL=class{static{u(this,"Xml2JsToolkit")}xml2js;constructor(e=wQ){this.xml2js=e,H4({XMLSerializer:sf.default.XMLSerializer,DOMParser:sf.default.DOMParser,DOMImplementation:sf.default.DOMImplementation})}async validate(e,t){if(!e||e.trim().length===0)return rr(new Mt("Please provide a valid xml content"));if(!t||t.trim().length===0)return rr(new Mt("Please provide a valid existing xsd path"));try{return await mP.validate(e,t),Hr()}catch(n){return cs(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...kL,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...PL,...t}).buildObject(e))}digest(e,t,n=z0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=z0){let n=new sf.default.DOMParser().parseFromString(this.clear(e),"application/xml");return new Xi(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t).item(0);return i?this.clear(this.serializeXml(i)):null}getFirstNode(e){let t=this.parseXml(e),s=this.getDocumentElement(t).firstChild;return s?this.clear(this.serializeXml(s)):null}getAttribute(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getAttribute(t)}appendNode(e,t){let n=this.parseXml(e),s=this.getDocumentElement(n),i=this.getDocumentElement(this.parseXml(t));return s.appendChild(i),this.clear(this.serializeXml(n))}insertBefore(e,t,n){let s=this.parseXml(e),a=this.getDocumentElement(s).getElementsByTagName(t).item(0);if(!a?.parentNode)throw new Mt(`No element found with tag "${t}" to insert before`);let o=this.getDocumentElement(this.parseXml(n));return a.parentNode.insertBefore(o,a),this.clear(this.serializeXml(s))}hash(e,t){return EQ.createHash(t).update(e,"utf8").digest().toString("base64")}parseXml(e){return new sf.default.DOMParser().parseFromString(e,"application/xml")}getDocumentElement(e){if(!e.documentElement)throw new Mt("Invalid xml provided. Missing root element.");return e.documentElement}serializeXml(e){return new sf.default.XMLSerializer().serializeToString(e)}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"))}};import{registerDecorator as SQ}from"class-validator";var VL=u(r=>(e,t)=>{SQ({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof pf?!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 FL}from"class-validator";var G0=Symbol("choice"),$0=u(r=>r==null||r==="","isEmpty"),Cme=u(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(G0,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(G0,i,e);for(let o of t)FL({name:"choice",target:e,propertyName:o,options:s,validator:{validate(l,c){let f=c.object,p=c.property,d=Reflect.getMetadata(G0,e);if(!d)return!0;let g=d.find(m=>m.properties.includes(p));if(!g||$0(l))return!0;for(let m of g.properties){if(m===p)continue;let v=f[m];if(!$0(v))return!1}for(let m of d)if(m!==g)for(let v of m.properties){let y=f[v];if(!$0(y))return!1}return!0},defaultMessage(l){let c=Reflect.getMetadata(G0,e);if(!c)return`${l.property} validation error`;let f=c.find(d=>d.properties.includes(l.property));if(!f)return`${l.property} validation error`;let p=l.object;for(let d of f.properties){let g=p[d];if(!$0(g)&&d!==l.property)return`${l.property} cannot be set because ${d} is already set. Only one property from this choice group is allowed.`}for(let d of c)if(d!==f)for(let g of d.properties){let m=p[g];if(!$0(m))return`${l.property} cannot be set because ${g} from a different choice group is already set.`}return`${l.property} validation error`}}});if(n)for(let o of t)FL({name:"choiceGroupRequired",target:e,propertyName:o,options:{...s,always:!0},validator:{validate(l,c){let f=c.object,p=Reflect.getMetadata(G0,e);if(!p)return!0;let d=p.find(g=>g.properties.includes(c.property));if(!d?.required)return!0;for(let g of d.properties){let m=f[g];if(!$0(m))return!0}return c.property!==d.properties[0]},defaultMessage(l){let c=Reflect.getMetadata(G0,e);if(!c)return"At least one property from a choice group must be provided";let f=c.find(p=>p.properties.includes(l.property));return f?`You must provide a value for one of the following properties: ${f.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as AQ}from"class-transformer";var Bme=u(({fixed:r,...e}={fixed:2})=>(t,n)=>{VL(e)(t,n),AQ(({value:s})=>pf.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as CQ}from"class-transformer";import{IsDateString as xQ}from"class-validator";var Lme=u((r={})=>(e,t)=>{CQ(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?Of(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),xQ()(e,t)},"TransformDateString");var UL=class{static{u(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((m,v,y)=>m+v*a[y],0)%11,c=l===0||l===1?0:11-l,f=[5,4,3,2,9,8,7,6,5,4,3,2],d=[...n,c].reduce((m,v,y)=>m+v*f[y],0)%11,g=d===0||d===1?0:11-d;return s===c&&i===g}};var ML=class{static{u(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 jL=class{static{u(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 qL=class{static{u(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 o=[9,8,7,6,5,4,3,2],l=i;for(let p=0;p<8;p++)l+=parseInt(t[p],10)*o[p];let f=11-l%11;return f===10?f=0:f===11&&(f=a),f===parseInt(t[8],10)}};var HL=class{static{u(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(v=>parseInt(v,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 v=0;v<i.length;v++)a+=n[v]*i[v];let o=a%s,l=s-o;(s===11&&o<=1||s===10&&o===0)&&(l=0);let f=(t.slice(0,t.length-2)+l.toString()).split("").map(v=>parseInt(v,10)),p=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],d=0;for(let v=0;v<p.length;v++)d+=f[v]*p[v];let g=d%s,m=s-g;return(s===11&&g<=1||s===10&&g===0)&&(m=0),m===n[t.length-2]&&l===n[t.length-1]}};var KL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var XL=class{static{u(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 p=10,d=0;p>=0;p--,d=(d+1)%i.length)a+=n[p]*i[d];let o=11-a%11;(o===10||o===11)&&(o=0);let l=n.concat([o]),c=0;for(let p=11,d=0;p>=0;p--,d=(d+1)%i.length)c+=l[p]*i[d];let f=11-c%11;return(f===10||f===11)&&(f=0),o===s[0]&&f===s[1]}};var GL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var $L=class{static{u(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 WL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var zL=class{static{u(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 g=0;g<12;g++){let m=g%2===0?1:2,v=(parseInt(s[g])*m).toString();i+=v.split("").reduce((y,S)=>y+parseInt(S),0)}let o=Math.ceil(i/10)*10-i,l=n+o.toString(),c=[3,2,11,10,9,8,7,6,5,4,3,2],f=0;for(let g=0;g<12;g++)f+=parseInt(l[g])*c[g];let p=f%11,d=p<2?0:11-p;return parseInt(t[11])===o&&parseInt(t[12])===d}};var JL=class{static{u(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 YL=class{static{u(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 o=0;o<10;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var QL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var ZL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var eV=class{static{u(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 g=0;g<7;g++)i+=n[g]*s[g];let a=i%11,o=a===0||a===1?0:11-a,l=[...n,o],c=[9,8,7,6,5,4,3,2],f=0;for(let g=0;g<8;g++)f+=l[g]*c[g];let p=f%11,d=p===0||p===1?0:11-p;return o===parseInt(t[7])&&d===parseInt(t[8])}};var tV=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var rV=class{static{u(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 p=0;p<8;p++)a+=n[p]*s[p];let o=11-a%11;o>=10&&(o=0);let l=[...n,o],c=0;for(let p=0;p<9;p++)c+=l[p]*i[p];let f=11-c%11;return f>=10&&(f=0),o===parseInt(t[8])&&f===parseInt(t[9])}};var nV=class{static{u(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 o=0;o<7;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var sV=class{static{u(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 c=0;c<n.length;c++)i+=s[c]*n[c];let o=i*10%11;return(o===10?0:o)===parseInt(t[t.length-1])}};var iV=class{static{u(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 o=11-i%11;return(o===10||o===11)&&(o-=10),o===parseInt(t[t.length-1])}};var aV=class{static{u(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 oV=class{static{u(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 uV=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var lV=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var cV=class{static{u(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 f=0;f<8;f++)i+=n[f]*s[f];let a=i%11%10,o=[3,2,10,9,8,7,6,5,4,3,2],l=0;for(let f=0;f<11;f++)l+=n[f]*o[f];let c=l%11%10;return a===n[8]&&c===n[11]}};var fV=class{static{u(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 c=0;c<i.length;c++)a+=s[c]*i[c];let o=a%11;return(o<2?0:11-o)===parseInt(t[10])}};export{yo as ASN1,gI as CanonicalizationMethod,Cme as Choice,pf as Decimal,fA as DigestAlgorithm,vI as EntitySigner,IQ as Environment,VL as IsDecimal,pA as Left,FI as MemoryCacheAdapter,Mt as NFeTsError,cR as NativeCertificateRepository,vv as NullCacheAdapter,VI as PdfkitPdfBuilder,By as Right,eo as SignatureAlgorithm,cA as SignatureMethod,lA as SignatureNamespace,lf as Signer,bZ as SkipAllValidations,xZ as SkipValidation,J0 as SkipValidationMetadata,pP as SoapRemoteTransmissionRepository,NQ as StateAcronyms,UL as StateCodeAcValidator,ML as StateCodeAlValidator,jL as StateCodeAmValidator,qL as StateCodeApValidator,HL as StateCodeBaValidator,KL as StateCodeCeValidator,XL as StateCodeDfValidator,GL as StateCodeEsValidator,$L as StateCodeGoValidator,WL as StateCodeMaValidator,zL as StateCodeMgValidator,JL as StateCodeMsValidator,YL as StateCodeMtValidator,QL as StateCodePaValidator,ZL as StateCodePbValidator,eV as StateCodePeValidator,tV as StateCodePiValidator,rV as StateCodePrValidator,nV as StateCodeRjValidator,sV as StateCodeRnValidator,iV as StateCodeRoValidator,aV as StateCodeRrValidator,oV as StateCodeRsValidator,uV as StateCodeScValidator,lV as StateCodeSeValidator,cV as StateCodeSpValidator,fV as StateCodeToValidator,Qt as StateCodes,Lme as TransformDateString,Bme as TransformDecimal,Dy as TransmissionError,W0 as TransmissionHostNotFoundError,uf as TransmissionTimeoutError,SI as ValidateErrorsMetadata,kZ as Validates,yI as ValidationError,LL as Xml2JsToolkit,EI as XmlSigner,Ry as clearEmptyValues,Of as dateToolkit,DG as fixUtf8Mojibake,rr as left,cs as leftFromError,fP as leftFromTransmissionError,AI as mapConstraintsToErrors,TG as mapTransmissionError,hP as normalizeTransmissionStrings,wI as plainToInstance,Hr as right,SC as search,SV as timezones,hA as unreachable};
95
+ `&&t===gt.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case gt.Text:case gt.CDATA:case gt.SignificantWhitespace:case gt.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 EJ(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}u(EJ,"XmlDsigC14NTransformNamespacesComparer");function wJ(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}u(wJ,"XmlDsigC14NTransformAttributesComparer");function S5(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(!GT(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===gt.Element){let a=S5(s,e,t);if(s.nodeType===gt.Element&&a)return++t+a}return t}u(S5,"IsNamespaceUsed");function GT(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===gt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}u(GT,"IsNamespaceNode");var jS=class extends Ms{static{u(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element||n.nodeName===oe.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case oe.ElementNames.RSAPSSParams:s=pi;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};jS=Oe([yt({localName:"Other"})],jS);var Gi=class extends Sr{static{u(this,"SignatureMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:""}),ze("design:type",String)],Gi.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.HMACOutputLength,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Wd}),ze("design:type",Number)],Gi.prototype,"HMACOutputLength",void 0);Oe([Nt({parser:jS,noRoot:!0,minOccurs:0}),ze("design:type",jS)],Gi.prototype,"Any",void 0);Gi=Oe([yt({localName:oe.ElementNames.SignatureMethod})],Gi);var g0=class extends Sr{static{u(this,"CanonicalizationMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:oe.DefaultCanonMethod}),ze("design:type",String)],g0.prototype,"Algorithm",void 0);g0=Oe([yt({localName:oe.ElementNames.CanonicalizationMethod})],g0);var y0=class extends Sr{static{u(this,"DataObject")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],y0.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.MimeType,defaultValue:""}),ze("design:type",String)],y0.prototype,"MimeType",void 0);Oe([pr({localName:oe.AttributeNames.Encoding,defaultValue:""}),ze("design:type",String)],y0.prototype,"Encoding",void 0);y0=Oe([yt({localName:oe.ElementNames.Object})],y0);var sy=class extends Ms{static{u(this,"DataObjects")}};sy=Oe([yt({localName:"xmldsig_objects",parser:y0})],sy);var Bn=class extends Sr{static{u(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new De(ye.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new De(ye.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};Oe([pr({localName:oe.AttributeNames.Algorithm,defaultValue:""}),ze("design:type",String)],Bn.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.XPath,defaultValue:""}),ze("design:type",String)],Bn.prototype,"XPath",void 0);Bn=Oe([yt({localName:oe.ElementNames.Transform})],Bn);var Xa=class extends Bn{static{u(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return zt.FromString(this.innerXml.textContent||"","base64")}};var $i=class extends Bn{static{u(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Xi(!1,!1)}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Wi=class extends $i{static{u(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Xi(!0,!1)}};var Ga=class extends Bn{static{u(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)ps(e)&&e.localName===oe.ElementNames.Signature&&e.namespaceURI===oe.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var zi=class extends Bn{static{u(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Xi(!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 De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},Ji=class extends zi{static{u(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Xi(!0,!0)}};function A5(r){return r.parentNode?A5(r.parentNode):r}u(A5,"lookupParentNode");var v0=class extends Bn{static{u(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");this.Filter(A5(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:eh("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})`,o=typeof self>"u"?eh("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:u(c=>i.lookupNamespaceURI(c),"lookupNamespaceURI")},o.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};Oe([Nt({localName:oe.ElementNames.XPath,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],v0.prototype,"XPath",void 0);var E0=class extends Ms{static{u(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return zc(t,Ga);case oe.AlgorithmNamespaces.XmlDsigC14NTransform:return zc(t,$i);case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return zc(t,Wi);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:return zc(t,zi);case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return zc(t,Ji);case oe.AlgorithmNamespaces.XmlDsigBase64Transform:return zc(t,Xa);case oe.AlgorithmNamespaces.XmlDsigXPathTransform:return zc(t,v0);default:try{let n=iy.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new De(ye.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};E0=Oe([yt({localName:oe.ElementNames.Transforms,parser:Bn})],E0);function zc(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}u(zc,"ChangeTransform");var Yi=class extends Sr{static{u(this,"Reference")}constructor(e){super(),this.DigestMethod=new js,e&&(this.Uri=e)}};Oe([pr({defaultValue:""}),ze("design:type",String)],Yi.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.URI}),ze("design:type",String)],Yi.prototype,"Uri",void 0);Oe([pr({localName:oe.AttributeNames.Type,defaultValue:""}),ze("design:type",String)],Yi.prototype,"Type",void 0);Oe([Nt({parser:E0}),ze("design:type",E0)],Yi.prototype,"Transforms",void 0);Oe([Nt({required:!0,parser:js}),ze("design:type",js)],Yi.prototype,"DigestMethod",void 0);Oe([Nt({required:!0,localName:oe.ElementNames.DigestValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Os}),ze("design:type",Uint8Array)],Yi.prototype,"DigestValue",void 0);Yi=Oe([yt({localName:oe.ElementNames.Reference}),ze("design:paramtypes",[String])],Yi);var w0=class extends Ms{static{u(this,"References")}};w0=Oe([yt({localName:"References",parser:Yi})],w0);var $a=class extends Sr{static{u(this,"SignedInfo")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],$a.prototype,"Id",void 0);Oe([Nt({parser:g0,required:!0}),ze("design:type",g0)],$a.prototype,"CanonicalizationMethod",void 0);Oe([Nt({parser:Gi,required:!0}),ze("design:type",Gi)],$a.prototype,"SignatureMethod",void 0);Oe([Nt({parser:w0,minOccurs:1,noRoot:!0}),ze("design:type",w0)],$a.prototype,"References",void 0);$a=Oe([yt({localName:oe.ElementNames.SignedInfo})],$a);var x0="http://www.w3.org/2001/04/xmldsig-more#",b0="ecdsa",Jc=class extends Yn{static{u(this,"EcdsaPublicKey")}};Oe([Nt({localName:oe.ElementNames.X,namespaceURI:x0,prefix:b0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"X",void 0);Oe([Nt({localName:oe.ElementNames.Y,namespaceURI:x0,prefix:b0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"Y",void 0);Jc=Oe([yt({localName:oe.ElementNames.PublicKey,namespaceURI:x0,prefix:b0})],Jc);var S0=class extends Yn{static{u(this,"NamedCurve")}};Oe([pr({localName:oe.AttributeNames.URI,required:!0}),ze("design:type",String)],S0.prototype,"Uri",void 0);S0=Oe([yt({localName:oe.ElementNames.NamedCurve,namespaceURI:x0,prefix:b0})],S0);var A0=class extends Yn{static{u(this,"DomainParameters")}};Oe([Nt({parser:S0}),ze("design:type",S0)],A0.prototype,"NamedCurve",void 0);A0=Oe([yt({localName:oe.ElementNames.DomainParameters,namespaceURI:x0,prefix:b0})],A0);var C0=class extends ys{static{u(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=oe.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Ha.toUpperCase()}get NamedCurve(){return x5(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new De(ye.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await qr.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new Jc,this.PublicKey.X=zt.FromString(t.x||"","base64url"),this.PublicKey.Y=zt.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new A0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new S0),this.DomainParameters.NamedCurve.Uri=x5(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=zt.ToBase64Url(this.PublicKey.X),n=zt.ToBase64Url(this.PublicKey.Y),s=SJ(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await qr.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};Oe([Nt({parser:A0}),ze("design:type",A0)],C0.prototype,"DomainParameters",void 0);Oe([Nt({parser:Jc,required:!0}),ze("design:type",Jc)],C0.prototype,"PublicKey",void 0);C0=Oe([yt({localName:oe.ElementNames.ECDSAKeyValue,namespaceURI:x0,prefix:b0})],C0);function x5(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 De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve")}u(x5,"GetNamedCurveOid");function SJ(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 De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}u(SJ,"GetNamedCurveFromOid");var AJ=class extends Map{static{u(this,"KeyInfoClauseRegistry")}},ju=new AJ;ju.set(oe.ElementNames.RSAKeyValue,p0);ju.set(oe.ElementNames.ECDSAKeyValue,C0);var qS=class{static{u(this,"KeyInfoClauseFactory")}static create(e){let t=ju.get(e);if(!t)throw new De(ye.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var ay=class extends ys{static{u(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 ju)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new De(ye.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new De(ye.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(ps(n))try{let s=n.localName,i=qS.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new De(ye.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};ay=Oe([yt({localName:oe.ElementNames.KeyValue}),ze("design:paramtypes",[ys])],ay);var CJ={"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"}},N0=class{static{u(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 qr.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()===Ha){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=CJ[i.toString()],o=a?a.short:null;n.push(`${o||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Ar(this.raw.buffer);this.simpl=new Dn({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var HS=class extends Sr{static{u(this,"X509IssuerSerial")}};Oe([Nt({localName:oe.ElementNames.X509IssuerName,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509IssuerName",void 0);Oe([Nt({localName:oe.ElementNames.X509SerialNumber,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509SerialNumber",void 0);HS=Oe([yt({localName:oe.ElementNames.X509IssuerSerial})],HS);var Yc;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(Yc||(Yc={}));var T0=class extends ys{static{u(this,"KeyInfoX509Data")}constructor(e,t=Yc.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new N0(e));else if(e instanceof N0)switch(t){case Yc.None:case Yc.EndCertOnly:this.AddCertificate(e);break;case Yc.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case Yc.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new De(ye.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new De(ye.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 De(ye.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new De(ye.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=zt.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(oe.NamespaceURI,n+oe.ElementNames.X509IssuerSerial),a=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let o=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SerialNumber);o.textContent=s.serialNumber,i.appendChild(o),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SKI);i.textContent=zt.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509Certificate);i.textContent=zt.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509CRL);s.textContent=zt.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(oe.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Sr.GetChild(s,oe.ElementNames.X509IssuerName,oe.NamespaceURI,!0),a=Sr.GetChild(s,oe.ElementNames.X509SerialNumber,oe.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(oe.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(oe.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(oe.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddCertificate(new N0(i))}});let n=this.GetChild(oe.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=zt.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};T0=Oe([yt({localName:oe.ElementNames.X509Data}),ze("design:paramtypes",[Object,Object])],T0);var oy=class extends ys{static{u(this,"SPKIData")}async importKey(e){let t=await qr.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 qr.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};Oe([Nt({localName:oe.ElementNames.SPKIexp,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os}),ze("design:type",Object)],oy.prototype,"SPKIexp",void 0);oy=Oe([yt({localName:oe.ElementNames.SPKIData})],oy);var Qc=class extends Ms{static{u(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element)continue;let s=null;switch(n.localName){case oe.ElementNames.KeyValue:s=ay;break;case oe.ElementNames.X509Data:s=T0;break;case oe.ElementNames.SPKIData:s=oy;break;case oe.ElementNames.KeyName:case oe.ElementNames.RetrievalMethod:case oe.ElementNames.PGPData:case oe.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],Qc.prototype,"Id",void 0);Qc=Oe([yt({localName:oe.ElementNames.KeyInfo})],Qc);var qu=class extends Sr{static{u(this,"Signature")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],qu.prototype,"Id",void 0);Oe([Nt({parser:$a,required:!0}),ze("design:type",$a)],qu.prototype,"SignedInfo",void 0);Oe([Nt({localName:oe.ElementNames.SignatureValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os,defaultValue:null}),ze("design:type",Object)],qu.prototype,"SignatureValue",void 0);Oe([Nt({parser:Qc}),ze("design:type",Qc)],qu.prototype,"KeyInfo",void 0);Oe([Nt({parser:sy,noRoot:!0}),ze("design:type",sy)],qu.prototype,"ObjectList",void 0);qu=Oe([yt({localName:oe.ElementNames.Signature})],qu);var bJ=class extends Map{static{u(this,"AlgorithmRegistry")}},Rt=new bJ;Rt.set(RS,{type:"signature",algorithm:l0});Rt.set(OS,{type:"signature",algorithm:c0});Rt.set(_S,{type:"signature",algorithm:f0});Rt.set(PS,{type:"signature",algorithm:h0});Rt.set(RS,{type:"signature",algorithm:l0});Rt.set(OS,{type:"signature",algorithm:c0});Rt.set(_S,{type:"signature",algorithm:f0});Rt.set(PS,{type:"signature",algorithm:h0});Rt.set(jT,{type:"signature",algorithm:LS});Rt.set(qT,{type:"signature",algorithm:VS});Rt.set(HT,{type:"signature",algorithm:FS});Rt.set(KT,{type:"signature",algorithm:US});Rt.set(XT,{type:"signature",algorithm:MS});Rt.set(bS,{type:"signature",algorithm:s0});Rt.set(NS,{type:"signature",algorithm:i0});Rt.set(TS,{type:"signature",algorithm:a0});Rt.set(IS,{type:"signature",algorithm:o0});Rt.set(bS.toUpperCase(),{type:"signature",algorithm:s0});Rt.set(NS.toUpperCase(),{type:"signature",algorithm:i0});Rt.set(TS.toUpperCase(),{type:"signature",algorithm:a0});Rt.set(IS.toUpperCase(),{type:"signature",algorithm:o0});Rt.set(kT,{type:"signature",algorithm:ey});Rt.set(LT,{type:"signature",algorithm:ty});Rt.set(VT,{type:"signature",algorithm:ry});Rt.set(FT,{type:"signature",algorithm:ny});Rt.set(e0,{type:"hash",algorithm:AS});Rt.set(t0,{type:"hash",algorithm:Z1});Rt.set(r0,{type:"hash",algorithm:CS});Rt.set(n0,{type:"hash",algorithm:xS});var Zc=class{static{u(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="hash"&&t===e)return new s;throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}};var NJ=class extends Map{static{u(this,"TransformRegistry")}},Wa=new NJ;Wa.set(oe.AlgorithmNamespaces.XmlDsigBase64Transform,Xa);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NTransform,$i);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Wi);Wa.set(oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Ga);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NTransform,zi);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,Ji);var iy=class{static{u(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new De(ye.PARAM_REQUIRED,"name");let t=Wa.get(e);if(t)return new t;let n;switch(e){case oe.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Xa;break;case oe.AlgorithmNamespaces.XmlDsigC14NTransform:n=new $i;break;case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Wi;break;case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Ga;break;case oe.AlgorithmNamespaces.XmlDsigXPathTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigXsltTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new zi;break;case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new Ji;break;case oe.AlgorithmNamespaces.XmlDecryptionTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);default:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return Zc.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return Zc.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return Zc.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}),Zc.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Gi;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){Rt.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){Rt.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){ju.set(e,t)}static RegisterTransform(e,t){Wa.set(e,t)}};var sf=Ty(_L(),1);var PL={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var kL={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var LL=class{static{u(this,"Xml2JsToolkit")}xml2js;constructor(e=wQ){this.xml2js=e,H4({XMLSerializer:sf.default.XMLSerializer,DOMParser:sf.default.DOMParser,DOMImplementation:sf.default.DOMImplementation})}async validate(e,t){if(!e||e.trim().length===0)return Zt(new kt("Please provide a valid xml content"));if(!t||t.trim().length===0)return Zt(new kt("Please provide a valid existing xsd path"));try{return await mP.validate(e,t),Hr()}catch(n){return cs(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...kL,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...PL,...t}).buildObject(e))}digest(e,t,n=z0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=z0){let n=new sf.default.DOMParser().parseFromString(this.clear(e),"application/xml");return new Xi(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t).item(0);return i?this.clear(this.serializeXml(i)):null}getFirstNode(e){let t=this.parseXml(e),s=this.getDocumentElement(t).firstChild;return s?this.clear(this.serializeXml(s)):null}getAttribute(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getAttribute(t)}appendNode(e,t){let n=this.parseXml(e),s=this.getDocumentElement(n),i=this.getDocumentElement(this.parseXml(t));return s.appendChild(i),this.clear(this.serializeXml(n))}insertBefore(e,t,n){let s=this.parseXml(e),a=this.getDocumentElement(s).getElementsByTagName(t).item(0);if(!a?.parentNode)throw new kt(`No element found with tag "${t}" to insert before`);let o=this.getDocumentElement(this.parseXml(n));return a.parentNode.insertBefore(o,a),this.clear(this.serializeXml(s))}hash(e,t){return EQ.createHash(t).update(e,"utf8").digest().toString("base64")}parseXml(e){return new sf.default.DOMParser().parseFromString(e,"application/xml")}getDocumentElement(e){if(!e.documentElement)throw new kt("Invalid xml provided. Missing root element.");return e.documentElement}serializeXml(e){return new sf.default.XMLSerializer().serializeToString(e)}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"))}};import{registerDecorator as SQ}from"class-validator";var VL=u(r=>(e,t)=>{SQ({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof pf?!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 FL}from"class-validator";var G0=Symbol("choice"),$0=u(r=>r==null||r==="","isEmpty"),Cme=u(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(G0,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(G0,i,e);for(let o of t)FL({name:"choice",target:e,propertyName:o,options:s,validator:{validate(l,c){let f=c.object,p=c.property,d=Reflect.getMetadata(G0,e);if(!d)return!0;let g=d.find(m=>m.properties.includes(p));if(!g||$0(l))return!0;for(let m of g.properties){if(m===p)continue;let v=f[m];if(!$0(v))return!1}for(let m of d)if(m!==g)for(let v of m.properties){let y=f[v];if(!$0(y))return!1}return!0},defaultMessage(l){let c=Reflect.getMetadata(G0,e);if(!c)return`${l.property} validation error`;let f=c.find(d=>d.properties.includes(l.property));if(!f)return`${l.property} validation error`;let p=l.object;for(let d of f.properties){let g=p[d];if(!$0(g)&&d!==l.property)return`${l.property} cannot be set because ${d} is already set. Only one property from this choice group is allowed.`}for(let d of c)if(d!==f)for(let g of d.properties){let m=p[g];if(!$0(m))return`${l.property} cannot be set because ${g} from a different choice group is already set.`}return`${l.property} validation error`}}});if(n)for(let o of t)FL({name:"choiceGroupRequired",target:e,propertyName:o,options:{...s,always:!0},validator:{validate(l,c){let f=c.object,p=Reflect.getMetadata(G0,e);if(!p)return!0;let d=p.find(g=>g.properties.includes(c.property));if(!d?.required)return!0;for(let g of d.properties){let m=f[g];if(!$0(m))return!0}return c.property!==d.properties[0]},defaultMessage(l){let c=Reflect.getMetadata(G0,e);if(!c)return"At least one property from a choice group must be provided";let f=c.find(p=>p.properties.includes(l.property));return f?`You must provide a value for one of the following properties: ${f.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as AQ}from"class-transformer";var Bme=u(({fixed:r,...e}={fixed:2})=>(t,n)=>{VL(e)(t,n),AQ(({value:s})=>pf.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as CQ}from"class-transformer";import{IsDateString as xQ}from"class-validator";var Lme=u((r={})=>(e,t)=>{CQ(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?Of(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),xQ()(e,t)},"TransformDateString");var UL=class{static{u(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((m,v,y)=>m+v*a[y],0)%11,c=l===0||l===1?0:11-l,f=[5,4,3,2,9,8,7,6,5,4,3,2],d=[...n,c].reduce((m,v,y)=>m+v*f[y],0)%11,g=d===0||d===1?0:11-d;return s===c&&i===g}};var ML=class{static{u(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 jL=class{static{u(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 qL=class{static{u(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 o=[9,8,7,6,5,4,3,2],l=i;for(let p=0;p<8;p++)l+=parseInt(t[p],10)*o[p];let f=11-l%11;return f===10?f=0:f===11&&(f=a),f===parseInt(t[8],10)}};var HL=class{static{u(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(v=>parseInt(v,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 v=0;v<i.length;v++)a+=n[v]*i[v];let o=a%s,l=s-o;(s===11&&o<=1||s===10&&o===0)&&(l=0);let f=(t.slice(0,t.length-2)+l.toString()).split("").map(v=>parseInt(v,10)),p=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],d=0;for(let v=0;v<p.length;v++)d+=f[v]*p[v];let g=d%s,m=s-g;return(s===11&&g<=1||s===10&&g===0)&&(m=0),m===n[t.length-2]&&l===n[t.length-1]}};var KL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var XL=class{static{u(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 p=10,d=0;p>=0;p--,d=(d+1)%i.length)a+=n[p]*i[d];let o=11-a%11;(o===10||o===11)&&(o=0);let l=n.concat([o]),c=0;for(let p=11,d=0;p>=0;p--,d=(d+1)%i.length)c+=l[p]*i[d];let f=11-c%11;return(f===10||f===11)&&(f=0),o===s[0]&&f===s[1]}};var GL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var $L=class{static{u(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 WL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var zL=class{static{u(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 g=0;g<12;g++){let m=g%2===0?1:2,v=(parseInt(s[g])*m).toString();i+=v.split("").reduce((y,S)=>y+parseInt(S),0)}let o=Math.ceil(i/10)*10-i,l=n+o.toString(),c=[3,2,11,10,9,8,7,6,5,4,3,2],f=0;for(let g=0;g<12;g++)f+=parseInt(l[g])*c[g];let p=f%11,d=p<2?0:11-p;return parseInt(t[11])===o&&parseInt(t[12])===d}};var JL=class{static{u(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 YL=class{static{u(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 o=0;o<10;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var QL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var ZL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var eV=class{static{u(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 g=0;g<7;g++)i+=n[g]*s[g];let a=i%11,o=a===0||a===1?0:11-a,l=[...n,o],c=[9,8,7,6,5,4,3,2],f=0;for(let g=0;g<8;g++)f+=l[g]*c[g];let p=f%11,d=p===0||p===1?0:11-p;return o===parseInt(t[7])&&d===parseInt(t[8])}};var tV=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var rV=class{static{u(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 p=0;p<8;p++)a+=n[p]*s[p];let o=11-a%11;o>=10&&(o=0);let l=[...n,o],c=0;for(let p=0;p<9;p++)c+=l[p]*i[p];let f=11-c%11;return f>=10&&(f=0),o===parseInt(t[8])&&f===parseInt(t[9])}};var nV=class{static{u(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 o=0;o<7;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var sV=class{static{u(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 c=0;c<n.length;c++)i+=s[c]*n[c];let o=i*10%11;return(o===10?0:o)===parseInt(t[t.length-1])}};var iV=class{static{u(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 o=11-i%11;return(o===10||o===11)&&(o-=10),o===parseInt(t[t.length-1])}};var aV=class{static{u(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 oV=class{static{u(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 uV=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var lV=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var cV=class{static{u(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 f=0;f<8;f++)i+=n[f]*s[f];let a=i%11%10,o=[3,2,10,9,8,7,6,5,4,3,2],l=0;for(let f=0;f<11;f++)l+=n[f]*o[f];let c=l%11%10;return a===n[8]&&c===n[11]}};var fV=class{static{u(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 c=0;c<i.length;c++)a+=s[c]*i[c];let o=a%11;return(o<2?0:11-o)===parseInt(t[10])}};export{yo as ASN1,gI as CanonicalizationMethod,Cme as Choice,pf as Decimal,fA as DigestAlgorithm,vI as EntitySigner,IQ as Environment,VL as IsDecimal,pA as Left,FI as MemoryCacheAdapter,kt as NFeTsError,cR as NativeCertificateRepository,vv as NullCacheAdapter,VI as PdfkitPdfBuilder,By as Right,eo as SignatureAlgorithm,cA as SignatureMethod,lA as SignatureNamespace,lf as Signer,bZ as SkipAllValidations,xZ as SkipValidation,J0 as SkipValidationMetadata,pP as SoapRemoteTransmissionRepository,NQ as StateAcronyms,UL as StateCodeAcValidator,ML as StateCodeAlValidator,jL as StateCodeAmValidator,qL as StateCodeApValidator,HL as StateCodeBaValidator,KL as StateCodeCeValidator,XL as StateCodeDfValidator,GL as StateCodeEsValidator,$L as StateCodeGoValidator,WL as StateCodeMaValidator,zL as StateCodeMgValidator,JL as StateCodeMsValidator,YL as StateCodeMtValidator,QL as StateCodePaValidator,ZL as StateCodePbValidator,eV as StateCodePeValidator,tV as StateCodePiValidator,rV as StateCodePrValidator,nV as StateCodeRjValidator,sV as StateCodeRnValidator,iV as StateCodeRoValidator,aV as StateCodeRrValidator,oV as StateCodeRsValidator,uV as StateCodeScValidator,lV as StateCodeSeValidator,cV as StateCodeSpValidator,fV as StateCodeToValidator,Qt as StateCodes,Lme as TransformDateString,Bme as TransformDecimal,Dy as TransmissionError,W0 as TransmissionHostNotFoundError,uf as TransmissionTimeoutError,SI as ValidateErrorsMetadata,kZ as Validates,yI as ValidationError,LL as Xml2JsToolkit,EI as XmlSigner,Ry as clearEmptyValues,Of as dateToolkit,DG as fixUtf8Mojibake,Zt as left,cs as leftFromError,fP as leftFromTransmissionError,AI as mapConstraintsToErrors,TG as mapTransmissionError,hP as normalizeTransmissionStrings,wI as plainToInstance,Hr as right,SC as search,SV as timezones,hA as unreachable};
97
97
  /*! Bundled license information:
98
98
 
99
99
  axios/dist/node/axios.cjs: