PageSourceSearch

https://azal.ai/_next/static/chunks/4134.703e3a19772c5556.js

js azal.ai collected 2026-10-05 11:54:16 UTC 246,228 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4134],{4134:(e,t,r)=>{"use strict";r.d(t,{compressRawPublicKey:()=>rs,encryptOtpCodeToBundle:()=>rd,g8:()=>rf,toDerSignature:()=>rh});var i,n,o,s,a,l,u,c,f,h,p,g,d,y,v,m,b,w,A,S,C,B,x,E,k,O,I,N,U,T,j,_,R,P,H,L,V,D,$,M,F,z,q,K,W,G,J,Z,Y,X,Q,ee,et,er,ei,en,eo,es,ea,el={};r.r(el),r.d(el,{Any:()=>iL,BaseBlock:()=>r$,BaseStringBlock:()=>rM,BitString:()=>r9,BmpString:()=>ib,Boolean:()=>r3,CharacterString:()=>iN,Choice:()=>iV,Constructed:()=>rQ,DATE:()=>ij,DEFAULT_MAX_CONTENT_LENGTH:()=>rW,DEFAULT_MAX_DEPTH:()=>rq,DEFAULT_MAX_NODES:()=>rK,DateTime:()=>iR,Duration:()=>iP,EndOfContent:()=>r1,Enumerated:()=>ir,GeneralString:()=>iI,GeneralizedTime:()=>iT,GraphicString:()=>ik,HexBlock:()=>rR,IA5String:()=>iE,Integer:()=>it,Null:()=>r2,NumericString:()=>iS,ObjectIdentifier:()=>is,OctetString:()=>r6,Primitive:()=>rz,PrintableString:()=>iC,RawData:()=>i$,RelativeObjectIdentifier:()=>iu,Repeated:()=>iD,Sequence:()=>ic,Set:()=>ih,TIME:()=>iH,TeletexString:()=>iB,TimeOfDay:()=>i_,UTCTime:()=>iU,UniversalString:()=>iA,Utf8String:()=>iv,ValueBlock:()=>rH,VideotexString:()=>ix,ViewWriter:()=>rx,VisibleString:()=>iO,compareSchema:()=>iM,fromBER:()=>rY,verifySchema:()=>iF});var eu=r(34918),ec=r(51607),ef=r(458);let eh=BigInt(0),ep=BigInt(1);function eg(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function ed(e){if(!eg(e))throw Error("Uint8Array expected")}function ey(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function ev(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function em(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?eh:BigInt("0x"+e)}let eb="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,ew=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function eA(e){if(ed(e),eb)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=ew[e[r]];return t}let eS={_0:48,_9:57,A:65,F:70,a:97,f:102};function eC(e){return e>=eS._0&&e<=eS._9?e-eS._0:e>=eS.A&&e<=eS.F?e-(eS.A-10):e>=eS.a&&e<=eS.f?e-(eS.a-10):void 0}function eB(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(eb)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){let r=eC(e.charCodeAt(n)),o=eC(e.charCodeAt(n+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[n]+e[n+1])+'" at index '+n);i[t]=16*r+o}return i}function ex(e){return em(eA(e))}function eE(e){return ed(e),em(eA(Uint8Array.from(e).reverse()))}function ek(e,t){return eB(e.toString(16).padStart(2*t,"0"))}function eO(e,t){return ek(e,t).reverse()}function eI(e,t,r){let i;if("string"==typeof t)try{i=eB(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(eg(t))i=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let n=i.length;if("number"==typeof r&&n!==r)throw Error(e+" of length "+r+" expected, got "+n);return i}function eN(...e){let t=0;for(let r=0;r<e.length;r++){let i=e[r];ed(i),t+=i.length}let r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){let n=e[t];r.set(n,i),i+=n.length}return r}let eU=e=>"bigint"==typeof e&&eh<=e;function eT(e,t,r){return eU(e)&&eU(t)&&eU(r)&&t<=e&&e<r}function ej(e,t,r,i){if(!eT(t,r,i))throw Error("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}let e_=e=>(ep<<BigInt(e))-ep,eR=e=>new Uint8Array(e),eP=e=>Uint8Array.from(e),eH={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||eg(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function eL(e,t,r={}){let i=(t,r,i)=>{let n=eH[r];if("function"!=typeof n)throw Error("invalid validator function");let o=e[t];if((!i||void 0!==o)&&!n(o,e))throw Error("param "+String(t)+" is invali
1d. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))i(e,r,!1);for(let[e,t]of Object.entries(r))i(e,t,!0);return e}function eV(e){let t=new WeakMap;return(r,...i)=>{let n=t.get(r);if(void 0!==n)return n;let o=e(r,...i);return t.set(r,o),o}}let eD=BigInt(0),e$=BigInt(1),eM=BigInt(2),eF=BigInt(3),ez=BigInt(4),eq=BigInt(5),eK=BigInt(8);function eW(e,t){let r=e%t;return r>=eD?r:t+r}function eG(e,t){if(e===eD)throw Error("invert: expected non-zero number");if(t<=eD)throw Error("invert: expected positive modulus, got "+t);let r=eW(e,t),i=t,n=eD,o=e$,s=e$,a=eD;for(;r!==eD;){let e=i/r,t=i%r,l=n-s*e,u=o-a*e;i=r,r=t,n=s,o=a,s=l,a=u}if(i!==e$)throw Error("invert: does not exist");return eW(n,t)}let eJ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function eZ(e,t,r=!1){let i=Array(t.length).fill(r?e.ZERO:void 0),n=t.reduce((t,r,n)=>e.is0(r)?t:(i[n]=t,e.mul(t,r)),e.ONE),o=e.inv(n);return t.reduceRight((t,r,n)=>e.is0(r)?t:(i[n]=e.mul(t,i[n]),e.mul(t,r)),o),i}function eY(e,t){let r=function(e,t){let r=(e.ORDER-e$)/eM,i=e.pow(t,r),n=e.eql(i,e.ONE),o=e.eql(i,e.ZERO),s=e.eql(i,e.neg(e.ONE));if(!n&&!o&&!s)throw Error("Cannot find square root: probably non-prime P");return n?1:o?0:-1}(e,t);return 0===r||1===r}function eX(e,t){void 0!==t&&(0,ef.Fe)(t);let r=void 0!==t?t:e.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function eQ(e,t,r=!1,i={}){let n;if(e<=eD)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=eX(e,t);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:e_(o),ZERO:eD,ONE:e$,create:t=>eW(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return eD<=t&&t<e},is0:e=>e===eD,isOdd:e=>(e&e$)===e$,neg:t=>eW(-t,e),eql:(e,t)=>e===t,sqr:t=>eW(t*t,e),add:(t,r)=>eW(t+r,e),sub:(t,r)=>eW(t-r,e),mul:(t,r)=>eW(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<eD)throw Error("invalid exponent, negatives unsupported");if(r===eD)return e.ONE;if(r===e$)return t;let i=e.ONE,n=t;for(;r>eD;)r&e$&&(i=e.mul(i,n)),n=e.sqr(n),r>>=e$;return i})(a,e,t),div:(t,r)=>eW(t*eG(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>eG(t,e),sqrt:i.sqrt||(t=>(n||(n=e%ez===eF?function(t,r){let i=t.pow(r,(e+e$)/ez);if(!t.eql(t.sqr(i),r))throw Error("Cannot find square root");return i}:e%eK===eq?function(t,r){let i=t.mul(r,eM),n=t.pow(i,(e-eq)/eK),o=t.mul(r,n),s=t.mul(t.mul(o,eM),n),a=t.mul(o,t.sub(s,t.ONE));if(!t.eql(t.sqr(a),r))throw Error("Cannot find square root");return a}:function(e){let t=e-e$,r=0;for(;t%eM===eD;)t/=eM,r++;let i=eM,n=eQ(e);for(;i<e&&eY(n,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r){let t=(e+e$)/ez;return function(e,r){let i=e.pow(r,t);if(!e.eql(e.sqr(i),r))throw Error("Cannot find square root");return i}}let o=(t+e$)/eM;return function(e,n){if(!eY(e,n))throw Error("Cannot find square root");let s=r,a=e.pow(e.mul(e.ONE,i),t),l=e.pow(n,o),u=e.pow(n,t);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(u);t<s&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(a,e$<<BigInt(s-t-1));a=e.sqr(r),l=e.mul(l,r),u=e.mul(u,a),s=t}return l}}(e)),n(a,t))),toBytes:e=>r?eO(e,s):ek(e,s),fromBytes:e=>{if(e.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?eE(e):ex(e)},invertBatch:e=>eZ(a,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(a)}function e0(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function e1(e){let t=e0(e);return t+Math.ceil(t/2)}let e2=BigInt(0),e8=BigInt(1);function e3(e,t){let r=t.negate();return e?r:t}function e4(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function e6(e,t){e4(e,t);let r=Math.ceil(t/e)+1,i=2**(e-1),n=2**e;return{windows:r,windowSize:i,mask:e_(e),maxNumber:n,shiftBy:BigInt(e)}}function e5(e,t,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:s}=r,a=Number(e&n),l=e>>s;a>i&&(a-=o,l+=e8);let u=t*i,c=u+Math.abs(a)-1,f=0===a;return{nextN:l,offset:c,isZero:f,isNeg:a<0,isNegF:t%2!=0,offsetF:u}}
vendor: 8,463 bytes, line 1
1let e9=new WeakMap,e7=new WeakMap;function te(e){return e7.get(e)||1}function tt(e){return eL(e.Fp,eJ.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),eL(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...eX(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}function tr(e){void 0!==e.lowS&&ey("lowS",e.lowS),void 0!==e.prehash&&ey("prehash",e.prehash)}class ti extends Error{constructor(e=""){super(e)}}let tn={Err:ti,_tlv:{encode:(e,t)=>{let{Err:r}=tn;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let i=t.length/2,n=ev(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?ev(n.length/2|128):"";return ev(e)+o+n+t},decode(e,t){let{Err:r}=tn,i=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");let n=t[i++],o=0;if(128&n){let e=127&n;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let s=t.subarray(i,i+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)o=o<<8|e;if(i+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=n;let s=t.subarray(i,i+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+o)}}},_int:{encode(e){let{Err:t}=tn;if(e<to)throw new t("integer: negative integers are not allowed");let r=ev(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=tn;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return ex(e)}},toSig(e){let{Err:t,_int:r,_tlv:i}=tn,n=eI("signature",e),{v:o,l:s}=i.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:l}=i.decode(2,o),{v:u,l:c}=i.decode(2,l);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=tn,i=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s));return t.encode(48,i+n)}},to=BigInt(0),ts=BigInt(1),ta=(BigInt(2),BigInt(3));function tl(e,t){let r=t=>(function(e){let t=function(e){let t=tt(e);return eL(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:i}=t,n=r.BYTES+1,o=2*r.BYTES+1;function s(e){return eW(e,i)}let{ProjectivePoint:a,normPrivateKeyToScalar:l,weierstrassEquation:u,isWithinCurveOrder:c}=function(e){var t;let r=function(e){let t=tt(e);eL(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:i,a:n}=t;if(r){if(!i.eql(n,i.ZERO))throw Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:i}=r,n=eQ(r.n,r.nBitLength),o=r.toBytes||((e,t,r)=>{let n=t.toAffine();return eN(Uint8Array.from([4]),i.toBytes(n.x),i.toBytes(n.y))}),s=r.fromBytes||(e=>{let t=e.subarray(1);return{x:i.fromBytes(t.subarray(0,i.BYTES)),y:i.fromBytes(t.subarray(i.BYTES,2*i.BYTES))}});function a(e){let{a:t,b:n}=r,o=i.sqr(e),s=i.mul(o,e);return i.add(i.add(s,i.mul(e,t)),n)}if(!i.eql(i.sqr(r.Gy),a(r.Gx)))throw Error("bad generator point: equation left != right");function l(e){let t,{allowedPrivateKeyLengths:i,nByteLength:n,wrapPrivateKey:o,n:s}=r;if(i&&"bigint"!=typeof e){if(eg(e)&&(e=eA(e)),"string"!=typeof e||!i.includes(e.length))throw Error("invalid private key");e=e.padStart(2*n,"0")}try{t="bigint"==typeof e?e:ex(eI("private key",e,n))}catch(t){throw Error("invalid private key, expected hex or "+n+" bytes, got "+typeof e)}return o&&(t=eW(t,s)),ej("private key",t,ts,s),t}function u(e){if(!(e instanceof h))throw Error("ProjectivePoint expected")}let c=eV((e,t)=>{let{px:r,py:n,pz:o}=e;if(i.eql(o,i.ONE))return{x:r,y:n};let s=e.is0();null==t&&(t=s?i.ONE:i.inv(o));let a=i.mul(r,t),l=i.mul(n,t),u=i.mul(o,t);if(s)return{x:i.ZERO,y:i.ZERO};if(!i.eql(u,i.ONE))throw Error("invZ was invalid");return{x:a,y:l}}),f=eV(e=>{if(e.is0()){if(r.allowInfinityPoint&&!i.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:n}=e.toAffine();if(!i.isValid(t)||!i.isValid(n))throw Error("bad point: x or y not FE");let o=i.sqr(n),s=a(t);if(!i.eql(o,s))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class h{constructor(e,t,r){if(null==e||!i.isValid(e))throw Error("x required");if(null==t||!i.isValid(t)||i.is0(t))throw Error("y required");if(null==r||!i.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!i.isValid(t)||!i.isValid(r))throw Error("invalid affine point");if(e instanceof h)throw Error("projective point not allowed");let n=e=>i.eql(e,i.ZERO);return n(t)&&n(r)?h.ZERO:new h(t,r,i.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=eZ(i,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(h.fromAffine)}static fromHex(e){let t=h.fromAffine(s(eI("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return h.BASE.multiply(l(e))}static msm(e,t){return function(e,t,r,i){if(!Array.isArray(r))throw Error("array expected");r.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)});if(!Array.isArray(i))throw Error("array of scalars expected");if(i.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)}),r.length!==i.length)throw Error("arrays of points and scalars must have equal length");let n=e.ZERO,o=function(e){let t;for(t=0;e>eh;e>>=ep,t+=1);return t}(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,a=e_(s),l=Array(Number(a)+1).fill(n),u=Math.floor((t.BITS-1)/s)*s,c=n;for(let e=u;e>=0;e-=s){l.fill(n);for(let t=0;t<i.length;t++){let n=Number(i[t]>>BigInt(e)&a);l[n]=l[n].add(r[t])}let t=n;for(let e=l.length-1,r=n;e>0;e--)r=r.add(l[e]),t=t.add(r);if(c=c.add(t),0!==e)for(let e=0;e<s;e++)c=c.double()}return c}(h,n,e,t)}_setWindowSize(e){g.setWindowSize(this,e)}assertValidity(){f(this)}hasEvenY(){let{y:e}=this.toAffine();if(i.isOdd)return!i.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){u(e);let{px:t,py:r,pz:n}=this,{px:o,py:s,pz:a}=e,l=i.eql(i.mul(t,a),i.mul(o,n)),c=i.eql(i.mul(r,a),i.mul(s,n));return l&&c}negate(){return new h(this.px,i.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,n=i.mul(t,ta),{px:o,py:s,pz:a}=this,l=i.ZERO,u=i.ZERO,c=i.ZERO,f=i.mul(o,o),p=i.mul(s,s),g=i.mul(a,a),d=i.mul(o,s);return d=i.add(d,d),c=i.mul(o,a),c=i.add(c,c),l=i.mul(e,c),u=i.mul(n,g),u=i.add(l,u),l=i.sub(p,u),u=i.add(p,u),u=i.mul(l,u),l=i.mul(d,l),c=i.mul(n,c),g=i.mul(e,g),d=i.sub(f,g),d=i.mul(e,d),d=i.add(d,c),c=i.add(f,f),f=i.add(c,f),f=i.add(f,g),f=i.mul(f,d),u=i.add(u,f),g=i.mul(s,a),g=i.add(g,g),f=i.mul(g,d),l=i.sub(l,f),c=i.mul(g,p),c=i.add(c,c),new h(l,u,c=i.add(c,c))}add(e){u(e);let{px:t,py:n,pz:o}=this,{px:s,py:a,pz:l}=e,c=i.ZERO,f=i.ZERO,p=i.ZERO,g=r.a,d=i.mul(r.b,ta),y=i.mul(t,s),v=i.mul(n,a),m=i.mul(o,l),b=i.add(t,n),w=i.add(s,a);b=i.mul(b,w),w=i.add(y,v),b=i.sub(b,w),w=i.add(t,o);let A=i.add(s,l);return w=i.mul(w,A),A=i.add(y,m),w=i.sub(w,A),A=i.add(n,o),c=i.add(a,l),A=i.mul(A,c),c=i.add(v,m),A=i.sub(A,c),p=i.mul(g,w),c=i.mul(d,m),p=i.add(c,p),c=i.sub(v,p),p=i.add(v,p),f=i.mul(c,p),v=i.add(y,y),v=i.add(v,y),m=i.mul(g,m),w=i.mul(d,w),v=i.add(v,m),m=i.sub(y,m),m=i.mul(g,m),w=i.add(w,m),y=i.mul(v,w),f=i.add(f,y),y=i.mul(A,w),c=i.mul(b,c),c=i.sub(c,y),y=i.mul(b,v),p=i.mul(A,p),new h(c,f,p=i.add(p,y))}subtract(e){return this.add(e.negate())}is0(){return this.equals(h.ZERO)}wNAF(e){return g.wNAFCached(this,e,h.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:n}=r;ej("scalar",e,to,n);let o=h.ZERO;if(e===to)return o;if(this.is0()||e===ts)return this;if(!t||g.hasPrecomputes(this))return g.wNAFCachedUnsafe(this,e,h.normalizeZ);
vendor: 8,120 bytes, line 1
1let{k1neg:s,k1:a,k2neg:l,k2:u}=t.splitScalar(e),c=o,f=o,p=this;for(;a>to||u>to;)a&ts&&(c=c.add(p)),u&ts&&(f=f.add(p)),p=p.double(),a>>=ts,u>>=ts;return s&&(c=c.negate()),l&&(f=f.negate()),f=new h(i.mul(f.px,t.beta),f.py,f.pz),c.add(f)}multiply(e){let t,n,{endo:o,n:s}=r;if(ej("scalar",e,ts,s),o){let{k1neg:r,k1:s,k2neg:a,k2:l}=o.splitScalar(e),{p:u,f:c}=this.wNAF(s),{p:f,f:p}=this.wNAF(l);u=g.constTimeNegate(r,u),f=g.constTimeNegate(a,f),f=new h(i.mul(f.px,o.beta),f.py,f.pz),t=u.add(f),n=c.add(p)}else{let{p:r,f:i}=this.wNAF(e);t=r,n=i}return h.normalizeZ([t,n])[0]}multiplyAndAddUnsafe(e,t,r){let i=h.BASE,n=(e,t)=>t!==to&&t!==ts&&e.equals(i)?e.multiply(t):e.multiplyUnsafe(t),o=n(this,t).add(n(e,r));return o.is0()?void 0:o}toAffine(e){return c(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===ts)return!0;if(t)return t(h,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===ts?this:t?t(h,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return ey("isCompressed",e),this.assertValidity(),o(h,this,e)}toHex(e=!0){return ey("isCompressed",e),eA(this.toRawBytes(e))}}h.BASE=new h(r.Gx,r.Gy,i.ONE),h.ZERO=new h(i.ZERO,i.ONE,i.ZERO);let p=r.nBitLength,g=(t=r.endo?Math.ceil(p/2):p,{constTimeNegate:e3,hasPrecomputes:e=>1!==te(e),unsafeLadder(e,t,r=h.ZERO){let i=e;for(;t>e2;)t&e8&&(r=r.add(i)),i=i.double(),t>>=e8;return r},precomputeWindow(e,r){let{windows:i,windowSize:n}=e6(r,t),o=[],s=e,a=s;for(let e=0;e<i;e++){a=s,o.push(a);for(let e=1;e<n;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,r,i){let n=h.ZERO,o=h.BASE,s=e6(e,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:a,isZero:l,isNeg:u,isNegF:c,offsetF:f}=e5(i,e,s);i=t,l?o=o.add(e3(c,r[f])):n=n.add(e3(u,r[a]))}return{p:n,f:o}},wNAFUnsafe(e,r,i,n=h.ZERO){let o=e6(e,t);for(let e=0;e<o.windows&&i!==e2;e++){let{nextN:t,offset:s,isZero:a,isNeg:l}=e5(i,e,o);if(i=t,!a){let e=r[s];n=n.add(l?e.negate():e)}}return n},getPrecomputes(e,t,r){let i=e9.get(t);return i||(i=this.precomputeWindow(t,e),1!==e&&e9.set(t,r(i))),i},wNAFCached(e,t,r){let i=te(e);return this.wNAF(i,this.getPrecomputes(i,e,r),t)},wNAFCachedUnsafe(e,t,r,i){let n=te(e);return 1===n?this.unsafeLadder(e,t,i):this.wNAFUnsafe(n,this.getPrecomputes(n,e,r),t,i)},setWindowSize(e,r){e4(r,t),e7.set(e,r),e9.delete(e)}});return{CURVE:r,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function(e){return eT(e,ts,r.n)}}}({...t,toBytes(e,t,i){let n=t.toAffine(),o=r.toBytes(n.x);return(ey("isCompressed",i),i)?eN(Uint8Array.from([t.hasEvenY()?2:3]),o):eN(Uint8Array.from([4]),o,r.toBytes(n.y))},fromBytes(e){let t=e.length,i=e[0],s=e.subarray(1);if(t===n&&(2===i||3===i)){let e,t=ex(s);if(!eT(t,ts,r.ORDER))throw Error("Point is not on curve");let n=u(t);try{e=r.sqrt(n)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&i)==1!=((e&ts)===ts)&&(e=r.neg(e)),{x:t,y:e}}if(t===o&&4===i)return{x:r.fromBytes(s.subarray(0,r.BYTES)),y:r.fromBytes(s.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+n+", or uncompressed "+o+", got "+t)}}),f=e=>eA(ek(e,t.nByteLength)),h=(e,t,r)=>ex(e.slice(t,r));class p{constructor(e,t,r){ej("r",e,ts,i),ej("s",t,ts,i),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){let r=t.nByteLength;return new p(h(e=eI("compactSignature",e,2*r),0,r),h(e,r,2*r))}static fromDER(e){let{r:t,s:r}=tn.toSig(eI("DER",e));return new p(t,r)}assertValidity(){}addRecoveryBit(e){return new p(this.r,this.s,e)}recoverPublicKey(e){let{r:n,s:o,recovery:l}=this,u=y(eI("msgHash",e));if(null==l||![0,1,2,3].includes(l))throw Error("recovery id invalid");let c=2===l||3===l?n+t.n:n;if(c>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let h=(1&l)==0?"02":"03",p=a.fromHex(h+f(c)),g=eG(c,i),d=s(-u*g),v=s(o*g),m=a.BASE.multiplyAndAddUnsafe(p,d,v);if(!m)throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>i>>ts}normalizeS(){return this.hasHighS()?new p(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return eB(this.toDERHex())}toDERHex(){return tn.hexFromSig(this)}toCompactRawBytes(){return eB(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}function g(e){let t=eg(e),r="string"==typeof e,i=(t||r)&&e.length;return t?i===n||i===o:r?i===2*n||i===2*o:e instanceof a}let d=t.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let r=ex(e),i=8*e.length-t.nBitLength;return i>0?r>>BigInt(i):r},y=t.bits2int_modN||function(e){return s(d(e))},v=e_(t.nBitLength);function m(e){return ej("num < 2^"+t.nBitLength,e,to,v),ek(e,t.nByteLength)}let b={lowS:t.lowS,prehash:!1},w={lowS:t.lowS,prehash:!1};return a.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return a.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(g(e))throw Error("first arg must be private key");if(!g(t))throw Error("second arg must be public key");return a.fromHex(t).multiply(l(e)).toRawBytes(r)},sign:function(e,n,o=b){let{seed:u,k2sig:f}=function(e,n,o=b){if(["recovered","canonical"].some(e=>e in o))throw Error("sign() legacy options not supported");let{hash:u,randomBytes:f}=t,{lowS:h,prehash:g,extraEntropy:v}=o;null==h&&(h=!0),e=eI("msgHash",e),tr(o),g&&(e=eI("prehashed msgHash",u(e)));let w=y(e),A=l(n),S=[m(A),m(w)];if(null!=v&&!1!==v){let e=!0===v?f(r.BYTES):v;S.push(eI("extraEntropy",e))}return{seed:eN(...S),k2sig:function(e){var t;let r=d(e);if(!c(r))return;let n=eG(r,i),o=a.BASE.multiply(r).toAffine(),l=s(o.x);if(l===to)return;let u=s(n*s(w+l*A));if(u===to)return;let f=2*(o.x!==l)|Number(o.y&ts),g=u;return h&&u>i>>ts&&(g=(t=u)>i>>ts?s(-t):t,f^=1),new p(l,g,f)}}}(e,n,o);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let i=eR(e),n=eR(e),o=0,s=()=>{i.fill(1),n.fill(0),o=0},a=(...e)=>r(n,i,...e),l=(e=eR(0))=>{n=a(eP([0]),e),i=a(),0!==e.length&&(n=a(eP([1]),e),i=a())},u=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(i=a()).slice();r.push(t),e+=i.length}return eN(...r)};return(e,t)=>{let r;for(s(),l(e);!(r=t(u()));)l();return s(),r}})(t.hash.outputLen,t.nByteLength,t.hmac)(u,f)},verify:function(e,r,n,o=w){let l,u;r=eI("msgHash",r),n=eI("publicKey",n);let{lowS:c,prehash:f,format:h}=o;if(tr(o),"strict"in o)throw Error("options.strict was renamed to lowS");if(void 0!==h&&"compact"!==h&&"der"!==h)throw Error("format must be compact or der");let g="string"==typeof e||eg(e),d=!g&&!h&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!g&&!d)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(d&&(u=new p(e.r,e.s)),g){try{"compact"!==h&&(u=p.fromDER(e))}catch(e){if(!(e instanceof tn.Err))throw e}u||"der"===h||(u=p.fromCompact(e))}l=a.fromHex(n)}catch(e){return!1}if(!u||c&&u.hasHighS())return!1;f&&(r=t.hash(r));let{r:v,s:m}=u,b=y(r),A=eG(m,i),S=s(b*A),C=s(v*A),B=a.BASE.multiplyAndAddUnsafe(l,S,C)?.toAffine();return!!B&&s(B.x)===v},ProjectivePoint:a,Signature:p,utils:{isValidPrivateKey(e){try{return l(e),!0}catch(e){return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let e=e1(t.n);return function(e,t,r=!1){let i=e.length,n=e0(t),o=e1(t);if(i<16||i<o||i>1024)throw Error("expected "+o+"-1024 bytes of input, got "+i);let s=eW(r?eE(e):ex(e),t-e$)+e$;return r?eO(s,n):ek(s,n)}(t.randomBytes(e),t.n)},precompute:(e=8,t=a.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,...{hash:t,hmac:(e,...r)=>(0,ec.w)(t,e,(0,ef.Id)(...r)),randomBytes:ef.po}});return{...r(t),create:r}}BigInt(4);let tu=eQ(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),tc=tl({a:tu.create(BigInt("-3")),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Fp:tu,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),G
1y:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},eu.sc),tf=eQ(BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"));tl({a:tf.create(BigInt("-3")),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Fp:tf,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},eu.qt);let th=eQ(BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));tl({a:th.create(BigInt("-3")),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Fp:th,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1),lowS:!1,allowedPrivateKeyLengths:[130,131,132]},eu.Zf);let tp=Uint8Array.from([0]),tg=Uint8Array.of();var td=r(24755);function ty(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function tv(e,...t){if(!ty(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function tm(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function tb(e,t){tv(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function tw(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function tA(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function tS(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}let tC=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function tB(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e);else if(ty(e))e=tk(e);else throw Error("Uint8Array expected, got "+typeof e);return e}function tx(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);let n=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>n&o),a=Number(r&o),l=4*!!i,u=4*!i;e.setUint32(t+l,s,i),e.setUint32(t+u,a,i)}function tE(e){return e.byteOffset%4==0}function tk(e){return Uint8Array.from(e)}let tO=new Uint8Array(16),tI=tw(tO),tN=(e,t,r,i)=>({s3:r<<31|i>>>1,s2:t<<31|r>>>1,s1:e<<31|t>>>1,s0:e>>>1^-0x1f000000&-(1&i&1)}),tU=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255;class tT{constructor(e,t){this.blockLen=16,this.outputLen=16,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,tv(e=tB(e),16);let r=tS(e),i=r.getUint32(0,!1),n=r.getUint32(4,!1),o=r.getUint32(8,!1),s=r.getUint32(12,!1),a=[];for(let e=0;e<128;e++)a.push({s0:tU(i),s1:tU(n),s2:tU(o),s3:tU(s)}),{s0:i,s1:n,s2:o,s3:s}=tN(i,n,o,s);let l=(e=>e>65536?8:e>1024?4:2)(t||1024);if(![1,2,4,8].includes(l))throw Error("ghash: invalid window size, expected 2, 4 or 8");this.W=l;let u=128/l,c=this.windowSize=2**l,f=[];for(let e=0;e<u;e++)for(let t=0;t<c;t++){let r=0,i=0,n=0,o=0;for(let s=0;s<l;s++){if(!(t>>>l-s-1&1))continue;let{s0:u,s1:c,s2:f,s3:h}=a[l*e+s];r^=u,i^=c,n^=f,o^=h}f.push({s0:r,s1:i,s2:n,s3:o})}this.t=f}_updateBlock(e,t,r,i){e^=this.s0,t^=this.s1,r^=this.s2,i^=this.s3;let{W:n,t:o,windowSize:s}=this,a=0,l=0,u=0,c=0,f=(1<<n)-1,h=0;for(let p of[e,t,r,i])for(let e=0;e<4;e++){let t=p>>>8*e&255;for(let e=8/n-1;e>=0;e--){let{s0:r,s1:i,s2:p,s3:g}=o[h*s+(t>>>n*e&f)];a^=r,l^=i,u^=p,c^=g,h+=1}}this.s0=a,this.s1=l,this.s2=u,this.s3=c}update(e){tm(this),tv(e=tB(e));let t=tw(e),r=Math.floor(e.length/16),i=e.length%16;for(let e=0;e<r;e++)this._updateBlock(t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]);return i&&(tO.set(e.subarray(16*r)),this._updateBlock(tI[0],tI[1],tI[2],tI[3]),tA(tI)),this}destroy(){let{t:e}=this;for(let t of e)t.s0=0,t.s1=0,t.s2=0,t.s3=0}digestInto(e){tm(this),tb(e,this),this.finished=!0;let{s0:t,s1:r,s2:i,s3:n}=this,o=tw(e);return o[0]=t,o[1]=r,o[2]=i,o[3]=n,e}digest(){let e=new Uint8Array(16);return this.digestInto(e),this.destroy(),e}}class tj extends tT{constructor(e,t){tv(e=tB(e));let r=function(e){e.reverse();let t=1&e[15],r=0;for(let t=0;t<e.length;t++){let i=e[t];e[t]=i>>>1|r,r=(1&i)<<7}return e[0]^=225&-t,e}(tk(e));super(r,t),tA(r)}update(e){e=tB(e),tm(this);let t=tw(e),r=e.length%16,i=Math.floor(e.length/16);for(let e=0;e<i;
1e++)this._updateBlock(tU(t[4*e+3]),tU(t[4*e+2]),tU(t[4*e+1]),tU(t[4*e+0]));return r&&(tO.set(e.subarray(16*i)),this._updateBlock(tU(tI[3]),tU(tI[2]),tU(tI[1]),tU(tI[0])),tA(tI)),this}digestInto(e){tm(this),tb(e,this),this.finished=!0;let{s0:t,s1:r,s2:i,s3:n}=this,o=tw(e);return o[0]=t,o[1]=r,o[2]=i,o[3]=n,e.reverse()}}function t_(e){let t=(t,r)=>e(r,t.length).update(tB(t)).digest(),r=e(new Uint8Array(16),0);return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=(t,r)=>e(t,r),t}let tR=t_((e,t)=>new tT(e,t));t_((e,t)=>new tj(e,t));let tP=new Uint8Array(16);function tH(e){return e<<1^283&-(e>>7)}function tL(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(1&t),e=tH(e);return r}let tV=(()=>{let e=new Uint8Array(256);for(let t=0,r=1;t<256;t++,r^=tH(r))e[t]=r;let t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=(i^i>>4^i>>5^i>>6^i>>7^99)&255}return tA(e),t})(),tD=tV.map((e,t)=>tV.indexOf(t)),t$=e=>e<<24|e>>>8,tM=e=>e<<8|e>>>24;function tF(e,t){if(256!==e.length)throw Error("Wrong sbox length");let r=new Uint32Array(256).map((r,i)=>t(e[i])),i=r.map(tM),n=i.map(tM),o=n.map(tM),s=new Uint32Array(65536),a=new Uint32Array(65536),l=new Uint16Array(65536);for(let t=0;t<256;t++)for(let u=0;u<256;u++){let c=256*t+u;s[c]=r[t]^i[u],a[c]=n[t]^o[u],l[c]=e[t]<<8|e[u]}return{sbox:e,sbox2:l,T0:r,T1:i,T2:n,T3:o,T01:s,T23:a}}let tz=tF(tV,e=>tL(e,3)<<24|e<<16|e<<8|tL(e,2)),tq=tF(tD,e=>tL(e,11)<<24|tL(e,13)<<16|tL(e,9)<<8|tL(e,14)),tK=(()=>{let e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=tH(r))e[t]=r;return e})();function tW(e){tv(e);let t=e.length;if(![16,24,32].includes(t))throw Error("aes: invalid key size, should be 16, 24 or 32, got "+t);let{sbox2:r}=tz,i=[];tE(e)||i.push(e=tk(e));let n=tw(e),o=n.length,s=e=>tJ(r,e,e,e,e),a=new Uint32Array(t+28);a.set(n);for(let e=o;e<a.length;e++){let t=a[e-1];e%o==0?t=s(t$(t))^tK[e/o-1]:o>6&&e%o==4&&(t=s(t)),a[e]=a[e-o]^t}return tA(...i),a}function tG(e,t,r,i,n,o){return e[r<<8&65280|i>>>8&255]^t[n>>>8&65280|o>>>24&255]}function tJ(e,t,r,i,n){return e[255&t|65280&r]|e[i>>>16&255|n>>>16&65280]<<16}function tZ(e,t,r,i,n){let{sbox2:o,T01:s,T23:a}=tz,l=0;t^=e[l++],r^=e[l++],i^=e[l++],n^=e[l++];let u=e.length/4-2;for(let o=0;o<u;o++){let o=e[l++]^tG(s,a,t,r,i,n),u=e[l++]^tG(s,a,r,i,n,t),c=e[l++]^tG(s,a,i,n,t,r),f=e[l++]^tG(s,a,n,t,r,i);t=o,r=u,i=c,n=f}let c=e[l++]^tJ(o,t,r,i,n),f=e[l++]^tJ(o,r,i,n,t);return{s0:c,s1:f,s2:e[l++]^tJ(o,i,n,t,r),s3:e[l++]^tJ(o,n,t,r,i)}}function tY(e,t,r,i,n){tv(r,16),tv(i),n=function(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw Error("invalid output length, expected "+e+", got: "+t.length);if(r&&!tE(t))throw Error("invalid output, must be aligned");return t}(i.length,n);let o=tw(r),s=tS(r),a=tw(i),l=tw(n),u=12*!t,c=i.length,f=s.getUint32(u,t),{s0:h,s1:p,s2:g,s3:d}=tZ(e,o[0],o[1],o[2],o[3]);for(let r=0;r+4<=a.length;r+=4)l[r+0]=a[r+0]^h,l[r+1]=a[r+1]^p,l[r+2]=a[r+2]^g,l[r+3]=a[r+3]^d,f=f+1>>>0,s.setUint32(u,f,t),{s0:h,s1:p,s2:g,s3:d}=tZ(e,o[0],o[1],o[2],o[3]);let y=16*Math.floor(a.length/4);if(y<c){var v;let e=new Uint32Array([h,p,g,d]),t=new Uint8Array((v=e).buffer,v.byteOffset,v.byteLength);for(let e=y,r=0;e<c;e++,r++)n[e]=i[e]^t[r];tA(e)}return n}let tX=((e,t)=>{function r(i,...n){if(tv(i),!tC)throw Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){let t=n[0];if(!t)throw Error("nonce / iv required");e.varSizeNonce?tv(t):tv(t,e.nonceLength)}let o=e.tagLength;o&&void 0!==n[1]&&tv(n[1]);let s=t(i,...n),a=(e,t)=>{if(void 0!==t){if(2!==e)throw Error("cipher output not supported");tv(t)}},l=!1;return{encrypt(e,t){if(l)throw Error("cannot encrypt() twice with same key + nonce");return l=!0,tv(e),a(s.encrypt.length,t),s.encrypt(e,t)},decrypt(e,t){if(tv(e),o&&e.length<o)throw Error("invalid ciphertext length: smaller than tagLength="+o);return a(s.decrypt.length,t),s.decrypt(e,t)}}}return Object.assign(r,e),r})({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},function(e,t,r){if(t.length<8)throw Error("aes/gcm: invalid nonce length");function i(e,t,i){let n=function(e,t,r,i,n){let o=n?n.length:0,s=e.create(r,i.length+o);n&&s.update(n);let a=function(e,t,r){if("boolean"!=typeof r)throw Error(`boolean expected, not ${r}`);let i=new Uint8Array(16),n=tS(i);return tx(n,0,BigInt(t),r),tx(n,8,BigInt(e),r),i}(8*i.length,8*o,t);s.update(i),s.update(a);let l=s.digest();return tA(a),l}(tR,!1,e,i,r);for(let e=0;e<t.length;e++)n[e]^=t[e];return n}function n(){let r=tW(e),i=tP.slice(),n=tP.slice();if(tY(r,!1,n,n,i),12===t.length)n.set(t);else{let e=tP.slice();tx(tS(e),8,BigInt(8*t.length),!1);let r=tR.create(i).update(t).update(e);r.digestInto(n),r.destroy()}let o=tY(r,!1,n,tP);return{xk:r,authKey:i,counter:n,tagMask:o}}return{encrypt(e){let{xk:t,authKey:r,counter:o,tagMask:s}=n(),a=new Uint8Array(e.length+16),l=[t,r,o,s];tE(e)||l.push(e=tk(e)),tY(t,!1,o,e,a.subarray(0,e.length));let u=i(r,s,a.subarray(0,a.length-16));return l.push(u),a.set(u,e.length),tA(...l),a},decrypt(e){let{xk:t,authKey:r,counter:o,tagMask:s}=n(),a=[t,r,s,o];tE(e)||a.push(e=tk(e));let l=e.subarray(0,-16),u=e.subarray(-16),c=i(r,s,l);
1if(a.push(c),!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r}(c,u))throw Error("aes/gcm: invalid ghash tag");let f=tY(t,!1,o,l);return tA(...a),f}}});var tQ=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"],t0=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),i=parseInt(r)/8;this.resize_if_necessary(i);var n="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[n](this.offset,e,!0),this.offset+=i},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),t1=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var i="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),n=this.view[i](this.offset,!0);return this.offset+=r,n},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),t2=function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function t8(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function t3(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}tQ.concat(["bool","string"]),function(e){t2(function(t,r){var i="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,i)||this},e)}(Error),function(){function e(e){this.encoded=new t0,this.fieldPath=["value"],this.checkTypes=e}e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(tQ.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&t8(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&function(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),i="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!i)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,i=new Uint8Array(r),n=0;n<r;n++)i[n]=Number(e&BigInt(255)),e>>
1=BigInt(8);this.encoded.store_bytes(new Uint8Array(i))},e.prototype.encode_string=function(e){this.checkTypes&&t8(e,"string",this.fieldPath);for(var t=[],r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t.push(i):i<2048?t.push(192|i>>6,128|63&i):i<55296||i>=57344?t.push(224|i>>12,128|i>>6&63,128|63&i):(r++,i=65536+((1023&i)<<10|1023&e.charCodeAt(r)),t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(t.length,"u32"),this.encoded.store_bytes(new Uint8Array(t))},e.prototype.encode_boolean=function(e){this.checkTypes&&t8(e,"boolean",this.fieldPath),this.encoded.store_value(+!!e,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&function(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}(e,this.fieldPath);for(var r=Object.keys(e)[0],i=0;i<t.enum.length;i++){var n=t.enum[i];if(r===Object.keys(n.struct)[0])return this.encoded.store_value(i,"u8"),this.encode_struct(e,n)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(Array.isArray(e)||e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?t3(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?t3(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&t8(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var i=0;i<r.length;i++){var n=r[i];this.encode_value(n,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&t8(e,"object",this.fieldPath);var r=e instanceof Map,i=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(i.length,"u32");for(var n=0;n<i.length;n++){var o=i[n];this.encode_value(o,t.map.key),this.encode_value(r?e.get(o):e[o],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&t8(e,"object",this.fieldPath);for(var r=0,i=Object.keys(t.struct);r<i.length;r++){var n=i[r];this.fieldPath.push(n),this.encode_value(e[n],t.struct[n]),this.fieldPath.pop()}}}(),function(){function e(e){this.buffer=new t1(e)}e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(tQ.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,i=new Uint8Array(this.buffer.consume_bytes(r)),n=i.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&i[r-1]?BigInt.asIntN(e,BigInt("0x".concat(n))):BigInt("0x".concat(n))},e.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),r=[],i=0;i<e;++i){var n=t[i];if(n<128)r.push(n);else if(n<224)r.push((31&n)<<6|63&t[++i]);else if(n<240)r.push((15&n)<<12|(63&t[++i])<<6|63&t[++i]);else{var o=(7&n)<<18|(63&t[++i])<<12|(63&t[++i])<<6|63&t[++i];r.push(o)}}return String.fromCodePoint.apply(String,r)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var i=e.enum[r].struct,n=Object.keys(i)[0];return(t={})[n]=this.decode_value(i[n]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),i=0;i<r;++i)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,i=0;i<t;++i)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,i=0;i<t;++i){var n=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(n,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t}}();var t4=r(95969);let t6=(e,t)=>(e&BigInt(1)<<BigInt(t))!==BigInt(0),t5=new Uint8Array([75,69,77,0,16]),t9=new Uint8Array([72,80,75,69,0,16,0,1,0,2]),t7=new Uint8Array([72,80,75,69,45,118,49]),re=new Uint8Array([115,101,99,114,101,116]),rt=new Uint8Array([101,97,101,95,112,114,107]),rr=new Uint8Array([115,104,97,114,101,100,95,115,101,99,114,101,116]),ri=new Uint8Array([0,32,72,80,75,69,45,118,49,72,80,75,69,0,16,0,1,0,2,107,101,121,0,143,195,174,184,50,73,10,75,90,179,228,32,35,40,125,178,154,31,75,199,194,34,192,223,34,135,39,183,10,64,33,18,47,63,4,233,32,108,209,36,19,80,53,41,180,122,198,166,48,185,46,196,207,125,35,69,8,208,175,151,113,201,158,80]),rn=new Uint8Array([0,12,72,80,75,69,45,118,49,72,80,75,69,0,16,0,1,0,2,98,97,115,101,95,110,111,110,99,101,0,143,195,174,184,50,73,10,75,90,179,228,32,35,40,125,178,154,31,75,199,194,34,192,223,34,135,39,183,10,64,33,18,47,63,4,233,32,108,209,36,19,80,53,41,180,122,198,166,48,185,46,196,207,125,35,69,8,208,175,151,113,201,158,80]);new Uint8Array([113,111,115,95,101,110,99,114,121,112,116,105,111,110,95,104,109,97,99,95,109,101,115,115,97,103,101]);let ro="04cf288fe433cc4e1aa0ce1632feac4ea26bf2f5a09dcfe5a42c398e06898710330f0572882f4dbdf0f5304b8fc8703acd69adca9a4bbf7f5d00d20a5e364b2569",rs=e=>{let t=e.byteLength;var r=e.slice(0,1+t>>>1);return r[0]=2|1&e[t-1],r},ra=(e,t="CURVE_P256")=>{let r,i,n;if(33!==e.length)throw Error("failed to uncompress raw public key: invali
1d length");if(2!==e[0]&&3!==e[0])throw Error("failed to uncompress raw public key: invalid prefix");let o=3===e[0],s=BigInt("0x"+(0,t4.pD)(e.subarray(1)));"CURVE_P256"===t?(r=BigInt("115792089210356248762697446949407573530086143415290314195533631308867097853951"),n=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),i=r-BigInt(3)):(r=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),i=BigInt(0),n=BigInt(7));let a=((e,t)=>{if(t<=BigInt(0))throw Error("p must be positive");let r=e%t;if(t6(t,0)&&t6(t,1)){let e=((e,t,r)=>{if(t===BigInt(0))return BigInt(1);let i=e%r,n=t.toString(2);for(let t=1;t<n.length;++t)i=i*i%r,"1"===n[t]&&(i=i*e%r);return i})(r,t+BigInt(1)>>BigInt(2),t);if(e*e%t!==r)throw Error("could not find a modular square root");return e}throw Error("unsupported modulus value")})(((s*s+i)*s+n)%r,r);if(o!==t6(a,0)&&(a=(r-a)%r),s<BigInt(0)||s>=r)throw Error("x is out of range");if(a<BigInt(0)||a>=r)throw Error("y is out of range");var l="04"+rc(s,64)+rc(a,64);return(0,t4.Ks)(l)},rl=(e,t,r)=>{let i=new Uint8Array(t7.length+r.length+e.length+t.length),n=0;return i.set(t7,n),n+=t7.length,i.set(r,n),n+=r.length,i.set(e,n),n+=e.length,i.set(t,n),i},ru=(e,t,r,i)=>{let n=function(e,t,r){return(0,ef.sd)(e),void 0===r&&(r=new Uint8Array(e.outputLen)),(0,ec.w)(e,(0,ef.ZJ)(r),(0,ef.ZJ)(t))}(td.sc,t,e),o=function(e,t,r,i=32){(0,ef.sd)(e),(0,ef.Fe)(i);let n=e.outputLen;if(i>255*n)throw Error("Length should be <= 255*HashLen");let o=Math.ceil(i/n);void 0===r&&(r=tg);let s=new Uint8Array(o*n),a=ec.w.create(e,t),l=a._cloneInto(),u=new Uint8Array(a.outputLen);for(let e=0;e<o;e++)tp[0]=e+1,l.update(0===e?tg:u).update(r).update(tp).digestInto(u),s.set(u,n*e),a._cloneInto(l);return a.destroy(),l.destroy(),(0,ef.uH)(u,tp),s.slice(0,i)}(td.sc,n,r,i);return new Uint8Array(o)},rc=(e,t)=>{let r=e.toString(16);if(r.length>t)throw Error(`number cannot fit in a hex string of ${t} characters`);return r.padStart(t,"0")},rf=e=>{let t=(0,t4.Ks)(e);if(t.length<2)throw Error("failed to convert DER-encoded signature: insufficient length");if(48!==t[0])throw Error("failed to convert DER-encoded signature: invalid format (missing SEQUENCE tag)");let r=1,i=t[1];if(i<=127){if(t.length<2+i)throw Error("failed to convert DER-encoded signature: inconsistent message length header");r+=1}else throw Error("failed to convert DER-encoded signature: unexpectedly large or invalid signature length");if(2!==t[r])throw Error("failed to convert DER-encoded signature: invalid tag for r");let n=t[++r];if(n>33)throw Error("failed to convert DER-encoded signature: unexpected length for r");r++;let o=t.slice(r,r+n);if(2!==t[r+=n])throw Error("failed to convert DER-encoded signature: invalid tag for s");let s=t[++r];if(s>33)throw Error("failed to convert DER-encoded signature: unexpected length for s");r++;let a=t.slice(r,r+s);return new Uint8Array([...(0,t4.fX)(o,32),...(0,t4.fX)(a,32)])},rh=e=>{let t=(0,t4.Ks)(e),r=t.slice(0,32),i=t.slice(32,64),n=e=>{if(void 0===e||0===e.length||void 0===e[0])throw Error("Invalid integer: input is undefined or empty.");let t=128&e[0]?new Uint8Array([0,...e]):e;return new Uint8Array([2,t.length,...t])},o=n(r),s=n(i),a=new Uint8Array([48,o.length+s.length,...o,...s]);return(0,t4.pD)(a)};!function(e){e.NOTARIZER="notarizer",e.SIGNER="signer",e.EVM_PARSER="evm-parser",e.TLS_FETCHER="tls-fetcher",e.UMP="ump"}(i||(i={}));let rp=async(e,t,r,i)=>{if(e!=(i||ro))throw Error(`expected signer key ${i??ro} does not match signer key from bundle: ${e}`);let n=rg(new Uint8Array((0,t4.Ks)(e)));if(!n)throw Error("failed to load quorum key");let o=rf(t),s=(0,t4.Ks)(r),a=(0,td.sc)(s);return tc.verify(o,a,n.toHex())},rg=e=>tc.ProjectivePoint.fromHex((0,t4.pD)(e)),rd=async(e,t,r,i)=>{let n=JSON.parse(t);if(!await rp(n.enclaveQuorumPublic,n.dataSignature,n.data,i??"046b4f88421f76b6ba418afc2ea1d8ced671337d7db6b80478a60d8531bf8f17fa9a512f0fef96fc0c9b4cd9dff70b34992e520ce04c79d931f6ff6296b547d201"))throw Error("OTP encryption target bundle signature verification failed");let o=JSON.parse(new TextDecoder().decode((0,t4.Ks)(n.data))),s=(0,t4.Ks)(o.targetPublic);return(e=>{let t=e.slice(0,33),r=e.slice(33);return JSON.stringify({encappedPublic:(0,t4.pD)(ra(t)),ciphertext:(0,t4.pD)(r)})})((({plainTextBuf:e,targetKeyBuf:t})=>{try{let r,i,n,o,s,a,l,u,c=(()=>{let e=(0,ef.po)(32),t=((e,t=!0)=>tc.getPublicKey(e,t))(e,!0),r=(0,t4.pD)(ra(t));return{privateKey:(0,t4.pD)(e),publicKey:(0,t4.pD)(t),publicKeyUncompressed:r}})(),f=(0,t4.Ks)(c.privateKey),h=(0,t4.Ks)(c.publicKeyUncompressed),p=(r=h,i=t,new Uint8Array([...Array.from(r),...Array.from(i)])),g=(n=t,o=(0,t4.pD)(f),tc.getSharedSecret((0,t4.Ks)(o),n).slice(1)),d=((e,t)=>{let r=new Uint8Array(e),i=(0,t4.Ks)(t),n=new Uint8Array(r.length+i.length);return n.set(r),n.set(i,r.length),n})(h,(0,t4.pD)(t)),y=rl(rt,g,t5),v=((e,t,r,i)=>{let n=new Uint8Array(9+r.byteLength+e.byteLength+t.byteLength);return n.set(new Uint8Array([0,i]),0),n.set(t7,2),n.set(r,9),n.set(e,9+r.byteLength),n.set(t,9+r.byteLength+e.byteLength),n})(rr,d,t5,32),m=ru(new Uint8Array([]),y,v,32);y=rl(re,new Uint8Array([]),t9),v=ri;let b=ru(m,y,v,32);v=rn;
1let w=ru(m,y,v,12),A=(s=e,a=b,l=w,u=p,tX(a,l,u).encrypt(s)),S=rs(h),C=new Uint8Array(S.length+A.length);return C.set(S,0),C.set(A,S.length),C}catch(e){throw Error(`Unable to perform hpkeEncrypt: ${e}`)}})({plainTextBuf:new TextEncoder().encode(JSON.stringify({otp_code:e,public_key:r})),targetKeyBuf:s}))};r(77661),r(76251);var ry=r(77328);function rv(e,t){let r=0;if(1===e.length)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function rm(e,t,r=-1){let i=e,n=0,o=Math.pow(2,t);for(let s=1;s<8;s++){if(e<o){let e;if(r<0)e=new ArrayBuffer(s),n=s;else{if(r<s)return new ArrayBuffer(0);e=new ArrayBuffer(r),n=r}let o=new Uint8Array(e);for(let e=s-1;e>=0;e--){let r=Math.pow(2,e*t);o[n-e-1]=Math.floor(i/r),i-=o[n-e-1]*r}return e}o*=Math.pow(2,t)}return new ArrayBuffer(0)}function rb(...e){let t=0,r=0;for(let r of e)t+=r.length;let i=new Uint8Array(new ArrayBuffer(t));for(let t of e)i.set(t,r),r+=t.length;return i}function rw(){let e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let t=255===e[0]&&128&e[1],r=0===e[0]&&(128&e[1])==0;(t||r)&&this.warnings.push("Needlessly long format")}let t=new Uint8Array(new ArrayBuffer(this.valueHex.byteLength));for(let e=0;e<this.valueHex.byteLength;e++)t[e]=0;t[0]=128&e[0];let r=rv(t,8),i=new Uint8Array(new ArrayBuffer(this.valueHex.byteLength));for(let t=0;t<this.valueHex.byteLength;t++)i[t]=e[t];return i[0]&=127,rv(i,8)-r}function rA(e,t){let r=e.toString(10);if(t<r.length)return"";let i=t-r.length,n=Array(i);for(let e=0;e<i;e++)n[e]="0";return n.join("").concat(r)}function rS(){if("undefined"==typeof BigInt)throw Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function rC(e){let t=0,r=0;for(let r=0;r<e.length;r++)t+=e[r].byteLength;let i=new Uint8Array(t);for(let t=0;t<e.length;t++){let n=e[t];i.set(new Uint8Array(n),r),r+=n.byteLength}return i.buffer}function rB(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):!(t.byteLength-r-i<0)||(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class rx{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return rC(this.items)}}let rE=[new Uint8Array([1])],rk="0123456789",rO="name",rI="valueHexView",rN=new ArrayBuffer(0),rU=new Uint8Array(0),rT="EndOfContent",rj="OCTET STRING",r_="BIT STRING";function rR(e){var t;return(t=class extends e{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(e){this.valueHexView=new Uint8Array(e)}constructor(...e){var t;super(...e);let r=e[0]||{};this.isHexOnly=null!=(t=r.isHexOnly)&&t,this.valueHexView=r.valueHex?ry._H.toUint8Array(r.valueHex):rU}fromBER(e,t,r,i){let n=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!rB(this,n,t,r))return -1;let o=t+r;return(this.valueHexView=n.subarray(t,o),this.valueHexView.length)?(this.blockLength=r,o):(this.warnings.push("Zero buffer length"),t)}toBER(e=!1){return this.isHexOnly?e?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",rN)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:ry.U$.ToHex(this.valueHexView)}}}).NAME="hexBlock",t}class rP{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="",warnings:r=[],valueBeforeDecode:i=rU}={}){this.blockLength=e,this.error=t,this.warnings=r,this.valueBeforeDecodeView=ry._H.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:ry.U$.ToHex(this.valueBeforeDecodeView)}}}rP.NAME="baseBlock";class rH extends rP{fromBER(e,t,r,i){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'")}}rH.NAME="valueBlock";class rL extends rR(rP){constructor({idBlock:e={}}={}){var t,r,i,n;super(),e?(this.isHexOnly=null!=(t=e.isHexOnly)&&t,this.valueHexView=e.valueHex?ry._H.toUint8Array(e.valueHex):rU,this.tagClass=null!=(r=e.tagClass)?r:-1,this.tagNumber=null!=(i=e.tagNumber)?i:-1,this.isConstructed=null!=(n=e.isConstructed)&&n):(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",rN}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let r=new Uint8Array(1);if(!e){let e=this.tagNumber;e&=31,t|=e,r[0]=t}return r.buffer}if(!this.isHexOnly){let r=rm(this.tagNumber,7),i=new Uint8Array(r),n=r.byteLength,o=new Uint8Array(n+1);if(o[0]=31|t,!e){for(let e=0;e<n-1;e++)o[e+1]=128|i[e];o[n]=i[n-1]}return o.buffer}let r=new Uint8Array(this.valueHexView.byteLength+1);if(r[0]=31|t,!e){let e=this.valueHexView;for(let t=0;t<e.length-1;t++)r[t+1]=128|e[t];r[this.valueHexView.byteLength]=e[e.length-1]}return r.buffer}fromBER(e,t,r){let i=ry._H.toUint8Array(e);if(!rB(this,i,t,r))return -1;let n=i.subarray(t,t+r);if(0===n.length)return this.error="Zero buffer length",-1;switch(192&n[0]){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=(32&n[0])==32,this.isHexOnly=!1;let o=31&n[0];if(31!==o)this.tagNumber=o,this.blockLength=1;else{let e=0;for(;;){let t=e+1;if(t>=n.length)return this.error="End of input reached before message was fully decoded",-1;if(e++,(128&n[t])==0)break}this.blockLength=e+1;let t=this.valueHexView=new Uint8Array(e);for(let r=0;r<e;r++)t[r]=127&n[r+1];this.blockLength<=9?this.tagNumber=rv(t,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(1===this.tagClass&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 
16: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}}}rL.NAME="identificationBlock";class rV extends rP{constructor({lenBlock:e={}}={}){var t,r,i;super(),this.isIndefiniteForm=null!=(t=e.isIndefiniteForm)&&t,this.longFormUsed=null!=(r=e.longFormUsed)&&r,this.length=null!=(i=e.length)?i:0}fromBER(e,t,r){let i=ry._H.toUint8Array(e);if(!rB(this,i,t,r))return -1;let n=i.subarray(t,t+r);if(0===n.length)return this.error="Zero buffer length",-1;if(255===n[0])return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=128===n[0],this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(128&n[0]),!1===this.longFormUsed)return this.length=n[0],this.blockLength=1,t+this.blockLength;let o=127&n[0];if(o>8)return this.error="Too big integer",-1;if(o+1>n.length)return this.error="End of input reached before message was fully decoded",-1;let s=t+1,a=i.subarray(s,s+o);return 0===a[o-1]&&this.warnings.push("Needlessly long encoded length"),this.length=rv(a,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=o+1,t+this.blockLength}toBER(e=!1){let t,r;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),!1===e&&((r=new Uint8Array(t))[0]=128),t;if(this.longFormUsed){let i=rm(this.length,8);if(i.byteLength>127)return this.error="Too big length",rN;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let n=new Uint8Array(i);(r=new Uint8Array(t))[0]=128|i.byteLength;for(let e=0;e<i.byteLength;e++)r[e+1]=n[e];return t}return t=new ArrayBuffer(1),!1===e&&((r=new Uint8Array(t))[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}rV.NAME="lengthBlock";let rD={};class r$ extends rP{constructor({name:e="",optional:t=!1,primitiveSchema:r,...i}={},n){super(i),this.name=e,this.optional=t,r&&(this.primitiveSchema=r),this.idBlock=new rL(i),this.lenBlock=new rV(i),this.valueBlock=n?new n(i):new rH(i)}fromBER(e,t,r,i){let n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length,i);return -1===n?this.error=this.valueBlock.error:(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)),n}toBER(e,t){let r=t||new rx;t||function e(t){var r;if(t instanceof rD.Constructed)for(let r of t.valueBlock.value)e(r)&&(t.lenBlock.isIndefiniteForm=!0);return!!(null==(r=t.lenBlock)?void 0:r.isIndefiniteForm)}(this);let i=this.idBlock.toBER(e);if(r.write(i),this.lenBlock.isIndefiniteForm)r.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,r),r.write(new ArrayBuffer(2));else{let t=this.valueBlock.toBER(e);this.lenBlock.length=t.byteLength;let i=this.lenBlock.toBER(e);r.write(i),r.write(t)}return t?rN:r.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"ascii"===e?this.onAsciiEncoding():ry.U$.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=ry.U$.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(),r=e.toBER();if(t.byteLength!==r.byteLength)return!1;let i=new Uint8Array(t),n=new Uint8Array(r);for(let e=0;e<i.length;e++)if(i[e]!==n[e])return!1;return!0}}r$.NAME="BaseBlock";class rM extends r${getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e="",...t}={},r){super(t,r),e&&this.fromString(e)}fromBER(e,t,r){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);return -1===i?this.error=this.valueBlock.error:(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)),i}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}rM.NAME="BaseStringBlock";class rF extends rR(rH){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}rF.NAME="PrimitiveValueBlock";class rz extends r${constructor(e={}){super(e,rF),this.idBlock.isConstructed=!1}}rD.Primitive=rz,rz.NAME="PRIMITIVE";let rq=100,rK=1e4,rW=0x1000000;function rG(e={}){var t,r,i;return{depth:0,maxDepth:null!=(t=e.maxDepth)?t:rq,nodesCount:0,maxNodes:null!=(r=e.maxNodes)?r:rK,maxContentLength:null!=(i=e.maxContentLength)?i:rW}}
1function rJ(e,t,r,i){let n=i.depth+1;if(n>i.maxDepth){let e=new r$({},rH);return e.error="Maximum ASN.1 nesting depth exceeded",{offset:-1,result:e}}i.depth=n;try{return rZ(e,t,r,i)}finally{i.depth-=1}}function rZ(e,t=0,r=e.length,i=rG()){let n=t,o=new r$({},rH),s=new rP;if(!rB(s,e,t,r))return o.error=s.error,{offset:-1,result:o};if(!e.subarray(t,t+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let a=function(e){if(e.nodesCount+=1,e.nodesCount>e.maxNodes)return"Maximum ASN.1 node count exceeded"}(i);if(a)return o.error=a,{offset:-1,result:o};let l=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),-1===l)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=l,r-=o.idBlock.blockLength,l=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),-1===l)return o.error=o.lenBlock.error,{offset:-1,result:o};t=l,r-=o.lenBlock.blockLength;let u=o.lenBlock.isIndefiniteForm?r:o.lenBlock.length,c=function(e,t){if(e>t.maxContentLength)return"Maximum ASN.1 content length exceeded"}(u,i);if(c)return o.error=c,{offset:-1,result:o};if(!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let f=r$;if(1===o.idBlock.tagClass){if(o.idBlock.tagNumber>=37&&!1===o.idBlock.isHexOnly)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};f=rD.EndOfContent;break;case 1:f=rD.Boolean;break;case 2:f=rD.Integer;break;case 3:f=rD.BitString;break;case 4:f=rD.OctetString;break;case 5:f=rD.Null;break;case 6:f=rD.ObjectIdentifier;break;case 10:f=rD.Enumerated;break;case 12:f=rD.Utf8String;break;case 13:f=rD.RelativeObjectIdentifier;break;case 14:f=rD.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:f=rD.Sequence;break;case 17:f=rD.Set;break;case 18:f=rD.NumericString;break;case 19:f=rD.PrintableString;break;case 20:f=rD.TeletexString;break;case 21:f=rD.VideotexString;break;case 22:f=rD.IA5String;break;case 23:f=rD.UTCTime;break;case 24:f=rD.GeneralizedTime;break;case 25:f=rD.GraphicString;break;case 26:f=rD.VisibleString;break;case 27:f=rD.GeneralString;break;case 28:f=rD.UniversalString;break;case 29:f=rD.CharacterString;break;case 30:f=rD.BmpString;break;case 31:f=rD.DATE;break;case 32:f=rD.TimeOfDay;break;case 33:f=rD.DateTime;break;case 34:f=rD.Duration;break;default:{let e=o.idBlock.isConstructed?new rD.Constructed:new rD.Primitive;e.idBlock=o.idBlock,e.lenBlock=o.lenBlock,e.warnings=o.warnings,o=e}}}else f=o.idBlock.isConstructed?rD.Constructed:rD.Primitive;return l=(o=function(e,t){if(e instanceof t)return e;let r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}(o,f)).fromBER(e,t,u,i),o.valueBeforeDecodeView=e.subarray(n,n+o.blockLength),{offset:l,result:o}}function rY(e,t={}){if(!e.byteLength){let e=new r$({},rH);return e.error="Input buffer has zero length",{offset:-1,result:e}}return rZ(ry._H.toUint8Array(e).slice(),0,e.byteLength,rG(t))}class rX extends rH{constructor({value:e=[],isIndefiniteForm:t=!1,...r}={}){super(r),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,r,i){var n,o;let s=ry._H.toUint8Array(e),a=null!=i?i:rG();if(!rB(this,s,t,r))return -1;if(this.valueBeforeDecodeView=s.subarray(t,t+r),0===this.valueBeforeDecodeView.length)return this.warnings.push("Zero buffer length"),t;let l=t;for(;n=this.isIndefiniteForm,o=r,(n?1:o)>0;){let e=rJ(s,l,r,a);if(-1===e.offset)return this.error=e.result.error,this.warnings.concat(e.result.warnings),-1;if(l=e.offset,this.blockLength+=e.result.blockLength,r-=e.result.blockLength,this.value.push(e.result),this.isIndefiniteForm&&e.result.constructor.NAME===rT)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===rT?this.value.pop():this.warnings.push("No EndOfContent block encoded")),l}toBER(e,t){let r=t||new rx;for(let t=0;t<this.value.length;t++)this.value[t].toBER(e,r);return t?rN:r.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}}rX.NAME="ConstructedValueBlock";class rQ extends r${constructor(e={}){super(e,rX),this.idBlock.isConstructed=!0}fromBER(e,t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length,i);return -1===n?this.error=this.valueBlock.error:(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)),n}onAsciiEncoding(){let e=[];for(let t of this.valueBlock.value)e.push(t.toString("ascii").split("\n").map(e=>`  ${e}`).join("\n"));let t=3===this.idBlock.tagClass?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
2${e.join("\n")}`:`${t} :`}}rD.Constructed=rQ,rQ.NAME="CONSTRUCTED";class r0 extends rH{fromBER(e,t,r){return t}toBER(e){return rN}}r0.override="EndOfContentValueBlock";class r1 extends r${constructor(e={}){super(e,r0),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}rD.EndOfContent=r1,r1.NAME=rT;class r2 extends r${constructor(e={}){super(e,rH),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,r){return(this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=r,t+r>e.byteLength)?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+r}toBER(e,t){let r=new ArrayBuffer(2);if(!e){let e=new Uint8Array(r);e[0]=5,e[1]=0}return t&&t.write(r),r}onAsciiEncoding(){return`${this.constructor.NAME}`}}rD.Null=r2,r2.NAME="NULL";class r8 extends rR(rH){get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=255*!!e}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=ry._H.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,r){let i=ry._H.toUint8Array(e);return rB(this,i,t,r)?(this.valueHexView=i.subarray(t,t+r),r>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,rw.call(this),this.blockLength=r,t+r):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}r8.NAME="BooleanValueBlock";class r3 extends r${getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,r8),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}}rD.Boolean=r3,r3.NAME="BOOLEAN";class r4 extends rR(rX){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,r,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,-1===(n=rX.prototype.fromBER.call(this,e,t,r,i)))return n;for(let e=0;e<this.value.length;e++){let t=this.value[e].constructor.NAME;if(t===rT)if(!this.isIndefiniteForm)return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1;else break;if(t!==rj)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(e,t,r),this.blockLength=r;return n}toBER(e,t){return this.isConstructed?rX.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}r4.NAME="OctetStringValueBlock";class r6 extends r${constructor({idBlock:e={},lenBlock:t={},...r}={}){var i;null!=r.isConstructed||(r.isConstructed=!!(null==(i=r.value)?void 0:i.length)),super({idBlock:{isConstructed:r.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!r.isIndefiniteForm},...r},r4),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,0===r)return 0===this.idBlock.error.length&&(this.blockLength+=this.idBlock.blockLength),0===this.lenBlock.error.length&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){let n=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+r);try{if(n.byteLength){let e=null!=i?i:rG(),t=rJ(n,0,n.byteLength,e);-1!==t.offset&&t.offset===r&&(this.valueBlock.value=[t.result])}}catch{}}return super.fromBER(e,t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return rQ.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,t=ry.U$.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof n&&e.push(t.valueBlock.valueHexView);return ry._H.concat(e)}}rD.OctetString=n=r6,r6.NAME=rj;class r5 extends rR(rX){constructor({unusedBits:e=0,isConstructed:t=!1,...r}={}){super(r),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,r,i){if(!r)return t;let n=-1;if(this.isConstructed){if(-1===(n=rX.prototype.fromBER.call(this,e,t,r,i)))return n;for(let e of this.value){let t=e.constructor.NAME;if(t===rT)if(!this.isIndefiniteForm)return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1;else break;if(t!==r_)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let r=e.valueBlock;if(this.unusedBits>0&&r.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=r.unusedBits}return n}let o=ry._H.toUint8Array(e);if(!rB(this,o,t,r))return -1;let s=o.subarray(t,t+r);if(this.unusedBits=s[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let e=s.subarray(1);try{if(e.byteLength){let t=null!=i?i:rG(),n=rJ(e,0,e.byteLength,t);-1!==n.offset&&n.offset===r-1&&(this.value=[n.result])}}catch{}}return this.valueHexView=s.subarray(1),this.blockLength=s.length,t+r}toBER(e,t){if(this.isConstructed)return rX.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){let e=new Uint8Array(1);return e[0]=0,e.buffer}let r=new Uint8Array(this.valueHexView.length+1);return r[0]=this.unusedBits,r.set(this.valueHexView,1),r.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}r5.NAME="BitStringValueBlock";class r9 extends r${constructor({idBlock:e={},lenBlock:t={},...r}={}){var i;null!=r.isConstructed||(r.isConstructed=!!(null==(i=r.value)?void 0:i.length)),super({idBlock:{isConstructed:r.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!r.isIndefiniteForm},...r},r5),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return rQ.prototype.onAsciiEncoding.call(this);{let e=[];for(let t of this.valueBlock.valueHexView)e.push(t.toString(2).padStart(8,"0"));let t=e.join(""),r=this.constructor.NAME,i=t.substring(0,t.length-this.valueBlock.unusedBits);return`${r} : ${i}`}}}function r7(e){if(e>=rE.length)for(let t=rE.length;t<=e;t++){let e=new Uint8Array([0]),r=rE[t-1].slice(0);for(let t=r.length-1;t>=0;t--){let i=new Uint8Array([(r[t]<<1)+e[0]]);e[0]=i[0]/10,r[t]=i[0]%10}e[0]>0&&(r=rb(e,r)),rE.push(r)}return rE[e]}rD.BitString=r9,r9.NAME=r_;class ie extends rR(rH){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=rw.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),void 0!==e&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(function(e){let t=e<0?-1*e:e,r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){let e=rm(r-t,8,i),n=new Uint8Array(e);return n[0]|=128,e}let n=rm(t,8,i),o=new Uint8Array(n);if(128&o[0]){let e=n.slice(0),t=new Uint8Array(e);o=new Uint8Array(n=new ArrayBuffer(n.byteLength+1));for(let r=0;r<e.byteLength;r++)o[r+1]=t[r];o[0]=0}return n}r*=256}return new ArrayBuffer(0)}(e))}get valueDec(){return this._valueDec}fromDER(e,t,r,i=0){let n=this.fromBER(e,t,r);if(-1===n)return n;let o=this.valueHexView;return 0===o[0]&&(128&o[1])!=0?this.valueHexView=o.subarray(1):0!==i&&o.length<i&&(i-o.length>1&&(i=o.length+1),this.valueHexView=o.subarray(i-o.length)),n}toDER(e=!1){let t=this.valueHexView;switch(!0){case(128&t[0])!=0:{let e=new Uint8Array(this.valueHexView.length+1);e[0]=0,e.set(t,1),this.valueHexView=e}break;case 0===t[0]&&(128&t[1])==0:this.valueHexView=this.valueHexView.subarray(1)}return this.toBER(e)}fromBER(e,t,r){let i=super.fromBER(e,t,r);return -1===i||this.setValueHex(),i}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e,t=8*this.valueHexView.length-1,r=new Uint8Array(8*this.valueHexView.length/3),i=0,n=this.valueHexView,o="",s=!1;for(let s=n.byteLength-1;s>=0;s--){e=n[s];for(let n=0;n<8;n++)(1&e)==1&&(i===t?(r=function(e,t){let r,i=0,n=new Uint8Array(e),o=new Uint8Array(t),s=n.slice(0),a=s.length-1,l=o.slice(0),u=l.length-1,c=0;for(let e=u;e>=0;e--,c++)!0==(r=s[a-c]-l[u-c]-i)<0?(i=1,s[a-c]=r+10):(i=0,s[a-c]=r);if(i>0)for(let e=a-u+1;e>=0;e--,c++)if((r=s[a-c]-i)<0)i=1,s[a-c]=r+10;else{i=0,s[a-c]=r;break}return s.slice()}(r7(i),r),o="-"):r=function(e,t){let r=new Uint8Array([0]),i=new Uint8Array(e),n=new Uint8Array(t),o=i.slice(0),s=o.length-1,a=n.slice(0),l=a.length-1,u=0,c=l<s?s:l,f=0;for(let e=c;e>=0;e--,f++)u=!0==f<a.length?o[s-f]+a[l-f]+r[0]:o[s-f]+r[0],r[0]=u/10,!0==f>=o.length?o=rb(new Uint8Array([u%10]),o):o[s-f]=u%10;return r[0]>0&&(o=rb(r,o)),o}(r,r7(i))),i++,e>>=1}for(let e=0;e<r.length;e++)r[e]&&(s=!0),s&&(o+=rk.charAt(r[e]));return!1===s&&(o+=rk.charAt(0)),o}}ie.NAME="IntegerValueBlock",Object.defineProperty(ie.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});class it extends r${constructor(e={}){super(e,ie),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return rS(),BigInt(this.valueBlock.toString())}static fromBigInt(e){rS();let t=BigInt(e),r=new rx,i=t.toString(16).replace(/^-/,""),n=new Uint8Array(ry.U$.FromHex(i));if(t<0){let e=new Uint8Array(n.length+(128&n[0]?1:0));e[0]|=128;let i=BigInt(`0x${ry.U$.ToHex(e)}`)+t,o=ry._H.toUint8Array(ry.U$.FromHex(i.toString(16)));o[0]|=128,r.write(o)}else 128&n[0]&&r.write(new Uint8Array([0])),r.write(n);return new o({valueHex:r.final()})}convertToDER(){let e=new o({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new o({valueHex:0===this.valueBlock.valueHexView[0]?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}rD.Integer=o=it,it.NAME="INTEGER";class ir extends it{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}rD.Enumerated=ir,ir.NAME="ENUMERATED";class ii extends rR(rH){constructor({valueDec:e=-1,isFirstSid:t=!1,...r}={}){super(r),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,r){if(!r)return t;let i=ry._H.toUint8Array(e);if(!rB(this,i,t,r))return -1;let n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(let e=0;e<r&&(this.valueHexView[e]=127&n[e],this.blockLength++,(128&n[e])!=0);e++);let o=new Uint8Array(this.blockLength);for(let e=0;e<this.blockLength;e++)o[e]=this.valueHexView[e];return(this.va
2lueHexView=o,(128&n[this.blockLength-1])!=0)?(this.error="End of input reached before message was fully decoded",-1):(0===this.valueHexView[0]&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=rv(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){rS();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let r=new Uint8Array(t.length/7);for(let e=0;e<r.length;e++)r[e]=parseInt(t.slice(7*e,7*e+7),2)+128*(e+1<r.length);this.fromBER(r.buffer,0,r.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let t=this.valueHexView,r=new Uint8Array(this.blockLength);for(let e=0;e<this.blockLength-1;e++)r[e]=128|t[e];return r[this.blockLength-1]=t[this.blockLength-1],r.buffer}let t=rm(this.valueDec,7);if(0===t.byteLength)return this.error="Error during encoding SID value",rN;let r=new Uint8Array(t.byteLength);if(!e){let e=new Uint8Array(t),i=t.byteLength-1;for(let t=0;t<i;t++)r[t]=128|e[t];r[i]=e[i]}return r}toString(){let e="";if(this.isHexOnly)e=ry.U$.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}ii.NAME="sidBlock";class io extends rH{constructor({value:e="",...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,r){let i=t;for(;r>0;){let t=new ii;if(-1===(i=t.fromBER(e,i,r))){this.blockLength=0,this.error=t.error;break}0===this.value.length&&(t.isFirstSid=!0),this.blockLength+=t.blockLength,r-=t.blockLength,this.value.push(t)}return i}toBER(e){let t=[];for(let r=0;r<this.value.length;r++){let i=this.value[r].toBER(e);if(0===i.byteLength)return this.error=this.value[r].error,rN;t.push(i)}return rC(t)}fromString(e){this.value=[];let t=0,r=0,i="",n=!1;do if(i=-1===(r=e.indexOf(".",t))?e.substring(t):e.substring(t,r),t=r+1,n){let e=this.value[0],t=0;switch(e.valueDec){case 0:break;case 1:t=40;break;case 2:t=80;break;default:this.value=[];return}let r=parseInt(i,10);if(isNaN(r))return;e.valueDec=r+t,n=!1}else{let e=new ii;if(i>Number.MAX_SAFE_INTEGER)rS(),e.valueBigInt=BigInt(i);else if(e.valueDec=parseInt(i,10),isNaN(e.valueDec))return;this.value.length||(e.isFirstSid=!0,n=!0),this.value.push(e)}while(-1!==r)}toString(){let e="",t=!1;for(let r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;let i=this.value[r].toString();0!==r&&(e=`${e}.`),t?(i=`{${i}}`,this.value[r].isFirstSid?e=`2.{${i} - 80}`:e+=i):e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}}io.NAME="ObjectIdentifierValueBlock";class is extends r${getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,io),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}rD.ObjectIdentifier=is,is.NAME="OBJECT IDENTIFIER";class ia extends rR(rP){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,r){if(0===r)return t;let i=ry._H.toUint8Array(e);if(!rB(this,i,t,r))return -1;let n=i.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(let e=0;e<r&&(this.valueHexView[e]=127&n[e],this.blockLength++,(128&n[e])!=0);e++);let o=new Uint8Array(this.blockLength);for(let e=0;e<this.blockLength;e++)o[e]=this.valueHexView[e];return(this.valueHexView=o,(128&n[this.blockLength-1])!=0)?(this.error="End of input reached before message was fully decoded",-1):(0===this.valueHexView[0]&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=rv(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);
2let t=this.valueHexView,r=new Uint8Array(this.blockLength);for(let e=0;e<this.blockLength-1;e++)r[e]=128|t[e];return r[this.blockLength-1]=t[this.blockLength-1],r.buffer}let t=rm(this.valueDec,7);if(0===t.byteLength)return this.error="Error during encoding SID value",rN;let r=new Uint8Array(t.byteLength);if(!e){let e=new Uint8Array(t),i=t.byteLength-1;for(let t=0;t<i;t++)r[t]=128|e[t];r[i]=e[i]}return r.buffer}toString(){return this.isHexOnly?ry.U$.ToHex(this.valueHexView):this.valueDec.toString()}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}ia.NAME="relativeSidBlock";class il extends rH{constructor({value:e="",...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,r){let i=t;for(;r>0;){let t=new ia;if(-1===(i=t.fromBER(e,i,r))){this.blockLength=0,this.error=t.error;break}this.blockLength+=t.blockLength,r-=t.blockLength,this.value.push(t)}return i}toBER(e,t){let r=[];for(let t=0;t<this.value.length;t++){let i=this.value[t].toBER(e);if(0===i.byteLength)return this.error=this.value[t].error,rN;r.push(i)}return rC(r)}fromString(e){this.value=[];let t=0,r=0,i="";do{i=-1===(r=e.indexOf(".",t))?e.substring(t):e.substring(t,r),t=r+1;let n=new ia;if(n.valueDec=parseInt(i,10),isNaN(n.valueDec))break;this.value.push(n)}while(-1!==r);return!0}toString(){let e="",t=!1;for(let r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;let i=this.value[r].toString();0!==r&&(e=`${e}.`),t?e+=i=`{${i}}`:e+=i}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}}il.NAME="RelativeObjectIdentifierValueBlock";class iu extends r${getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,il),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}rD.RelativeObjectIdentifier=iu,iu.NAME="RelativeObjectIdentifier";class ic extends rQ{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}rD.Sequence=ic,ic.NAME="SEQUENCE";class ih extends rQ{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}}rD.Set=ih,ih.NAME="SET";class ip extends rR(rH){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=""}toJSON(){return{...super.toJSON(),value:this.value}}}ip.NAME="StringValueBlock";class ig extends ip{}ig.NAME="SimpleStringValueBlock";class id extends rM{constructor({...e}={}){super(e,ig)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,ry._H.toUint8Array(e))}fromString(e){let t=e.length,r=this.valueBlock.valueHexView=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e.charCodeAt(i);this.valueBlock.value=e}}id.NAME="SIMPLE STRING";class iy extends id{fromBuffer(e){this.valueBlock.valueHexView=ry._H.toUint8Array(e);try{this.valueBlock.value=ry.U$.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=ry.U$.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(ry.U$.FromUtf8String(e)),this.valueBlock.value=e}}iy.NAME="Utf8StringValueBlock";class iv extends iy{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}rD.Utf8String=iv,iv.NAME="UTF8String";class im extends id{fromBuffer(e){this.valueBlock.value=ry.U$.ToUtf16String(e),this.valueBlock.valueHexView=ry._H.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(ry.U$.FromUtf16String(e))}}im.NAME="BmpStringValueBlock";class ib extends im{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}rD.BmpString=ib,ib.NAME="BMPString";class iw extends id{fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),r=new Uint8Array(t);for(let e=0;e<r.length;e+=4)r[e]=r[e+3],r[e+1]=r[e+2],r[e+2]=0,r[e+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,r=this.valueBlock.valueHexView=new Uint8Array(4*t);for(let i=0;i<t;i++){let t=new Uint8Array(rm(e.charCodeAt(i),8));if(t.length>4)continue;let n=4-t.length;for(let e=t.length-1;e>=0;e--)r[4*i+e+n]=t[e]}this.valueBlock.value=e}}iw.NAME="UniversalStringValueBlock";class iA extends iw{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}rD.UniversalString=iA,iA.NAME="UniversalString";class iS extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}rD.NumericString=iS,iS.NAME="NumericString";class iC extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}rD.PrintableString=iC,iC.NAME="PrintableString";class iB extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}rD.TeletexString=iB,iB.NAME="TeletexString";class ix extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}rD.VideotexString=ix,ix.NAME="VideotexString";class iE extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}rD.IA5String=iE,iE.NAME="IA5String";class ik extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}rD.GraphicString=ik,ik.NAME="GraphicString";class iO extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}rD.VisibleString=iO,iO.NAME="VisibleString";class iI extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}rD.GeneralString=iI,iI.NAME="GeneralString";class iN extends id{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}rD.CharacterString=iN,iN.NAME="CharacterString";class iU extends iO{constructor({value:e,valueDate:t,...r}={}){if(super(r),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let t=0;t<e.length;t++)this.valueBlock.valueHexView[t]=e.charCodeAt(t)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,ry._H.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),r=new 
2Uint8Array(t);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let t=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(null===t){this.error="Wrong input string for conversion";return}let r=parseInt(t[1],10);r>=50?this.year=1900+r:this.year=2e3+r,this.month=parseInt(t[2],10),this.day=parseInt(t[3],10),this.hour=parseInt(t[4],10),this.minute=parseInt(t[5],10),this.second=parseInt(t[6],10)}toString(e="iso"){if("iso"===e){let e=Array(7);return e[0]=rA(this.year<2e3?this.year-1900:this.year-2e3,2),e[1]=rA(this.month,2),e[2]=rA(this.day,2),e[3]=rA(this.hour,2),e[4]=rA(this.minute,2),e[5]=rA(this.second,2),e[6]="Z",e.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}rD.UTCTime=iU,iU.NAME="UTCTime";class iT extends iU{constructor(e={}){super(e),null!=this.millisecond||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t,r=!1,i="",n="",o=0,s=0,a=0;if("Z"===e[e.length-1])i=e.substring(0,e.length-1),r=!0;else{if(isNaN(new Number(e[e.length-1]).valueOf()))throw Error("Wrong input string for conversion");i=e}if(r){if(-1!==i.indexOf("+")||-1!==i.indexOf("-"))throw Error("Wrong input string for conversion")}else{let e=1,t=i.indexOf("+"),r="";if(-1===t&&(t=i.indexOf("-"),e=-1),-1!==t){if(r=i.substring(t+1),i=i.substring(0,t),2!==r.length&&4!==r.length)throw Error("Wrong input string for conversion");let n=parseInt(r.substring(0,2),10);if(isNaN(n.valueOf()))throw Error("Wrong input string for conversion");if(s=e*n,4===r.length){if(isNaN((n=parseInt(r.substring(2,4),10)).valueOf()))throw Error("Wrong input string for conversion");a=e*n}}}let l=i.indexOf(".");if(-1===l&&(l=i.indexOf(",")),-1!==l){let e=new Number(`0${i.substring(l)}`);if(isNaN(e.valueOf()))throw Error("Wrong input string for conversion");o=e.valueOf(),n=i.substring(0,l)}else n=i;switch(!0){case 8===n.length:if(t=/(\d{4})(\d{2})(\d{2})/ig,-1!==l)throw Error("Wrong input string for conversion");break;case 10===n.length:if(t=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,-1!==l){let e=60*o;this.minute=Math.floor(e),e=60*(e-this.minute),this.second=Math.floor(e),e=1e3*(e-this.second),this.millisecond=Math.floor(e)}break;case 12===n.length:if(t=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,-1!==l){let e=60*o;this.second=Math.floor(e),e=1e3*(e-this.second),this.millisecond=Math.floor(e)}break;case 14===n.length:if(t=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,-1!==l){let e=1e3*o;this.millisecond=Math.floor(e)}break;default:throw Error("Wrong input string for conversion")}let u=t.exec(n);if(null===u)throw Error("Wrong input string for conversion");for(let e=1;e<u.length;e++)switch(e){case 1:this.year=parseInt(u[e],10);break;case 2:this.month=parseInt(u[e],10);break;case 3:this.day=parseInt(u[e],10);break;case 4:this.hour=parseInt(u[e],10)+s;break;case 5:this.minute=parseInt(u[e],10)+a;break;case 6:this.second=parseInt(u[e],10);break;default:throw Error("Wrong input string for conversion")}if(!1===r){let e=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=e.getUTCFullYear(),this.month=e.getUTCMonth(),this.day=e.getUTCDay(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds(),this.millisecond=e.getUTCMilliseconds()}}toString(e="iso"){if("iso"===e){let e=[];return e.push(rA(this.year,4)),e.push(rA(this.month,2)),e.push(rA(this.day,2)),e.push(rA(this.hour,2)),e.push(rA(this.minute,2)),e.push(rA(this.second,2)),0!==this.millisecond&&(e.push("."),e.push(rA(this.millisecond,3))),e.push("Z"),e.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}rD.GeneralizedTime=iT,iT.NAME="GeneralizedTime";class ij extends iv{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}rD.DATE=ij,ij.NAME="DATE";class i_ extends iv{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}rD.TimeOfDay=i_,i_.NAME="TimeOfDay";class iR extends iv{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}rD.DateTime=iR,iR.NAME="DateTime";class iP extends iv{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}
2rD.Duration=iP,iP.NAME="Duration";class iH extends iv{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}rD.TIME=iH,iH.NAME="TIME";class iL{constructor({name:e="",optional:t=!1}={}){this.name=e,this.optional=t}}class iV extends iL{constructor({value:e=[],...t}={}){super(t),this.value=e}}class iD extends iL{constructor({value:e=new iL,local:t=!1,...r}={}){super(r),this.value=e,this.local=t}}class i${get data(){return this.dataView.slice().buffer}set data(e){this.dataView=ry._H.toUint8Array(e)}constructor({data:e=rU}={}){this.dataView=ry._H.toUint8Array(e)}fromBER(e,t,r){let i=t+r;return this.dataView=ry._H.toUint8Array(e).subarray(t,i),i}toBER(e){return this.dataView.slice().buffer}}function iM(e,t,r){if(r instanceof iV){for(let i of r.value)if(iM(e,t,i).verified)return{verified:!0,result:e};{let e={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(rO)&&(e.name=r.name),e}}if(r instanceof iL)return r.hasOwnProperty(rO)&&(e[r.name]=t),{verified:!0,result:e};if(e instanceof Object==!1)return{verified:!1,result:{error:"Wrong root object"}};if(t instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(r instanceof Object==!1||"idBlock"in r==!1||"fromBER"in r.idBlock==!1||"toBER"in r.idBlock==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let i=r.idBlock.toBER(!1);if(0===i.byteLength)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(-1===r.idBlock.fromBER(i,0,i.byteLength))return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(!1===r.idBlock.hasOwnProperty("tagClass"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(!1===r.idBlock.hasOwnProperty("tagNumber"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(!1===r.idBlock.hasOwnProperty("isConstructed"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!("isHexOnly"in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly)return{verified:!1,result:e};if(r.idBlock.isHexOnly){if(rI in r.idBlock==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let i=r.idBlock.valueHexView,n=t.idBlock.valueHexView;if(i.length!==n.length)return{verified:!1,result:e};for(let t=0;t<i.length;t++)if(i[t]!==n[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,""),r.name&&(e[r.name]=t)),r instanceof rD.Constructed){let i=0,n={verified:!1,result:{error:"Unknown error"}},o=r.valueBlock.value.length;if(o>0&&r.valueBlock.value[0]instanceof iD&&(o=t.valueBlock.value.length),0===o)return{verified:!0,result:e};if(0===t.valueBlock.value.length&&0!==r.valueBlock.value.length){let t=!0;for(let e=0;e<r.valueBlock.value.length;e++)t=t&&(r.valueBlock.value[e].optional||!1);return t?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,""),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let s=0;s<o;s++)if(s-i>=t.valueBlock.value.length){if(!1===r.valueBlock.value[s].optional){let t={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,""),r.name&&(delete e[r.name],t.name=r.name)),t}}else if(r.valueBlock.value[0]instanceof iD){if(!1===(n=iM(e,t.valueBlock.value[s],r.valueBlock.value[0].value)).verified)if(!r.valueBlock.value[0].optional)return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,""),r.name&&delete e[r.name]),n;else i++;if(rO in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let i={};void 0===(i="local"in r.valueBlock.value[0]&&r.valueBlock.value[0].local?t:e)[r.valueBlock.value[0].name]&&(i[r.valueBlock.value[0].name]=[]),i[r.valueBlock.value[0].name].push(t.valueBlock.value[s])}}else if(!1===(n=iM(e,t.valueBlock.value[s-i],r.valueBlock.value[s])).verified)if(!r.valueBlock.value[s].optional)return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,""),r.name&&delete e[r.name]),n;else i++;if(!1===n.verified){let t={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,""),r.name&&(delete e[r.name],t.name=r.name)),t}return{verified:!0,result:e}}if(r.primitiveSchema&&rI in t.valueBlock){let i=rZ(t.valueBlock.valueHexView);if(-1===i.offset){let t={verified:!1,result:i.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,""),r.name&&(delete e[r.name],t.name=r.name)),t}return iM(e,i.result,r.primitiveSchema)}return{verified:!0,result:e}}function iF(e,t){if(t instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let r=rZ(ry._H.toUint8Array(e));return -1===r.offset?{verified:!1,result:r.result}:iM(r.result,r.result,t)}function iz(e){return Object.prototype.toString.call(e)}function iq(e){return"[object ArrayBuffer]"===iz(e)}function iK(e){return iq(e)||"undefined"!=typeof SharedArrayBuffer&&"[object SharedArrayBuffer]"===iz(e)}function iW(e){return iK(e)||!!ArrayBuffer.isView(e)||!!e&&"object"==typeof e&&"number"==typeof e.byteOffset&&"number"==typeof e.byteLength&&iK(e.buffer)}function iG(e){if(!iW(e))throw TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}function iJ(e){return(iG(e),iK(e))?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function iZ(e){if(iG(e),iq(e))return e;let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(iJ(e)),t}!function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"}(s||(s={})),function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"}(a||(a={}));class iY{unusedBits=0;value=new ArrayBuffer(0);constructor(e,t=0){if(e)if("number"==typeof e)this.fromNumber(e);else if(iW(e))this.unusedBits=t,this.value=iZ(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof r9))throw TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=iZ(e.valueBlock.valueHex),this}toASN(){return new r9({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new r9({name:e})}toNumber(){let e="";for(let t of new Uint8Array(this.value))e+=t.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let t=e.toString(2),r=t.length+7>>3;this.unusedBits=(r<<3)-t.length;let i=new Uint8Array(r);t=t.padStart(r<<3,"0").split("").reverse().join("");let n=0;for(;n<r;)i[n]=parseInt(t.slice(n<<3,(n<<3)+8),2),n++;this.value=i.buffer}}class iX{buffer;get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){"number"==typeof e?this.buffer=new ArrayBuffer(e):iW(e)?this.buffer=iZ(e):Array.isArray(e)?this.buffer=new Uint8Array(e).buffer:this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof r6))throw TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=iZ(e.valueBlock.valueHex),this}toASN(){return new r6({valueHex:this.buffer})}toSchema(e){return new r6({name:e})}}let iQ={fromASN:e=>e instanceof r2?null:iZ(e.valueBeforeDecodeView),toASN:e=>{if(null===e)return new r2;let t=rY(e);
2if(t.result.error)throw Error(t.result.error);return t.result}},i0={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new it({value:+e})},i1={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new ir({value:e})},i2={fromASN:e=>iZ(e.valueBlock.valueHexView),toASN:e=>new it({valueHex:e})},i8={fromASN:e=>iZ(e.valueBlock.valueHexView),toASN:e=>new r9({valueHex:e})},i3={fromASN:e=>e.valueBlock.toString(),toASN:e=>new is({value:e})},i4={fromASN:e=>e.valueBlock.value,toASN:e=>new r3({value:e})},i6={fromASN:e=>iZ(e.valueBlock.valueHexView),toASN:e=>new r6({valueHex:e})};function i5(e){return{fromASN:e=>e.valueBlock.value,toASN:t=>new e({value:t})}}let i9=i5(iv),i7=i5(ib),ne=i5(iA),nt=i5(iS),nr=i5(iC),ni=i5(iB),nn=i5(ix),no=i5(iE),ns=i5(ik),na=i5(iO),nl=i5(iI),nu=i5(iN),nc={fromASN:e=>e.toDate(),toASN:e=>new iU({valueDate:e})},nf={fromASN:e=>e.toDate(),toASN:e=>new iT({valueDate:e})},nh={fromASN:()=>null,toASN:()=>new r2};function np(e){switch(e){case a.Any:return iQ;case a.BitString:return i8;case a.BmpString:return i7;case a.Boolean:return i4;case a.CharacterString:return nu;case a.Enumerated:return i1;case a.GeneralString:return nl;case a.GeneralizedTime:return nf;case a.GraphicString:return ns;case a.IA5String:return no;case a.Integer:return i0;case a.Null:return nh;case a.NumericString:return nt;case a.ObjectIdentifier:return i3;case a.OctetString:return i6;case a.PrintableString:return nr;case a.TeletexString:return ni;case a.UTCTime:return nc;case a.UniversalString:return ne;case a.Utf8String:return i9;case a.VideotexString:return nn;case a.VisibleString:return na;default:return null}}function ng(e){return"function"==typeof e&&e.prototype?!!e.prototype.toASN&&!!e.prototype.fromASN||ng(e.prototype):!!(e&&"object"==typeof e&&"toASN"in e&&"fromASN"in e)}class nd{items=new WeakMap;has(e){return this.items.has(e)}get(e,t=!1){let r=this.items.get(e);if(!r)throw Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!r.schema)throw Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return r}cache(e){let t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){let t={type:s.Sequence,items:{}},r=this.findParentSchema(e);return r&&(Object.assign(t,r),t.items=Object.assign({},t.items,r.items)),t}create(e,t){let r=this.items.get(e)||this.createDefault(e),i=[];for(let e in r.items){let n,o=r.items[e],l=t?e:"";if("number"==typeof o.type){let e=a[o.type],t=el[e];if(!t)throw Error(`Cannot get ASN1 class by name '${e}'`);n=new t({name:l})}else ng(o.type)?n=new o.type().toSchema(l):o.optional?this.get(o.type).type===s.Choice?n=new iL({name:l}):(n=this.create(o.type,!1)).name=l:n=new iL({name:l});let u=!!o.optional||void 0!==o.defaultValue;if(o.repeated&&(n.name="",n=new("set"===o.repeated?ih:ic)({name:"",value:[new iD({name:l,value:n})]})),null!==o.context&&void 0!==o.context)if(o.implicit)if("number"==typeof o.type||ng(o.type)){let e=o.repeated?rQ:rz;i.push(new e({name:l,optional:u,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);let e=!!o.repeated,t=e?n:this.get(o.type,!0).schema;t="valueBlock"in t?t.valueBlock.value:t.value,i.push(new rQ({name:e?"":l,optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:t}))}else i.push(new rQ({optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:[n]}));else n.optional=u,i.push(n)}switch(r.type){case s.Sequence:return new ic({value:i,name:""});case s.Set:return new ih({value:i,name:""});case s.Choice:return new iV({value:i,name:""});default:throw Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){let t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}}let ny=new nd,nv=e=>t=>{let r;ny.has(t)?r=ny.get(t):(r=ny.createDefault(t),ny.set(t,r)),Object.assign(r,e)},nm=e=>(t,r)=>{let i;ny.has(t.constructor)?i=ny.get(t.constructor):(i=ny.createDefault(t.constructor),ny.set(t.constructor,i));let n=Object.assign({},e);if("number"==typeof n.type&&!n.converter){let i=np(e.type);if(!i)throw Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);n.converter=i}n.raw=e.raw,i.items[r]=n};
2class nb extends Error{schemas=[]}class nw{static parse(e,t){let r=rY(iZ(e));if(r.result.error)throw Error(r.result.error);return this.fromASN(r.result,t)}static fromASN(e,t){try{if(ng(t))return new t().fromASN(e);let r=ny.get(t);ny.cache(t);let i=r.schema,n=this.handleChoiceTypes(e,r,t,i);if(n?.result)return n.result;n?.targetSchema&&(i=n.targetSchema);let o=this.handleSequenceTypes(e,r,t,i),s=new t;if(function e(t){if(t){let r=Object.getPrototypeOf(t);return r?.prototype?.constructor===Array||e(r)}return!1}(t))return this.handleArrayTypes(e,r,t);return this.processSchemaItems(r,o,s),s}catch(e){throw e instanceof nb&&e.schemas.push(t.name),e}}static handleChoiceTypes(e,t,r,i){if(e.constructor===rQ&&t.type===s.Choice&&3===e.idBlock.tagClass)for(let i in t.items){let n=t.items[i];if(n.context===e.idBlock.tagNumber&&n.implicit&&"function"==typeof n.type&&ny.has(n.type)){let t=ny.get(n.type);if(t&&t.type===s.Sequence){let t=new ic;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in t.valueBlock){t.valueBlock.value=e.valueBlock.value;let o=this.fromASN(t,n.type),s=new r;return s[i]=o,{result:s}}}}}else if(e.constructor===rQ&&t.type!==s.Choice){let r=new rQ({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(let r in t.items)delete e[r];return{targetSchema:r}}return null}static handleSequenceTypes(e,t,r,i){if(t.type===s.Sequence){let t=iM({},e,i);if(!t.verified)throw new nb(`Data does not match to ${r.name} ASN1 schema.${t.result.error?` ${t.result.error}`:""}`);return t}{let t=iM({},e,i);if(!t.verified)throw new nb(`Data does not match to ${r.name} ASN1 schema.${t.result.error?` ${t.result.error}`:""}`);return t}}static processRepeatedField(e,t,r){let i=e.slice(t);if(1===i.length&&"Sequence"===i[0].constructor.name){let e=i[0];e.valueBlock&&e.valueBlock.value&&Array.isArray(e.valueBlock.value)&&(i=e.valueBlock.value)}if("number"!=typeof r.type)return i.filter(e=>e&&e.valueBlock).map(e=>{try{return this.fromASN(e,r.type)}catch{return}}).filter(e=>void 0!==e);{let e=np(r.type);if(!e)throw Error(`No converter for ASN.1 type ${r.type}`);return i.filter(e=>e&&e.valueBlock).map(t=>{try{return e.fromASN(t)}catch{return}}).filter(e=>void 0!==e)}}static processPrimitiveField(e,t){let r=np(t.type);if(!r)throw Error(`No converter for ASN.1 type ${t.type}`);return r.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&"function"==typeof e.type&&ny.has(e.type)&&ny.get(e.type).type===s.Choice}static processOptionalChoiceField(e,t){try{let r=this.fromASN(e,t.type);return{processed:!0,value:r}}catch(e){if(e instanceof nb&&/Wrong values for Choice type/.test(e.message))return{processed:!1};throw e}}static handleArrayTypes(e,t,r){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let i=t.itemType;if("number"!=typeof i)return r.from(e.valueBlock.value,e=>this.fromASN(e,i));{let t=np(i);if(!t)throw Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(e.valueBlock.value,e=>t.fromASN(e))}}static processSchemaItems(e,t,r){for(let i in e.items){let n,o=t.result[i];if(!o)continue;let s=e.items[i],a=s.type;(n="number"==typeof a||ng(a)?this.processPrimitiveSchemaItem(o,s,a):this.processComplexSchemaItem(o,s,a))&&"object"==typeof n&&"value"in n&&"raw"in n?(r[i]=n.value,r[`${i}Raw`]=n.raw):r[i]=n}}static processPrimitiveSchemaItem(e,t,r){let i=t.converter??(ng(r)?new r:null);if(!i)throw Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,i):this.processSinglePrimitiveItem(e,t,r,i)}static processRepeatedPrimitiveItem(e,t,r){if(!t.implicit)return Array.from(e,e=>r.fromASN(e));{let i=new("sequence"===t.repeated?ic:ih);i.valueBlock=e.valueBlock;let n=rY(i.toBER(!1));if(-1===n.offset)throw Error(`Cannot parse the child item. ${n.result.error}`);if(!("value"in n.result.valueBlock&&Array.isArray(n.result.valueBlock.value)))throw Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");return Array.from(n.result.valueBlock.value,e=>r.fromASN(e))}}
2static processSinglePrimitiveItem(e,t,r,i){let n=e;if(t.implicit){let e;if(ng(r))e=new r().toSchema("");else{let t=a[r],i=el[t];if(!i)throw Error(`Cannot get '${t}' class from asn1js module`);e=new i}e.valueBlock=n.valueBlock,n=rY(e.toBER(!1)).result}return i.fromASN(n)}static processComplexSchemaItem(e,t,r){if(t.repeated){if(!Array.isArray(e))throw Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,e=>this.fromASN(e,r))}{let i=this.handleImplicitTagging(e,t,r);if(this.isOptionalChoiceField(t))try{return this.fromASN(i,r)}catch(e){if(e instanceof nb&&/Wrong values for Choice type/.test(e.message))return;throw e}{let n=this.fromASN(i,r);return t.raw?{value:n,raw:e.valueBeforeDecodeView}:n}}}static handleImplicitTagging(e,t,r){if(t.implicit&&"number"==typeof t.context){let t=ny.get(r);if(t.type===s.Sequence){let t=new ic;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in t.valueBlock)return t.valueBlock.value=e.valueBlock.value,t}else if(t.type===s.Set){let t=new ih;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in t.valueBlock)return t.valueBlock.value=e.valueBlock.value,t}}return e}}class nA{static serialize(e){return e instanceof r$?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){let t;if(e&&"object"==typeof e&&ng(e))return e.toASN();if(!(e&&"object"==typeof e))throw TypeError("Parameter 1 should be type of Object.");let r=e.constructor,i=ny.get(r);ny.cache(r);let n=[];if(i.itemType){if(!Array.isArray(e))throw TypeError("Parameter 1 should be type of Array.");if("number"==typeof i.itemType){let t=np(i.itemType);if(!t)throw Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);n=e.map(e=>t.toASN(e))}else n=e.map(e=>this.toAsnItem({type:i.itemType},"[]",r,e))}else for(let t in i.items){let o=i.items[t],s=e[t];if(void 0===s||o.defaultValue===s||"object"==typeof o.defaultValue&&"object"==typeof s&&function(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;let r=new Uint8Array(e),i=new Uint8Array(t);for(let t=0;t<e.byteLength;t++)if(r[t]!==i[t])return!1;return!0}(this.serialize(o.defaultValue),this.serialize(s)))continue;let a=nA.toAsnItem(o,t,r,s);if("number"==typeof o.context)if(o.implicit)if(!o.repeated&&("number"==typeof o.type||ng(o.type))){let e={};e.valueHex=a instanceof r2?iZ(a.valueBeforeDecodeView):a.valueBlock.toBER(),n.push(new rz({optional:o.optional,idBlock:{tagClass:3,tagNumber:o.context},...e}))}else n.push(new rQ({optional:o.optional,idBlock:{tagClass:3,tagNumber:o.context},value:a.valueBlock.value}));else n.push(new rQ({optional:o.optional,idBlock:{tagClass:3,tagNumber:o.context},value:[a]}));else o.repeated?n=n.concat(a):n.push(a)}switch(i.type){case s.Sequence:t=new ic({value:n});break;case s.Set:t=new ih({value:n});break;case s.Choice:if(!n[0])throw Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);t=n[0]}return t}static toAsnItem(e,t,r,i){let n;if("number"==typeof e.type){let o=e.converter;if(!o)throw Error(`Property '${t}' doesn't have converter for type ${a[e.type]} in schema '${r.name}'`);if(e.repeated){if(!Array.isArray(i))throw TypeError("Parameter 'objProp' should be type of Array.");let t=Array.from(i,e=>o.toASN(e));n=new("sequence"===e.repeated?ic:ih)({value:t})}else n=o.toASN(i)}else if(e.repeated){if(!Array.isArray(i))throw TypeError("Parameter 'objProp' should be type of Array.");let t=Array.from(i,e=>this.toASN(e));n=new("sequence"===e.repeated?ic:ih)({value:t})}else n=this.toASN(i);return n}}class nS extends Array{constructor(e=[]){if("number"==typeof e)super(e);else for(let t of(super(),e))this.push(t)}}class nC{static serialize(e){return nA.serialize(e)}static parse(e,t){return nw.parse(e,t)}static toString(e){let t=rY(iW(e)?iZ(e):nC.serialize(e));if(-1===t.offset)throw Error(`Cannot decode ASN.1 data. ${t.result.error}`);return t.result.toString()}}var nB=r(71450);function nx(e,t){if(!t)return e.join("");if(!Number.isInteger(t.size)||t.size<1)throw RangeError("Hex group size must be a positive integer");let r=[];for(let i=0;i<e.length;i+=t.size)r.push(e.slice(i,i+t.size).join(""));return r.join(t.separator)}function nE(e,t={}){let r=iJ(e),i=t.case??"lower",n=Array.from(r,e=>{let t=e.toString(16).padStart(2,"0");return"upper"===i?t.toUpperCase():t}),o="";
2if(t.line){let e=t.line.bytesPerLine;if(!Number.isInteger(e)||e<1)throw RangeError("Hex bytesPerLine must be a positive integer");let r=t.line.separator??"\n",i=[];for(let r=0;r<n.length;r+=e)i.push(nx(n.slice(r,r+e),t.group));o=i.join(r)}else o=nx(n,t.group);return`${t.prefix??""}${o}`}Object.freeze({}),Object.freeze({case:"upper"}),Object.freeze({group:{size:1,separator:":"}}),Object.freeze({case:"upper",group:{size:1,separator:":"}}),Object.freeze({group:{size:4,separator:" "}}),Object.freeze({prefix:"0x"});class nk{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let t=e.split(".");if(4!==t.length)throw Error("Invalid IPv4 address");return t.map(e=>{let t=parseInt(e,10);if(isNaN(t)||t<0||t>255)throw Error("Invalid IPv4 address part");return t})}static parseIPv6(e){let t=this.expandIPv6(e).split(":");if(8!==t.length)throw Error("Invalid IPv6 address");return t.reduce((e,t)=>{let r=parseInt(t,16);if(isNaN(r)||r<0||r>65535)throw Error("Invalid IPv6 address part");return e.push(r>>8&255),e.push(255&r),e},[])}static expandIPv6(e){if(!e.includes("::"))return e;let t=e.split("::");if(t.length>2)throw Error("Invalid IPv6 address");let r=t[0]?t[0].split(":"):[],i=t[1]?t[1].split(":"):[],n=8-(r.length+i.length);if(n<0)throw Error("Invalid IPv6 address");return[...r,...Array(n).fill("0"),...i].join(":")}static formatIPv6(e){let t=[];for(let r=0;r<16;r+=2)t.push((e[r]<<8|e[r+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){let t=e.split(":"),r=-1,i=0,n=-1,o=0;for(let e=0;e<t.length;e++)"0"===t[e]?(-1===n&&(n=e),o++):(o>i&&(r=n,i=o),n=-1,o=0);if(o>i&&(r=n,i=o),i>1){let e=t.slice(0,r).join(":"),n=t.slice(r+i).join(":");return`${e}::${n}`}return e}static parseCIDR(e){let[t,r]=e.split("/"),i=parseInt(r,10);if(this.isIPv4(t)){if(i<0||i>32)throw Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),i]}if(i<0||i>128)throw Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),i]}static decodeIP(e){if(64===e.length&&0===parseInt(e,16))return"::/0";if(16!==e.length)return e;let t=parseInt(e.slice(8),16).toString(2).split("").reduce((e,t)=>e+ +t,0),r=e.slice(0,8).replace(/(.{2})/g,e=>`${parseInt(e,16)}.`);return r=r.slice(0,-1),`${r}/${t}`}static toString(e){let t=new Uint8Array(e);if(4===t.length)return Array.from(t).join(".");if(16===t.length)return this.formatIPv6(t);if(8===t.length||32===t.length){let e=t.length/2,r=t.slice(0,e),i=t.slice(e);if(t.every(e=>0===e))return 8===t.length?"0.0.0.0/0":"::/0";let n=i.reduce((e,t)=>e+(t.toString(2).match(/1/g)||[]).length,0);if(8===t.length){let e=Array.from(r).join(".");return`${e}/${n}`}{let e=this.formatIPv6(r);return`${e}/${n}`}}return this.decodeIP(nE(e))}static fromString(e){if(e.includes("/")){let[t,r]=this.parseCIDR(e),i=new Uint8Array(t.length),n=r;for(let e=0;e<i.length;e++)n>=8?(i[e]=255,n-=8):n>0&&(i[e]=255<<8-n,n=0);let o=new Uint8Array(2*t.length);return o.set(t,0),o.set(i,t.length),o.buffer}return new Uint8Array(this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e)).buffer}}let nO=class{teletexString;printableString;universalString;utf8String;bmpString;constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};(0,nB.Cg)([nm({type:a.TeletexString})],nO.prototype,"teletexString",void 0),(0,nB.Cg)([nm({type:a.PrintableString})],nO.prototype,"printableString",void 0),(0,nB.Cg)([nm({type:a.UniversalString})],nO.prototype,"universalString",void 0),(0,nB.Cg)([nm({type:a.Utf8String})],nO.prototype,"utf8String",void 0),(0,nB.Cg)([nm({type:a.BmpString})],nO.prototype,"bmpString",void 0),nO=(0,nB.Cg)([nv({type:s.Choice})],nO);let nI=class extends nO{ia5String;anyValue;constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?nE(this.anyValue):super.toString())}};(0,nB.Cg)([nm({type:a.IA5String})],nI.prototype,"ia5String",void 0),(0,nB.Cg)([nm({type:a.Any})],nI.prototype,"anyValue",void 0),nI=(0,nB.Cg)([nv({type:s.Choice})],nI);class nN{type="";value=new nI;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],nN.prototype,"type",void 0),(0,nB.Cg)([nm({type:nI})],nN.prototype,"value",void 0);let nU=l=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,l.prototype)}};nU=l=(0,nB.Cg)([nv({type:s.Set,itemType:nN})],nU);let nT=u=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,u.prototype)}};nT=u=(0,nB.Cg)([nv({type:s.Sequence,itemType:nU})],nT);let nj=c=class extends nT{constructor(e){super(e),Object.setPrototypeOf(this,c.prototype)}};nj=c=(0,nB.Cg)([nv({type:s.Sequence})],nj);
2class n_{typeId="";value=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],n_.prototype,"typeId",void 0),(0,nB.Cg)([nm({type:a.Any,context:0})],n_.prototype,"value",void 0);class nR{nameAssigner;partyName=new nO;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:nO,optional:!0,context:0,implicit:!0})],nR.prototype,"nameAssigner",void 0),(0,nB.Cg)([nm({type:nO,context:1,implicit:!0})],nR.prototype,"partyName",void 0);let nP=class{otherName;rfc822Name;dNSName;x400Address;directoryName;ediPartyName;uniformResourceIdentifier;iPAddress;registeredID;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:n_,context:0,implicit:!0})],nP.prototype,"otherName",void 0),(0,nB.Cg)([nm({type:a.IA5String,context:1,implicit:!0})],nP.prototype,"rfc822Name",void 0),(0,nB.Cg)([nm({type:a.IA5String,context:2,implicit:!0})],nP.prototype,"dNSName",void 0),(0,nB.Cg)([nm({type:a.Any,context:3,implicit:!0})],nP.prototype,"x400Address",void 0),(0,nB.Cg)([nm({type:nj,context:4,implicit:!1})],nP.prototype,"directoryName",void 0),(0,nB.Cg)([nm({type:nR,context:5})],nP.prototype,"ediPartyName",void 0),(0,nB.Cg)([nm({type:a.IA5String,context:6,implicit:!0})],nP.prototype,"uniformResourceIdentifier",void 0),(0,nB.Cg)([nm({type:a.OctetString,context:7,implicit:!0,converter:{fromASN:e=>nk.toString(i6.fromASN(e)),toASN:e=>i6.toASN(nk.fromString(e))}})],nP.prototype,"iPAddress",void 0),(0,nB.Cg)([nm({type:a.ObjectIdentifier,context:8,implicit:!0})],nP.prototype,"registeredID",void 0),nP=(0,nB.Cg)([nv({type:s.Choice})],nP);let nH="1.3.6.1.5.5.7",nL=`${nH}.1`,nV=`${nH}.3`,nD=`${nH}.48`,n$=`${nD}.1`,nM=`${nD}.2`,nF=`${nD}.3`,nz=`${nD}.5`,nq="2.5.29",nK=`${nL}.1`;class nW{accessMethod="";accessLocation=new nP;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],nW.prototype,"accessMethod",void 0),(0,nB.Cg)([nm({type:nP})],nW.prototype,"accessLocation",void 0);let nG=f=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,f.prototype)}};nG=f=(0,nB.Cg)([nv({type:s.Sequence,itemType:nW})],nG);let nJ=`${nq}.35`;class nZ extends iX{}class nY{keyIdentifier;authorityCertIssuer;authorityCertSerialNumber;constructor(e={}){e&&Object.assign(this,e)}}(0,nB.Cg)([nm({type:nZ,context:0,optional:!0,implicit:!0})],nY.prototype,"keyIdentifier",void 0),(0,nB.Cg)([nm({type:nP,context:1,optional:!0,implicit:!0,repeated:"sequence"})],nY.prototype,"authorityCertIssuer",void 0),(0,nB.Cg)([nm({type:a.Integer,context:2,optional:!0,implicit:!0,converter:i2})],nY.prototype,"authorityCertSerialNumber",void 0);let nX=`${nq}.19`;class nQ{cA=!1;pathLenConstraint;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Boolean,defaultValue:!1})],nQ.prototype,"cA",void 0),(0,nB.Cg)([nm({type:a.Integer,optional:!0})],nQ.prototype,"pathLenConstraint",void 0);let n0=h=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,h.prototype)}};n0=h=(0,nB.Cg)([nv({type:s.Sequence,itemType:nP})],n0);let n1=p=class extends n0{constructor(e){super(e),Object.setPrototypeOf(this,p.prototype)}};n1=p=(0,nB.Cg)([nv({type:s.Sequence})],n1);let n2=`${nq}.32`,n8=class{ia5String;visibleString;bmpString;utf8String;constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};(0,nB.Cg)([nm({type:a.IA5String})],n8.prototype,"ia5String",void 0),(0,nB.Cg)([nm({type:a.VisibleString})],n8.prototype,"visibleString",void 0),(0,nB.Cg)([nm({type:a.BmpString})],n8.prototype,"bmpString",void 0),(0,nB.Cg)([nm({type:a.Utf8String})],n8.prototype,"utf8String",void 0),n8=(0,nB.Cg)([nv({type:s.Choice})],n8);class n3{organization=new n8;noticeNumbers=[];constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:n8})],n3.prototype,"organization",void 0),(0,nB.Cg)([nm({type:a.Integer,repeated:"sequence"})],n3.prototype,"noticeNumbers",void 0);class n4{noticeRef;explicitText;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:n3,optional:!0})],n4.prototype,"noticeRef",void 0),(0,nB.Cg)([nm({type:n8,optional:!0})],n4.prototype,"explicitText",void 0);let n6=class{cPSuri;userNotice;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:a.IA5String})],n6.prototype,"cPSuri",void 0),(0,nB.Cg)([nm({type:n4})],n6.prototype,"userNotice",void 0),n6=(0,nB.Cg)([nv({type:s.Choice})],n6);
2class n5{policyQualifierId="";qualifier=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],n5.prototype,"policyQualifierId",void 0),(0,nB.Cg)([nm({type:a.Any})],n5.prototype,"qualifier",void 0);class n9{policyIdentifier="";policyQualifiers;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],n9.prototype,"policyIdentifier",void 0),(0,nB.Cg)([nm({type:n5,repeated:"sequence",optional:!0})],n9.prototype,"policyQualifiers",void 0);let n7=g=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,g.prototype)}};n7=g=(0,nB.Cg)([nv({type:s.Sequence,itemType:n9})],n7);let oe=class{value;constructor(e=0){this.value=e}};(0,nB.Cg)([nm({type:a.Integer})],oe.prototype,"value",void 0),oe=(0,nB.Cg)([nv({type:s.Choice})],oe);let ot=class extends oe{};ot=(0,nB.Cg)([nv({type:s.Choice})],ot);let or=`${nq}.31`;!function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"}(y||(y={}));class oi extends iY{toJSON(){let e=[],t=this.toNumber();return t&y.aACompromise&&e.push("aACompromise"),t&y.affiliationChanged&&e.push("affiliationChanged"),t&y.cACompromise&&e.push("cACompromise"),t&y.certificateHold&&e.push("certificateHold"),t&y.cessationOfOperation&&e.push("cessationOfOperation"),t&y.keyCompromise&&e.push("keyCompromise"),t&y.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&y.superseded&&e.push("superseded"),t&y.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let on=class{fullName;nameRelativeToCRLIssuer;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:nP,context:0,repeated:"sequence",implicit:!0})],on.prototype,"fullName",void 0),(0,nB.Cg)([nm({type:nU,context:1,implicit:!0})],on.prototype,"nameRelativeToCRLIssuer",void 0),on=(0,nB.Cg)([nv({type:s.Choice})],on);class oo{distributionPoint;reasons;cRLIssuer;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:on,context:0,optional:!0})],oo.prototype,"distributionPoint",void 0),(0,nB.Cg)([nm({type:oi,context:1,optional:!0,implicit:!0})],oo.prototype,"reasons",void 0),(0,nB.Cg)([nm({type:nP,context:2,optional:!0,repeated:"sequence",implicit:!0})],oo.prototype,"cRLIssuer",void 0);let os=d=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,d.prototype)}};os=d=(0,nB.Cg)([nv({type:s.Sequence,itemType:oo})],os);let oa=v=class extends os{constructor(e){super(e),Object.setPrototypeOf(this,v.prototype)}};oa=v=(0,nB.Cg)([nv({type:s.Sequence,itemType:oo})],oa);class ol{static ONLY=!1;distributionPoint;onlyContainsUserCerts=ol.ONLY;onlyContainsCACerts=ol.ONLY;onlySomeReasons;indirectCRL=ol.ONLY;onlyContainsAttributeCerts=ol.ONLY;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:on,context:0,optional:!0})],ol.prototype,"distributionPoint",void 0),(0,nB.Cg)([nm({type:a.Boolean,context:1,defaultValue:ol.ONLY,implicit:!0})],ol.prototype,"onlyContainsUserCerts",void 0),(0,nB.Cg)([nm({type:a.Boolean,context:2,defaultValue:ol.ONLY,implicit:!0})],ol.prototype,"onlyContainsCACerts",void 0),(0,nB.Cg)([nm({type:oi,context:3,optional:!0,implicit:!0})],ol.prototype,"onlySomeReasons",void 0),(0,nB.Cg)([nm({type:a.Boolean,context:4,defaultValue:ol.ONLY,implicit:!0})],ol.prototype,"indirectCRL",void 0),(0,nB.Cg)([nm({type:a.Boolean,context:5,defaultValue:ol.ONLY,implicit:!0})],ol.prototype,"onlyContainsAttributeCerts",void 0),function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"}(m||(m={}));let ou=class{reason=m.unspecified;constructor(e=m.unspecified){this.reason=e}toJSON(){return m[this.reason]}toString(){return this.toJSON()}};(0,nB.Cg)([nm({type:a.Enumerated})],ou.prototype,"reason",void 0),ou=(0,nB.Cg)([nv({type:s.Choice})],ou);let oc=`${nq}.37`,of=b=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,b.prototype)}};of=b=(0,nB.Cg)([nv({type:s.Sequence,itemType:a.ObjectIdentifier})],of);let oh=`${nV}.1`,op=`${nV}.2`,og=`${nV}.3`,od=`${nV}.4`,oy=`${nV}.8`,ov=`${nV}.9`,om=class{value;constructor(e=new ArrayBuffer(0)){this.value=e}};(0,nB.Cg)([nm({type:a.Integer,converter:i2})],om.prototype,"value",void 0),om=(0,nB.Cg)([nv({type:s.Choice})],om);let ob=class{value=new Date;constructor(e){e&&(this.value=e)}};(0,nB.Cg)([nm({type:a.GeneralizedTime})],ob.prototype,"value",void 0),ob=(0,nB.Cg)([nv({type:s.Choice})],ob);let ow=w=class extends n0{constructor(e){super(e),Object.setPrototypeOf(this,w.prototype)}};ow=w=(0,nB.Cg)([nv({type:s.Sequence})],ow);let oA=`${nq}.15`;!function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"}(A||(A={}));class oS extends iY{toJSON(){let e=this.toNumber(),t=[];return e&A.cRLSign&&t.push("crlSign"),e&A.dataEncipherment&&t.push("dataEncipherment"),e&A.decipherOnly&&t.pu
2sh("decipherOnly"),e&A.digitalSignature&&t.push("digitalSignature"),e&A.encipherOnly&&t.push("encipherOnly"),e&A.keyAgreement&&t.push("keyAgreement"),e&A.keyCertSign&&t.push("keyCertSign"),e&A.keyEncipherment&&t.push("keyEncipherment"),e&A.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class oC{base=new nP;minimum=0;maximum;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:nP})],oC.prototype,"base",void 0),(0,nB.Cg)([nm({type:a.Integer,context:0,defaultValue:0,implicit:!0})],oC.prototype,"minimum",void 0),(0,nB.Cg)([nm({type:a.Integer,context:1,optional:!0,implicit:!0})],oC.prototype,"maximum",void 0);let oB=S=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,S.prototype)}};oB=S=(0,nB.Cg)([nv({type:s.Sequence,itemType:oC})],oB);class ox{permittedSubtrees;excludedSubtrees;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oB,context:0,optional:!0,implicit:!0})],ox.prototype,"permittedSubtrees",void 0),(0,nB.Cg)([nm({type:oB,context:1,optional:!0,implicit:!0})],ox.prototype,"excludedSubtrees",void 0);class oE{requireExplicitPolicy;inhibitPolicyMapping;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer,context:0,implicit:!0,optional:!0,converter:i2})],oE.prototype,"requireExplicitPolicy",void 0),(0,nB.Cg)([nm({type:a.Integer,context:1,implicit:!0,optional:!0,converter:i2})],oE.prototype,"inhibitPolicyMapping",void 0);class ok{issuerDomainPolicy="";subjectDomainPolicy="";constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],ok.prototype,"issuerDomainPolicy",void 0),(0,nB.Cg)([nm({type:a.ObjectIdentifier})],ok.prototype,"subjectDomainPolicy",void 0);let oO=C=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,C.prototype)}};oO=C=(0,nB.Cg)([nv({type:s.Sequence,itemType:ok})],oO);let oI=`${nq}.17`,oN=B=class extends n0{constructor(e){super(e),Object.setPrototypeOf(this,B.prototype)}};oN=B=(0,nB.Cg)([nv({type:s.Sequence})],oN);class oU{type="";values=[];constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],oU.prototype,"type",void 0),(0,nB.Cg)([nm({type:a.Any,repeated:"set"})],oU.prototype,"values",void 0);let oT=x=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,x.prototype)}};oT=x=(0,nB.Cg)([nv({type:s.Sequence,itemType:oU})],oT);let oj=`${nq}.14`;class o_ extends nZ{}class oR{notBefore;notAfter;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.GeneralizedTime,context:0,implicit:!0,optional:!0})],oR.prototype,"notBefore",void 0),(0,nB.Cg)([nm({type:a.GeneralizedTime,context:1,implicit:!0,optional:!0})],oR.prototype,"notAfter",void 0),function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"}(E||(E={}));class oP extends iY{toJSON(){let e=[],t=this.toNumber();return t&E.pKIXCertificate&&e.push("pKIXCertificate"),t&E.newExtensions&&e.push("newExtensions"),t&E.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class oH{entrustVers="";entrustInfoFlags=new oP;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.GeneralString})],oH.prototype,"entrustVers",void 0),(0,nB.Cg)([nm({type:oP})],oH.prototype,"entrustInfoFlags",void 0);let oL=k=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,k.prototype)}};oL=k=(0,nB.Cg)([nv({type:s.Sequence,itemType:nW})],oL);class oV{algorithm="";parameters;constructor(e={}){Object.assign(this,e)}isEqual(e){return e instanceof oV&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&function(e,t,r={}){let i=iJ(e),n=iJ(t);if(!r.constantTime&&i.byteLength!==n.byteLength)return!1;let o=Math.max(i.byteLength,n.byteLength),s=i.byteLength^n.byteLength;for(let e=0;e<o;e++)s|=(i[e]??0)^(n[e]??0);return 0===s}(e.parameters,this.parameters)||e.parameters===this.parameters)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],oV.prototype,"algorithm",void 0),(0,nB.Cg)([nm({type:a.Any,optional:!0})],oV.prototype,"parameters",void 0);class oD{algorithm=new oV;subjectPublicKey=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oV})],oD.prototype,"algorithm",void 0),(0,nB.Cg)([nm({type:a.BitString})],oD.prototype,"subjectPublicKey",void 0);let o$=class{utcTime;generalTime;constructor(e){if(e)if("string"==typeof e||"number"==typeof e||e instanceof Date){let t=new Date(e);t.setMilliseconds(0),t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){let e=this.utcTime||this.generalTime;if(!e)throw Error("Cannot get time from CHOICE object");return e}};(0,nB.Cg)([nm({type:a.UTCTime})],o$.prototype,"utcTime",void 0),(0,nB.Cg)([nm({type:a.GeneralizedTime})],o$.prototype,"generalTime",void 0),o$=(0,nB.Cg)([nv({type:s.Choice})],o$);class oM{notBefore=new o$(new Date);notAfter=new o$(new Date);constructor(e){e&&(this.notBefore=new o$(e.notBefore),this.notAfter=new o$(e.notAfter))}}(0,nB.Cg)([nm({type:o$})],oM.prototype,"notBefore",void 0),(0,nB.Cg)([nm({type:o$})],oM.prototype,"notAfter",void 0);class oF{static CRITICAL=!1;extnID="";critical=oF.CRITICAL;extnValue=new iX;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],oF.prototype,"extnID",void 0),(0,nB.Cg)([nm({type:a.Boolean,defaultValue:oF.CRITICAL})],oF.prototype,"critical",void 0),(0,nB.Cg)([nm({type:iX})],oF.prototype,"extnValue",void 0);let oz=O=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,O.prototype)}};
2oz=O=(0,nB.Cg)([nv({type:s.Sequence,itemType:oF})],oz),function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"}(I||(I={}));class oq{version=I.v1;serialNumber=new ArrayBuffer(0);signature=new oV;issuer=new nj;validity=new oM;subject=new nj;subjectPublicKeyInfo=new oD;issuerUniqueID;subjectUniqueID;extensions;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer,context:0,defaultValue:I.v1})],oq.prototype,"version",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],oq.prototype,"serialNumber",void 0),(0,nB.Cg)([nm({type:oV})],oq.prototype,"signature",void 0),(0,nB.Cg)([nm({type:nj})],oq.prototype,"issuer",void 0),(0,nB.Cg)([nm({type:oM})],oq.prototype,"validity",void 0),(0,nB.Cg)([nm({type:nj})],oq.prototype,"subject",void 0),(0,nB.Cg)([nm({type:oD})],oq.prototype,"subjectPublicKeyInfo",void 0),(0,nB.Cg)([nm({type:a.BitString,context:1,implicit:!0,optional:!0})],oq.prototype,"issuerUniqueID",void 0),(0,nB.Cg)([nm({type:a.BitString,context:2,implicit:!0,optional:!0})],oq.prototype,"subjectUniqueID",void 0),(0,nB.Cg)([nm({type:oz,context:3,optional:!0})],oq.prototype,"extensions",void 0);class oK{tbsCertificate=new oq;tbsCertificateRaw;signatureAlgorithm=new oV;signatureValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oq,raw:!0})],oK.prototype,"tbsCertificate",void 0),(0,nB.Cg)([nm({type:oV})],oK.prototype,"signatureAlgorithm",void 0),(0,nB.Cg)([nm({type:a.BitString})],oK.prototype,"signatureValue",void 0);class oW{userCertificate=new ArrayBuffer(0);revocationDate=new o$;crlEntryExtensions;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer,converter:i2})],oW.prototype,"userCertificate",void 0),(0,nB.Cg)([nm({type:o$})],oW.prototype,"revocationDate",void 0),(0,nB.Cg)([nm({type:oF,optional:!0,repeated:"sequence"})],oW.prototype,"crlEntryExtensions",void 0);class oG{version;signature=new oV;issuer=new nj;thisUpdate=new o$;nextUpdate;revokedCertificates;crlExtensions;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer,optional:!0})],oG.prototype,"version",void 0),(0,nB.Cg)([nm({type:oV})],oG.prototype,"signature",void 0),(0,nB.Cg)([nm({type:nj})],oG.prototype,"issuer",void 0),(0,nB.Cg)([nm({type:o$})],oG.prototype,"thisUpdate",void 0),(0,nB.Cg)([nm({type:o$,optional:!0})],oG.prototype,"nextUpdate",void 0),(0,nB.Cg)([nm({type:oW,repeated:"sequence",optional:!0})],oG.prototype,"revokedCertificates",void 0),(0,nB.Cg)([nm({type:oF,optional:!0,context:0,repeated:"sequence"})],oG.prototype,"crlExtensions",void 0);class oJ{tbsCertList=new oG;tbsCertListRaw;signatureAlgorithm=new oV;signature=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oG,raw:!0})],oJ.prototype,"tbsCertList",void 0),(0,nB.Cg)([nm({type:oV})],oJ.prototype,"signatureAlgorithm",void 0),(0,nB.Cg)([nm({type:a.BitString})],oJ.prototype,"signature",void 0);class oZ{issuer=new nj;serialNumber=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:nj})],oZ.prototype,"issuer",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],oZ.prototype,"serialNumber",void 0);let oY=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:o_,context:0,implicit:!0})],oY.prototype,"subjectKeyIdentifier",void 0),(0,nB.Cg)([nm({type:oZ})],oY.prototype,"issuerAndSerialNumber",void 0),oY=(0,nB.Cg)([nv({type:s.Choice})],oY),function(e){e[e.v0=0]="v0",e[e.v1=1]="v1",e[e.v2=2]="v2",e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v5=5]="v5"}(N||(N={}));let oX=class extends oV{};oX=(0,nB.Cg)([nv({type:s.Sequence})],oX);let oQ=class extends oV{};oQ=(0,nB.Cg)([nv({type:s.Sequence})],oQ);let o0=class extends oV{};o0=(0,nB.Cg)([nv({type:s.Sequence})],o0);let o1=class extends oV{};o1=(0,nB.Cg)([nv({type:s.Sequence})],o1);let o2=class extends oV{};o2=(0,nB.Cg)([nv({type:s.Sequence})],o2);let o8=class extends oV{};o8=(0,nB.Cg)([nv({type:s.Sequence})],o8);class o3{attrType="";attrValues=[];constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],o3.prototype,"attrType",void 0),(0,nB.Cg)([nm({type:a.Any,repeated:"set"})],o3.prototype,"attrValues",void 0);class o4{version=N.v0;sid=new oY;digestAlgorithm=new oX;signedAttrs;signedAttrsRaw;signatureAlgorithm=new oQ;signature=new iX;unsignedAttrs;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer}
2)],o4.prototype,"version",void 0),(0,nB.Cg)([nm({type:oY})],o4.prototype,"sid",void 0),(0,nB.Cg)([nm({type:oX})],o4.prototype,"digestAlgorithm",void 0),(0,nB.Cg)([nm({type:o3,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],o4.prototype,"signedAttrs",void 0),(0,nB.Cg)([nm({type:oQ})],o4.prototype,"signatureAlgorithm",void 0),(0,nB.Cg)([nm({type:iX})],o4.prototype,"signature",void 0),(0,nB.Cg)([nm({type:o3,repeated:"set",context:1,implicit:!0,optional:!0})],o4.prototype,"unsignedAttrs",void 0);let o6=U=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,U.prototype)}};o6=U=(0,nB.Cg)([nv({type:s.Set,itemType:o4})],o6);let o5=class extends o4{};o5=(0,nB.Cg)([nv({type:s.Sequence})],o5);let o9=class extends o${};o9=(0,nB.Cg)([nv({type:s.Choice})],o9);class o7{acIssuer=new nP;acSerial=0;attrs=[];constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:nP})],o7.prototype,"acIssuer",void 0),(0,nB.Cg)([nm({type:a.Integer})],o7.prototype,"acSerial",void 0),(0,nB.Cg)([nm({type:oU,repeated:"sequence"})],o7.prototype,"attrs",void 0);let se=T=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,T.prototype)}};se=T=(0,nB.Cg)([nv({type:s.Sequence,itemType:a.ObjectIdentifier})],se);class st{pathLenConstraint;permittedAttrs;excludedAttrs;permitUnSpecified=!0;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer,optional:!0})],st.prototype,"pathLenConstraint",void 0),(0,nB.Cg)([nm({type:se,implicit:!0,context:0,optional:!0})],st.prototype,"permittedAttrs",void 0),(0,nB.Cg)([nm({type:se,implicit:!0,context:1,optional:!0})],st.prototype,"excludedAttrs",void 0),(0,nB.Cg)([nm({type:a.Boolean,defaultValue:!0})],st.prototype,"permitUnSpecified",void 0);class sr{issuer=new n0;serial=new ArrayBuffer(0);issuerUID=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:n0})],sr.prototype,"issuer",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],sr.prototype,"serial",void 0),(0,nB.Cg)([nm({type:a.BitString,optional:!0})],sr.prototype,"issuerUID",void 0),function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"}(j||(j={}));class si{digestedObjectType=j.publicKey;otherObjectTypeID;digestAlgorithm=new oV;objectDigest=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Enumerated})],si.prototype,"digestedObjectType",void 0),(0,nB.Cg)([nm({type:a.ObjectIdentifier,optional:!0})],si.prototype,"otherObjectTypeID",void 0),(0,nB.Cg)([nm({type:oV})],si.prototype,"digestAlgorithm",void 0),(0,nB.Cg)([nm({type:a.BitString})],si.prototype,"objectDigest",void 0);class sn{issuerName;baseCertificateID;objectDigestInfo;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:n0,optional:!0})],sn.prototype,"issuerName",void 0),(0,nB.Cg)([nm({type:sr,context:0,implicit:!0,optional:!0})],sn.prototype,"baseCertificateID",void 0),(0,nB.Cg)([nm({type:si,context:1,implicit:!0,optional:!0})],sn.prototype,"objectDigestInfo",void 0);let so=class{v1Form;v2Form;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:nP,repeated:"sequence"})],so.prototype,"v1Form",void 0),(0,nB.Cg)([nm({type:sn,context:0,implicit:!0})],so.prototype,"v2Form",void 0),so=(0,nB.Cg)([nv({type:s.Choice})],so);class ss{notBeforeTime=new Date;notAfterTime=new Date;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.GeneralizedTime})],ss.prototype,"notBeforeTime",void 0),(0,nB.Cg)([nm({type:a.GeneralizedTime})],ss.prototype,"notAfterTime",void 0);class sa{baseCertificateID;entityName;objectDigestInfo;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:sr,implicit:!0,context:0,optional:!0})],sa.prototype,"baseCertificateID",void 0),(0,nB.Cg)([nm({type:n0,implicit:!0,context:1,optional:!0})],sa.prototype,"entityName",void 0),(0,nB.Cg)([nm({type:si,implicit:!0,context:2,optional:!0})],sa.prototype,"objectDigestInfo",void 0),function(e){e[e.v2=1]="v2"}(_||(_={}));class sl{version=_.v2;holder=new sa;issuer=new so;signature=new oV;serialNumber=new ArrayBuffer(0);attrCertValidityPeriod=new ss;attributes=[];issuerUniqueID;extensions;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer}
2)],sl.prototype,"version",void 0),(0,nB.Cg)([nm({type:sa})],sl.prototype,"holder",void 0),(0,nB.Cg)([nm({type:so})],sl.prototype,"issuer",void 0),(0,nB.Cg)([nm({type:oV})],sl.prototype,"signature",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],sl.prototype,"serialNumber",void 0),(0,nB.Cg)([nm({type:ss})],sl.prototype,"attrCertValidityPeriod",void 0),(0,nB.Cg)([nm({type:oU,repeated:"sequence"})],sl.prototype,"attributes",void 0),(0,nB.Cg)([nm({type:a.BitString,optional:!0})],sl.prototype,"issuerUniqueID",void 0),(0,nB.Cg)([nm({type:oz,optional:!0})],sl.prototype,"extensions",void 0);class su{acinfo=new sl;signatureAlgorithm=new oV;signatureValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:sl})],su.prototype,"acinfo",void 0),(0,nB.Cg)([nm({type:oV})],su.prototype,"signatureAlgorithm",void 0),(0,nB.Cg)([nm({type:a.BitString})],su.prototype,"signatureValue",void 0),function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"}(R||(R={}));class sc extends iY{}class sf{type="";value=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier,implicit:!0,context:0})],sf.prototype,"type",void 0),(0,nB.Cg)([nm({type:a.Any,implicit:!0,context:1})],sf.prototype,"value",void 0);class sh{policyId="";classList=new sc(R.unclassified);securityCategories;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sh.prototype,"policyId",void 0),(0,nB.Cg)([nm({type:sc,defaultValue:new sc(R.unclassified)})],sh.prototype,"classList",void 0),(0,nB.Cg)([nm({type:sf,repeated:"set"})],sh.prototype,"securityCategories",void 0);class sp{cotets;oid;string;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:iX})],sp.prototype,"cotets",void 0),(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sp.prototype,"oid",void 0),(0,nB.Cg)([nm({type:a.Utf8String})],sp.prototype,"string",void 0);class sg{policyAuthority;values=[];constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:n0,implicit:!0,context:0,optional:!0})],sg.prototype,"policyAuthority",void 0),(0,nB.Cg)([nm({type:sp,repeated:"sequence"})],sg.prototype,"values",void 0);class sd{targetCertificate=new sr;targetName;certDigestInfo;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:sr})],sd.prototype,"targetCertificate",void 0),(0,nB.Cg)([nm({type:nP,optional:!0})],sd.prototype,"targetName",void 0),(0,nB.Cg)([nm({type:si,optional:!0})],sd.prototype,"certDigestInfo",void 0);let sy=class{targetName;targetGroup;targetCert;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:nP,context:0,implicit:!0})],sy.prototype,"targetName",void 0),(0,nB.Cg)([nm({type:nP,context:1,implicit:!0})],sy.prototype,"targetGroup",void 0),(0,nB.Cg)([nm({type:sd,context:2,implicit:!0})],sy.prototype,"targetCert",void 0),sy=(0,nB.Cg)([nv({type:s.Choice})],sy);let sv=P=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,P.prototype)}};sv=P=(0,nB.Cg)([nv({type:s.Sequence,itemType:sy})],sv);let sm=H=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,H.prototype)}};sm=H=(0,nB.Cg)([nv({type:s.Sequence,itemType:sv})],sm);class sb{roleAuthority;roleName;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:n0,implicit:!0,context:0,optional:!0})],sb.prototype,"roleAuthority",void 0),(0,nB.Cg)([nm({type:nP,implicit:!0,context:1})],sb.prototype,"roleName",void 0);class sw{service=new nP;ident=new nP;authInfo;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:nP})],sw.prototype,"service",void 0),(0,nB.Cg)([nm({type:nP})],sw.prototype,"ident",void 0),(0,nB.Cg)([nm({type:iX,optional:!0})],sw.prototype,"authInfo",void 0);class sA{otherCertFormat="";otherCert=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sA.prototype,"otherCertFormat",void 0),(0,nB.Cg)([nm({type:a.Any})],sA.prototype,"otherCert",void 0);let sS=class{certificate;v2AttrCert;other;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:oK})],sS.prototype,"certificate",void 0),(0,nB.Cg)([nm({type:su,context:2,implicit:!0})],sS.prototype,"v2AttrCert",void 0),(0,nB.Cg)([nm({type:sA,context:3,implicit:!0})],sS.prototype,"other",void 0),sS=(0,nB.Cg)([nv({type:s.Choice})],sS);let sC=L=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,L.prototype)}};sC=L=(0,nB.Cg)([nv({type:s.Set,itemType:sS})],sC);class sB{contentType="";content=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sB.prototype,"contentType",void 0),(0,nB.Cg)([nm({type:a.Any,context:0})],sB.prototype,"content",void 0);let sx=class{single;any;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:iX})],sx.prototype,"single",void 0),(0,nB.Cg)([nm({type:a.Any})],sx.prototype,"any",void 0),sx=(0,nB.Cg)([nv({type:s.Choice})],sx);class sE{eContentType="";eContent;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sE.prototype,"eContentType",void 0),(0,nB.Cg)([nm({type:sx,context:0,optional:!0})],sE.prototype,"eContent",void 0);let sk=class{value;constructedValue;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:iX,context:0,implicit:!0,optional:!0})],sk.prototype,"value",void 0),(0,nB.Cg)([nm({type:iX,converter:{fromASN:e=>new iX(e.getValue()),toASN:e=>e.toASN()},context:0,implicit:!0,optional:!0,repeated:"sequence"})],sk.prototype,"constructedValue",void 0),sk=(0,nB.Cg)([nv({type:s.Choice})],sk);class sO{contentType="";contentEncryptionAlgorithm=new o1;encryptedContent;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sO.prototype,"contentType",void 0),(0,nB.Cg)([nm({type:o1})],sO.prototype,"contentEncryptionAlgorithm",void 0),(0,nB.Cg)([nm({type:sk,optional:!0})],sO.prototype,"encryptedContent",void 0);class sI{keyAttrId="";keyAttr;
2constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sI.prototype,"keyAttrId",void 0),(0,nB.Cg)([nm({type:a.Any,optional:!0})],sI.prototype,"keyAttr",void 0);class sN{subjectKeyIdentifier=new o_;date;other;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:o_})],sN.prototype,"subjectKeyIdentifier",void 0),(0,nB.Cg)([nm({type:a.GeneralizedTime,optional:!0})],sN.prototype,"date",void 0),(0,nB.Cg)([nm({type:sI,optional:!0})],sN.prototype,"other",void 0);let sU=class{rKeyId;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:sN,context:0,implicit:!0,optional:!0})],sU.prototype,"rKeyId",void 0),(0,nB.Cg)([nm({type:oZ,optional:!0})],sU.prototype,"issuerAndSerialNumber",void 0),sU=(0,nB.Cg)([nv({type:s.Choice})],sU);class sT{rid=new sU;encryptedKey=new iX;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:sU})],sT.prototype,"rid",void 0),(0,nB.Cg)([nm({type:iX})],sT.prototype,"encryptedKey",void 0);let sj=V=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,V.prototype)}};sj=V=(0,nB.Cg)([nv({type:s.Sequence,itemType:sT})],sj);class s_{algorithm=new oV;publicKey=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oV})],s_.prototype,"algorithm",void 0),(0,nB.Cg)([nm({type:a.BitString})],s_.prototype,"publicKey",void 0);let sR=class{subjectKeyIdentifier;originatorKey;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:o_,context:0,implicit:!0,optional:!0})],sR.prototype,"subjectKeyIdentifier",void 0),(0,nB.Cg)([nm({type:s_,context:1,implicit:!0,optional:!0})],sR.prototype,"originatorKey",void 0),(0,nB.Cg)([nm({type:oZ,optional:!0})],sR.prototype,"issuerAndSerialNumber",void 0),sR=(0,nB.Cg)([nv({type:s.Choice})],sR);class sP{version=N.v3;originator=new sR;ukm;keyEncryptionAlgorithm=new o0;recipientEncryptedKeys=new sj;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],sP.prototype,"version",void 0),(0,nB.Cg)([nm({type:sR,context:0})],sP.prototype,"originator",void 0),(0,nB.Cg)([nm({type:iX,context:1,optional:!0})],sP.prototype,"ukm",void 0),(0,nB.Cg)([nm({type:o0})],sP.prototype,"keyEncryptionAlgorithm",void 0),(0,nB.Cg)([nm({type:sj})],sP.prototype,"recipientEncryptedKeys",void 0);let sH=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:o_,context:0,implicit:!0})],sH.prototype,"subjectKeyIdentifier",void 0),(0,nB.Cg)([nm({type:oZ})],sH.prototype,"issuerAndSerialNumber",void 0),sH=(0,nB.Cg)([nv({type:s.Choice})],sH);class sL{version=N.v0;rid=new sH;keyEncryptionAlgorithm=new o0;encryptedKey=new iX;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],sL.prototype,"version",void 0),(0,nB.Cg)([nm({type:sH})],sL.prototype,"rid",void 0),(0,nB.Cg)([nm({type:o0})],sL.prototype,"keyEncryptionAlgorithm",void 0),(0,nB.Cg)([nm({type:iX})],sL.prototype,"encryptedKey",void 0);class sV{keyIdentifier=new iX;date;other;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:iX})],sV.prototype,"keyIdentifier",void 0),(0,nB.Cg)([nm({type:a.GeneralizedTime,optional:!0})],sV.prototype,"date",void 0),(0,nB.Cg)([nm({type:sI,optional:!0})],sV.prototype,"other",void 0);class sD{version=N.v4;kekid=new sV;keyEncryptionAlgorithm=new o0;encryptedKey=new iX;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],sD.prototype,"version",void 0),(0,nB.Cg)([nm({type:sV})],sD.prototype,"kekid",void 0),(0,nB.Cg)([nm({type:o0})],sD.prototype,"keyEncryptionAlgorithm",void 0),(0,nB.Cg)([nm({type:iX})],sD.prototype,"encryptedKey",void 0);class s${version=N.v0;keyDerivationAlgorithm;keyEncryptionAlgorithm=new o0;encryptedKey=new iX;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],s$.prototype,"version",void 0),(0,nB.Cg)([nm({type:o8,context:0,optional:!0})],s$.prototype,"keyDerivationAlgorithm",void 0),(0,nB.Cg)([nm({type:o0})],s$.prototype,"keyEncryptionAlgorithm",void 0),(0,nB.Cg)([nm({type:iX})],s$.prototype,"encryptedKey",void 0);class sM{oriType="";oriValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sM.prototype,"oriType",void 0),(0,nB.Cg)([nm({type:a.Any})],sM.prototype,"oriValue",void 0);let sF=class{ktri;kari;kekri;pwri;ori;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:sL,optional:!0})],sF.prototype,"ktri",void 0),(0,nB.Cg)([nm({type:sP,context:1,implicit:!0,optional:!0})],sF.prototype,"kari",void 0),(0,nB.Cg)([nm({type:sD,context:2,implicit:!0,optional:!0})],sF.prototype,"kekri",void 0),(0,nB.Cg)([nm({type:s$,context:3,implicit:!0,optional:!0})],sF.prototype,"pwri",void 0),(0,nB.Cg)([nm({type:sM,context:4,implicit:!0,optional:!0})],sF.prototype,"ori",void 0),sF=(0,nB.Cg)([nv({type:s.Choice})],sF);let sz=D=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,D.prototype)}};sz=D=(0,nB.Cg)([nv({type:s.Set,itemType:sF})],sz);class sq{otherRevInfoFormat="";otherRevInfo=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],sq.prototype,"otherRevInfoFormat",void 0),(0,nB.Cg)([nm({type:a.Any})],sq.prototype,"otherRevInfo",void 0);let sK=class{other=new sq;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:sq,context:1,implicit:!0})],sK.prototype,"other",void 0),sK=(0,nB.Cg)([nv({type:s.Choice})],sK);let sW=$=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,$.prototype)}};sW=$=(0,nB.Cg)([nv({type:s.Set,itemType:sK})],sW);
2class sG{certs;crls;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:sC,context:0,implicit:!0,optional:!0})],sG.prototype,"certs",void 0),(0,nB.Cg)([nm({type:sW,context:1,implicit:!0,optional:!0})],sG.prototype,"crls",void 0);let sJ=M=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,M.prototype)}};sJ=M=(0,nB.Cg)([nv({type:s.Set,itemType:o3})],sJ);class sZ{version=N.v0;originatorInfo;recipientInfos=new sz;encryptedContentInfo=new sO;unprotectedAttrs;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],sZ.prototype,"version",void 0),(0,nB.Cg)([nm({type:sG,context:0,implicit:!0,optional:!0})],sZ.prototype,"originatorInfo",void 0),(0,nB.Cg)([nm({type:sz})],sZ.prototype,"recipientInfos",void 0),(0,nB.Cg)([nm({type:sO})],sZ.prototype,"encryptedContentInfo",void 0),(0,nB.Cg)([nm({type:sJ,context:1,implicit:!0,optional:!0})],sZ.prototype,"unprotectedAttrs",void 0);let sY=F=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,F.prototype)}};sY=F=(0,nB.Cg)([nv({type:s.Set,itemType:oX})],sY);class sX{version=N.v0;digestAlgorithms=new sY;encapContentInfo=new sE;certificates;crls;signerInfos=new o6;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],sX.prototype,"version",void 0),(0,nB.Cg)([nm({type:sY})],sX.prototype,"digestAlgorithms",void 0),(0,nB.Cg)([nm({type:sE})],sX.prototype,"encapContentInfo",void 0),(0,nB.Cg)([nm({type:sC,context:0,implicit:!0,optional:!0})],sX.prototype,"certificates",void 0),(0,nB.Cg)([nm({type:sW,context:1,implicit:!0,optional:!0})],sX.prototype,"crls",void 0),(0,nB.Cg)([nm({type:o6})],sX.prototype,"signerInfos",void 0);let sQ="1.2.840.10045.2.1",s0="1.2.840.10045.4.1",s1="1.2.840.10045.4.3.1",s2="1.2.840.10045.4.3.2",s8="1.2.840.10045.4.3.3",s3="1.2.840.10045.4.3.4",s4="1.2.840.10045.3.1.7",s6="1.3.132.0.34",s5="1.3.132.0.35";function s9(e){return new oV({algorithm:e})}let s7=s9(s0);s9(s1);let ae=s9(s2),at=s9(s8),ar=s9(s3),ai=class{fieldType;parameters;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:a.ObjectIdentifier})],ai.prototype,"fieldType",void 0),(0,nB.Cg)([nm({type:a.Any})],ai.prototype,"parameters",void 0),ai=(0,nB.Cg)([nv({type:s.Sequence})],ai);class an extends iX{}let ao=class{a;b;seed;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:a.OctetString})],ao.prototype,"a",void 0),(0,nB.Cg)([nm({type:a.OctetString})],ao.prototype,"b",void 0),(0,nB.Cg)([nm({type:a.BitString,optional:!0})],ao.prototype,"seed",void 0),ao=(0,nB.Cg)([nv({type:s.Sequence})],ao),function(e){e[e.ecpVer1=1]="ecpVer1"}(z||(z={}));let as=class{version=z.ecpVer1;fieldID;curve;base;order;cofactor;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:a.Integer})],as.prototype,"version",void 0),(0,nB.Cg)([nm({type:ai})],as.prototype,"fieldID",void 0),(0,nB.Cg)([nm({type:ao})],as.prototype,"curve",void 0),(0,nB.Cg)([nm({type:an})],as.prototype,"base",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],as.prototype,"order",void 0),(0,nB.Cg)([nm({type:a.Integer,optional:!0})],as.prototype,"cofactor",void 0),as=(0,nB.Cg)([nv({type:s.Sequence})],as);let aa=class{namedCurve;implicitCurve;specifiedCurve;constructor(e={}){Object.assign(this,e)}};(0,nB.Cg)([nm({type:a.ObjectIdentifier})],aa.prototype,"namedCurve",void 0),(0,nB.Cg)([nm({type:a.Null})],aa.prototype,"implicitCurve",void 0),(0,nB.Cg)([nm({type:as})],aa.prototype,"specifiedCurve",void 0),aa=(0,nB.Cg)([nv({type:s.Choice})],aa);class al{version=1;privateKey=new iX;parameters;publicKey;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],al.prototype,"version",void 0),(0,nB.Cg)([nm({type:iX})],al.prototype,"privateKey",void 0),(0,nB.Cg)([nm({type:aa,context:0,optional:!0})],al.prototype,"parameters",void 0),(0,nB.Cg)([nm({type:a.BitString,context:1,optional:!0})],al.prototype,"publicKey",void 0);class au{r=new ArrayBuffer(0);s=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer,converter:i2})],au.prototype,"r",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],au.prototype,"s",void 0);let ac="1.2.840.113549.1.1",af=`${ac}.1`,ah=`${ac}.7`,ap=`${ac}.9`,ag=`${ac}.10`,ad=`${ac}.2`,ay=`${ac}.4`,av=`${ac}.5`,am=`${ac}.14`,ab=`${ac}.11`,aw=`${ac}.12`,aA=`${ac}.13`,aS=`${ac}.15`,aC=`${ac}.16`,aB="1.3.14.3.2.26",ax="2.16.840.1.101.3.4.2.4",aE="2.16.840.1.101.3.4.2.1",ak="2.16.840.1.101.3.4.2.2",aO="2.16.840.1.101.3.4.2.3",aI=`${ac}.8`;function aN(e){return new oV({algorithm:e,parameters:null})}aN("1.2.840.113549.2.2"),aN("1.2.840.113549.2.5");let aU=aN(aB);aN(ax),aN(aE),aN(ak),aN(aO),aN("2.16.840.1.101.3.4.2.5"),aN("2.16.840.1.101.3.4.2.6");
2let aT=new oV({algorithm:aI,parameters:nC.serialize(aU)}),aj=new oV({algorithm:ap,parameters:nC.serialize(i6.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});aN(af),aN(ad),aN(ay),aN(av),aN(aS),aN(aC),aN(aw),aN(aA),aN(aS),aN(aC);class a_{hashAlgorithm=new oV(aU);maskGenAlgorithm=new oV({algorithm:aI,parameters:nC.serialize(aU)});pSourceAlgorithm=new oV(aj);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oV,context:0,defaultValue:aU})],a_.prototype,"hashAlgorithm",void 0),(0,nB.Cg)([nm({type:oV,context:1,defaultValue:aT})],a_.prototype,"maskGenAlgorithm",void 0),(0,nB.Cg)([nm({type:oV,context:2,defaultValue:aj})],a_.prototype,"pSourceAlgorithm",void 0),new oV({algorithm:ah,parameters:nC.serialize(new a_)});class aR{hashAlgorithm=new oV(aU);maskGenAlgorithm=new oV({algorithm:aI,parameters:nC.serialize(aU)});saltLength=20;trailerField=1;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oV,context:0,defaultValue:aU})],aR.prototype,"hashAlgorithm",void 0),(0,nB.Cg)([nm({type:oV,context:1,defaultValue:aT})],aR.prototype,"maskGenAlgorithm",void 0),(0,nB.Cg)([nm({type:a.Integer,context:2,defaultValue:20})],aR.prototype,"saltLength",void 0),(0,nB.Cg)([nm({type:a.Integer,context:3,defaultValue:1})],aR.prototype,"trailerField",void 0),new oV({algorithm:ag,parameters:nC.serialize(new aR)});class aP{digestAlgorithm=new oV;digest=new iX;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oV})],aP.prototype,"digestAlgorithm",void 0),(0,nB.Cg)([nm({type:iX})],aP.prototype,"digest",void 0);class aH{prime=new ArrayBuffer(0);exponent=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aH.prototype,"prime",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aH.prototype,"exponent",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aH.prototype,"coefficient",void 0);let aL=q=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,q.prototype)}};aL=q=(0,nB.Cg)([nv({type:s.Sequence,itemType:aH})],aL);class aV{version=0;modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);privateExponent=new ArrayBuffer(0);prime1=new ArrayBuffer(0);prime2=new ArrayBuffer(0);exponent1=new ArrayBuffer(0);exponent2=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);otherPrimeInfos;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],aV.prototype,"version",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aV.prototype,"modulus",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aV.prototype,"publicExponent",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aV.prototype,"privateExponent",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aV.prototype,"prime1",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aV.prototype,"prime2",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aV.prototype,"exponent1",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aV.prototype,"exponent2",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aV.prototype,"coefficient",void 0),(0,nB.Cg)([nm({type:aL,optional:!0})],aV.prototype,"otherPrimeInfos",void 0);class aD{modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aD.prototype,"modulus",void 0),(0,nB.Cg)([nm({type:a.Integer,converter:i2})],aD.prototype,"publicExponent",void 0),function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"}(K||(K={}));let a$=K;var aM=function(e,t){return(aM=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function aF(e,t){function r(){this.constructor=e}aM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function az(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function aq(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function aK(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(aq(arguments[t]));return e}function aW(e){return!!e.useClass}function aG(e){return!!e.useFactory}var aJ=function(){function e(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return e.prototype.createProxy=function(e){var t,r=this,i=!1;return new Proxy({}
2,this.createHandler(function(){return i||(t=e(r.wrap()),i=!0),t}))},e.prototype.createHandler=function(e){var t={};return this.reflectMethods.forEach(function(r){t[r]=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return t[0]=e(),Reflect[r].apply(void 0,aK(t))}}),t},e}();function aZ(e){return"string"==typeof e||"symbol"==typeof e}function aY(e){return"object"==typeof e&&"token"in e&&"transform"in e}function aX(e){return!!e.useToken}function aQ(e){return void 0!=e.useValue}var a0=function(){function e(){this._registryMap=new Map}return e.prototype.entries=function(){return this._registryMap.entries()},e.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},e.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},e.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},e.prototype.setAll=function(e,t){this._registryMap.set(e,t)},e.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},e.prototype.clear=function(){this._registryMap.clear()},e.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},e}(),a1=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aF(t,e),t}(a0);let a2=function(){this.scopedResolutions=new Map};var a8=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aF(t,e),t}(a0),a3=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aF(t,e),t}(a0);let a4=function(){this.preResolution=new a8,this.postResolution=new a3};var a6=new Map,a5=new(function(){function e(e){this.parent=e,this._registry=new a1,this.interceptors=new a4,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(e,t,r){if(void 0===r&&(r={lifecycle:a$.Transient}),this.ensureNotDisposed(),i=aW(t)||aQ(t)||aX(t)||aG(t)?t:{useClass:t},aX(i))for(var i,n=[e],o=i;
2null!=o;){var s=o.useToken;if(n.includes(s))throw Error("Token registration cycle detected! "+aK(n,[s]).join(" -> "));n.push(s);var a=this._registry.get(s);o=a&&aX(a.provider)?a.provider:null}if((r.lifecycle===a$.Singleton||r.lifecycle==a$.ContainerScoped||r.lifecycle==a$.ResolutionScoped)&&(aQ(i)||aG(i)))throw Error('Cannot use lifecycle "'+a$[r.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:i,options:r}),this},e.prototype.registerType=function(e,t){return(this.ensureNotDisposed(),aZ(t))?this.register(e,{useToken:t}):this.register(e,{useClass:t})},e.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},e.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),aZ(e)){if(aZ(t))return this.register(e,{useToken:t},{lifecycle:a$.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:a$.Singleton});throw Error('Cannot register a type name as a singleton without a "to" token')}var r=e;return t&&!aZ(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:a$.Singleton})},e.prototype.resolve=function(e,t,r){void 0===t&&(t=new a2),void 0===r&&(r=!1),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&aZ(e)){if(r)return;throw Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),i){var n=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}if("function"==typeof e||e instanceof aJ){var n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(e,t){var r,i;if(this.interceptors.preResolution.has(e)){var n=[];try{for(var o=az(this.interceptors.preResolution.getAll(e)),s=o.next();!s.done;s=o.next()){var a=s.value;"Once"!=a.options.frequency&&n.push(a),a.callback(e,t)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}this.interceptors.preResolution.setAll(e,n)}},e.prototype.executePostResolutionInterceptor=function(e,t,r){var i,n;if(this.interceptors.postResolution.has(e)){var o=[];try{for(var s=az(this.interceptors.postResolution.getAll(e)),a=s.next();!a.done;a=s.next()){var l=a.value;"Once"!=l.options.frequency&&o.push(l),l.callback(e,t,r)}}catch(e){i={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}this.interceptors.postResolution.setAll(e,o)}},e.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===a$.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var r,i=e.options.lifecycle===a$.Singleton,n=e.options.lifecycle===a$.ContainerScoped,o=i||n;return r=aQ(e.provider)?e.provider.useValue:aX(e.provider)?o?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):aW(e.provider)?o?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):aG(e.provider)?e.provider.useFactory(this):this.construct(e.provider,t),e.options.lifecycle===a$.ResolutionScoped&&t.scopedResolutions.set(e,r),r},e.prototype.resolveAll=function(e,t,r){var i=this;void 0===t&&(t=new a2),void 0===r&&(r=!1),this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&aZ(e)){if(r)return[];throw Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),n){var o=n.map(function(e){return i.resolveRegistration(e,t)});return this.executePostResolutionInterceptor(e,o,"All"),o}var s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s},e.prototype.isRegistered=function(e,t){return void 0===t&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();
2try{for(var r=az(this._registry.entries()),i=r.next();!i.done;i=r.next()){var n=aq(i.value,2),o=n[0],s=n[1];this._registry.setAll(o,s.filter(function(e){return!aQ(e.provider)}).map(function(e){return e.instance=void 0,e}))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.createChildContainer=function(){this.ensureNotDisposed();var t,r,i=new e(this);try{for(var n=az(this._registry.entries()),o=n.next();!o.done;o=n.next()){var s=aq(o.value,2),a=s[0],l=s[1];l.some(function(e){return e.options.lifecycle===a$.ContainerScoped})&&i._registry.setAll(a,l.map(function(e){return e.options.lifecycle===a$.ContainerScoped?{provider:e.provider,options:e.options}:e}))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(e,t,r){void 0===r&&(r={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:r})},e.prototype.afterResolution=function(e,t,r){void 0===r&&(r={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:r})},e.prototype.dispose=function(){var e,t,r,i;return e=this,t=void 0,r=void 0,i=function(){var e;return function(e,t){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){var l=[o,a];if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&l[0]?i.return:l[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,l[1])).done)return n;switch(i=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return s.label++,{value:l[1],done:!1};case 5:s.label++,i=l[1],l=[0];continue;case 7:l=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){s=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){s.label=l[1];break}if(6===l[0]&&s.label<n[1]){s.label=n[1],n=l;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(l);break}n[2]&&s.ops.pop(),s.trys.pop();continue}l=t.call(e,s)}catch(e){l=[6,e],i=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEac
2h(function(t){var r=t.dispose();r&&e.push(r)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})},new(r||(r=Promise))(function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((i=i.apply(e,t||[])).next())})},e.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},e.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},e.prototype.construct=function(e,t){var r=this;if(e instanceof aJ)return e.createProxy(function(e){return r.resolve(e,t)});var i=function(){var i=a6.get(e);if(!i||0===i.length)if(0===e.length)return new e;else throw Error('TypeInfo not known for "'+e.name+'"');var n=i.map(r.resolveParams(t,e));return new(e.bind.apply(e,aK([void 0],n)))}();return"function"!=typeof i.dispose||i.dispose.length>0||this.disposables.add(i),i},e.prototype.resolveParams=function(e,t){var r=this;return function(i,n){var o,s,a,l,u,c,f;try{if("object"==typeof i&&"token"in i&&"multiple"in i)if(aY(i))return i.multiple?(o=r.resolve(i.transform)).transform.apply(o,aK([r.resolveAll(i.token,new a2,i.isOptional)],i.transformArgs)):(s=r.resolve(i.transform)).transform.apply(s,aK([r.resolve(i.token,e,i.isOptional)],i.transformArgs));else return i.multiple?r.resolveAll(i.token,new a2,i.isOptional):r.resolve(i.token,e,i.isOptional);if(aY(i))return(a=r.resolve(i.transform,e)).transform.apply(a,aK([r.resolve(i.token,e)],i.transformArgs));return r.resolve(i,e)}catch(e){throw Error((c="Cannot inject the dependency "+(u=void 0===(l=aq(t.toString().match(/constructor\(([\w, ]+)\)/)||[],2)[1])?null:l,null===u?"at position #"+n:'"'+u.split(",")[n].trim()+'" at position #'+n)+' of "'+t.name+'" constructor. Reason:',void 0===f&&(f="    "),aK([c],e.message.split("\n").map(function(e){return f+e})).join("\n")))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw Error("This container has been disposed, you cannot interact with a disposed container")},e}());let a9=function(e){return function(t){var r,i;a6.set(t,(r=Reflect.getMetadata("design:paramtypes",t)||[],Object.keys(i=Reflect.getOwnMetadata("injectionTokens",t)||{}).forEach(function(e){r[+e]=i[e]}),r)),e&&e.token&&(Array.isArray(e.token)?e.token.forEach(function(e){a5.register(e,t)}):a5.register(e.token,t))}};if("undefined"==typeof Reflect||!Reflect.getMetadata)throw Error("tsyringe requires a reflect polyfill. Please add 'import \"reflect-metadata\"' to the top of your entry point.");class a7{attrId="";attrValues=[];constructor(e={}){Object.assign(e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],a7.prototype,"attrId",void 0),(0,nB.Cg)([nm({type:a.Any,repeated:"set"})],a7.prototype,"attrValues",void 0);let le=W=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,W.prototype)}};le=W=(0,nB.Cg)([nv({type:s.Sequence,itemType:a7})],le);let lt=G=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,G.prototype)}};lt=G=(0,nB.Cg)([nv({type:s.Sequence,itemType:sB})],lt);class lr{certId="";certValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],lr.prototype,"certId",void 0),(0,nB.Cg)([nm({type:a.Any,context:0})],lr.prototype,"certValue",void 0);class li{crlId="";crltValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],li.prototype,"crlId",void 0),(0,nB.Cg)([nm({type:a.Any,context:0})],li.prototype,"crltValue",void 0);class ln extends iX{}class lo{encryptionAlgorithm=new oV;encryptedData=new ln;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:oV})],lo.prototype,"encryptionAlgorithm",void 0),(0,nB.Cg)([nm({type:ln})],lo.prototype,"encryptedData",void 0),function(e){e[e.v1=0]="v1"}(Z||(Z={}));class ls extends iX{}let la=J=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,J.prototype)}};
2la=J=(0,nB.Cg)([nv({type:s.Sequence,itemType:oU})],la);class ll{version=Z.v1;privateKeyAlgorithm=new oV;privateKey=new ls;attributes;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],ll.prototype,"version",void 0),(0,nB.Cg)([nm({type:oV})],ll.prototype,"privateKeyAlgorithm",void 0),(0,nB.Cg)([nm({type:ls})],ll.prototype,"privateKey",void 0),(0,nB.Cg)([nm({type:la,implicit:!0,context:0,optional:!0})],ll.prototype,"attributes",void 0);let lu=class extends ll{};lu=(0,nB.Cg)([nv({type:s.Sequence})],lu);let lc=class extends lo{};lc=(0,nB.Cg)([nv({type:s.Sequence})],lc);class lf{secretTypeId="";secretValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],lf.prototype,"secretTypeId",void 0),(0,nB.Cg)([nm({type:a.Any,context:0})],lf.prototype,"secretValue",void 0);class lh{mac=new aP;macSalt=new iX;iterations=1;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:aP})],lh.prototype,"mac",void 0),(0,nB.Cg)([nm({type:iX})],lh.prototype,"macSalt",void 0),(0,nB.Cg)([nm({type:a.Integer,defaultValue:1})],lh.prototype,"iterations",void 0);class lp{version=3;authSafe=new sB;macData=new lh;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],lp.prototype,"version",void 0),(0,nB.Cg)([nm({type:sB})],lp.prototype,"authSafe",void 0),(0,nB.Cg)([nm({type:lh,optional:!0})],lp.prototype,"macData",void 0);class lg{bagId="";bagValue=new ArrayBuffer(0);bagAttributes;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.ObjectIdentifier})],lg.prototype,"bagId",void 0),(0,nB.Cg)([nm({type:a.Any,context:0})],lg.prototype,"bagValue",void 0),(0,nB.Cg)([nm({type:a7,repeated:"set",optional:!0})],lg.prototype,"bagAttributes",void 0);let ld=Y=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,Y.prototype)}};ld=Y=(0,nB.Cg)([nv({type:s.Sequence,itemType:lg})],ld);let ly="1.2.840.113549.1.9",lv=`${ly}.7`,lm=`${ly}.14`,lb=class extends nO{ia5String;constructor(e={}){super(e)}toString(){return({}).toString(),this.ia5String||super.toString()}};(0,nB.Cg)([nm({type:a.IA5String})],lb.prototype,"ia5String",void 0),lb=(0,nB.Cg)([nv({type:s.Choice})],lb);let lw=class extends sB{};lw=(0,nB.Cg)([nv({type:s.Sequence})],lw);let lA=class extends lp{};lA=(0,nB.Cg)([nv({type:s.Sequence})],lA);let lS=class extends lo{};lS=(0,nB.Cg)([nv({type:s.Sequence})],lS);let lC=class{value;constructor(e=""){this.value=e}toString(){return this.value}};(0,nB.Cg)([nm({type:a.IA5String})],lC.prototype,"value",void 0),lC=(0,nB.Cg)([nv({type:s.Choice})],lC);let lB=class extends lb{};lB=(0,nB.Cg)([nv({type:s.Choice})],lB);let lx=class extends nO{};lx=(0,nB.Cg)([nv({type:s.Choice})],lx);let lE=class{value;constructor(e=new Date){this.value=e}};(0,nB.Cg)([nm({type:a.GeneralizedTime})],lE.prototype,"value",void 0),lE=(0,nB.Cg)([nv({type:s.Choice})],lE);let lk=class extends nO{};lk=(0,nB.Cg)([nv({type:s.Choice})],lk);let lO=class{value;constructor(e="M"){this.value=e}toString(){return this.value}};(0,nB.Cg)([nm({type:a.PrintableString})],lO.prototype,"value",void 0),lO=(0,nB.Cg)([nv({type:s.Choice})],lO);let lI=class{value;constructor(e=""){this.value=e}toString(){return this.value}};(0,nB.Cg)([nm({type:a.PrintableString})],lI.prototype,"value",void 0),lI=(0,nB.Cg)([nv({type:s.Choice})],lI);let lN=class extends lI{};lN=(0,nB.Cg)([nv({type:s.Choice})],lN);let lU=class extends nO{};lU=(0,nB.Cg)([nv({type:s.Choice})],lU);let lT=class{value;constructor(e=""){this.value=e}toString(){return this.value}};(0,nB.Cg)([nm({type:a.ObjectIdentifier})],lT.prototype,"value",void 0),lT=(0,nB.Cg)([nv({type:s.Choice})],lT);let lj=class extends o${};lj=(0,nB.Cg)([nv({type:s.Choice})],lj);let l_=class{value;constructor(e=0){this.value=e}toString(){return this.value.toString()}};(0,nB.Cg)([nm({type:a.Integer})],l_.prototype,"value",void 0),l_=(0,nB.Cg)([nv({type:s.Choice})],l_);let lR=class extends o4{};lR=(0,nB.Cg)([nv({type:s.Sequence})],lR);let lP=class extends nO{};lP=(0,nB.Cg)([nv({type:s.Choice})],lP);let lH=X=class extends oz{constructor(e){super(e),Object.setPrototypeOf(this,X.prototype)}};lH=X=(0,nB.Cg)([nv({type:s.Sequence})],lH);let lL=Q=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,Q.prototype)}};
2lL=Q=(0,nB.Cg)([nv({type:s.Set,itemType:o3})],lL);let lV=class{value;constructor(e=""){this.value=e}toString(){return this.value}};(0,nB.Cg)([nm({type:a.BmpString})],lV.prototype,"value",void 0),lV=(0,nB.Cg)([nv({type:s.Choice})],lV);let lD=class extends oV{};lD=(0,nB.Cg)([nv({type:s.Sequence})],lD);let l$=ee=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,ee.prototype)}};l$=ee=(0,nB.Cg)([nv({type:s.Sequence,itemType:lD})],l$);let lM=et=class extends nS{constructor(e){super(e),Object.setPrototypeOf(this,et.prototype)}};lM=et=(0,nB.Cg)([nv({type:s.Sequence,itemType:oU})],lM);class lF{version=0;subject=new nj;subjectPKInfo=new oD;attributes=new lM;constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:a.Integer})],lF.prototype,"version",void 0),(0,nB.Cg)([nm({type:nj})],lF.prototype,"subject",void 0),(0,nB.Cg)([nm({type:oD})],lF.prototype,"subjectPKInfo",void 0),(0,nB.Cg)([nm({type:lM,implicit:!0,context:0,optional:!0})],lF.prototype,"attributes",void 0);class lz{certificationRequestInfo=new lF;certificationRequestInfoRaw;signatureAlgorithm=new oV;signature=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}}(0,nB.Cg)([nm({type:lF,raw:!0})],lz.prototype,"certificationRequestInfo",void 0),(0,nB.Cg)([nm({type:oV})],lz.prototype,"signatureAlgorithm",void 0),(0,nB.Cg)([nm({type:a.BitString})],lz.prototype,"signature",void 0);let lq="crypto.algorithm";class lK{getAlgorithms(){return a5.resolveAll(lq)}toAsnAlgorithm(e){for(let t of({...e},this.getAlgorithms())){let r=t.toAsnAlgorithm(e);if(r)return r}if(/^[0-9.]+$/.test(e.name)){let t=new oV({algorithm:e.name});return"parameters"in e&&(t.parameters=e.parameters),t}throw Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(let t of this.getAlgorithms()){let r=t.toWebAlgorithm(e);if(r)return r}return{name:e.algorithm,parameters:e.parameters}}}let lW="crypto.algorithmProvider";a5.registerSingleton(lW,lK);let lG="1.3.36.3.3.2.8.1.1",lJ=`${lG}.1`,lZ=`${lG}.2`,lY=`${lG}.3`,lX=`${lG}.4`,lQ=`${lG}.5`,l0=`${lG}.6`,l1=`${lG}.7`,l2=`${lG}.8`,l8=`${lG}.9`,l3=`${lG}.10`,l4=`${lG}.11`,l6=`${lG}.12`,l5=`${lG}.13`,l9=`${lG}.14`,l7="brainpoolP160r1",ue="brainpoolP160t1",ut="brainpoolP192r1",ur="brainpoolP192t1",ui="brainpoolP224r1",un="brainpoolP224t1",uo="brainpoolP256r1",us="brainpoolP256t1",ua="brainpoolP320r1",ul="brainpoolP320t1",uu="brainpoolP384r1",uc="brainpoolP384t1",uf="brainpoolP512r1",uh="brainpoolP512t1",up="ECDSA",ug=er=class{toAsnAlgorithm(e){if(e.name.toLowerCase()===up.toLowerCase()){if("hash"in e)switch(("string"==typeof e.hash?e.hash:e.hash.name).toLowerCase()){case"sha-1":return s7;case"sha-256":return ae;case"sha-384":return at;case"sha-512":return ar}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=s4;break;case"K-256":t=er.SECP256K1;break;case"P-384":t=s6;break;case"P-521":t=s5;break;case l7:t=lJ;break;case ue:t=lZ;break;case ut:t=lY;break;case ur:t=lX;break;case ui:t=lQ;break;case un:t=l0;break;case uo:t=l1;break;case us:t=l2;break;case ua:t=l8;break;case ul:t=l3;break;case uu:t=l4;break;case uc:t=l6;break;case uf:t=l5;break;case uh:t=l9}if(t)return new oV({algorithm:sQ,parameters:nC.serialize(new aa({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case s0:return{name:up,hash:{name:"SHA-1"}};case s2:return{name:up,hash:{name:"SHA-256"}};case s8:return{name:up,hash:{name:"SHA-384"}};case s3:return{name:up,hash:{name:"SHA-512"}};case sQ:if(!e.parameters)throw TypeError("Cannot get required parameters from EC algorithm");switch(nC.parse(e.parameters,aa).namedCurve){case s4:return{name:up,namedCurve:"P-256"};case er.SECP256K1:return{name:up,namedCurve:"K-256"};case s6:return{name:up,namedCurve:"P-384"};case s5:return{name:up,namedCurve:"P-521"};case lJ:return{name:up,namedCurve:l7};case lZ:return{name:up,namedCurve:ue};case lY:return{name:up,namedCurve:ut};case lX:return{name:up,namedCurve:ur};case lQ:return{name:up,namedCurve:ui};case l0:return{name:up,namedCurve:un};case l1:return{name:up,namedCurve:uo};case l2:return{name:up,namedCurve:us};case l8:return{name:up,namedCurve:ua};case l3:return{name:up,namedCurve:ul};case l4:return{name:up,namedCurve:uu};case l6:return{name:up,namedCurve:uc};case l5:return{name:up,namedCurve:uf};case l9:return{name:up,namedCurve:uh}}}return null}};ug.SECP256K1="1.3.132.0.10",ug=er=(0,nB.Cg)([a9()],ug),a5.registerSingleton(lq,ug);let ud=Symbol("name"),uy=Symbol("value");class uv{constructor(e,t={},r=""){for(let i in this[ud]=e,this[uy]=r,t)this[i]=t[i]}}uv.NAME=ud,uv.VALUE=uy;class um{static toTextObject(e){let t=new uv("Algorithm Identifier",{},ub.toString(e.algorithm));if(e.parameters)if(e.algorithm===sQ){let r=new ug().toWebAlgorithm(e);r&&"namedCurve"in r?t["Named Curve"]=r.namedCurve:t.Parameters=e.parameters}else t.Parameters=e.parameters;return t}}class ub{static toString(e){let t=this.items[e];return t||e}}ub.items={[aB]:"sha1",[ax]:"sha224",[aE]:"sha256",[ak]:"sha384",[aO]:"sha512",[af]:"rsaEncryption",[av]:"sha1WithRSAEncryption",[am]:"sha224WithRSAEncryption",[ab]:"sha256WithRSAEncryption",[aw]:"sha384WithRSAEncryption",[aA]:"sha512WithRSAEncryption",[sQ]:"ecPublicKey",[s0]:"ecdsaWithSHA1",[s1]:"ecdsaWithSHA224",[s2]:"ecdsaWithSHA256",[s8]:"ecdsaWithSHA384",[s3]:"ecdsaWithSHA512",[oh]:"TLS WWW server authentication",[op]:"TLS WWW client authentication",[og]:"Code Signing",[od]:"E-mail Protection",[oy]:"Time Stamping",[ov]:"OCSP Signing","1.2.840.113549.1.7.2":"Signed Data"};class uw{static serialize(e){return this.serializeObj(e).join("\n")}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){let r=[],i=this.pad(t++),n="",o=e[uv.VALUE];for(let s in o&&(n=` ${o}`),r.push(`${i}${e[uv.NAME]}:${n}`),i=this.pad(t),e){if("symbol"==typeof s)continue;let n=e[s],o=s?`${s}: `:"";if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)r.push(`${i}${o}${n}`);else if(n instanceof Date)r.push(`${i}${o}${n.toUTCString()}`);else if(Array.isArray(n))for(let e of n)e[uv.NAME]=s,r.push(...this.serializeObj(e,t));else if(n instanceof uv)n[uv.NAME]=s,r.push(...this.serializeObj(n,t));
2else if(ry._H.isBufferSource(n))s?(r.push(`${i}${o}`),r.push(...this.serializeBufferSource(n,t+1))):r.push(...this.serializeBufferSource(n,t));else if("toTextObject"in n){let e=n.toTextObject();e[uv.NAME]=s,r.push(...this.serializeObj(e,t))}else throw TypeError("Cannot serialize data in text format. Unsupported type.")}return r}static serializeBufferSource(e,t=0){let r=this.pad(t),i=ry._H.toUint8Array(e),n=[];for(let e=0;e<i.length;){let t=[];for(let r=0;r<16&&e<i.length;r++){8===r&&t.push("");let n=i[e++].toString(16).padStart(2,"0");t.push(n)}n.push(`${r}${t.join(" ")}`)}return n}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}uw.oidSerializer=ub,uw.algorithmSerializer=um;class uA{constructor(...e){if(1===e.length){let t=e[0];this.rawData=nC.serialize(t),this.onInit(t)}else{let t=nC.parse(e[0],e[1]);this.rawData=ry._H.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof uA&&(0,ry.n4)(e.rawData,this.rawData)}toString(e="text"){switch(e){case"asn":return nC.toString(this.rawData);case"text":return uw.serialize(this.toTextObject());case"hex":return ry.U$.ToHex(this.rawData);case"base64":return ry.U$.ToBase64(this.rawData);case"base64url":return ry.U$.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){let e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new uv(this.getTextName(),{},e)}}uA.NAME="ASN";class uS extends uA{constructor(...e){super(ry._H.isBufferSource(e[0])?ry._H.toArrayBuffer(e[0]):nC.serialize(new oF({extnID:e[0],critical:e[1],extnValue:new iX(ry._H.toArrayBuffer(e[2]))})),oF)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[uv.NAME]===uS.NAME&&(e[uv.NAME]=ub.toString(this.type)),e}}class uC{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&void 0!==e.extractable}constructor(){this.items=new Map,this[ei]="CryptoProvider","undefined"!=typeof self&&"undefined"!=typeof crypto?this.set(uC.DEFAULT,crypto):void 0!==r.g&&r.g.crypto&&r.g.crypto.subtle&&this.set(uC.DEFAULT,r.g.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,t){return this.items.forEach(e,t)}has(e){return this.items.has(e)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(e=uC.DEFAULT){let t=this.items.get(e.toLowerCase());if(!t)throw Error(`Cannot get Crypto by name '${e}'`);return t}set(e,t){if("string"==typeof e){if(!t)throw TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),t)}else this.items.set(uC.DEFAULT,e);return this}}ei=Symbol.toStringTag,uC.DEFAULT="default";let uB=new uC,ux=/^[0-2](?:\.[1-9][0-9]*)+$/;class uE{constructor(e={}){for(let t in this.items={},e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return new RegExp(ux).test(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}let uk=new uE;function uO(e,t){return`\\${ry.U$.ToHex(ry.U$.FromUtf8String(t)).toUpperCase()}`}uk.register("CN","2.5.4.3"),uk.register("L","2.5.4.7"),uk.register("ST","2.5.4.8"),uk.register("O","2.5.4.10"),uk.register("OU","2.5.4.11"),uk.register("C","2.5.4.6"),uk.register("DC","0.9.2342.19200300.100.1.25"),uk.register("E","1.2.840.113549.1.9.1"),uk.register("G","2.5.4.42"),uk.register("I","2.5.4.43"),uk.register("SN","2.5.4.4"),uk.register("T","2.5.4.12");class uI{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,t={}){for(let e in this.extraNames=new uE,this.asn=new nj,t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];this.extraNames.register(e,r)}"string"==typeof e?this.asn=this.fromString(e):e instanceof nj?this.asn=e:ry._H.isBufferS
2ource(e)?this.asn=nC.parse(e,nj):this.asn=this.fromJSON(e)}getField(e){let t=this.extraNames.findId(e)||uk.findId(e),r=[];for(let e of this.asn)for(let i of e)i.type===t&&r.push(i.value.toString());return r}getName(e){return this.extraNames.get(e)||uk.get(e)}toString(){return this.asn.map(e=>e.map(e=>{let t=this.getName(e.type)||e.type,r=e.value.anyValue?`#${ry.U$.ToHex(e.value.anyValue)}`:e.value.toString().replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,uO);return`${t}=${r}`}).join("+")).join(", ")}toJSON(){let e=[];for(let t of this.asn){let r={};for(let e of t){let t=this.getName(e.type)||e.type;null!=r[t]||(r[t]=[]),r[t].push(e.value.anyValue?`#${ry.U$.ToHex(e.value.anyValue)}`:e.value.toString())}e.push(r)}return e}fromString(e){let t=new nj,r=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g,i=null,n=",";for(;i=r.exec(`${e},`);){let[,e,r]=i,o=r[r.length-1];(","===o||"+"===o)&&(r=r.slice(0,r.length-1),i[3]=o);let s=i[3];e=this.getTypeOid(e);let a=this.createAttribute(e,r);"+"===n?t[t.length-1].push(a):t.push(new nU([a])),n=s}return t}fromJSON(e){let t=new nj;for(let r of e){let e=new nU;for(let t in r){let i=this.getTypeOid(t);for(let n of r[t]){let t=this.createAttribute(i,n);e.push(t)}}t.push(e)}return t}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,t){let r=new nN({type:e});if("object"==typeof t)for(let e in t)switch(e){case"ia5String":r.value.ia5String=t[e];break;case"utf8String":r.value.utf8String=t[e];break;case"universalString":r.value.universalString=t[e];break;case"bmpString":r.value.bmpString=t[e];break;case"printableString":r.value.printableString=t[e]}else if("#"===t[0])r.value.anyValue=ry.U$.FromHex(t.slice(1));else{let i=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?r.value.ia5String=i:uI.isPrintableString(i)?r.value.printableString=i:r.value.utf8String=i}return r}processStringValue(e){let t=/"(.*?[^\\])?"/.exec(e);return t&&(e=t[1]),e.replace(/\\0a/ig,"\n").replace(/\\0d/ig,"\r").replace(/\\0g/ig,"	").replace(/\\(.)/g,"$1")}toArrayBuffer(){return nC.serialize(this.asn)}async getThumbprint(...e){var t;let r,i="SHA-1";return!(e.length>=1)||(null==(t=e[0])?void 0:t.subtle)?r=e[0]||uB.get():(i=e[0]||i,r=e[1]||uB.get()),await r.subtle.digest(i,this.toArrayBuffer())}}let uN="Cannot initialize GeneralName from ASN.1 data.",uU=`${uN} Unsupported string format in use.`,uT=`${uN} Value doesn't match to GUID regular expression.`,uj=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,u_="1.3.6.1.4.1.311.25.1",uR="1.3.6.1.4.1.311.20.2.3",uP="email",uH="guid";class uL extends uA{constructor(...e){let t;if(2===e.length)switch(e[0]){case"dn":{let r=new uI(e[1]).toArrayBuffer(),i=nC.parse(r,nj);t=new nP({directoryName:i});break}case"dns":t=new nP({dNSName:e[1]});break;case uP:t=new nP({rfc822Name:e[1]});break;case uH:{let r=RegExp(uj,"i").exec(e[1]);if(!r)throw Error("Cannot parse GUID value. Value doesn't match to regular expression");let i=r.slice(1).map((e,t)=>t<3?ry.U$.ToHex(new Uint8Array(ry.U$.FromHex(e)).reverse()):e).join("");t=new nP({otherName:new n_({typeId:u_,value:nC.serialize(new iX(ry.U$.FromHex(i)))})});break}case"ip":t=new nP({iPAddress:e[1]});break;case"id":t=new nP({registeredID:e[1]});break;case"upn":t=new nP({otherName:new n_({typeId:uR,value:nC.serialize(i9.toASN(e[1]))})});break;case"url":t=new nP({uniformResourceIdentifier:e[1]});break;default:throw Error("Cannot create GeneralName. Unsupported type of the name")}else t=ry._H.isBufferSource(e[0])?nC.parse(e[0],nP):e[0];super(t)}onInit(e){if(void 0!=e.dNSName)this.type="dns",this.value=e.dNSName;else if(void 0!=e.rfc822Name)this.type=uP,this.value=e.rfc822Name;else if(void 0!=e.iPAddress)this.type="ip",this.value=e.iPAddress;else if(void 0!=e.uniformResourceIdentifier)this.type="url",this.value=e.uniformResourceIdentifier;else if(void 0!=e.registeredID)this.type="id",this.value=e.registeredID;else if(void 0!=e.directoryName)this.type="dn",this.value=new uI(e.directoryName).toString();else if(void 0!=e.otherName)if(e.otherName.typeId===u_){this.type=uH;let t=nC.parse(e.otherName.value,iX),r=RegExp(uj,"i").exec(ry.U$.ToHex(t));if(!r)throw Error(uT);this.value=r.slice(1).map((e,t)=>t<3?ry.U$.ToHex(new Uint8Array(ry.U$.FromHex(e)).reverse()):e).join("-")}else if(e.otherName.typeId===uR)this.type="upn",this.value=nC.parse(e.otherName.value,nO).toString();else throw Error(uU);else throw Error(uU)}
2toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case"dn":case"dns":case uH:case"ip":case"id":case"upn":case"url":e=this.type.toUpperCase();break;case uP:e="Email";break;default:throw Error("Unsupported GeneralName type")}let t=this.value;return"id"===this.type&&(t=ub.toString(t)),new uv(e,void 0,t)}}class uV extends uA{constructor(e){let t;if(e instanceof n0)t=e;else if(Array.isArray(e)){let r=[];for(let t of e)if(t instanceof nP)r.push(t);else{let e=nC.parse(new uL(t.type,t.value).rawData,nP);r.push(e)}t=new n0(r)}else if(ry._H.isBufferSource(e))t=nC.parse(e,n0);else throw Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){let t=[];for(let r of e){let e=null;try{e=new uL(r)}catch{continue}t.push(e)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){let e=super.toTextObjectEmpty();for(let t of this.items){let r=t.toTextObject(),i=e[r[uv.NAME]];Array.isArray(i)||(i=[],e[r[uv.NAME]]=i),i.push(r)}return e}}uV.NAME="GeneralNames";let uD="-{5}",u$=`[^\\n]+`,uM=`${uD}BEGIN (${u$}(?=${uD}))${uD}`,uF=`${uD}END \\1${uD}`,uz=`[^:\\n]+`,uq=`(?:[^\\n]+\\n(?: +[^\\n]+\\n)*)`,uK=`(?:[a-zA-Z0-9=+/]+\\n)+`,uW=`${uM}\\n(?:((?:${uz}: ${uq})+))?\\n?(${uK})${uF}`;class uG{static isPem(e){return"string"==typeof e&&RegExp(uW,"g").test(e)}static decodeWithHeaders(e){e=e.replace(/\r/g,"");let t=RegExp(uW,"g"),r=[],i=null;for(;i=t.exec(e);){let e=i[3].replace(RegExp(`[\\n]+`,"g"),""),t={type:i[1],headers:[],rawData:ry.U$.FromBase64(e)},n=i[2];if(n){let e=n.split(RegExp("\\n","g")),r=null;for(let i of e){let[e,n]=i.split(/:(.*)/);if(void 0===n){if(!r)throw Error("Cannot parse PEM string. Incorrect header value");r.value+=e.trim()}else r&&t.headers.push(r),r={key:e,value:n.trim()}}r&&t.headers.push(r)}r.push(t)}return r}static decode(e){return this.decodeWithHeaders(e).map(e=>e.rawData)}static decodeFirst(e){let t=this.decode(e);if(!t.length)throw RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){let r=[];return t?e.forEach(e=>{if(!ry._H.isBufferSource(e))throw TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");r.push(this.encodeStruct({type:t,rawData:ry._H.toArrayBuffer(e)}))}):e.forEach(e=>{if(!("type"in e))throw TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");r.push(this.encodeStruct(e))}),r.join("\n")}if(!t)throw Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:ry._H.toArrayBuffer(e)})}static encodeStruct(e){var t;let r,i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),null==(t=e.headers)?void 0:t.length){for(let t of e.headers)n.push(`${t.key}: ${t.value}`);n.push("")}let o=ry.U$.ToBase64(e.rawData),s=0,a=[];for(;s<o.length;)if(o.length-s<64?r=o.substring(s):(r=o.substring(s,s+64),s+=64),0!==r.length){if(a.push(r),r.length<64)break}else break;return n.push(...a),n.push(`-----END ${i}-----`),n.join("\n")}}uG.CertificateTag="CERTIFICATE",uG.CrlTag="CRL",uG.CertificateRequestTag="CERTIFICATE REQUEST",uG.PublicKeyTag="PUBLIC KEY",uG.PrivateKeyTag="PRIVATE KEY";class uJ extends uA{static isAsnEncoded(e){return ry._H.isBufferSource(e)||"string"==typeof e}static toArrayBuffer(e){if("string"==typeof e)if(uG.isPem(e))return uG.decode(e)[0];else if(ry.U$.isHex(e))return ry.U$.FromHex(e);else if(ry.U$.isBase64(e))return ry.U$.FromBase64(e);else if(ry.U$.isBase64Url(e))return ry.U$.FromBase64Url(e);else throw TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url");{let t=ry.U$.ToBinary(e);if(uG.isPem(t))return uG.decode(t)[0];if(ry.U$.isHex(t))return ry.U$.FromHex(t);if(ry.U$.isBase64(t))return ry.U$.FromBase64(t);else if(ry.U$.isBase64Url(t))return ry.U$.FromBase64Url(t);return ry._H.toArrayBuffer(e)}}constructor(...e){uJ.isAsnEncoded(e[0])?super(uJ.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){return"pem"===e?uG.encode(this.rawData,this.tag):super.toString(e)}}class uZ extends uJ{static async create(e,t=uB.get()){if(e instanceof uZ)return e;if(uC.isCryptoKey(e)){if("public"!==e.type)throw TypeError("Public key is required");return new uZ(await t.subtle.exportKey("spki",e))}if(e.publicKey)return e.publicKey;
2if(ry._H.isBufferSource(e))return new uZ(e);throw TypeError("Unsupported PublicKeyType")}constructor(e){uJ.isAsnEncoded(e)?super(e,oD):super(e),this.tag=uG.PublicKeyTag}async export(...e){var t;let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};e.length>1?(n=e[0]||n,i=e[1]||i,r=e[2]||uB.get()):r=e[0]||uB.get();let o=this.rawData,s=nC.parse(this.rawData,oD);return s.algorithm.algorithm===ag&&(t=s,t.algorithm=new oV({algorithm:af,parameters:null}),o=nC.serialize(t)),r.subtle.importKey("spki",o,n,!0,i)}onInit(e){let t=a5.resolve(lW),r=this.algorithm=t.toWebAlgorithm(e.algorithm);if(e.algorithm.algorithm===af){let t=nC.parse(e.subjectPublicKey,aD),i=ry._H.toUint8Array(t.modulus);r.publicExponent=ry._H.toUint8Array(t.publicExponent),r.modulusLength=(!i[0]?i.slice(1):i).byteLength<<3}}async getThumbprint(...e){var t;let r,i="SHA-1";return!(e.length>=1)||(null==(t=e[0])?void 0:t.subtle)?r=e[0]||uB.get():(i=e[0]||i,r=e[1]||uB.get()),await r.subtle.digest(i,this.rawData)}async getKeyIdentifier(...e){let t,r="SHA-1";1===e.length?"string"==typeof e[0]?(r=e[0],t=uB.get()):t=e[0]:2===e.length?(r=e[0],t=e[1]):t=uB.get();let i=nC.parse(this.rawData,oD);return await t.subtle.digest(r,i.subjectPublicKey)}toTextObject(){let e=this.toTextObjectEmpty(),t=nC.parse(this.rawData,oD);return e.Algorithm=uw.serializeAlgorithm(t.algorithm),t.algorithm.algorithm===sQ?e["EC Point"]=t.subjectPublicKey:e["Raw Data"]=t.subjectPublicKey,e}}class uY extends uS{static async create(e,t=!1,r=uB.get()){if("name"in e&&"serialNumber"in e)return new uY(e,t);let i=await uZ.create(e,r),n=await i.getKeyIdentifier(r);return new uY(ry.U$.ToHex(n),t)}constructor(...e){if(ry._H.isBufferSource(e[0]))super(e[0]);else if("string"==typeof e[0])super(nJ,e[1],nC.serialize(new nY({keyIdentifier:new nZ(ry.U$.FromHex(e[0]))})));else{let t=e[0];super(nJ,e[1],nC.serialize(new nY({authorityCertIssuer:t.name instanceof uV?nC.parse(t.name.rawData,n0):t.name,authorityCertSerialNumber:ry.U$.FromHex(t.serialNumber)})))}}onInit(e){super.onInit(e);let t=nC.parse(e.extnValue,nY);t.keyIdentifier&&(this.keyId=ry.U$.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?ry.U$.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){let e=this.toTextObjectWithoutValue(),t=nC.parse(this.value,nY);return t.authorityCertIssuer&&(e["Authority Issuer"]=new uV(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}uY.NAME="Authority Key Identifier";class uX extends uS{constructor(...e){if(ry._H.isBufferSource(e[0])){super(e[0]);let t=nC.parse(this.value,nQ);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else super(nX,e[2],nC.serialize(new nQ({cA:e[0],pathLenConstraint:e[1]}))),this.ca=e[0],this.pathLength=e[1]}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),void 0!==this.pathLength&&(e["Path Length"]=this.pathLength),e}}uX.NAME="Basic Constraints",function(e){e.serverAuth="1.3.6.1.5.5.7.3.1",e.clientAuth="1.3.6.1.5.5.7.3.2",e.codeSigning="1.3.6.1.5.5.7.3.3",e.emailProtection="1.3.6.1.5.5.7.3.4",e.timeStamping="1.3.6.1.5.5.7.3.8",e.ocspSigning="1.3.6.1.5.5.7.3.9"}(en||(en={}));class uQ extends uS{constructor(...e){if(ry._H.isBufferSource(e[0])){super(e[0]);let t=nC.parse(this.value,of);this.usages=t.map(e=>e)}else super(oc,e[1],nC.serialize(new of(e[0]))),this.usages=e[0]}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(e=>ub.toString(e)).join(", "),e}}uQ.NAME="Extended Key Usages",function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"}(eo||(eo={}));class u0 extends uS{constructor(...e){if(ry._H.isBufferSource(e[0])){super(e[0]);let t=nC.parse(this.value,oS);this.usages=t.toNumber()}else super(oA,e[1],nC.serialize(new oS(e[0]))),this.usages=e[0]}toTextObject(){let e=this.toTextObjectWithoutValue(),t=nC.parse(this.value,oS);return e[""]=t.toJSON().join(", "),e}}
2u0.NAME="Key Usages";class u1 extends uS{static async create(e,t=!1,r=uB.get()){let i=await uZ.create(e,r),n=await i.getKeyIdentifier(r);return new u1(ry.U$.ToHex(n),t)}constructor(...e){if(ry._H.isBufferSource(e[0])){super(e[0]);let t=nC.parse(this.value,o_);this.keyId=ry.U$.ToHex(t)}else{let t="string"==typeof e[0]?ry.U$.FromHex(e[0]):e[0];super(oj,e[1],nC.serialize(new o_(t))),this.keyId=ry.U$.ToHex(t)}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=nC.parse(this.value,o_);return e[""]=t,e}}u1.NAME="Subject Key Identifier";class u2 extends uS{constructor(...e){ry._H.isBufferSource(e[0])?super(e[0]):super(oI,e[1],new uV(e[0]||[]).rawData)}onInit(e){super.onInit(e);let t=nC.parse(e.extnValue,oN);this.names=new uV(t)}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(let r in t)e[r]=t[r];return e}}u2.NAME="Subject Alternative Name";class u8{static register(e,t){this.items.set(e,t)}static create(e){let t=new uS(e),r=this.items.get(t.type);return r?new r(e):t}}u8.items=new Map;class u3 extends uS{constructor(...e){var t;if(ry._H.isBufferSource(e[0])){super(e[0]);let t=nC.parse(this.value,n7);this.policies=t.map(e=>e.policyIdentifier)}else{let r=e[0];super(n2,null!=(t=e[1])&&t,nC.serialize(new n7(r.map(e=>new n9({policyIdentifier:e}))))),this.policies=r}}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(e=>new uv("",{},ub.toString(e))),e}}u3.NAME="Certificate Policies",u8.register(n2,u3);class u4 extends uS{constructor(...e){ry._H.isBufferSource(e[0])?super(e[0]):Array.isArray(e[0])&&"string"==typeof e[0][0]?super(or,e[1],nC.serialize(new os(e[0].map(e=>new oo({distributionPoint:new on({fullName:[new nP({uniformResourceIdentifier:e})]})}))))):super(or,e[1],nC.serialize(new os(e[0]))),null!=this.distributionPoints||(this.distributionPoints=[])}onInit(e){super.onInit(e);let t=nC.parse(e.extnValue,os);this.distributionPoints=t}toTextObject(){let e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(e=>{var t;let r={};return e.distributionPoint&&(r[""]=null==(t=e.distributionPoint.fullName)?void 0:t.map(e=>new uL(e).toString()).join(", ")),e.reasons&&(r.Reasons=e.reasons.toString()),e.cRLIssuer&&(r["CRL Issuer"]=e.cRLIssuer.map(e=>e.toString()).join(", ")),r}),e}}u4.NAME="CRL Distribution Points";class u6 extends uS{constructor(...e){if(ry._H.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof nG)super(nK,e[1],nC.serialize(new nG(e[0])));else{let t=e[0],r=new nG;u9(r,t,n$,"ocsp"),u9(r,t,nM,"caIssuers"),u9(r,t,nF,"timeStamping"),u9(r,t,nz,"caRepository"),super(nK,e[1],nC.serialize(r))}null!=this.ocsp||(this.ocsp=[]),null!=this.caIssuers||(this.caIssuers=[]),null!=this.timeStamping||(this.timeStamping=[]),null!=this.caRepository||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],nC.parse(e.extnValue,nG).forEach(e=>{switch(e.accessMethod){case n$:this.ocsp.push(new uL(e.accessLocation));break;case nM:this.caIssuers.push(new uL(e.accessLocation));break;case nF:this.timeStamping.push(new uL(e.accessLocation));break;case nz:this.caRepository.push(new uL(e.accessLocation))}})}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ocsp.length&&u5(e,"OCSP",this.ocsp),this.caIssuers.length&&u5(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&u5(e,"Time Stamping",this.timeStamping),this.caRepository.length&&u5(e,"CA Repository",this.caRepository),e}}function u5(e,t,r){if(1===r.length)e[t]=r[0].toTextObject();else{let i=new uv("");r.forEach((e,t)=>{let r=e.toTextObject(),n=`${r[uv.NAME]} ${t+1}`,o=i[n];Array.isArray(o)||(o=[],i[n]=o),o.push(r)}),e[t]=i}}
2function u9(e,t,r,i){let n=t[i];n&&(Array.isArray(n)?n:[n]).forEach(t=>{"string"==typeof t&&(t=new uL("url",t)),e.push(new nW({accessMethod:r,accessLocation:nC.parse(t.rawData,nP)}))})}u6.NAME="Authority Info Access";class u7 extends uA{constructor(...e){let t;if(ry._H.isBufferSource(e[0]))t=ry._H.toArrayBuffer(e[0]);else{let r=e[0],i=Array.isArray(e[1])?e[1].map(e=>ry._H.toArrayBuffer(e)):[];t=nC.serialize(new oU({type:r,values:i}))}super(t,oU)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Value=this.values.map(e=>new uv("",{"":e})),e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty();return e[uv.NAME]===u7.NAME&&(e[uv.NAME]=ub.toString(this.type)),e}}u7.NAME="Attribute";class ce extends u7{constructor(...e){ry._H.isBufferSource(e[0])?super(e[0]):super(lv,[nC.serialize(new lP({printableString:e[0]}))]),null!=this.password||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){let e=nC.parse(this.values[0],lP);this.password=e.toString()}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[uv.VALUE]=this.password,e}}ce.NAME="Challenge Password";class ct extends u7{constructor(...e){if(ry._H.isBufferSource(e[0]))super(e[0]);else{let t=e[0],r=new oz;for(let e of t)r.push(nC.parse(e.rawData,oF));super(lm,[nC.serialize(r)])}null!=this.items||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){let e=nC.parse(this.values[0],oz);this.items=e.map(e=>u8.create(nC.serialize(e)))}}toTextObject(){let e=this.toTextObjectWithoutValue();for(let t of this.items.map(e=>e.toTextObject()))e[t[uv.NAME]]=t;return e}}ct.NAME="Extensions";class cr{static register(e,t){this.items.set(e,t)}static create(e){let t=new u7(e),r=this.items.get(t.type);return r?new r(e):t}}cr.items=new Map;let ci="crypto.signatureFormatter";class cn{toAsnSignature(e,t){return ry._H.toArrayBuffer(t)}toWebSignature(e,t){return ry._H.toArrayBuffer(t)}}let co=es=class{static createPssParams(e,t){let r=es.getHashAlgorithm(e);return r?new aR({hashAlgorithm:r,maskGenAlgorithm:new oV({algorithm:aI,parameters:nC.serialize(r)}),saltLength:t}):null}static getHashAlgorithm(e){let t=a5.resolve(lW);return"string"==typeof e?t.toAsnAlgorithm({name:e}):"object"==typeof e&&e&&"name"in e?t.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if(!("hash"in e))return new oV({algorithm:af,parameters:null});{let t;if("string"==typeof e.hash)t=e.hash;else if(e.hash&&"object"==typeof e.hash&&"name"in e.hash&&"string"==typeof e.hash.name)t=e.hash.name.toUpperCase();else throw Error("Cannot get hash algorithm name");switch(t.toLowerCase()){case"sha-1":return new oV({algorithm:av,parameters:null});case"sha-256":return new oV({algorithm:ab,parameters:null});case"sha-384":return new oV({algorithm:aw,parameters:null});case"sha-512":return new oV({algorithm:aA,parameters:null})}}break;case"rsa-pss":if(!("hash"in e))return new oV({algorithm:ag,parameters:null});{if(!("saltLength"in e&&"number"==typeof e.saltLength))throw Error("Cannot get 'saltLength' from 'alg' argument");let t=es.createPssParams(e.hash,e.saltLength);if(!t)throw Error("Cannot create PSS parameters");return new oV({algorithm:ag,parameters:nC.serialize(t)})}}return null}toWebAlgorithm(e){switch(e.algorithm){case af:return{name:"RSASSA-PKCS1-v1_5"};case av:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case ab:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case aw:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case aA:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case ag:if(!e.parameters)return{name:"RSA-PSS"};{let t=nC.parse(e.parameters,aR);return{name:"RSA-PSS",hash:a5.resolve(lW).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}}return null}};co=es=(0,nB.Cg)([a9()],co),a5.registerSingleton(lq,co);let cs=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new oV({algorithm:aB});case"sha-256":return new oV({algorithm:aE});case"sha-384":return new oV({algorithm:ak});case"sha-512":return new oV({algorithm:aO})}return null}toWebAlgorithm(e){switch(e.algorithm){case aB:return{name:"SHA-1"};case aE:return{name:"SHA-256"};case ak:return{name:"SHA-384"};case aO:return{name:"SHA-512"}}return null}};cs=(0,nB.Cg)([a9()],cs),a5.registerSingleton(lq,cs);class ca{addPadding(e,t){let r=ry._H.toUint8Array(t),i=new Uint8Array(e);return i.set(r,e-r.length),i}removePadding(e,t=!1){let r=ry._H.toUint8Array(e);for(let e=0;e<r.length;e++)if(r[e]){r=r.slice(e);break}if(t&&r[0]>127){let e=new Uint8Array(r.length+1);return e.set(r,1),e.buffer}return r.buffer}toAsnSignature(e,t){if("ECDSA"===e.name){let r=e.namedCurve,i=ca.namedCurveSize.get(r)||ca.defaultNamedCurveSize,n=new au,o=ry._H.toUint8Array(t);return n.r=this.removePadding(o.slice(0,i),!0),n.s=this.removePadding(o.slice(i,i+i),!0),nC.serialize(n)}return null}toWebSignature(e,t){if("ECDSA"===e.name){let r=nC.parse(t,au),i=e.namedCurve,n=ca.namedCurveSize.get(i)||ca.defaultNamedCurveSize,o=this.addPadding(n,this.removePadding(r.r)),s=this.addPadding(n,this.removePadding(r.s));
2return(0,ry.kg)(o,s)}return null}}ca.namedCurveSize=new Map,ca.defaultNamedCurveSize=32;let cl="1.3.101.110",cu="1.3.101.111",cc="1.3.101.112",cf="1.3.101.113",ch=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=cc;break;case"x25519":t=cl;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=cc;break;case"ed448":t=cf}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=cl;break;case"x448":t=cu}}return t?new oV({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case cc:return{name:"Ed25519"};case cf:return{name:"EdDSA",namedCurve:"Ed448"};case cl:return{name:"X25519"};case cu:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};ch=(0,nB.Cg)([a9()],ch),a5.registerSingleton(lq,ch);class cp extends uJ{constructor(e){uJ.isAsnEncoded(e)?super(e,lz):super(e),this.tag=uG.CertificateRequestTag}onInit(e){this.tbs=nC.serialize(e.certificationRequestInfo),this.publicKey=new uZ(e.certificationRequestInfo.subjectPKInfo);let t=a5.resolve(lW);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(e=>cr.create(nC.serialize(e)));let r=this.getAttribute(lm);this.extensions=[],r instanceof ct&&(this.extensions=r.items),this.subjectName=new uI(e.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(e){for(let t of this.attributes)if(t.type===e)return t;return null}getAttributes(e){return this.attributes.filter(t=>t.type===e)}getExtension(e){for(let t of this.extensions)if(t.type===e)return t;return null}getExtensions(e){return this.extensions.filter(t=>t.type===e)}async verify(e=uB.get()){let t={...this.publicKey.algorithm,...this.signatureAlgorithm},r=await this.publicKey.export(t,["verify"],e),i=a5.resolveAll(ci).reverse(),n=null;for(let e of i)if(n=e.toWebSignature(t,this.signature))break;if(!n)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,r,n,this.tbs)}toTextObject(){let e=this.toTextObjectEmpty(),t=nC.parse(this.rawData,lz),r=t.certificationRequestInfo,i=new uv("",{Version:`${I[r.version]} (${r.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let e=new uv("");for(let t of this.attributes){let r=t.toTextObject();e[r[uv.NAME]]=r}i.Attributes=e}return e.Data=i,e.Signature=new uv("",{Algorithm:uw.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}cp.NAME="PKCS#10 Certificate Request";class cg extends uJ{constructor(e){uJ.isAsnEncoded(e)?super(e,oK):super(e),this.tag=uG.CertificateTag}onInit(e){let t=e.tbsCertificate;this.tbs=nC.serialize(t),this.serialNumber=ry.U$.ToHex(t.serialNumber),this.subjectName=new uI(t.subject),this.subject=new uI(t.subject).toString(),this.issuerName=new uI(t.issuer),this.issuer=this.issuerName.toString();let r=a5.resolve(lW);this.signatureAlgorithm=r.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;let i=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!i)throw Error("Cannot get 'notBefore' value");this.notBefore=i;let n=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!n)throw Error("Cannot get 'notAfter' value");this.notAfter=n,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(e=>
2u8.create(nC.serialize(e)))),this.publicKey=new uZ(t.subjectPublicKeyInfo)}getExtension(e){for(let t of this.extensions)if("string"==typeof e){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>"string"==typeof e?t.type===e:t instanceof e)}async verify(e={},t=uB.get()){let r,i,n=e.publicKey;try{if(n)if("publicKey"in n)r={...n.publicKey.algorithm,...this.signatureAlgorithm},i=await n.publicKey.export(r,["verify"],t);else if(n instanceof uZ)r={...n.algorithm,...this.signatureAlgorithm},i=await n.export(r,["verify"],t);else if(ry._H.isBufferSource(n)){let e=new uZ(n);r={...e.algorithm,...this.signatureAlgorithm},i=await e.export(r,["verify"],t)}else r={...n.algorithm,...this.signatureAlgorithm},i=n;else r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t)}catch(e){return!1}let o=a5.resolveAll(ci).reverse(),s=null;for(let e of o)if(s=e.toWebSignature(r,this.signature))break;if(!s)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");let a=await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs);if(e.signatureOnly)return a;{let t=(e.date||new Date).getTime();return a&&this.notBefore.getTime()<t&&t<this.notAfter.getTime()}}async getThumbprint(...e){let t,r="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(r=e[0]||r,t=e[1])),null!=t||(t=uB.get()),await t.subtle.digest(r,this.rawData)}async isSelfSigned(e=uB.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){let e=this.toTextObjectEmpty(),t=nC.parse(this.rawData,oK),r=t.tbsCertificate,i=new uv("",{Version:`${I[r.version]} (${r.version})`,"Serial Number":r.serialNumber,"Signature Algorithm":uw.serializeAlgorithm(r.signature),Issuer:this.issuer,Validity:new uv("",{"Not Before":r.validity.notBefore.getTime(),"Not After":r.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(r.issuerUniqueID&&(i["Issuer Unique ID"]=r.issuerUniqueID),r.subjectUniqueID&&(i["Subject Unique ID"]=r.subjectUniqueID),this.extensions.length){let e=new uv("");for(let t of this.extensions){let r=t.toTextObject();e[r[uv.NAME]]=r}i.Extensions=e}return e.Data=i,e.Signature=new uv("",{Algorithm:uw.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}cg.NAME="Certificate",function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"}(ea||(ea={})),u8.register(nX,uX),u8.register(oc,uQ),u8.register(oA,u0),u8.register(oj,u1),u8.register(nJ,uY),u8.register(oI,u2),u8.register(or,u4),u8.register(nK,u6),cr.register(lv,ce),cr.register(lm,ct),a5.registerSingleton(ci,cn),a5.registerSingleton(ci,ca),ca.namedCurveSize.set("P-256",32),ca.namedCurveSize.set("K-256",32),ca.namedCurveSize.set("P-384",48),ca.namedCurveSize.set("P-521",66)},71450:(e,t,r)=>{"use strict";r.d(t,{Cg:()=>o,Cl:()=>i,Tt:()=>n,fX:()=>s});var i=function(){return(i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function n(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)0>t.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}function o(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}Object.create;function s(e,t,r){if(r||2==arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}Object.create,"function"==typeof SuppressedError&&SuppressedError},76251:(e,t,r)=>{var i;!function(e){!function(t){var i="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=o(e);function o(e,t){return function(r,i){Object.defineProperty(e,r,{configurable:!0,writable:!0,value:i}),t&&t(r,i)}}void 0!==i.Reflect&&(n=o(i.Reflect,n)),t(n,i),void 0===i.Reflect&&(i.Reflect=e)}(function(e,t){var r,i=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",s=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,l=({__proto__:[]}
2)instanceof Array,u=!a&&!l,c={create:a?function(){return H(Object.create(null))}:l?function(){return H({__proto__:null})}:function(){return H({})},has:u?function(e,t){return i.call(e,t)}:function(e,t){return t in e},get:u?function(e,t){return i.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},f=Object.getPrototypeOf(Function),h="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[s]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();function i(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(i.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),i.prototype.has=function(e){return this._find(e,!1)>=0},i.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},i.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},i.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var i=this._keys.length,n=r+1;n<i;n++)this._keys[n-1]=this._keys[n],this._values[n-1]=this._values[n];return this._keys.length--,this._values.length--,N(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},i.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},i.prototype.keys=function(){return new r(this._keys,this._values,n)},i.prototype.values=function(){return new r(this._keys,this._values,o)},i.prototype.entries=function(){return new r(this._keys,this._values,a)},i.prototype["@@iterator"]=function(){return this.entries()},i.prototype[s]=function(){return this.entries()},i.prototype._find=function(e,t){if(!N(this._cacheKey,e)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(N(this._keys[r],e)){this._cacheIndex=r;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},i;function n(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}(),p="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function e(){this._map=new h}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[s]=function(){return this.keys()},e}(),g="function"==typeof WeakMap?WeakMap:function(){var e=c.create(),t=n();function r(){this._key=n()}return r.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&c.has(t,this._key)},r.prototype.get=function(e){var t=o(e,!1);return void 0!==t?c.get(t,this._key):void 0},r.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},r.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},r.prototype.clear=function(){this._key=n()},r;function n(){var t;do t="@@WeakMap@@"+function(){var e=function(e){if("function"==typeof Uint8Array){var t=new Uint8Array(16);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):s(t,16),t}return s(Array(e),e)}(16);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var t="",r=0;r<16;++r){var i=e[r];(4===r||6===r||8===r)&&(t+="-"),i<16&&(t+="0"),t+=i.toString(16).toLowerCase()}return t}();while(c.has(e,t));return e[t]=!0,t}function o(e,r){if(!i.call(e,t)){if(!r)return;Object.defineProperty(e,t,{value:c.create()})}return e[t]}function s(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}}(),d=n?Symbol.for("@reflect-metadata:registry"):void 0,y=(!C(d)&&x(t.Reflect)&&Object.isExtensible(t.Reflect)&&(r=t.Reflect[d
2]),C(r)&&(r=function(){C(d)||void 0===t.Reflect||d in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(r=(e=t.Reflect).defineMetadata,i=e.hasOwnMetadata,n=e.getOwnMetadata,o=e.getOwnMetadataKeys,s=e.deleteMetadata,a=new g,l={isProviderFor:function(e,t){var r=a.get(e);return!!(!C(r)&&r.has(t))||!!o(e,t).length&&(C(r)&&(r=new p,a.set(e,r)),r.add(t),!0)},OrdinaryDefineOwnMetadata:r,OrdinaryHasOwnMetadata:i,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:s});var e,r,i,n,o,s,a,l,u,c,f,y=new g,v={registerProvider:function(e){if(!Object.isExtensible(v))throw Error("Cannot add provider to a frozen registry.");switch(!0){case l===e:break;case C(u):u=e;break;case u===e:break;case C(c):c=e;break;case c===e:break;default:void 0===f&&(f=new p),f.add(e)}},getProvider:m,setProvider:function(e,t,r){if(!function(e){if(C(e))throw TypeError();return u===e||c===e||!C(f)&&f.has(e)}(r))throw Error("Metadata provider not registered.");var i=m(e,t);if(i!==r){if(!C(i))return!1;var n=y.get(e);C(n)&&(n=new h,y.set(e,n)),n.set(t,r)}return!0}};return v;function m(e,t){var r,i=y.get(e);return C(i)||(r=i.get(t)),C(r)&&(r=function(e,t){if(!C(u)){if(u.isProviderFor(e,t))return u;if(!C(c)){if(c.isProviderFor(e,t))return u;if(!C(f))for(var r=T(f);;){var i=j(r);if(!i)return;var n=i.value;if(n.isProviderFor(e,t))return _(r),n}}}if(!C(l)&&l.isProviderFor(e,t))return l}(e,t),C(r)||(C(i)&&(i=new h,y.set(e,i)),i.set(t,r))),r}}()),!C(d)&&x(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,d,{enumerable:!1,configurable:!1,writable:!1,value:r}),r),v=function(e){var t=new g,r={isProviderFor:function(e,r){var i=t.get(e);return!C(i)&&i.has(r)},OrdinaryDefineOwnMetadata:function(e,t,r,n){i(r,n,!0).set(e,t)},OrdinaryHasOwnMetadata:function(e,t,r){var n=i(t,r,!1);return!C(n)&&!!n.has(e)},OrdinaryGetOwnMetadata:function(e,t,r){var n=i(t,r,!1);if(!C(n))return n.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var r=[],n=i(e,t,!1);if(C(n))return r;for(var o=T(n.keys()),s=0;;){var a=j(o);if(!a)return r.length=s,r;var l=a.value;try{r[s]=l}catch(e){try{_(o)}finally{throw e}}s++}},OrdinaryDeleteMetadata:function(e,r,n){var o=i(r,n,!1);if(C(o)||!o.delete(e))return!1;if(0===o.size){var s=t.get(r);C(s)||(s.delete(n),0===s.size&&t.delete(s))}return!0}};return y.registerProvider(r),r;function i(i,n,o){var s=t.get(i),a=!1;if(C(s)){if(!o)return;s=new h,t.set(i,s),a=!0}var l=s.get(n);if(C(l)){if(!o)return;if(l=new h,s.set(n,l),!e.setProvider(i,n,r))throw s.delete(n),a&&t.delete(i),Error("Wrong provider for target.")}return l}}(y);function m(e,t,r){var i=P(t,r,!1);return!C(i)&&!!i.OrdinaryHasOwnMetadata(e,t,r)}function b(e,t,r){var i=P(t,r,!1);if(!C(i))return i.OrdinaryGetOwnMetadata(e,t,r)}function w(e,t,r,i){P(r,i,!0).OrdinaryDefineOwnMetadata(e,t,r,i)}function A(e,t){var r=P(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function S(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function C(e){return void 0===e}function B(e){return null===e}function x(e){return"object"==typeof e?null!==e:"function"==typeof e}e("decorate",function(e,t,r,i){if(C(r)){if(!k(e)||!I(t))throw TypeError();for(var n=e,o=t,s=n.length-1;s>=0;--s){var a=(0,n[s])(o);if(!C(a)&&!B(a)){if(!I(a))throw TypeError();o=a}}return o}if(!k(e)||!x(t)||!x(i)&&!C(i)&&!B(i))throw TypeError();return B(i)&&(i=void 0),function(e,t,r,i){for(var n=e.length-1;n>=0;--n){var o=(0,e[n])(t,r,i);if(!C(o)&&!B(o)){if(!x(o))throw TypeError();i=o}}return i}(e,t,r=E(r),i)}),e("metadata",function(e,t){return function(r,i){if(!x(r)||!C(i)&&!function(e){switch(S(e)){case 3:case 4:return!0;default:return!1}}(i))throw TypeError();w(e,t,r,i)}}),e("defineMetadata",function(e,t,r,i){if(!x(r))throw TypeError();return C(i)||(i=E(i)),w(e,t,r,i)}),e("hasMetadata",function(e,t,r){if(!x(t))throw TypeError();return C(r)||(r=E(r)),function e(t,r,i){if(m(t,r,i))return!0;var n=R(r);return!B(n)&&e(t,n,i)}(e,t,r)}),e("hasOwnMetadata",function(e,t,r){if(!x(t))throw TypeError();return C(r)||(r=E(r)),m(e,t,r)}),e("getMetadata",function(e,t,r){if(!x(t))throw TypeError();return C(r)||(r=E(r)),function e(t,r,i){if(m(t,r,i))return b(t,r,i);var n=R(r);if(!B(n))return e(t,n,i)}(e,t,r)}),e("getOwnMetadata",function(e,t,r){if(!x(t))throw TypeError();return C(r)||(r=E(r)),b(e,t,r)}),e("getMetadataKeys",function(e,t){if(!x(e))throw TypeError();return C(t)||(t=E(t)),function e(t,r){var i=A(t,r),n=R(t);if(null===n)return i;var o=e(n,r);if(o.length<=0)return i;if(i.length<=0)return o;for(var s=new p,a=[],l=0;l<i.length;l++){var u=i[l],c=s.has(u);c||(s.add(u),a.push(u))}for(var f=0;f<o.length;f++){var u=o[f],c=s.has(u);c||(s.add(u),a.push(u))}return a}(e,t)}),e("getOwnMetadataKeys",function(e,t){if(!x(e))throw TypeError();return C(t)||(t=E(t)),A(e,t)}),e("deleteMetadata",function(e,t,r){if(!x(t)||(C(r)||(r=E(r)),!x(t)))throw TypeError();C(r)||(r=E(r));var i=P(t,r,!1);return!C(i)&&i.OrdinaryDeleteMetadata(e,t,r)});function E(e){var t=function(e,t){switch(S(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r="string",i=U(e,o);if(void 0!==i){var n=i.call(e,r);if(x(n))throw TypeError();return n}return function(e,t){if("string"===t){var r=e.toString;if(O(r)){var i=r.call(e);
2if(!x(i))return i}var n=e.valueOf;if(O(n)){var i=n.call(e);if(!x(i))return i}}else{var n=e.valueOf;if(O(n)){var i=n.call(e);if(!x(i))return i}var o=e.toString;if(O(o)){var i=o.call(e);if(!x(i))return i}}throw TypeError()}(e,r)}(e,0);return"symbol"==typeof t?t:""+t}function k(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function O(e){return"function"==typeof e}function I(e){return"function"==typeof e}function N(e,t){return e===t||e!=e&&t!=t}function U(e,t){var r=e[t];if(null!=r){if(!O(r))throw TypeError();return r}}function T(e){var t=U(e,s);if(!O(t))throw TypeError();var r=t.call(e);if(!x(r))throw TypeError();return r}function j(e){var t=e.next();return!t.done&&t}function _(e){var t=e.return;t&&t.call(e)}function R(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===f||t!==f)return t;var r=e.prototype,i=r&&Object.getPrototypeOf(r);if(null==i||i===Object.prototype)return t;var n=i.constructor;return"function"!=typeof n||n===e?t:n}function P(e,t,r){var i=y.getProvider(e,t);if(!C(i))return i;if(r){if(y.setProvider(e,t,v))return v;throw Error("Illegal state.")}}function H(e){return e.__=void 0,delete e.__,e}})}(i||(i={}))},77328:(e,t,r)=>{"use strict";var i=r(81029).Buffer;class n{static isArrayBuffer(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||0===e.byteOffset&&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 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 r=n.toUint8Array(e),i=n.toUint8Array(t);if(r.length!==i.byteLength)return!1;for(let e=0;e<r.length;e++)if(r[e]!==i[e])return!1;return!0}static concat(...e){let t;t=!Array.isArray(e[0])||e[1]instanceof Function?Array.isArray(e[0])&&e[1]instanceof Function?e[0]:e[e.length-1]instanceof Function?e.slice(0,e.length-1):e:e[0];let r=0;for(let e of t)r+=e.byteLength;let i=new Uint8Array(r),n=0;for(let e of t){let t=this.toUint8Array(e);i.set(t,n),n+=t.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}}let o="string",s=/^[0-9a-f\s]+$/i,a=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,l=/^[a-zA-Z0-9-_]+$/;class u{static fromString(e){let t=unescape(encodeURIComponent(e)),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}static toString(e){let t=n.toUint8Array(e),r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return decodeURIComponent(escape(r))}}class c{static toString(e,t=!1){let r=n.toArrayBuffer(e),i=new DataView(r),o="";for(let e=0;e<r.byteLength;e+=2)o+=String.fromCharCode(i.getUint16(e,t));return o}static fromString(e,t=!1){let r=new ArrayBuffer(2*e.length),i=new DataView(r);for(let r=0;r<e.length;r++)i.setUint16(2*r,e.charCodeAt(r),t);return r}}class f{static isHex(e){return typeof e===o&&s.test(e)}static isBase64(e){return typeof e===o&&a.test(e)}static isBase64Url(e){return typeof e===o&&l.test(e)}static ToString(e,t="utf8"){let r=n.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(r);case"binary":return this.ToBinary(r);case"hex":return this.ToHex(r);case"base64":return this.ToBase64(r);case"base64url":return this.ToBase64Url(r);case"utf16le":return c.toString(r,!0);case"utf16":case"utf16be":return c.toString(r);default:throw 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 c.fromString(e,!0);case"utf16":case"utf16be":return c.fromString(e);default:throw Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=n.toUint8Array(e);return"undefined"!=typeof btoa?btoa(this.ToString(t,"binary")):i.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!f.isBase64(t))throw TypeError("Argument 'base64Text' is not Base64 encoded");return"undefined"!=typeof atob?this.FromBinary(atob(t)):new Uint8Array(i.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!f.isBase64Url(t))throw 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=f.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return u.fromString(e);case"utf16":case"utf16be":return c.fromString(e);case"utf16le":case"usc2":return c.fromString(e,!0);default:throw Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=f.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return u.toString(e);case"utf16":case"utf16be":return c.toString(e);case"utf16le":case"usc2":return c.toString(e,!0);default:throw Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e.charCodeAt(i);return r.buffer}static ToBinary(e){let t=n.toUint8Array(e),r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return r}static ToHex(e){let t=n.toUint8Array(e),r="",i=t.length;for(let e=0;e<i;e++){let i=t[e];i<16&&(r+="0"),r+=i.toString(16)}return r}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!f.isHex(t))throw TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2){let i=t.slice(e,e+2);r[e/2]=parseInt(i,16)}return r.buffer}static ToUtf16String(e,t=!1){return c.toString(e,t)}static FromUtf16String(e,t=!1){return c.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let r=0;r<t;r++)e+="=";return e}static formatString(e){return(null==e?void 0:e.replace(/[\n\r\t ]/g,""))||""}}f.DEFAULT_UTF8_ENCODING="utf8",t._H=n,t.U$=f,t.kg=function(...e){let t=new Uint8Array(e.map(e=>e.byteLength).reduce((e,t)=>
2e+t)),r=0;return e.map(e=>new Uint8Array(e)).forEach(e=>{for(let i of e)t[r++]=i}),t.buffer},t.n4=function(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;let r=new Uint8Array(e),i=new Uint8Array(t);for(let t=0;t<e.byteLength;t++)if(r[t]!==i[t])return!1;return!0}},77661:function(e,t,r){var i,n;!function(o,s){"use strict";n="function"==typeof(i={encode:function(e){var t,r=new ArrayBuffer(256),i=new DataView(r),n=0;function o(e){for(var o=r.byteLength,s=n+e;o<s;)o*=2;if(o!==r.byteLength){var a=i;i=new DataView(r=new ArrayBuffer(o));for(var l=n+3>>2,u=0;u<l;++u)i.setUint32(4*u,a.getUint32(4*u))}return t=e,i}function s(e){o(1).setUint8(n,e),n+=t}function a(e){for(var r=o(e.length),i=0;i<e.length;++i)r.setUint8(n+i,e[i]);n+=t}function l(e,r){var i,a;r<24?s(e<<5|r):r<256?(s(e<<5|24),s(r)):(r<65536?(s(e<<5|25),o(2).setUint16(n,r)):r<0x100000000?(s(e<<5|26),o(4).setUint32(n,r)):(s(e<<5|27),i=r%0x100000000,(a=o(8)).setUint32(n,(r-i)/0x100000000),a.setUint32(n+4,i)),n+=t)}if(!function e(r){if(!1===r)return s(244);if(!0===r)return s(245);if(null===r)return s(246);if(void 0===r)return s(247);switch(typeof r){case"number":if(Math.floor(r)===r){if(0<=r&&r<=0x20000000000000)return l(0,r);if(-0x20000000000000<=r&&r<0)return l(1,-(r+1))}return s(251),void(o(8).setFloat64(n,r),n+=t);case"string":var i,u,c=[];for(i=0;i<r.length;++i){var f=r.charCodeAt(i);f<128?c.push(f):(f<2048?c.push(192|f>>6):(f<55296?c.push(224|f>>12):(f=((1023&f)<<10|1023&r.charCodeAt(++i))+65536,c.push(240|f>>18),c.push(128|f>>12&63)),c.push(128|f>>6&63)),c.push(128|63&f))}return l(3,c.length),a(c);default:if(Array.isArray(r))for(l(4,u=r.length),i=0;i<u;++i)e(r[i]);else if(r instanceof Uint8Array)l(2,r.length),a(r);else{var h=Object.keys(r);for(l(5,u=h.length),i=0;i<u;++i){var p=h[i];e(p),e(r[p])}}}}(e),"slice"in r)return r.slice(0,n);for(var u=new ArrayBuffer(n),c=new DataView(u),f=0;f<n;++f)c.setUint8(f,i.getUint8(f));return u},decode:function(e,t,r){var i=new DataView(e),n=0;function o(t){var r;return r=new Uint8Array(e,n,t),n+=t,r}function a(){var e;return e=i.getUint8(n),n+=1,e}function l(){var e;return e=i.getUint16(n),n+=2,e}function u(){var e;return e=i.getUint32(n),n+=4,e}function c(){return 255===i.getUint8(n)&&(n+=1,!0)}function f(e){if(e<24)return e;if(24===e)return a();if(25===e)return l();if(26===e)return u();if(27===e)return 0x100000000*u()+u();if(31===e)return -1;throw"Invalid length encoding"}function h(e){var t=a();if(255===t)return -1;var r=f(31&t);if(r<0||t>>5!==e)throw"Invalid indefinite length element";return r}function p(e,t){for(var r=0;r<t;++r){var i=a();128&i&&(i<224?(i=(31&i)<<6|63&a(),t-=1):i<240?(i=(15&i)<<12|(63&a())<<6|63&a(),t-=2):(i=(15&i)<<18|(63&a())<<12|(63&a())<<6|63&a(),t-=3)),i<65536?e.push(i):(i-=65536,e.push(55296|i>>10),e.push(56320|1023&i))}}"function"!=typeof t&&(t=function(e){return e}),"function"!=typeof r&&(r=function(){});var g=function e(){var u,g,d,y,v,m=a(),b=m>>5,w=31&m;if(7===b)switch(w){case 25:var A=new DataView(new ArrayBuffer(4)),S=l(),C=31744&S,B=1023&S;if(31744===C)C=261120;else if(0!==C)C+=114688;else if(0!==B)return 5960464477539063e-23*B;return A.setUint32(0,(32768&S)<<16|C<<13|B<<13),A.getFloat32(0);case 26:return u=i.getFloat32(n),n+=4,u;case 27:return g=i.getFloat64(n),n+=8,g}if((y=f(w))<0&&(b<2||6<b))throw"Invalid length";switch(b){case 0:return y;case 1:return -1-y;case 2:if(y<0){for(var x=[],E=0;(y=h(b))>=0;)E+=y,x.push(o(y));var k=new Uint8Array(E),O=0;for(d=0;d<x.length;++d)k.set(x[d],O),O+=x[d].length;return k}return o(y);case 3:var I=[];if(y<0)for(;(y=h(b))>=0;)p(I,y);else p(I,y);return String.fromCharCode.apply(null,I);case 4:if(y<0)for(v=[];!c();)v.push(e());else for(d=0,v=Array(y);d<y;++d)v[d]=e();return v;case 5:var N={};for(d=0;d<y||y<0&&!c();++d)N[e()]=e();return N;case 6:return t(e(),y);case 7:switch(y){case 20:return!1;case 21:return!0;case 22:return null;case 23:return s;default:return r(y)}}}();if(n!==e.byteLength)throw"Remaining bytes";return g}})?i.call(t,r,t,e):i,s===n||(e.exports=n)}(0)},95969:(e,t,r)=>{"use strict";r.d(t,{Ev:()=>p,el:()=>l,fX:()=>s,JD:()=>u,up:()=>a,Ks:()=>o,pD:()=>n});var i={};function n(e){return e.reduce((e,t)=>
2e+t.toString(16).padStart(2,"0"),"")}r.r(i),r.d(i,{default:()=>h});let o=(e,t)=>{if(!e||e.length%2!=0||!/^[0-9A-Fa-f]+$/.test(e))throw Error(`cannot create uint8array from invalid hex string: "${e}"`);let r=new Uint8Array(e.match(/../g).map(e=>parseInt(e,16)));if(!t)return r;if(e.length/2>t)throw Error("hex value cannot fit in a buffer of "+t+" byte(s)");let i=new Uint8Array(t);return i.set(r,t-r.length),i},s=(e,t)=>{let r=t-e.length;if(r>0){let t=new Uint8Array(r).fill(0);return new Uint8Array([...t,...e])}if(r<0){let i=-1*r,n=0;for(let t=0;t<i&&t<e.length;t++)0===e[t]&&n++;if(n!==i)throw Error(`invalid number of starting zeroes. Expected number of zeroes: ${i}. Found: ${n}.`);return e.slice(i,i+t)}return e};function a(e){return(function(e){let t;if(0==arguments.length)throw TypeError("1 argument required, but only 0 present.");for(t=0,e=`${e}`;t<e.length;t++)if(e.charCodeAt(t)>255)throw Error(`InvalidCharacterError: found code point greater than 255:${e.charCodeAt(t)} at position ${t}`);let r="";for(t=0;t<e.length;t+=3){let i=[void 0,void 0,void 0,void 0];i[0]=e.charCodeAt(t)>>2,i[1]=(3&e.charCodeAt(t))<<4,e.length>t+1&&(i[1]|=e.charCodeAt(t+1)>>4,i[2]=(15&e.charCodeAt(t+1))<<2),e.length>t+2&&(i[2]|=e.charCodeAt(t+2)>>6,i[3]=63&e.charCodeAt(t+2));for(let e=0;e<i.length;e++)void 0===i[e]?r+="=":r+=function(e){if(e>=0&&e<64)return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e]}(i[e])}return r})(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function l(e,t){return a(o(e.padStart(2*Math.ceil(e.length/2),"0"),t).reduce((e,t)=>e+String.fromCharCode(t),""))}function u(e){if(65!==e.length||4!==e[0])throw Error("Invalid uncompressed P-256 key");let t=e.slice(1,33),r=e.slice(33,65);if(32!==t.length||32!==r.length)throw Error("Invalid x or y length");let i=(1&r[31])==0?2:3,n=new Uint8Array(33);return n[0]=i,n.set(t,1),n}var c=r(8444);!function(e){let t=e;for(;t&&!(t.encode&&t.decode&&t.decodeUnsafe)&&t.default;)t=t.default}(c);var f=r(24755);let h=function(e){function t(t){var r=t.slice(0,-4),i=t.slice(-4),n=e(r);if(!(i[0]^n[0]|i[1]^n[1]|i[2]^n[2]|i[3]^n[3]))return r}return{encode:function(t){var r=Uint8Array.from(t),i=e(r),n=new Uint8Array(r.length+4);return n.set(r,0),n.set(i.subarray(0,4),r.length),c.default.encode(n)},decode:function(e){var r=t(c.default.decode(e));if(null==r)throw Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=c.default.decodeUnsafe(e);if(null!=r)return t(r)}}}(function(e){return(0,f.sc)((0,f.sc)(e))});!function(e){let t=e;for(;t&&!(t.encode&&t.decode&&t.decodeUnsafe)&&t.default;)t=t.default}(i);let p=32}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.