@kong-ui-public/entities-certificates 3.6.33 → 3.6.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@
11
11
 
12
12
  See the Apache Version 2.0 License for specific language governing permissions
13
13
  and limitations under the License.
14
- ***************************************************************************** */var Aa;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Xn=="object"?Xn:typeof self=="object"?self:typeof this=="object"?this:u(),i=n(r);typeof t.Reflect<"u"&&(i=n(t.Reflect,i)),e(i,t),typeof t.Reflect>"u"&&(t.Reflect=r);function n(f,p){return function(b,y){Object.defineProperty(f,b,{configurable:!0,writable:!0,value:y}),p&&p(b,y)}}function s(){try{return Function("return this;")()}catch{}}function c(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||c()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",c=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,p=!u&&!f,b={create:u?function(){return va(Object.create(null))}:f?function(){return va({__proto__:null})}:function(){return va({})},has:p?function(m,v){return i.call(m,v)}:function(m,v){return v in m},get:p?function(m,v){return i.call(m,v)?m[v]:void 0}:function(m,v){return m[v]}},y=Object.getPrototypeOf(Function),K=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ip(),N=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Np(),d=typeof WeakMap=="function"?WeakMap:Op(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,A=Cp(),w=Bp(A);function I(m,v,S,V){if(q(S)){if(!he(m))throw new TypeError;if(!W(v))throw new TypeError;return Ie(m,v)}else{if(!he(m))throw new TypeError;if(!O(v))throw new TypeError;if(!O(V)&&!q(V)&&!z(V))throw new TypeError;return z(V)&&(V=void 0),S=Y(S),ae(m,v,S,V)}}e("decorate",I);function k(m,v){function S(V,G){if(!O(V))throw new TypeError;if(!q(G)&&!we(G))throw new TypeError;St(m,v,V,G)}return S}e("metadata",k);function E(m,v,S,V){if(!O(S))throw new TypeError;return q(V)||(V=Y(V)),St(m,v,S,V)}e("defineMetadata",E);function J(m,v,S){if(!O(v))throw new TypeError;return q(S)||(S=Y(S)),pe(m,v,S)}e("hasMetadata",J);function se(m,v,S){if(!O(v))throw new TypeError;return q(S)||(S=Y(S)),tt(m,v,S)}e("hasOwnMetadata",se);function $(m,v,S){if(!O(v))throw new TypeError;return q(S)||(S=Y(S)),X(m,v,S)}e("getMetadata",$);function C(m,v,S){if(!O(v))throw new TypeError;return q(S)||(S=Y(S)),Or(m,v,S)}e("getOwnMetadata",C);function P(m,v){if(!O(m))throw new TypeError;return q(v)||(v=Y(v)),Tr(m,v)}e("getMetadataKeys",P);function ye(m,v){if(!O(m))throw new TypeError;return q(v)||(v=Y(v)),tr(m,v)}e("getOwnMetadataKeys",ye);function ie(m,v,S){if(!O(v))throw new TypeError;if(q(S)||(S=Y(S)),!O(v))throw new TypeError;q(S)||(S=Y(S));var V=di(v,S,!1);return q(V)?!1:V.OrdinaryDeleteMetadata(m,v,S)}e("deleteMetadata",ie);function Ie(m,v){for(var S=m.length-1;S>=0;--S){var V=m[S],G=V(v);if(!q(G)&&!z(G)){if(!W(G))throw new TypeError;v=G}}return v}function ae(m,v,S,V){for(var G=m.length-1;G>=0;--G){var Ae=m[G],ve=Ae(v,S,V);if(!q(ve)&&!z(ve)){if(!O(ve))throw new TypeError;V=ve}}return V}function pe(m,v,S){var V=tt(m,v,S);if(V)return!0;var G=ba(v);return z(G)?!1:pe(m,G,S)}function tt(m,v,S){var V=di(v,S,!1);return q(V)?!1:Ce(V.OrdinaryHasOwnMetadata(m,v,S))}function X(m,v,S){var V=tt(m,v,S);if(V)return Or(m,v,S);var G=ba(v);if(!z(G))return X(m,G,S)}function Or(m,v,S){var V=di(v,S,!1);if(!q(V))return V.OrdinaryGetOwnMetadata(m,v,S)}function St(m,v,S,V){var G=di(S,V,!0);G.OrdinaryDefineOwnMetadata(m,v,S,V)}function Tr(m,v){var S=tr(m,v),V=ba(m);if(V===null)return S;var G=Tr(V,v);if(G.length<=0)return S;if(S.length<=0)return G;for(var Ae=new N,ve=[],Q=0,R=S;Q<R.length;Q++){var U=R[Q],H=Ae.has(U);H||(Ae.add(U),ve.push(U))}for(var F=0,ee=G;F<ee.length;F++){var U=ee[F],H=Ae.has(U);H||(Ae.add(U),ve.push(U))}return ve}function tr(m,v){var S=di(m,v,!1);return S?S.OrdinaryOwnMetadataKeys(m,v):[]}function jt(m){if(m===null)return 1;switch(typeof m){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return m===null?1:6;default:return 6}}function q(m){return m===void 0}function z(m){return m===null}function le(m){return typeof m=="symbol"}function O(m){return typeof m=="object"?m!==null:typeof m=="function"}function ne(m,v){switch(jt(m)){case 0:return m;case 1:return m;case 2:return m;case 3:return m;case 4:return m;case 5:return m}var S="string",V=Lu(m,s);if(V!==void 0){var G=V.call(m,S);if(O(G))throw new TypeError;return G}return ue(m)}function ue(m,v){var S,V;{var G=m.toString;if(We(G)){var V=G.call(m);if(!O(V))return V}var S=m.valueOf;if(We(S)){var V=S.call(m);if(!O(V))return V}}throw new TypeError}function Ce(m){return!!m}function kt(m){return""+m}function Y(m){var v=ne(m);return le(v)?v:kt(v)}function he(m){return Array.isArray?Array.isArray(m):m instanceof Object?m instanceof Array:Object.prototype.toString.call(m)==="[object Array]"}function We(m){return typeof m=="function"}function W(m){return typeof m=="function"}function we(m){switch(jt(m)){case 3:return!0;case 4:return!0;default:return!1}}function Pt(m,v){return m===v||m!==m&&v!==v}function Lu(m,v){var S=m[v];if(S!=null){if(!We(S))throw new TypeError;return S}}function Hu(m){var v=Lu(m,c);if(!We(v))throw new TypeError;var S=v.call(m);if(!O(S))throw new TypeError;return S}function Fu(m){return m.value}function Ku(m){var v=m.next();return v.done?!1:v}function qu(m){var v=m.return;v&&v.call(m)}function ba(m){var v=Object.getPrototypeOf(m);if(typeof m!="function"||m===y||v!==y)return v;var S=m.prototype,V=S&&Object.getPrototypeOf(S);if(V==null||V===Object.prototype)return v;var G=V.constructor;return typeof G!="function"||G===m?v:G}function xp(){var m;!q(g)&&typeof t.Reflect<"u"&&!(g in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(m=Ep(t.Reflect));var v,S,V,G=new d,Ae={registerProvider:ve,getProvider:R,setProvider:H};return Ae;function ve(F){if(!Object.isExtensible(Ae))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case m===F:break;case q(v):v=F;break;case v===F:break;case q(S):S=F;break;case S===F:break;default:V===void 0&&(V=new N),V.add(F);break}}function Q(F,ee){if(!q(v)){if(v.isProviderFor(F,ee))return v;if(!q(S)){if(S.isProviderFor(F,ee))return v;if(!q(V))for(var fe=Hu(V);;){var ge=Ku(fe);if(!ge)return;var rt=Fu(ge);if(rt.isProviderFor(F,ee))return qu(fe),rt}}}if(!q(m)&&m.isProviderFor(F,ee))return m}function R(F,ee){var fe=G.get(F),ge;return q(fe)||(ge=fe.get(ee)),q(ge)&&(ge=Q(F,ee),q(ge)||(q(fe)&&(fe=new K,G.set(F,fe)),fe.set(ee,ge))),ge}function U(F){if(q(F))throw new TypeError;return v===F||S===F||!q(V)&&V.has(F)}function H(F,ee,fe){if(!U(fe))throw new Error("Metadata provider not registered.");var ge=R(F,ee);if(ge!==fe){if(!q(ge))return!1;var rt=G.get(F);q(rt)&&(rt=new K,G.set(F,rt)),rt.set(ee,fe)}return!0}}function Cp(){var m;return!q(g)&&O(t.Reflect)&&Object.isExtensible(t.Reflect)&&(m=t.Reflect[g]),q(m)&&(m=xp()),!q(g)&&O(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:m}),m}function Bp(m){var v=new d,S={isProviderFor:function(U,H){var F=v.get(U);return q(F)?!1:F.has(H)},OrdinaryDefineOwnMetadata:ve,OrdinaryHasOwnMetadata:G,OrdinaryGetOwnMetadata:Ae,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:R};return A.registerProvider(S),S;function V(U,H,F){var ee=v.get(U),fe=!1;if(q(ee)){if(!F)return;ee=new K,v.set(U,ee),fe=!0}var ge=ee.get(H);if(q(ge)){if(!F)return;if(ge=new K,ee.set(H,ge),!m.setProvider(U,H,S))throw ee.delete(H),fe&&v.delete(U),new Error("Wrong provider for target.")}return ge}function G(U,H,F){var ee=V(H,F,!1);return q(ee)?!1:Ce(ee.has(U))}function Ae(U,H,F){var ee=V(H,F,!1);if(!q(ee))return ee.get(U)}function ve(U,H,F,ee){var fe=V(F,ee,!0);fe.set(U,H)}function Q(U,H){var F=[],ee=V(U,H,!1);if(q(ee))return F;for(var fe=ee.keys(),ge=Hu(fe),rt=0;;){var zu=Ku(ge);if(!zu)return F.length=rt,F;var Tp=Fu(zu);try{F[rt]=Tp}catch(Vp){try{qu(ge)}finally{throw Vp}}rt++}}function R(U,H,F){var ee=V(H,F,!1);if(q(ee)||!ee.delete(U))return!1;if(ee.size===0){var fe=v.get(H);q(fe)||(fe.delete(F),fe.size===0&&v.delete(fe))}return!0}}function Ep(m){var v=m.defineMetadata,S=m.hasOwnMetadata,V=m.getOwnMetadata,G=m.getOwnMetadataKeys,Ae=m.deleteMetadata,ve=new d,Q={isProviderFor:function(R,U){var H=ve.get(R);return!q(H)&&H.has(U)?!0:G(R,U).length?(q(H)&&(H=new N,ve.set(R,H)),H.add(U),!0):!1},OrdinaryDefineOwnMetadata:v,OrdinaryHasOwnMetadata:S,OrdinaryGetOwnMetadata:V,OrdinaryOwnMetadataKeys:G,OrdinaryDeleteMetadata:Ae};return Q}function di(m,v,S){var V=A.getProvider(m,v);if(!q(V))return V;if(S){if(A.setProvider(m,v,w))return w;throw new Error("Illegal state.")}}function Ip(){var m={},v=[],S=function(){function Q(R,U,H){this._index=0,this._keys=R,this._values=U,this._selector=H}return Q.prototype["@@iterator"]=function(){return this},Q.prototype[c]=function(){return this},Q.prototype.next=function(){var R=this._index;if(R>=0&&R<this._keys.length){var U=this._selector(this._keys[R],this._values[R]);return R+1>=this._keys.length?(this._index=-1,this._keys=v,this._values=v):this._index++,{value:U,done:!1}}return{value:void 0,done:!0}},Q.prototype.throw=function(R){throw this._index>=0&&(this._index=-1,this._keys=v,this._values=v),R},Q.prototype.return=function(R){return this._index>=0&&(this._index=-1,this._keys=v,this._values=v),{value:R,done:!0}},Q}(),V=function(){function Q(){this._keys=[],this._values=[],this._cacheKey=m,this._cacheIndex=-2}return Object.defineProperty(Q.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Q.prototype.has=function(R){return this._find(R,!1)>=0},Q.prototype.get=function(R){var U=this._find(R,!1);return U>=0?this._values[U]:void 0},Q.prototype.set=function(R,U){var H=this._find(R,!0);return this._values[H]=U,this},Q.prototype.delete=function(R){var U=this._find(R,!1);if(U>=0){for(var H=this._keys.length,F=U+1;F<H;F++)this._keys[F-1]=this._keys[F],this._values[F-1]=this._values[F];return this._keys.length--,this._values.length--,Pt(R,this._cacheKey)&&(this._cacheKey=m,this._cacheIndex=-2),!0}return!1},Q.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=m,this._cacheIndex=-2},Q.prototype.keys=function(){return new S(this._keys,this._values,G)},Q.prototype.values=function(){return new S(this._keys,this._values,Ae)},Q.prototype.entries=function(){return new S(this._keys,this._values,ve)},Q.prototype["@@iterator"]=function(){return this.entries()},Q.prototype[c]=function(){return this.entries()},Q.prototype._find=function(R,U){if(!Pt(this._cacheKey,R)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(Pt(this._keys[H],R)){this._cacheIndex=H;break}}return this._cacheIndex<0&&U&&(this._cacheIndex=this._keys.length,this._keys.push(R),this._values.push(void 0)),this._cacheIndex},Q}();return V;function G(Q,R){return Q}function Ae(Q,R){return R}function ve(Q,R){return[Q,R]}}function Np(){var m=function(){function v(){this._map=new K}return Object.defineProperty(v.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),v.prototype.has=function(S){return this._map.has(S)},v.prototype.add=function(S){return this._map.set(S,S),this},v.prototype.delete=function(S){return this._map.delete(S)},v.prototype.clear=function(){this._map.clear()},v.prototype.keys=function(){return this._map.keys()},v.prototype.values=function(){return this._map.keys()},v.prototype.entries=function(){return this._map.entries()},v.prototype["@@iterator"]=function(){return this.keys()},v.prototype[c]=function(){return this.keys()},v}();return m}function Op(){var m=16,v=b.create(),S=V();return function(){function R(){this._key=V()}return R.prototype.has=function(U){var H=G(U,!1);return H!==void 0?b.has(H,this._key):!1},R.prototype.get=function(U){var H=G(U,!1);return H!==void 0?b.get(H,this._key):void 0},R.prototype.set=function(U,H){var F=G(U,!0);return F[this._key]=H,this},R.prototype.delete=function(U){var H=G(U,!1);return H!==void 0?delete H[this._key]:!1},R.prototype.clear=function(){this._key=V()},R}();function V(){var R;do R="@@WeakMap@@"+Q();while(b.has(v,R));return v[R]=!0,R}function G(R,U){if(!i.call(R,S)){if(!U)return;Object.defineProperty(R,S,{value:b.create()})}return R[S]}function Ae(R,U){for(var H=0;H<U;++H)R[H]=Math.random()*255|0;return R}function ve(R){if(typeof Uint8Array=="function"){var U=new Uint8Array(R);return typeof crypto<"u"?crypto.getRandomValues(U):typeof msCrypto<"u"?msCrypto.getRandomValues(U):Ae(U,R),U}return Ae(new Array(R),R)}function Q(){var R=ve(m);R[6]=R[6]&79|64,R[8]=R[8]&191|128;for(var U="",H=0;H<m;++H){var F=R[H];(H===4||H===6||H===8)&&(U+="-"),F<16&&(U+="0"),U+=F.toString(16).toLowerCase()}return U}}function va(m){return m.__=void 0,delete m.__,m}})})(Aa||(Aa={}));/*!
14
+ ***************************************************************************** */var Aa;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Xn=="object"?Xn:typeof self=="object"?self:typeof this=="object"?this:u(),i=n(r);typeof t.Reflect<"u"&&(i=n(t.Reflect,i)),e(i,t),typeof t.Reflect>"u"&&(t.Reflect=r);function n(f,p){return function(b,y){Object.defineProperty(f,b,{configurable:!0,writable:!0,value:y}),p&&p(b,y)}}function s(){try{return Function("return this;")()}catch{}}function c(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||c()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",c=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,p=!u&&!f,b={create:u?function(){return va(Object.create(null))}:f?function(){return va({__proto__:null})}:function(){return va({})},has:p?function(m,v){return i.call(m,v)}:function(m,v){return v in m},get:p?function(m,v){return i.call(m,v)?m[v]:void 0}:function(m,v){return m[v]}},y=Object.getPrototypeOf(Function),K=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ip(),N=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Np(),d=typeof WeakMap=="function"?WeakMap:Op(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,A=Cp(),w=Bp(A);function I(m,v,S,_){if(q(S)){if(!he(m))throw new TypeError;if(!W(v))throw new TypeError;return Ie(m,v)}else{if(!he(m))throw new TypeError;if(!O(v))throw new TypeError;if(!O(_)&&!q(_)&&!z(_))throw new TypeError;return z(_)&&(_=void 0),S=Y(S),ae(m,v,S,_)}}e("decorate",I);function k(m,v){function S(_,G){if(!O(_))throw new TypeError;if(!q(G)&&!we(G))throw new TypeError;St(m,v,_,G)}return S}e("metadata",k);function E(m,v,S,_){if(!O(S))throw new TypeError;return q(_)||(_=Y(_)),St(m,v,S,_)}e("defineMetadata",E);function J(m,v,S){if(!O(v))throw new TypeError;return q(S)||(S=Y(S)),pe(m,v,S)}e("hasMetadata",J);function se(m,v,S){if(!O(v))throw new TypeError;return q(S)||(S=Y(S)),tt(m,v,S)}e("hasOwnMetadata",se);function $(m,v,S){if(!O(v))throw new TypeError;return q(S)||(S=Y(S)),X(m,v,S)}e("getMetadata",$);function C(m,v,S){if(!O(v))throw new TypeError;return q(S)||(S=Y(S)),Or(m,v,S)}e("getOwnMetadata",C);function P(m,v){if(!O(m))throw new TypeError;return q(v)||(v=Y(v)),Tr(m,v)}e("getMetadataKeys",P);function ye(m,v){if(!O(m))throw new TypeError;return q(v)||(v=Y(v)),tr(m,v)}e("getOwnMetadataKeys",ye);function ie(m,v,S){if(!O(v))throw new TypeError;if(q(S)||(S=Y(S)),!O(v))throw new TypeError;q(S)||(S=Y(S));var _=di(v,S,!1);return q(_)?!1:_.OrdinaryDeleteMetadata(m,v,S)}e("deleteMetadata",ie);function Ie(m,v){for(var S=m.length-1;S>=0;--S){var _=m[S],G=_(v);if(!q(G)&&!z(G)){if(!W(G))throw new TypeError;v=G}}return v}function ae(m,v,S,_){for(var G=m.length-1;G>=0;--G){var Ae=m[G],ve=Ae(v,S,_);if(!q(ve)&&!z(ve)){if(!O(ve))throw new TypeError;_=ve}}return _}function pe(m,v,S){var _=tt(m,v,S);if(_)return!0;var G=ba(v);return z(G)?!1:pe(m,G,S)}function tt(m,v,S){var _=di(v,S,!1);return q(_)?!1:Ce(_.OrdinaryHasOwnMetadata(m,v,S))}function X(m,v,S){var _=tt(m,v,S);if(_)return Or(m,v,S);var G=ba(v);if(!z(G))return X(m,G,S)}function Or(m,v,S){var _=di(v,S,!1);if(!q(_))return _.OrdinaryGetOwnMetadata(m,v,S)}function St(m,v,S,_){var G=di(S,_,!0);G.OrdinaryDefineOwnMetadata(m,v,S,_)}function Tr(m,v){var S=tr(m,v),_=ba(m);if(_===null)return S;var G=Tr(_,v);if(G.length<=0)return S;if(S.length<=0)return G;for(var Ae=new N,ve=[],Q=0,R=S;Q<R.length;Q++){var U=R[Q],H=Ae.has(U);H||(Ae.add(U),ve.push(U))}for(var F=0,ee=G;F<ee.length;F++){var U=ee[F],H=Ae.has(U);H||(Ae.add(U),ve.push(U))}return ve}function tr(m,v){var S=di(m,v,!1);return S?S.OrdinaryOwnMetadataKeys(m,v):[]}function jt(m){if(m===null)return 1;switch(typeof m){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return m===null?1:6;default:return 6}}function q(m){return m===void 0}function z(m){return m===null}function le(m){return typeof m=="symbol"}function O(m){return typeof m=="object"?m!==null:typeof m=="function"}function ne(m,v){switch(jt(m)){case 0:return m;case 1:return m;case 2:return m;case 3:return m;case 4:return m;case 5:return m}var S="string",_=Lu(m,s);if(_!==void 0){var G=_.call(m,S);if(O(G))throw new TypeError;return G}return ue(m)}function ue(m,v){var S,_;{var G=m.toString;if(We(G)){var _=G.call(m);if(!O(_))return _}var S=m.valueOf;if(We(S)){var _=S.call(m);if(!O(_))return _}}throw new TypeError}function Ce(m){return!!m}function kt(m){return""+m}function Y(m){var v=ne(m);return le(v)?v:kt(v)}function he(m){return Array.isArray?Array.isArray(m):m instanceof Object?m instanceof Array:Object.prototype.toString.call(m)==="[object Array]"}function We(m){return typeof m=="function"}function W(m){return typeof m=="function"}function we(m){switch(jt(m)){case 3:return!0;case 4:return!0;default:return!1}}function Pt(m,v){return m===v||m!==m&&v!==v}function Lu(m,v){var S=m[v];if(S!=null){if(!We(S))throw new TypeError;return S}}function Hu(m){var v=Lu(m,c);if(!We(v))throw new TypeError;var S=v.call(m);if(!O(S))throw new TypeError;return S}function Fu(m){return m.value}function Ku(m){var v=m.next();return v.done?!1:v}function qu(m){var v=m.return;v&&v.call(m)}function ba(m){var v=Object.getPrototypeOf(m);if(typeof m!="function"||m===y||v!==y)return v;var S=m.prototype,_=S&&Object.getPrototypeOf(S);if(_==null||_===Object.prototype)return v;var G=_.constructor;return typeof G!="function"||G===m?v:G}function xp(){var m;!q(g)&&typeof t.Reflect<"u"&&!(g in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(m=Ep(t.Reflect));var v,S,_,G=new d,Ae={registerProvider:ve,getProvider:R,setProvider:H};return Ae;function ve(F){if(!Object.isExtensible(Ae))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case m===F:break;case q(v):v=F;break;case v===F:break;case q(S):S=F;break;case S===F:break;default:_===void 0&&(_=new N),_.add(F);break}}function Q(F,ee){if(!q(v)){if(v.isProviderFor(F,ee))return v;if(!q(S)){if(S.isProviderFor(F,ee))return v;if(!q(_))for(var fe=Hu(_);;){var ge=Ku(fe);if(!ge)return;var rt=Fu(ge);if(rt.isProviderFor(F,ee))return qu(fe),rt}}}if(!q(m)&&m.isProviderFor(F,ee))return m}function R(F,ee){var fe=G.get(F),ge;return q(fe)||(ge=fe.get(ee)),q(ge)&&(ge=Q(F,ee),q(ge)||(q(fe)&&(fe=new K,G.set(F,fe)),fe.set(ee,ge))),ge}function U(F){if(q(F))throw new TypeError;return v===F||S===F||!q(_)&&_.has(F)}function H(F,ee,fe){if(!U(fe))throw new Error("Metadata provider not registered.");var ge=R(F,ee);if(ge!==fe){if(!q(ge))return!1;var rt=G.get(F);q(rt)&&(rt=new K,G.set(F,rt)),rt.set(ee,fe)}return!0}}function Cp(){var m;return!q(g)&&O(t.Reflect)&&Object.isExtensible(t.Reflect)&&(m=t.Reflect[g]),q(m)&&(m=xp()),!q(g)&&O(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:m}),m}function Bp(m){var v=new d,S={isProviderFor:function(U,H){var F=v.get(U);return q(F)?!1:F.has(H)},OrdinaryDefineOwnMetadata:ve,OrdinaryHasOwnMetadata:G,OrdinaryGetOwnMetadata:Ae,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:R};return A.registerProvider(S),S;function _(U,H,F){var ee=v.get(U),fe=!1;if(q(ee)){if(!F)return;ee=new K,v.set(U,ee),fe=!0}var ge=ee.get(H);if(q(ge)){if(!F)return;if(ge=new K,ee.set(H,ge),!m.setProvider(U,H,S))throw ee.delete(H),fe&&v.delete(U),new Error("Wrong provider for target.")}return ge}function G(U,H,F){var ee=_(H,F,!1);return q(ee)?!1:Ce(ee.has(U))}function Ae(U,H,F){var ee=_(H,F,!1);if(!q(ee))return ee.get(U)}function ve(U,H,F,ee){var fe=_(F,ee,!0);fe.set(U,H)}function Q(U,H){var F=[],ee=_(U,H,!1);if(q(ee))return F;for(var fe=ee.keys(),ge=Hu(fe),rt=0;;){var zu=Ku(ge);if(!zu)return F.length=rt,F;var Tp=Fu(zu);try{F[rt]=Tp}catch(_p){try{qu(ge)}finally{throw _p}}rt++}}function R(U,H,F){var ee=_(H,F,!1);if(q(ee)||!ee.delete(U))return!1;if(ee.size===0){var fe=v.get(H);q(fe)||(fe.delete(F),fe.size===0&&v.delete(fe))}return!0}}function Ep(m){var v=m.defineMetadata,S=m.hasOwnMetadata,_=m.getOwnMetadata,G=m.getOwnMetadataKeys,Ae=m.deleteMetadata,ve=new d,Q={isProviderFor:function(R,U){var H=ve.get(R);return!q(H)&&H.has(U)?!0:G(R,U).length?(q(H)&&(H=new N,ve.set(R,H)),H.add(U),!0):!1},OrdinaryDefineOwnMetadata:v,OrdinaryHasOwnMetadata:S,OrdinaryGetOwnMetadata:_,OrdinaryOwnMetadataKeys:G,OrdinaryDeleteMetadata:Ae};return Q}function di(m,v,S){var _=A.getProvider(m,v);if(!q(_))return _;if(S){if(A.setProvider(m,v,w))return w;throw new Error("Illegal state.")}}function Ip(){var m={},v=[],S=function(){function Q(R,U,H){this._index=0,this._keys=R,this._values=U,this._selector=H}return Q.prototype["@@iterator"]=function(){return this},Q.prototype[c]=function(){return this},Q.prototype.next=function(){var R=this._index;if(R>=0&&R<this._keys.length){var U=this._selector(this._keys[R],this._values[R]);return R+1>=this._keys.length?(this._index=-1,this._keys=v,this._values=v):this._index++,{value:U,done:!1}}return{value:void 0,done:!0}},Q.prototype.throw=function(R){throw this._index>=0&&(this._index=-1,this._keys=v,this._values=v),R},Q.prototype.return=function(R){return this._index>=0&&(this._index=-1,this._keys=v,this._values=v),{value:R,done:!0}},Q}(),_=function(){function Q(){this._keys=[],this._values=[],this._cacheKey=m,this._cacheIndex=-2}return Object.defineProperty(Q.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Q.prototype.has=function(R){return this._find(R,!1)>=0},Q.prototype.get=function(R){var U=this._find(R,!1);return U>=0?this._values[U]:void 0},Q.prototype.set=function(R,U){var H=this._find(R,!0);return this._values[H]=U,this},Q.prototype.delete=function(R){var U=this._find(R,!1);if(U>=0){for(var H=this._keys.length,F=U+1;F<H;F++)this._keys[F-1]=this._keys[F],this._values[F-1]=this._values[F];return this._keys.length--,this._values.length--,Pt(R,this._cacheKey)&&(this._cacheKey=m,this._cacheIndex=-2),!0}return!1},Q.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=m,this._cacheIndex=-2},Q.prototype.keys=function(){return new S(this._keys,this._values,G)},Q.prototype.values=function(){return new S(this._keys,this._values,Ae)},Q.prototype.entries=function(){return new S(this._keys,this._values,ve)},Q.prototype["@@iterator"]=function(){return this.entries()},Q.prototype[c]=function(){return this.entries()},Q.prototype._find=function(R,U){if(!Pt(this._cacheKey,R)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(Pt(this._keys[H],R)){this._cacheIndex=H;break}}return this._cacheIndex<0&&U&&(this._cacheIndex=this._keys.length,this._keys.push(R),this._values.push(void 0)),this._cacheIndex},Q}();return _;function G(Q,R){return Q}function Ae(Q,R){return R}function ve(Q,R){return[Q,R]}}function Np(){var m=function(){function v(){this._map=new K}return Object.defineProperty(v.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),v.prototype.has=function(S){return this._map.has(S)},v.prototype.add=function(S){return this._map.set(S,S),this},v.prototype.delete=function(S){return this._map.delete(S)},v.prototype.clear=function(){this._map.clear()},v.prototype.keys=function(){return this._map.keys()},v.prototype.values=function(){return this._map.keys()},v.prototype.entries=function(){return this._map.entries()},v.prototype["@@iterator"]=function(){return this.keys()},v.prototype[c]=function(){return this.keys()},v}();return m}function Op(){var m=16,v=b.create(),S=_();return function(){function R(){this._key=_()}return R.prototype.has=function(U){var H=G(U,!1);return H!==void 0?b.has(H,this._key):!1},R.prototype.get=function(U){var H=G(U,!1);return H!==void 0?b.get(H,this._key):void 0},R.prototype.set=function(U,H){var F=G(U,!0);return F[this._key]=H,this},R.prototype.delete=function(U){var H=G(U,!1);return H!==void 0?delete H[this._key]:!1},R.prototype.clear=function(){this._key=_()},R}();function _(){var R;do R="@@WeakMap@@"+Q();while(b.has(v,R));return v[R]=!0,R}function G(R,U){if(!i.call(R,S)){if(!U)return;Object.defineProperty(R,S,{value:b.create()})}return R[S]}function Ae(R,U){for(var H=0;H<U;++H)R[H]=Math.random()*255|0;return R}function ve(R){if(typeof Uint8Array=="function"){var U=new Uint8Array(R);return typeof crypto<"u"?crypto.getRandomValues(U):typeof msCrypto<"u"?msCrypto.getRandomValues(U):Ae(U,R),U}return Ae(new Array(R),R)}function Q(){var R=ve(m);R[6]=R[6]&79|64,R[8]=R[8]&191|128;for(var U="",H=0;H<m;++H){var F=R[H];(H===4||H===6||H===8)&&(U+="-"),F<16&&(U+="0"),U+=F.toString(16).toLowerCase()}return U}}function va(m){return m.__=void 0,delete m.__,m}})})(Aa||(Aa={}));/*!
15
15
  * MIT License
16
16
  *
17
17
  * Copyright (c) 2017-2022 Peculiar Ventures, LLC
@@ -34,7 +34,7 @@
34
34
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
35
  * SOFTWARE.
36
36
  *
37
- */const Ju="[object ArrayBuffer]";class _{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Ju}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){const i=_.toUint8Array(e),n=_.toUint8Array(t);if(i.length!==n.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let i=0;for(const c of t)i+=c.byteLength;const n=new Uint8Array(i);let s=0;for(const c of t){const u=this.toUint8Array(c);n.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}}const eo="string",Yu=/^[0-9a-f]+$/i,Zu=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Qu=/^[a-zA-Z0-9-_]+$/;class Sa{static fromString(e){const t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i.buffer}static toString(e){const t=_.toUint8Array(e);let i="";for(let s=0;s<t.length;s++)i+=String.fromCharCode(t[s]);return decodeURIComponent(escape(i))}}class it{static toString(e,t=!1){const i=_.toArrayBuffer(e),n=new DataView(i);let s="";for(let c=0;c<i.byteLength;c+=2){const u=n.getUint16(c,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){const i=new ArrayBuffer(e.length*2),n=new DataView(i);for(let s=0;s<e.length;s++)n.setUint16(s*2,e.charCodeAt(s),t);return i}}class L{static isHex(e){return typeof e===eo&&Yu.test(e)}static isBase64(e){return typeof e===eo&&Zu.test(e)}static isBase64Url(e){return typeof e===eo&&Qu.test(e)}static ToString(e,t="utf8"){const i=_.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return it.toString(i,!0);case"utf16":case"utf16be":return it.toString(i);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return it.fromString(e,!0);case"utf16":case"utf16be":return it.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){const t=_.toUint8Array(e);if(typeof btoa<"u"){const i=this.ToString(t,"binary");return btoa(i)}else return Buffer.from(t).toString("base64")}static FromBase64(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=L.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Sa.fromString(e);case"utf16":case"utf16be":return it.fromString(e);case"utf16le":case"usc2":return it.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=L.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Sa.toString(e);case"utf16":case"utf16be":return it.toString(e);case"utf16le":case"usc2":return it.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){const t=e.length,i=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);return i.buffer}static ToBinary(e){const t=_.toUint8Array(e);let i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){const t=_.toUint8Array(e);let i="";const n=t.length;for(let s=0;s<n;s++){const c=t[s];c<16&&(i+="0"),i+=c.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);const i=new Uint8Array(t.length/2);for(let n=0;n<t.length;n=n+2){const s=t.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,t=!1){return it.toString(e,t)}static FromUtf16String(e,t=!1){return it.fromString(e,t)}static Base64Padding(e){const t=4-e.length%4;if(t<4)for(let i=0;i<t;i++)e+="=";return e}static formatString(e){return(e==null?void 0:e.replace(/[\n\r\t ]/g,""))||""}}L.DEFAULT_UTF8_ENCODING="utf8";function Xu(...r){const e=r.map(n=>n.byteLength).reduce((n,s)=>n+s),t=new Uint8Array(e);let i=0;return r.map(n=>new Uint8Array(n)).forEach(n=>{for(const s of n)t[i++]=s}),t.buffer}function ka(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}/*!
37
+ */const Ju="[object ArrayBuffer]";class V{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Ju}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){const i=V.toUint8Array(e),n=V.toUint8Array(t);if(i.length!==n.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let i=0;for(const c of t)i+=c.byteLength;const n=new Uint8Array(i);let s=0;for(const c of t){const u=this.toUint8Array(c);n.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}}const eo="string",Yu=/^[0-9a-f]+$/i,Zu=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Qu=/^[a-zA-Z0-9-_]+$/;class Sa{static fromString(e){const t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i.buffer}static toString(e){const t=V.toUint8Array(e);let i="";for(let s=0;s<t.length;s++)i+=String.fromCharCode(t[s]);return decodeURIComponent(escape(i))}}class it{static toString(e,t=!1){const i=V.toArrayBuffer(e),n=new DataView(i);let s="";for(let c=0;c<i.byteLength;c+=2){const u=n.getUint16(c,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){const i=new ArrayBuffer(e.length*2),n=new DataView(i);for(let s=0;s<e.length;s++)n.setUint16(s*2,e.charCodeAt(s),t);return i}}class L{static isHex(e){return typeof e===eo&&Yu.test(e)}static isBase64(e){return typeof e===eo&&Zu.test(e)}static isBase64Url(e){return typeof e===eo&&Qu.test(e)}static ToString(e,t="utf8"){const i=V.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return it.toString(i,!0);case"utf16":case"utf16be":return it.toString(i);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return it.fromString(e,!0);case"utf16":case"utf16be":return it.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){const t=V.toUint8Array(e);if(typeof btoa<"u"){const i=this.ToString(t,"binary");return btoa(i)}else return Buffer.from(t).toString("base64")}static FromBase64(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=L.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Sa.fromString(e);case"utf16":case"utf16be":return it.fromString(e);case"utf16le":case"usc2":return it.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=L.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Sa.toString(e);case"utf16":case"utf16be":return it.toString(e);case"utf16le":case"usc2":return it.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){const t=e.length,i=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);return i.buffer}static ToBinary(e){const t=V.toUint8Array(e);let i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){const t=V.toUint8Array(e);let i="";const n=t.length;for(let s=0;s<n;s++){const c=t[s];c<16&&(i+="0"),i+=c.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);const i=new Uint8Array(t.length/2);for(let n=0;n<t.length;n=n+2){const s=t.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,t=!1){return it.toString(e,t)}static FromUtf16String(e,t=!1){return it.fromString(e,t)}static Base64Padding(e){const t=4-e.length%4;if(t<4)for(let i=0;i<t;i++)e+="=";return e}static formatString(e){return(e==null?void 0:e.replace(/[\n\r\t ]/g,""))||""}}L.DEFAULT_UTF8_ENCODING="utf8";function Xu(...r){const e=r.map(n=>n.byteLength).reduce((n,s)=>n+s),t=new Uint8Array(e);let i=0;return r.map(n=>new Uint8Array(n)).forEach(n=>{for(const s of n)t[i++]=s}),t.buffer}function ka(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}/*!
38
38
  Copyright (c) Peculiar Ventures, LLC
39
39
  */function rr(r,e){let t=0;if(r.length===1)return r[0];for(let i=r.length-1;i>=0;i--)t+=r[r.length-1-i]*Math.pow(2,e*i);return t}function Rt(r,e,t=-1){const i=t;let n=r,s=0,c=Math.pow(2,e);for(let u=1;u<8;u++){if(r<c){let f;if(i<0)f=new ArrayBuffer(u),s=u;else{if(i<u)return new ArrayBuffer(0);f=new ArrayBuffer(i),s=i}const p=new Uint8Array(f);for(let b=u-1;b>=0;b--){const y=Math.pow(2,b*e);p[s-b-1]=Math.floor(n/y),n-=p[s-b-1]*y}return f}c*=Math.pow(2,e)}return new ArrayBuffer(0)}function to(...r){let e=0,t=0;for(const s of r)e+=s.length;const i=new ArrayBuffer(e),n=new Uint8Array(i);for(const s of r)n.set(s,t),t+=s.length;return n}function xa(){const r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const u=r[0]===255&&r[1]&128,f=r[0]===0&&(r[1]&128)===0;(u||f)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;const i=rr(t,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let u=0;u<this.valueHex.byteLength;u++)s[u]=r[u];return s[0]&=127,rr(s,8)-i}function ef(r){const e=r<0?r*-1:r;let t=128;for(let i=1;i<8;i++){if(e<=t){if(r<0){const c=t-e,u=Rt(c,8,i),f=new Uint8Array(u);return f[0]|=128,u}let n=Rt(e,8,i),s=new Uint8Array(n);if(s[0]&128){const c=n.slice(0),u=new Uint8Array(c);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let f=0;f<c.byteLength;f++)s[f+1]=u[f];s[0]=0}return n}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function tf(r,e){if(r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}function $e(r,e){const t=r.toString(10);if(e<t.length)return"";const i=e-t.length,n=new Array(i);for(let c=0;c<i;c++)n[c]="0";return n.join("").concat(t)}/*!
40
40
  * Copyright (c) 2014, GMO GlobalSign
@@ -68,11 +68,11 @@
68
68
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
69
69
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
70
70
  *
71
- */function yi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function ro(r){let e=0,t=0;for(let n=0;n<r.length;n++){const s=r[n];e+=s.byteLength}const i=new Uint8Array(e);for(let n=0;n<r.length;n++){const s=r[n];i.set(new Uint8Array(s),t),t+=s.byteLength}return i.buffer}function ft(r,e,t,i){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):i<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-i<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class gi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return ro(this.items)}}const Vr=[new Uint8Array([1])],Ca="0123456789",io="name",Ba="valueHexView",rf="isHexOnly",nf="idBlock",of="tagClass",sf="tagNumber",af="isConstructed",cf="fromBER",lf="toBER",uf="local",_e="",Je=new ArrayBuffer(0),mi=new Uint8Array(0),_r="EndOfContent",Ea="OCTET STRING",Ia="BIT STRING";function nt(r){var e;return e=class extends r{constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?_.toUint8Array(s.valueHex):mi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const c=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!ft(this,c,n,s))return-1;const u=n+s;return this.valueHexView=c.subarray(n,u),this.valueHexView.length?(this.blockLength=s,u):(this.warnings.push("Zero buffer length"),n)}toBER(i=!1){return this.isHexOnly?i?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",Je)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Dt{constructor({blockLength:e=0,error:t=_e,warnings:i=[],valueBeforeDecode:n=mi}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=_.toUint8Array(n)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:L.ToHex(this.valueBeforeDecodeView)}}}Dt.NAME="baseBlock";class Ne extends Dt{fromBER(e,t,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'")}}Ne.NAME="valueBlock";class Na extends nt(Dt){constructor({idBlock:e={}}={}){var t,i,n,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?_.toUint8Array(e.valueHex):mi,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=e.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Je}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,n[0]=t}return n.buffer}if(!this.isHexOnly){const n=Rt(this.tagNumber,7),s=new Uint8Array(n),c=n.byteLength,u=new Uint8Array(c+1);if(u[0]=t|31,!e){for(let f=0;f<c-1;f++)u[f+1]=s[f]|128;u[c]=s[c-1]}return u.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=t|31,!e){const n=this.valueHexView;for(let s=0;s<n.length-1;s++)i[s+1]=n[s]|128;i[this.valueHexView.byteLength]=n[n.length-1]}return i.buffer}fromBER(e,t,i){const n=_.toUint8Array(e);if(!ft(this,n,t,i))return-1;const s=n.subarray(t,t+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let f=1,p=this.valueHexView=new Uint8Array(255),b=255;for(;s[f]&128;){if(p[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===b){b+=255;const K=new Uint8Array(b);for(let N=0;N<p.length;N++)K[N]=p[N];p=this.valueHexView=new Uint8Array(b)}}this.blockLength=f+1,p[f-1]=s[f]&127;const y=new Uint8Array(f);for(let K=0;K<f;K++)y[K]=p[K];p=this.valueHexView=new Uint8Array(f),p.set(y),this.blockLength<=9?this.tagNumber=rr(p,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}Na.NAME="identificationBlock";class Oa extends Dt{constructor({lenBlock:e={}}={}){var t,i,n;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(n=e.length)!==null&&n!==void 0?n:0}fromBER(e,t,i){const n=_.toUint8Array(e);if(!ft(this,n,t,i))return-1;const s=n.subarray(t,t+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;const c=s[0]&127;if(c>8)return this.error="Too big integer",-1;if(c+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const u=t+1,f=n.subarray(u,u+c);return f[c-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=rr(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=c+1,t+this.blockLength}toBER(e=!1){let t,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=128),t;if(this.longFormUsed){const n=Rt(this.length,8);if(n.byteLength>127)return this.error="Too big length",Je;if(t=new ArrayBuffer(n.byteLength+1),e)return t;const s=new Uint8Array(n);i=new Uint8Array(t),i[0]=n.byteLength|128;for(let c=0;c<n.byteLength;c++)i[c+1]=s[c];return t}return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}Oa.NAME="lengthBlock";const M={};class Se extends Dt{constructor({name:e=_e,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new Na(n),this.lenBlock=new Oa(n),this.valueBlock=s?new s(n):new Ne(n)}fromBER(e,t,i){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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){const i=t||new gi;t||Ta(this);const n=this.idBlock.toBER(e);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const c=this.lenBlock.toBER(e);i.write(c),i.write(s)}return t?Je:i.final()}toJSON(){const e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return tf(t,i)}}Se.NAME="BaseBlock";function Ta(r){if(r instanceof M.Constructed)for(const e of r.valueBlock.value)Ta(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}class no extends Se{constructor({value:e=_e,...t}={},i){super(t,i),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,i){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}no.NAME="BaseStringBlock";class Va extends nt(Ne){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}Va.NAME="PrimitiveValueBlock";var _a;class jr extends Se{constructor(e={}){super(e,Va),this.idBlock.isConstructed=!1}}_a=jr,M.Primitive=_a,jr.NAME="PRIMITIVE";function ff(r,e){if(r instanceof e)return r;const t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function ir(r,e=0,t=r.length){const i=e;let n=new Se({},Ne);const s=new Dt;if(!ft(s,r,e,t))return n.error=s.error,{offset:-1,result:n};if(!r.subarray(e,e+t).length)return n.error="Zero buffer length",{offset:-1,result:n};let u=n.idBlock.fromBER(r,e,t);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),u===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(e=u,t-=n.idBlock.blockLength,u=n.lenBlock.fromBER(r,e,t),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),u===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(e=u,t-=n.lenBlock.blockLength,!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm)return n.error="Indefinite length form used for primitive encoding form",{offset:-1,result:n};let f=Se;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};f=M.EndOfContent;break;case 1:f=M.Boolean;break;case 2:f=M.Integer;break;case 3:f=M.BitString;break;case 4:f=M.OctetString;break;case 5:f=M.Null;break;case 6:f=M.ObjectIdentifier;break;case 10:f=M.Enumerated;break;case 12:f=M.Utf8String;break;case 13:f=M.RelativeObjectIdentifier;break;case 14:f=M.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=M.Sequence;break;case 17:f=M.Set;break;case 18:f=M.NumericString;break;case 19:f=M.PrintableString;break;case 20:f=M.TeletexString;break;case 21:f=M.VideotexString;break;case 22:f=M.IA5String;break;case 23:f=M.UTCTime;break;case 24:f=M.GeneralizedTime;break;case 25:f=M.GraphicString;break;case 26:f=M.VisibleString;break;case 27:f=M.GeneralString;break;case 28:f=M.UniversalString;break;case 29:f=M.CharacterString;break;case 30:f=M.BmpString;break;case 31:f=M.DATE;break;case 32:f=M.TimeOfDay;break;case 33:f=M.DateTime;break;case 34:f=M.Duration;break;default:{const p=n.idBlock.isConstructed?new M.Constructed:new M.Primitive;p.idBlock=n.idBlock,p.lenBlock=n.lenBlock,p.warnings=n.warnings,n=p}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?M.Constructed:M.Primitive}return n=ff(n,f),u=n.fromBER(r,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=r.subarray(i,i+n.blockLength),{offset:u,result:n}}function nr(r){if(!r.byteLength){const e=new Se({},Ne);return e.error="Input buffer has zero length",{offset:-1,result:e}}return ir(_.toUint8Array(r).slice(),0,r.byteLength)}function df(r,e){return r?1:e}class xt extends Ne{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=_.toUint8Array(e);if(!ft(this,n,t,i))return-1;if(this.valueBeforeDecodeView=n.subarray(t,t+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;df(this.isIndefiniteForm,i)>0;){const c=ir(n,s,i);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(s=c.offset,this.blockLength+=c.result.blockLength,i-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===_r)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===_r?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new gi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?Je:i.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}xt.NAME="ConstructedValueBlock";var ja;class je extends Se{constructor(e={}){super(e,xt),this.idBlock.isConstructed=!0}fromBER(e,t,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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(){const e=[];for(const i of this.valueBlock.value)e.push(i.toString("ascii").split(`
71
+ */function yi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function ro(r){let e=0,t=0;for(let n=0;n<r.length;n++){const s=r[n];e+=s.byteLength}const i=new Uint8Array(e);for(let n=0;n<r.length;n++){const s=r[n];i.set(new Uint8Array(s),t),t+=s.byteLength}return i.buffer}function ft(r,e,t,i){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):i<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-i<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class gi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return ro(this.items)}}const _r=[new Uint8Array([1])],Ca="0123456789",io="name",Ba="valueHexView",rf="isHexOnly",nf="idBlock",of="tagClass",sf="tagNumber",af="isConstructed",cf="fromBER",lf="toBER",uf="local",Ve="",Je=new ArrayBuffer(0),mi=new Uint8Array(0),Vr="EndOfContent",Ea="OCTET STRING",Ia="BIT STRING";function nt(r){var e;return e=class extends r{constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?V.toUint8Array(s.valueHex):mi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const c=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!ft(this,c,n,s))return-1;const u=n+s;return this.valueHexView=c.subarray(n,u),this.valueHexView.length?(this.blockLength=s,u):(this.warnings.push("Zero buffer length"),n)}toBER(i=!1){return this.isHexOnly?i?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",Je)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Dt{constructor({blockLength:e=0,error:t=Ve,warnings:i=[],valueBeforeDecode:n=mi}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=V.toUint8Array(n)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:L.ToHex(this.valueBeforeDecodeView)}}}Dt.NAME="baseBlock";class Ne extends Dt{fromBER(e,t,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'")}}Ne.NAME="valueBlock";class Na extends nt(Dt){constructor({idBlock:e={}}={}){var t,i,n,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?V.toUint8Array(e.valueHex):mi,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=e.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Je}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,n[0]=t}return n.buffer}if(!this.isHexOnly){const n=Rt(this.tagNumber,7),s=new Uint8Array(n),c=n.byteLength,u=new Uint8Array(c+1);if(u[0]=t|31,!e){for(let f=0;f<c-1;f++)u[f+1]=s[f]|128;u[c]=s[c-1]}return u.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=t|31,!e){const n=this.valueHexView;for(let s=0;s<n.length-1;s++)i[s+1]=n[s]|128;i[this.valueHexView.byteLength]=n[n.length-1]}return i.buffer}fromBER(e,t,i){const n=V.toUint8Array(e);if(!ft(this,n,t,i))return-1;const s=n.subarray(t,t+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let f=1,p=this.valueHexView=new Uint8Array(255),b=255;for(;s[f]&128;){if(p[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===b){b+=255;const K=new Uint8Array(b);for(let N=0;N<p.length;N++)K[N]=p[N];p=this.valueHexView=new Uint8Array(b)}}this.blockLength=f+1,p[f-1]=s[f]&127;const y=new Uint8Array(f);for(let K=0;K<f;K++)y[K]=p[K];p=this.valueHexView=new Uint8Array(f),p.set(y),this.blockLength<=9?this.tagNumber=rr(p,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}Na.NAME="identificationBlock";class Oa extends Dt{constructor({lenBlock:e={}}={}){var t,i,n;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(n=e.length)!==null&&n!==void 0?n:0}fromBER(e,t,i){const n=V.toUint8Array(e);if(!ft(this,n,t,i))return-1;const s=n.subarray(t,t+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;const c=s[0]&127;if(c>8)return this.error="Too big integer",-1;if(c+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const u=t+1,f=n.subarray(u,u+c);return f[c-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=rr(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=c+1,t+this.blockLength}toBER(e=!1){let t,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=128),t;if(this.longFormUsed){const n=Rt(this.length,8);if(n.byteLength>127)return this.error="Too big length",Je;if(t=new ArrayBuffer(n.byteLength+1),e)return t;const s=new Uint8Array(n);i=new Uint8Array(t),i[0]=n.byteLength|128;for(let c=0;c<n.byteLength;c++)i[c+1]=s[c];return t}return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}Oa.NAME="lengthBlock";const M={};class Se extends Dt{constructor({name:e=Ve,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new Na(n),this.lenBlock=new Oa(n),this.valueBlock=s?new s(n):new Ne(n)}fromBER(e,t,i){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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){const i=t||new gi;t||Ta(this);const n=this.idBlock.toBER(e);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const c=this.lenBlock.toBER(e);i.write(c),i.write(s)}return t?Je:i.final()}toJSON(){const e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return tf(t,i)}}Se.NAME="BaseBlock";function Ta(r){if(r instanceof M.Constructed)for(const e of r.valueBlock.value)Ta(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}class no extends Se{constructor({value:e=Ve,...t}={},i){super(t,i),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,i){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}no.NAME="BaseStringBlock";class _a extends nt(Ne){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}_a.NAME="PrimitiveValueBlock";var Va;class jr extends Se{constructor(e={}){super(e,_a),this.idBlock.isConstructed=!1}}Va=jr,M.Primitive=Va,jr.NAME="PRIMITIVE";function ff(r,e){if(r instanceof e)return r;const t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function ir(r,e=0,t=r.length){const i=e;let n=new Se({},Ne);const s=new Dt;if(!ft(s,r,e,t))return n.error=s.error,{offset:-1,result:n};if(!r.subarray(e,e+t).length)return n.error="Zero buffer length",{offset:-1,result:n};let u=n.idBlock.fromBER(r,e,t);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),u===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(e=u,t-=n.idBlock.blockLength,u=n.lenBlock.fromBER(r,e,t),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),u===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(e=u,t-=n.lenBlock.blockLength,!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm)return n.error="Indefinite length form used for primitive encoding form",{offset:-1,result:n};let f=Se;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};f=M.EndOfContent;break;case 1:f=M.Boolean;break;case 2:f=M.Integer;break;case 3:f=M.BitString;break;case 4:f=M.OctetString;break;case 5:f=M.Null;break;case 6:f=M.ObjectIdentifier;break;case 10:f=M.Enumerated;break;case 12:f=M.Utf8String;break;case 13:f=M.RelativeObjectIdentifier;break;case 14:f=M.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=M.Sequence;break;case 17:f=M.Set;break;case 18:f=M.NumericString;break;case 19:f=M.PrintableString;break;case 20:f=M.TeletexString;break;case 21:f=M.VideotexString;break;case 22:f=M.IA5String;break;case 23:f=M.UTCTime;break;case 24:f=M.GeneralizedTime;break;case 25:f=M.GraphicString;break;case 26:f=M.VisibleString;break;case 27:f=M.GeneralString;break;case 28:f=M.UniversalString;break;case 29:f=M.CharacterString;break;case 30:f=M.BmpString;break;case 31:f=M.DATE;break;case 32:f=M.TimeOfDay;break;case 33:f=M.DateTime;break;case 34:f=M.Duration;break;default:{const p=n.idBlock.isConstructed?new M.Constructed:new M.Primitive;p.idBlock=n.idBlock,p.lenBlock=n.lenBlock,p.warnings=n.warnings,n=p}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?M.Constructed:M.Primitive}return n=ff(n,f),u=n.fromBER(r,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=r.subarray(i,i+n.blockLength),{offset:u,result:n}}function nr(r){if(!r.byteLength){const e=new Se({},Ne);return e.error="Input buffer has zero length",{offset:-1,result:e}}return ir(V.toUint8Array(r).slice(),0,r.byteLength)}function df(r,e){return r?1:e}class xt extends Ne{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=V.toUint8Array(e);if(!ft(this,n,t,i))return-1;if(this.valueBeforeDecodeView=n.subarray(t,t+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;df(this.isIndefiniteForm,i)>0;){const c=ir(n,s,i);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(s=c.offset,this.blockLength+=c.result.blockLength,i-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===Vr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Vr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new gi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?Je:i.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}xt.NAME="ConstructedValueBlock";var ja;class je extends Se{constructor(e={}){super(e,xt),this.idBlock.isConstructed=!0}fromBER(e,t,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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(){const e=[];for(const i of this.valueBlock.value)e.push(i.toString("ascii").split(`
72
72
  `).map(n=>` ${n}`).join(`
73
73
  `));const t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
74
74
  ${e.join(`
75
- `)}`:`${t} :`}}ja=je,M.Constructed=ja,je.NAME="CONSTRUCTED";class Pa extends Ne{fromBER(e,t,i){return t}toBER(e){return Je}}Pa.override="EndOfContentValueBlock";var Ra;class oo extends Se{constructor(e={}){super(e,Pa),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}Ra=oo,M.EndOfContent=Ra,oo.NAME=_r;var Da;class Mt extends Se{constructor(e={}){super(e,Ne),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,i){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+=i,t+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+i}toBER(e,t){const i=new ArrayBuffer(2);if(!e){const n=new Uint8Array(i);n[0]=5,n[1]=0}return t&&t.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}Da=Mt,M.Null=Da,Mt.NAME="NULL";class Ma extends nt(Ne){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=_.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,i){const n=_.toUint8Array(e);return ft(this,n,t,i)?(this.valueHexView=n.subarray(t,t+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,xa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Ma.NAME="BooleanValueBlock";var $a;let bi=class extends Se{constructor(e={}){super(e,Ma),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};$a=bi,M.Boolean=$a,bi.NAME="BOOLEAN";class Ua extends nt(xt){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=xt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const c=this.value[s].constructor.NAME;if(c===_r){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==Ea)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(e,t,i),this.blockLength=i;return n}toBER(e,t){return this.isConstructed?xt.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Ua.NAME="OctetStringValueBlock";var La;let $t=class Gu extends Se{constructor({idBlock:e={},lenBlock:t={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},Ua),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){const s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+i);try{if(s.byteLength){const c=ir(s,0,s.byteLength);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?je.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof Gu&&e.push(t.valueBlock.valueHexView);return _.concat(e)}};La=$t,M.OctetString=La,$t.NAME=Ea;class Ha extends nt(xt){constructor({unusedBits:e=0,isConstructed:t=!1,...i}={}){super(i),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,i){if(!i)return t;let n=-1;if(this.isConstructed){if(n=xt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===_r){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==Ia)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const p=u.valueBlock;if(this.unusedBits>0&&p.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=p.unusedBits}return n}const s=_.toUint8Array(e);if(!ft(this,s,t,i))return-1;const c=s.subarray(t,t+i);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=c.subarray(1);try{if(u.byteLength){const f=ir(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,t+i}toBER(e,t){if(this.isConstructed)return xt.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Je;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Ha.NAME="BitStringValueBlock";var Fa;let Ut=class extends Se{constructor({idBlock:e={},lenBlock:t={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},Ha),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return je.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const n of t)e.push(n.toString(2).padStart(8,"0"));const i=e.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};Fa=Ut,M.BitString=Fa,Ut.NAME=Ia;var Ka;function pf(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const c=s.length-1,u=n.slice(0),f=u.length-1;let p=0;const b=f<c?c:f;let y=0;for(let K=b;K>=0;K--,y++){switch(!0){case y<u.length:p=s[c-y]+u[f-y]+t[0];break;default:p=s[c-y]+t[0]}switch(t[0]=p/10,!0){case y>=s.length:s=to(new Uint8Array([p%10]),s);break;default:s[c-y]=p%10}}return t[0]>0&&(s=to(t,s)),s}function qa(r){if(r>=Vr.length)for(let e=Vr.length;e<=r;e++){const t=new Uint8Array([0]);let i=Vr[e-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+t[0]]);t[0]=s[0]/10,i[n]=s[0]%10}t[0]>0&&(i=to(t,i)),Vr.push(i)}return Vr[r]}function hf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),c=s.length-1,u=n.slice(0),f=u.length-1;let p,b=0;for(let y=f;y>=0;y--,b++)switch(p=s[c-b]-u[f-b]-t,!0){case p<0:t=1,s[c-b]=p+10;break;default:t=0,s[c-b]=p}if(t>0)for(let y=c-f+1;y>=0;y--,b++)if(p=s[c-b]-t,p<0)t=1,s[c-b]=p+10;else{t=0,s[c-b]=p;break}return s.slice()}class so extends nt(Ne){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}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=xa.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(ef(e))}get valueDec(){return this._valueDec}fromDER(e,t,i,n=0){const s=this.fromBER(e,t,i);if(s===-1)return s;const c=this.valueHexView;return c[0]===0&&c[1]&128?this.valueHexView=c.subarray(1):n!==0&&c.length<n&&(n-c.length>1&&(n=c.length+1),this.valueHexView=c.subarray(n-c.length)),s}toDER(e=!1){const t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(t,1),this.valueHexView=i}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,i){const n=super.fromBER(e,t,i);return n===-1||this.setValueHex(),n}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const e=this.valueHexView.length*8-1;let t=new Uint8Array(this.valueHexView.length*8/3),i=0,n;const s=this.valueHexView;let c="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let p=0;p<8;p++){if((n&1)===1)switch(i){case e:t=hf(qa(i),t),c="-";break;default:t=pf(t,qa(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(c+=Ca.charAt(t[f]));return u===!1&&(c+=Ca.charAt(0)),c}}Ka=so,so.NAME="IntegerValueBlock",Object.defineProperty(Ka.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var za;class ot extends Se{constructor(e={}){super(e,so),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return yi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){yi();const t=BigInt(e),i=new gi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const p=BigInt(`0x${L.ToHex(u)}`)+t,b=_.toUint8Array(L.FromHex(p.toString(16)));b[0]|=128,i.write(b)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new ot({valueHex:i.final()})}convertToDER(){const e=new ot({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new ot({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}za=ot,M.Integer=za,ot.NAME="INTEGER";var Ga;class vi extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ga=vi,M.Enumerated=Ga,vi.NAME="ENUMERATED";class ao extends nt(Ne){constructor({valueDec:e=-1,isFirstSid:t=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,i){if(!i)return t;const n=_.toUint8Array(e);if(!ft(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=rr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){yi();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const i=new Uint8Array(t.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(t.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Rt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Je;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=L.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}}}ao.NAME="sidBlock";class Wa extends Ne{constructor({value:e=_e,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new ao;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e){const t=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,Je;t.push(n)}return ro(t)}fromString(e){this.value=[];let t=0,i=0,n="",s=!1;do if(i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1,s){const c=this.value[0];let u=0;switch(c.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}const f=parseInt(n,10);if(isNaN(f))return;c.valueDec=f+u,s=!1}else{const c=new ao;if(n>Number.MAX_SAFE_INTEGER){yi();const u=BigInt(n);c.valueBigInt=u}else if(c.valueDec=parseInt(n,10),isNaN(c.valueDec))return;this.value.length||(c.isFirstSid=!0,s=!0),this.value.push(c)}while(i!==-1)}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t?(n=`{${n}}`,this.value[i].isFirstSid?e=`2.{${n} - 80}`:e+=n):e+=n}return e}toJSON(){const 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}}Wa.NAME="ObjectIdentifierValueBlock";var Ja;class wi extends Se{constructor(e={}){super(e,Wa),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ja=wi,M.ObjectIdentifier=Ja,wi.NAME="OBJECT IDENTIFIER";class co extends nt(Dt){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=_.toUint8Array(e);if(!ft(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=rr(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);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Rt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Je;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=L.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}co.NAME="relativeSidBlock";class Ya extends Ne{constructor({value:e=_e,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new co;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e,t){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,Je;i.push(s)}return ro(i)}fromString(e){this.value=[];let t=0,i=0,n="";do{i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1;const s=new co;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t&&(n=`{${n}}`),e+=n}return e}toJSON(){const 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}}Ya.NAME="RelativeObjectIdentifierValueBlock";var Za;class lo extends Se{constructor(e={}){super(e,Ya),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Za=lo,M.RelativeObjectIdentifier=Za,lo.NAME="RelativeObjectIdentifier";var Qa;class dt extends je{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Qa=dt,M.Sequence=Qa,dt.NAME="SEQUENCE";var Xa;let pt=class extends je{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Xa=pt,M.Set=Xa,pt.NAME="SET";class ec extends nt(Ne){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=_e}toJSON(){return{...super.toJSON(),value:this.value}}}ec.NAME="StringValueBlock";class tc extends ec{}tc.NAME="SimpleStringValueBlock";class Ue extends no{constructor({...e}={}){super(e,tc)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,_.toUint8Array(e))}fromString(e){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);this.valueBlock.value=e}}Ue.NAME="SIMPLE STRING";class rc extends Ue{fromBuffer(e){this.valueBlock.valueHexView=_.toUint8Array(e);try{this.valueBlock.value=L.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=L.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(e)),this.valueBlock.value=e}}rc.NAME="Utf8StringValueBlock";var ic;class ht extends rc{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ic=ht,M.Utf8String=ic,ht.NAME="UTF8String";class nc extends Ue{fromBuffer(e){this.valueBlock.value=L.ToUtf16String(e),this.valueBlock.valueHexView=_.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(e))}}nc.NAME="BmpStringValueBlock";var oc;class Ai extends nc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}oc=Ai,M.BmpString=oc,Ai.NAME="BMPString";class sc extends Ue{fromBuffer(e){const t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(t);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let n=0;n<t;n++){const s=Rt(e.charCodeAt(n),8),c=new Uint8Array(s);if(c.length>4)continue;const u=4-c.length;for(let f=c.length-1;f>=0;f--)i[n*4+f+u]=c[f]}this.valueBlock.value=e}}sc.NAME="UniversalStringValueBlock";var ac;class Si extends sc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}ac=Si,M.UniversalString=ac,Si.NAME="UniversalString";var cc;class ki extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}cc=ki,M.NumericString=cc,ki.NAME="NumericString";var lc;class xi extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}lc=xi,M.PrintableString=lc,xi.NAME="PrintableString";var uc;class Ci extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}uc=Ci,M.TeletexString=uc,Ci.NAME="TeletexString";var fc;class Bi extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}fc=Bi,M.VideotexString=fc,Bi.NAME="VideotexString";var dc;class Ei extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}dc=Ei,M.IA5String=dc,Ei.NAME="IA5String";var pc;class Ii extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}pc=Ii,M.GraphicString=pc,Ii.NAME="GraphicString";var hc;class Pr extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}hc=Pr,M.VisibleString=hc,Pr.NAME="VisibleString";var yc;class Ni extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}yc=Ni,M.GeneralString=yc,Ni.NAME="GeneralString";var gc;class Oi extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}gc=Oi,M.CharacterString=gc,Oi.NAME="CharacterString";var mc;class Rr extends Pr{constructor({value:e,valueDate:t,...i}={}){if(super(i),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 n=0;n<e.length;n++)this.valueBlock.valueHexView[n]=e.charCodeAt(n)}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,_.toUint8Array(e)))}toBuffer(){const e=this.toString(),t=new ArrayBuffer(e.length),i=new Uint8Array(t);for(let n=0;n<e.length;n++)i[n]=e.charCodeAt(n);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){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}const n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(e="iso"){if(e==="iso"){const t=new Array(7);return t[0]=$e(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=$e(this.month,2),t[2]=$e(this.day,2),t[3]=$e(this.hour,2),t[4]=$e(this.minute,2),t[5]=$e(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}mc=Rr,M.UTCTime=mc,Rr.NAME="UTCTime";var bc;class Ti extends Rr{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,i="",n="",s=0,c,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const y=new Number(e[e.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(t){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let y=1,K=i.indexOf("+"),N="";if(K===-1&&(K=i.indexOf("-"),y=-1),K!==-1){if(N=i.substring(K+1),i=i.substring(0,K),N.length!==2&&N.length!==4)throw new Error("Wrong input string for conversion");let d=parseInt(N.substring(0,2),10);if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");if(u=y*d,N.length===4){if(d=parseInt(N.substring(2,4),10),isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");f=y*d}}}let p=i.indexOf(".");if(p===-1&&(p=i.indexOf(",")),p!==-1){const y=new Number(`0${i.substring(p)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),n=i.substring(0,p)}else n=i;switch(!0){case n.length===8:if(c=/(\d{4})(\d{2})(\d{2})/ig,p!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===12:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===14:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){const y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}const b=c.exec(n);if(b===null)throw new Error("Wrong input string for conversion");for(let y=1;y<b.length;y++)switch(y){case 1:this.year=parseInt(b[y],10);break;case 2:this.month=parseInt(b[y],10);break;case 3:this.day=parseInt(b[y],10);break;case 4:this.hour=parseInt(b[y],10)+u;break;case 5:this.minute=parseInt(b[y],10)+f;break;case 6:this.second=parseInt(b[y],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push($e(this.year,4)),t.push($e(this.month,2)),t.push($e(this.day,2)),t.push($e(this.hour,2)),t.push($e(this.minute,2)),t.push($e(this.second,2)),this.millisecond!==0&&(t.push("."),t.push($e(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}bc=Ti,M.GeneralizedTime=bc,Ti.NAME="GeneralizedTime";var vc;class uo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}vc=uo,M.DATE=vc,uo.NAME="DATE";var wc;class fo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}wc=fo,M.TimeOfDay=wc,fo.NAME="TimeOfDay";var Ac;class po extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Ac=po,M.DateTime=Ac,po.NAME="DateTime";var Sc;class ho extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Sc=ho,M.Duration=Sc,ho.NAME="Duration";var kc;class yo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}kc=yo,M.TIME=kc,yo.NAME="TIME";class Lt{constructor({name:e=_e,optional:t=!1}={}){this.name=e,this.optional=t}}class go extends Lt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class Vi extends Lt{constructor({value:e=new Lt,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class yf{constructor({data:e=mi}={}){this.dataView=_.toUint8Array(e)}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=_.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=_.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function Ht(r,e,t){if(t instanceof go){for(let s=0;s<t.value.length;s++)if(Ht(r,e,t.value[s]).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(io)&&(s.name=t.name),s}}if(t instanceof Lt)return t.hasOwnProperty(io)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(nf in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(cf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(lf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=t.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(of)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(sf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(af)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(rf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(Ba in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,c=e.idBlock.valueHexView;if(s.length!==c.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==c[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_e),t.name&&(r[t.name]=e)),t instanceof M.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof Vi&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let f=!0;for(let p=0;p<t.valueBlock.value.length;p++)f=f&&(t.valueBlock.value[p].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_e),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let f=0;f<u;f++)if(f-s>=e.valueBlock.value.length){if(t.valueBlock.value[f].optional===!1){const p={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_e),t.name&&(delete r[t.name],p.name=t.name)),p}}else if(t.valueBlock.value[0]instanceof Vi){if(c=Ht(r,e.valueBlock.value[f],t.valueBlock.value[0].value),c.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_e),t.name&&delete r[t.name]),c;if(io in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let p={};uf in t.valueBlock.value[0]&&t.valueBlock.value[0].local?p=e:p=r,typeof p[t.valueBlock.value[0].name]>"u"&&(p[t.valueBlock.value[0].name]=[]),p[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(c=Ht(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),c.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_e),t.name&&delete r[t.name]),c;if(c.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_e),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&Ba in e.valueBlock){const s=ir(e.valueBlock.valueHexView);if(s.offset===-1){const c={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_e),t.name&&(delete r[t.name],c.name=t.name)),c}return Ht(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function gf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=ir(_.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Ht(t.result,t.result,e)}const xc=Object.freeze(Object.defineProperty({__proto__:null,Any:Lt,BaseBlock:Se,BaseStringBlock:no,BitString:Ut,BmpString:Ai,Boolean:bi,CharacterString:Oi,Choice:go,Constructed:je,DATE:uo,DateTime:po,Duration:ho,EndOfContent:oo,Enumerated:vi,GeneralString:Ni,GeneralizedTime:Ti,GraphicString:Ii,HexBlock:nt,IA5String:Ei,Integer:ot,Null:Mt,NumericString:ki,ObjectIdentifier:wi,OctetString:$t,Primitive:jr,PrintableString:xi,RawData:yf,RelativeObjectIdentifier:lo,Repeated:Vi,Sequence:dt,Set:pt,TIME:yo,TeletexString:Ci,TimeOfDay:fo,UTCTime:Rr,UniversalString:Si,Utf8String:ht,ValueBlock:Ne,VideotexString:Bi,ViewWriter:gi,VisibleString:Pr,compareSchema:Ht,fromBER:nr,verifySchema:gf},Symbol.toStringTag,{value:"Module"}));var x;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(x||(x={}));var h;(function(r){r[r.Any=1]="Any",r[r.Boolean=2]="Boolean",r[r.OctetString=3]="OctetString",r[r.BitString=4]="BitString",r[r.Integer=5]="Integer",r[r.Enumerated=6]="Enumerated",r[r.ObjectIdentifier=7]="ObjectIdentifier",r[r.Utf8String=8]="Utf8String",r[r.BmpString=9]="BmpString",r[r.UniversalString=10]="UniversalString",r[r.NumericString=11]="NumericString",r[r.PrintableString=12]="PrintableString",r[r.TeletexString=13]="TeletexString",r[r.VideotexString=14]="VideotexString",r[r.IA5String=15]="IA5String",r[r.GraphicString=16]="GraphicString",r[r.VisibleString=17]="VisibleString",r[r.GeneralString=18]="GeneralString",r[r.CharacterString=19]="CharacterString",r[r.UTCTime=20]="UTCTime",r[r.GeneralizedTime=21]="GeneralizedTime",r[r.DATE=22]="DATE",r[r.TimeOfDay=23]="TimeOfDay",r[r.DateTime=24]="DateTime",r[r.Duration=25]="Duration",r[r.TIME=26]="TIME",r[r.Null=27]="Null"})(h||(h={}));class _i{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(_.isBufferSource(e))this.unusedBits=t,this.value=_.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Ut))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new Ut({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ut({name:e})}toNumber(){let e="";const t=new Uint8Array(this.value);for(const i of t)e+=i.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);const i=t.length+7>>3;this.unusedBits=(i<<3)-t.length;const n=new Uint8Array(i);t=t.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(t.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}}class te{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):_.isBufferSource(e)?this.buffer=_.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof $t))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new $t({valueHex:this.buffer})}toSchema(e){return new $t({name:e})}}const mf={fromASN:r=>r instanceof Mt?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Mt;const e=nr(r);if(e.result.error)throw new Error(e.result.error);return e.result}},bf={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new ot({value:+r})},vf={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new vi({value:r})},ce={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new ot({valueHex:r})},wf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ut({valueHex:r})},Af={fromASN:r=>r.valueBlock.toString(),toASN:r=>new wi({value:r})},Sf={fromASN:r=>r.valueBlock.value,toASN:r=>new bi({value:r})},ji={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new $t({valueHex:r})},kf={fromASN:r=>new te(r.getValue()),toASN:r=>r.toASN()};function He(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Cc=He(ht),xf=He(Ai),Cf=He(Si),Bf=He(ki),Ef=He(xi),If=He(Ci),Nf=He(Bi),Of=He(Ei),Tf=He(Ii),Vf=He(Pr),_f=He(Ni),jf=He(Oi),Pf={fromASN:r=>r.toDate(),toASN:r=>new Rr({valueDate:r})},Rf={fromASN:r=>r.toDate(),toASN:r=>new Ti({valueDate:r})},Df={fromASN:()=>null,toASN:()=>new Mt};function mo(r){switch(r){case h.Any:return mf;case h.BitString:return wf;case h.BmpString:return xf;case h.Boolean:return Sf;case h.CharacterString:return jf;case h.Enumerated:return vf;case h.GeneralString:return _f;case h.GeneralizedTime:return Rf;case h.GraphicString:return Tf;case h.IA5String:return Of;case h.Integer:return bf;case h.Null:return Df;case h.NumericString:return Bf;case h.ObjectIdentifier:return Af;case h.OctetString:return ji;case h.PrintableString:return Ef;case h.TeletexString:return If;case h.UTCTime:return Pf;case h.UniversalString:return Cf;case h.Utf8String:return Cc;case h.VideotexString:return Nf;case h.VisibleString:return Vf;default:return null}}function yt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:yt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function Bc(r){var e;if(r){const t=Object.getPrototypeOf(r);return((e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:Bc(t)}return!1}function Mf(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}class $f{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){const i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:x.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(t,i),t.items=Object.assign({},t.items,i.items)),t}create(e,t){const i=this.items.get(e)||this.createDefault(e),n=[];for(const s in i.items){const c=i.items[s],u=t?s:"";let f;if(typeof c.type=="number"){const b=h[c.type],y=xc[b];if(!y)throw new Error(`Cannot get ASN1 class by name '${b}'`);f=new y({name:u})}else yt(c.type)?f=new c.type().toSchema(u):c.optional?this.get(c.type).type===x.Choice?f=new Lt({name:u}):(f=this.create(c.type,!1),f.name=u):f=new Lt({name:u});const p=!!c.optional||c.defaultValue!==void 0;if(c.repeated){f.name="";const b=c.repeated==="set"?pt:dt;f=new b({name:"",value:[new Vi({name:u,value:f})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||yt(c.type)){const b=c.repeated?je:jr;n.push(new b({name:u,optional:p,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const b=!!c.repeated;let y=b?f:this.get(c.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,n.push(new je({name:b?"":u,optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:y}))}else n.push(new je({optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else f.optional=p,n.push(f)}switch(i.type){case x.Sequence:return new dt({value:n,name:""});case x.Set:return new pt({value:n,name:""});case x.Choice:return new go({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){const t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}}const Fe=new $f,B=r=>e=>{let t;Fe.has(e)?t=Fe.get(e):(t=Fe.createDefault(e),Fe.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;Fe.has(e.constructor)?i=Fe.get(e.constructor):(i=Fe.createDefault(e.constructor),Fe.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=mo(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}i.items[t]=n};class Ec extends Error{constructor(){super(...arguments),this.schemas=[]}}class Uf{static parse(e,t){const i=nr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){var i;try{if(yt(t))return new t().fromASN(e);const n=Fe.get(t);Fe.cache(t);let s=n.schema;if(e.constructor===je&&n.type!==x.Choice){s=new je({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const f in n.items)delete e[f]}const c=Ht({},e,s);if(!c.verified)throw new Ec(`Data does not match to ${t.name} ASN1 schema. ${c.result.error}`);const u=new t;if(Bc(t)){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const f=n.itemType;if(typeof f=="number"){const p=mo(f);if(!p)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);return t.from(e.valueBlock.value,b=>p.fromASN(b))}else return t.from(e.valueBlock.value,p=>this.fromASN(p,f))}for(const f in n.items){const p=c.result[f];if(!p)continue;const b=n.items[f],y=b.type;if(typeof y=="number"||yt(y)){const K=(i=b.converter)!==null&&i!==void 0?i:yt(y)?new y:null;if(!K)throw new Error("Converter is empty");if(b.repeated)if(b.implicit){const N=b.repeated==="sequence"?dt:pt,d=new N;d.valueBlock=p.valueBlock;const g=nr(d.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const A=g.result.valueBlock.value;u[f]=Array.from(A,w=>K.fromASN(w))}else u[f]=Array.from(p,N=>K.fromASN(N));else{let N=p;if(b.implicit){let d;if(yt(y))d=new y().toSchema("");else{const g=h[y],A=xc[g];if(!A)throw new Error(`Cannot get '${g}' class from asn1js module`);d=new A}d.valueBlock=N.valueBlock,N=nr(d.toBER(!1)).result}u[f]=K.fromASN(N)}}else if(b.repeated){if(!Array.isArray(p))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");u[f]=Array.from(p,K=>this.fromASN(K,y))}else u[f]=this.fromASN(p,y)}return u}catch(n){throw n instanceof Ec&&n.schemas.push(t.name),n}}}class bo{static serialize(e){return e instanceof Se?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&yt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=Fe.get(t);Fe.cache(t);let n=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const c=mo(i.itemType);if(!c)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>c.toASN(u))}else n=e.map(c=>this.toAsnItem({type:i.itemType},"[]",t,c))}else for(const c in i.items){const u=i.items[c],f=e[c];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&Mf(this.serialize(u.defaultValue),this.serialize(f)))continue;const p=bo.toAsnItem(u,c,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||yt(u.type))){const b={};b.valueHex=p instanceof Mt?p.valueBeforeDecodeView:p.valueBlock.toBER(),n.push(new jr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...b}))}else n.push(new je({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:p.valueBlock.value}));else n.push(new je({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[p]}));else u.repeated?n=n.concat(p):n.push(p)}let s;switch(i.type){case x.Sequence:s=new dt({value:n});break;case x.Set:s=new pt({value:n});break;case x.Choice:if(!n[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(e,t,i,n){let s;if(typeof e.type=="number"){const c=e.converter;if(!c)throw new Error(`Property '${t}' doesn't have converter for type ${h[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const u=Array.from(n,p=>c.toASN(p)),f=e.repeated==="sequence"?dt:pt;s=new f({value:u})}else s=c.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?dt:pt;s=new u({value:c})}else s=this.toASN(n);return s}}class oe extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class j{static serialize(e){return bo.serialize(e)}static parse(e,t){return Uf.parse(e,t)}static toString(e){const t=_.isBufferSource(e)?_.toArrayBuffer(e):j.serialize(e),i=nr(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function a(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(s=(n<3?c(s):n>3?c(e,t,s):c(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;var Ic={exports:{}};(function(r){(function(e){const t="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",f={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${c})?$`,"i")};function p(d,g){if(d.indexOf("::")!==d.lastIndexOf("::"))return null;let A=0,w=-1,I=(d.match(f.zoneIndex)||[])[0],k,E;for(I&&(I=I.substring(1),d=d.replace(/%.+$/,""));(w=d.indexOf(":",w+1))>=0;)A++;if(d.substr(0,2)==="::"&&A--,d.substr(-2,2)==="::"&&A--,A>g)return null;for(E=g-A,k=":";E--;)k+="0:";return d=d.replace("::",k),d[0]===":"&&(d=d.slice(1)),d[d.length-1]===":"&&(d=d.slice(0,-1)),g=function(){const J=d.split(":"),se=[];for(let $=0;$<J.length;$++)se.push(parseInt(J[$],16));return se}(),{parts:g,zoneId:I}}function b(d,g,A,w){if(d.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let I=0,k;for(;w>0;){if(k=A-w,k<0&&(k=0),d[I]>>k!==g[I]>>k)return!1;w-=A,I+=1}return!0}function y(d){if(s.test(d))return parseInt(d,16);if(d[0]==="0"&&!isNaN(parseInt(d[1],10))){if(n.test(d))return parseInt(d,8);throw new Error(`ipaddr: cannot parse ${d} as octal`)}return parseInt(d,10)}function K(d,g){for(;d.length<g;)d=`0${d}`;return d}const N={};N.IPv4=function(){function d(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let A,w;for(A=0;A<g.length;A++)if(w=g[A],!(0<=w&&w<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return d.prototype.SpecialRanges={unspecified:[[new d([0,0,0,0]),8]],broadcast:[[new d([255,255,255,255]),32]],multicast:[[new d([224,0,0,0]),4]],linkLocal:[[new d([169,254,0,0]),16]],loopback:[[new d([127,0,0,0]),8]],carrierGradeNat:[[new d([100,64,0,0]),10]],private:[[new d([10,0,0,0]),8],[new d([172,16,0,0]),12],[new d([192,168,0,0]),16]],reserved:[[new d([192,0,0,0]),24],[new d([192,0,2,0]),24],[new d([192,88,99,0]),24],[new d([198,18,0,0]),15],[new d([198,51,100,0]),24],[new d([203,0,113,0]),24],[new d([240,0,0,0]),4]],as112:[[new d([192,175,48,0]),24],[new d([192,31,196,0]),24]],amt:[[new d([192,52,193,0]),24]]},d.prototype.kind=function(){return"ipv4"},d.prototype.match=function(g,A){let w;if(A===void 0&&(w=g,g=w[0],A=w[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return b(this.octets,g.octets,8,A)},d.prototype.prefixLengthFromSubnetMask=function(){let g=0,A=!1;const w={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let I,k,E;for(I=3;I>=0;I-=1)if(k=this.octets[I],k in w){if(E=w[k],A&&E!==0)return null;E!==8&&(A=!0),g+=E}else return null;return 32-g},d.prototype.range=function(){return N.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){return this.octets.slice(0)},d.prototype.toIPv4MappedAddress=function(){return N.IPv6.parse(`::ffff:${this.toString()}`)},d.prototype.toNormalizedString=function(){return this.toString()},d.prototype.toString=function(){return this.octets.join(".")},d}(),N.IPv4.broadcastAddressFromCIDR=function(d){try{const g=this.parseCIDR(d),A=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),I=[];let k=0;for(;k<4;)I.push(parseInt(A[k],10)|parseInt(w[k],10)^255),k++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},N.IPv4.isIPv4=function(d){return this.parser(d)!==null},N.IPv4.isValid=function(d){try{return new this(this.parser(d)),!0}catch{return!1}},N.IPv4.isValidCIDR=function(d){try{return this.parseCIDR(d),!0}catch{return!1}},N.IPv4.isValidFourPartDecimal=function(d){return!!(N.IPv4.isValid(d)&&d.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},N.IPv4.networkAddressFromCIDR=function(d){let g,A,w,I,k;try{for(g=this.parseCIDR(d),w=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),I=[],A=0;A<4;)I.push(parseInt(w[A],10)&parseInt(k[A],10)),A++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},N.IPv4.parse=function(d){const g=this.parser(d);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},N.IPv4.parseCIDR=function(d){let g;if(g=d.match(/^(.+)\/(\d+)$/)){const A=parseInt(g[2]);if(A>=0&&A<=32){const w=[this.parse(g[1]),A];return Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},N.IPv4.parser=function(d){let g,A,w;if(g=d.match(i.fourOctet))return function(){const I=g.slice(1,6),k=[];for(let E=0;E<I.length;E++)A=I[E],k.push(y(A));return k}();if(g=d.match(i.longValue)){if(w=y(g[1]),w>4294967295||w<0)throw new Error("ipaddr: address outside defined range");return function(){const I=[];let k;for(k=0;k<=24;k+=8)I.push(w>>k&255);return I}().reverse()}else return(g=d.match(i.twoOctet))?function(){const I=g.slice(1,4),k=[];if(w=y(I[1]),w>16777215||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(I[0])),k.push(w>>16&255),k.push(w>>8&255),k.push(w&255),k}():(g=d.match(i.threeOctet))?function(){const I=g.slice(1,5),k=[];if(w=y(I[2]),w>65535||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(I[0])),k.push(y(I[1])),k.push(w>>8&255),k.push(w&255),k}():null},N.IPv4.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let A=0;const w=Math.floor(d/8);for(;A<w;)g[A]=255,A++;return w<4&&(g[w]=Math.pow(2,d%8)-1<<8-d%8),new this(g)},N.IPv6=function(){function d(g,A){let w,I;if(g.length===16)for(this.parts=[],w=0;w<=14;w+=2)this.parts.push(g[w]<<8|g[w+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(w=0;w<this.parts.length;w++)if(I=this.parts[w],!(0<=I&&I<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");A&&(this.zoneId=A)}return d.prototype.SpecialRanges={unspecified:[new d([0,0,0,0,0,0,0,0]),128],linkLocal:[new d([65152,0,0,0,0,0,0,0]),10],multicast:[new d([65280,0,0,0,0,0,0,0]),8],loopback:[new d([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new d([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new d([0,0,0,0,0,65535,0,0]),96],discard:[new d([256,0,0,0,0,0,0,0]),64],rfc6145:[new d([0,0,0,0,65535,0,0,0]),96],rfc6052:[new d([100,65435,0,0,0,0,0,0]),96],"6to4":[new d([8194,0,0,0,0,0,0,0]),16],teredo:[new d([8193,0,0,0,0,0,0,0]),32],benchmarking:[new d([8193,2,0,0,0,0,0,0]),48],amt:[new d([8193,3,0,0,0,0,0,0]),32],as112v6:[[new d([8193,4,274,0,0,0,0,0]),48],[new d([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new d([8193,16,0,0,0,0,0,0]),28],orchid2:[new d([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new d([8193,48,0,0,0,0,0,0]),28],reserved:[[new d([8193,0,0,0,0,0,0,0]),23],[new d([8193,3512,0,0,0,0,0,0]),32]]},d.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},d.prototype.kind=function(){return"ipv6"},d.prototype.match=function(g,A){let w;if(A===void 0&&(w=g,g=w[0],A=w[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return b(this.parts,g.parts,16,A)},d.prototype.prefixLengthFromSubnetMask=function(){let g=0,A=!1;const w={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let I,k;for(let E=7;E>=0;E-=1)if(I=this.parts[E],I in w){if(k=w[I],A&&k!==0)return null;k!==16&&(A=!0),g+=k}else return null;return 128-g},d.prototype.range=function(){return N.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){let g;const A=[],w=this.parts;for(let I=0;I<w.length;I++)g=w[I],A.push(g>>8),A.push(g&255);return A},d.prototype.toFixedLengthString=function(){const g=(function(){const w=[];for(let I=0;I<this.parts.length;I++)w.push(K(this.parts[I].toString(16),4));return w}).call(this).join(":");let A="";return this.zoneId&&(A=`%${this.zoneId}`),g+A},d.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),A=g[0],w=g[1];return new N.IPv4([A>>8,A&255,w>>8,w&255])},d.prototype.toNormalizedString=function(){const g=(function(){const w=[];for(let I=0;I<this.parts.length;I++)w.push(this.parts[I].toString(16));return w}).call(this).join(":");let A="";return this.zoneId&&(A=`%${this.zoneId}`),g+A},d.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,A=this.toNormalizedString();let w=0,I=-1,k;for(;k=g.exec(A);)k[0].length>I&&(w=k.index,I=k[0].length);return I<0?A:`${A.substring(0,w)}::${A.substring(w+I)}`},d.prototype.toString=function(){return this.toRFC5952String()},d}(),N.IPv6.broadcastAddressFromCIDR=function(d){try{const g=this.parseCIDR(d),A=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),I=[];let k=0;for(;k<16;)I.push(parseInt(A[k],10)|parseInt(w[k],10)^255),k++;return new this(I)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},N.IPv6.isIPv6=function(d){return this.parser(d)!==null},N.IPv6.isValid=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{const g=this.parser(d);return new this(g.parts,g.zoneId),!0}catch{return!1}},N.IPv6.isValidCIDR=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{return this.parseCIDR(d),!0}catch{return!1}},N.IPv6.networkAddressFromCIDR=function(d){let g,A,w,I,k;try{for(g=this.parseCIDR(d),w=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),I=[],A=0;A<16;)I.push(parseInt(w[A],10)&parseInt(k[A],10)),A++;return new this(I)}catch(E){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${E})`)}},N.IPv6.parse=function(d){const g=this.parser(d);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},N.IPv6.parseCIDR=function(d){let g,A,w;if((A=d.match(/^(.+)\/(\d+)$/))&&(g=parseInt(A[2]),g>=0&&g<=128))return w=[this.parse(A[1]),g],Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},N.IPv6.parser=function(d){let g,A,w,I,k,E;if(w=d.match(f.deprecatedTransitional))return this.parser(`::ffff:${w[1]}`);if(f.native.test(d))return p(d,8);if((w=d.match(f.transitional))&&(E=w[6]||"",g=w[1],w[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+E,6),g.parts)){for(k=[parseInt(w[2]),parseInt(w[3]),parseInt(w[4]),parseInt(w[5])],A=0;A<k.length;A++)if(I=k[A],!(0<=I&&I<=255))return null;return g.parts.push(k[0]<<8|k[1]),g.parts.push(k[2]<<8|k[3]),{parts:g.parts,zoneId:g.zoneId}}return null},N.IPv6.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let A=0;const w=Math.floor(d/8);for(;A<w;)g[A]=255,A++;return w<16&&(g[w]=Math.pow(2,d%8)-1<<8-d%8),new this(g)},N.fromByteArray=function(d){const g=d.length;if(g===4)return new N.IPv4(d);if(g===16)return new N.IPv6(d);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},N.isValid=function(d){return N.IPv6.isValid(d)||N.IPv4.isValid(d)},N.isValidCIDR=function(d){return N.IPv6.isValidCIDR(d)||N.IPv4.isValidCIDR(d)},N.parse=function(d){if(N.IPv6.isValid(d))return N.IPv6.parse(d);if(N.IPv4.isValid(d))return N.IPv4.parse(d);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},N.parseCIDR=function(d){try{return N.IPv6.parseCIDR(d)}catch{try{return N.IPv4.parseCIDR(d)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},N.process=function(d){const g=this.parse(d);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},N.subnetMatch=function(d,g,A){let w,I,k,E;A==null&&(A="unicast");for(I in g)if(Object.prototype.hasOwnProperty.call(g,I)){for(k=g[I],k[0]&&!(k[0]instanceof Array)&&(k=[k]),w=0;w<k.length;w++)if(E=k[w],d.kind()===E[0].kind()&&d.match.apply(d,E))return I}return A},r.exports?r.exports=N:e.ipaddr=N})(Xn)})(Ic);var Nc=Ic.exports;class Oc{static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const t=parseInt(e.slice(8),16).toString(2).split("").reduce((n,s)=>n+ +s,0);let i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${t}`}static toString(e){if(e.byteLength===4||e.byteLength===16){const t=new Uint8Array(e);return Nc.fromByteArray(Array.from(t)).toString()}return this.decodeIP(L.ToHex(e))}static fromString(e){const t=Nc.parse(e);return new Uint8Array(t.toByteArray()).buffer}}var vo,wo,Ao;let ke=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:h.TeletexString})],ke.prototype,"teletexString",void 0),a([l({type:h.PrintableString})],ke.prototype,"printableString",void 0),a([l({type:h.UniversalString})],ke.prototype,"universalString",void 0),a([l({type:h.Utf8String})],ke.prototype,"utf8String",void 0),a([l({type:h.BmpString})],ke.prototype,"bmpString",void 0),ke=a([B({type:x.Choice})],ke);let or=class extends ke{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};a([l({type:h.IA5String})],or.prototype,"ia5String",void 0),a([l({type:h.Any})],or.prototype,"anyValue",void 0),or=a([B({type:x.Choice})],or);class Pi{constructor(e={}){this.type="",this.value=new or,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Pi.prototype,"type",void 0),a([l({type:or})],Pi.prototype,"value",void 0);let sr=vo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,vo.prototype)}};sr=vo=a([B({type:x.Set,itemType:Pi})],sr);let So=wo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,wo.prototype)}};So=wo=a([B({type:x.Sequence,itemType:sr})],So);let me=Ao=class extends So{constructor(e){super(e),Object.setPrototypeOf(this,Ao.prototype)}};me=Ao=a([B({type:x.Sequence})],me);const Lf={fromASN:r=>Oc.toString(ji.fromASN(r)),toASN:r=>ji.toASN(Oc.fromString(r))};class Dr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Dr.prototype,"typeId",void 0),a([l({type:h.Any,context:0})],Dr.prototype,"value",void 0);class ko{constructor(e={}){this.partyName=new ke,Object.assign(this,e)}}a([l({type:ke,optional:!0,context:0,implicit:!0})],ko.prototype,"nameAssigner",void 0),a([l({type:ke,context:1,implicit:!0})],ko.prototype,"partyName",void 0);let Z=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Dr,context:0,implicit:!0})],Z.prototype,"otherName",void 0),a([l({type:h.IA5String,context:1,implicit:!0})],Z.prototype,"rfc822Name",void 0),a([l({type:h.IA5String,context:2,implicit:!0})],Z.prototype,"dNSName",void 0),a([l({type:h.Any,context:3,implicit:!0})],Z.prototype,"x400Address",void 0),a([l({type:me,context:4,implicit:!1})],Z.prototype,"directoryName",void 0),a([l({type:ko,context:5})],Z.prototype,"ediPartyName",void 0),a([l({type:h.IA5String,context:6,implicit:!0})],Z.prototype,"uniformResourceIdentifier",void 0),a([l({type:h.OctetString,context:7,implicit:!0,converter:Lf})],Z.prototype,"iPAddress",void 0),a([l({type:h.ObjectIdentifier,context:8,implicit:!0})],Z.prototype,"registeredID",void 0),Z=a([B({type:x.Choice})],Z);const xo="1.3.6.1.5.5.7",Hf=`${xo}.1`,ar=`${xo}.3`,Ri=`${xo}.48`,Tc=`${Ri}.1`,Vc=`${Ri}.2`,_c=`${Ri}.3`,jc=`${Ri}.5`,Ct="2.5.29";var Co;const Bo=`${Hf}.1`;class Mr{constructor(e={}){this.accessMethod="",this.accessLocation=new Z,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Mr.prototype,"accessMethod",void 0),a([l({type:Z})],Mr.prototype,"accessLocation",void 0);let cr=Co=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Co.prototype)}};cr=Co=a([B({type:x.Sequence,itemType:Mr})],cr);const Eo=`${Ct}.35`;class Io extends te{}class Ft{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:Io,context:0,optional:!0,implicit:!0})],Ft.prototype,"keyIdentifier",void 0),a([l({type:Z,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ft.prototype,"authorityCertIssuer",void 0),a([l({type:h.Integer,context:2,optional:!0,implicit:!0,converter:ce})],Ft.prototype,"authorityCertSerialNumber",void 0);const Pc=`${Ct}.19`;class Di{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:h.Boolean,defaultValue:!1})],Di.prototype,"cA",void 0),a([l({type:h.Integer,optional:!0})],Di.prototype,"pathLenConstraint",void 0);var No;let Oe=No=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,No.prototype)}};Oe=No=a([B({type:x.Sequence,itemType:Z})],Oe);var Oo;let Rc=Oo=class extends Oe{constructor(e){super(e),Object.setPrototypeOf(this,Oo.prototype)}};Rc=Oo=a([B({type:x.Sequence})],Rc);var To;const Dc=`${Ct}.32`;let gt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:h.IA5String})],gt.prototype,"ia5String",void 0),a([l({type:h.VisibleString})],gt.prototype,"visibleString",void 0),a([l({type:h.BmpString})],gt.prototype,"bmpString",void 0),a([l({type:h.Utf8String})],gt.prototype,"utf8String",void 0),gt=a([B({type:x.Choice})],gt);class Vo{constructor(e={}){this.organization=new gt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:gt})],Vo.prototype,"organization",void 0),a([l({type:h.Integer,repeated:"sequence"})],Vo.prototype,"noticeNumbers",void 0);class _o{constructor(e={}){Object.assign(this,e)}}a([l({type:Vo,optional:!0})],_o.prototype,"noticeRef",void 0),a([l({type:gt,optional:!0})],_o.prototype,"explicitText",void 0);let Mi=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.IA5String})],Mi.prototype,"cPSuri",void 0),a([l({type:_o})],Mi.prototype,"userNotice",void 0),Mi=a([B({type:x.Choice})],Mi);class jo{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],jo.prototype,"policyQualifierId",void 0),a([l({type:h.Any})],jo.prototype,"qualifier",void 0);class $i{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],$i.prototype,"policyIdentifier",void 0),a([l({type:jo,repeated:"sequence",optional:!0})],$i.prototype,"policyQualifiers",void 0);let Ui=To=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,To.prototype)}};Ui=To=a([B({type:x.Sequence,itemType:$i})],Ui);let Li=class{constructor(e=0){this.value=e}};a([l({type:h.Integer})],Li.prototype,"value",void 0),Li=a([B({type:x.Choice})],Li);let Mc=class extends Li{};Mc=a([B({type:x.Choice})],Mc);var Po;const Ro=`${Ct}.31`;var Ye;(function(r){r[r.unused=1]="unused",r[r.keyCompromise=2]="keyCompromise",r[r.cACompromise=4]="cACompromise",r[r.affiliationChanged=8]="affiliationChanged",r[r.superseded=16]="superseded",r[r.cessationOfOperation=32]="cessationOfOperation",r[r.certificateHold=64]="certificateHold",r[r.privilegeWithdrawn=128]="privilegeWithdrawn",r[r.aACompromise=256]="aACompromise"})(Ye||(Ye={}));class $c extends _i{toJSON(){const e=[],t=this.toNumber();return t&Ye.aACompromise&&e.push("aACompromise"),t&Ye.affiliationChanged&&e.push("affiliationChanged"),t&Ye.cACompromise&&e.push("cACompromise"),t&Ye.certificateHold&&e.push("certificateHold"),t&Ye.cessationOfOperation&&e.push("cessationOfOperation"),t&Ye.keyCompromise&&e.push("keyCompromise"),t&Ye.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Ye.superseded&&e.push("superseded"),t&Ye.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Kt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,context:0,repeated:"sequence",implicit:!0})],Kt.prototype,"fullName",void 0),a([l({type:sr,context:1,implicit:!0})],Kt.prototype,"nameRelativeToCRLIssuer",void 0),Kt=a([B({type:x.Choice})],Kt);class lr{constructor(e={}){Object.assign(this,e)}}a([l({type:Kt,context:0,optional:!0})],lr.prototype,"distributionPoint",void 0),a([l({type:$c,context:1,optional:!0,implicit:!0})],lr.prototype,"reasons",void 0),a([l({type:Z,context:2,optional:!0,repeated:"sequence",implicit:!0})],lr.prototype,"cRLIssuer",void 0);let ur=Po=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Po.prototype)}};ur=Po=a([B({type:x.Sequence,itemType:lr})],ur);var Do;let Uc=Do=class extends ur{constructor(e){super(e),Object.setPrototypeOf(this,Do.prototype)}};Uc=Do=a([B({type:x.Sequence,itemType:lr})],Uc);class Ee{constructor(e={}){this.onlyContainsUserCerts=Ee.ONLY,this.onlyContainsCACerts=Ee.ONLY,this.indirectCRL=Ee.ONLY,this.onlyContainsAttributeCerts=Ee.ONLY,Object.assign(this,e)}}Ee.ONLY=!1,a([l({type:Kt,context:0,optional:!0})],Ee.prototype,"distributionPoint",void 0),a([l({type:h.Boolean,context:1,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsUserCerts",void 0),a([l({type:h.Boolean,context:2,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsCACerts",void 0),a([l({type:$c,context:3,optional:!0,implicit:!0})],Ee.prototype,"onlySomeReasons",void 0),a([l({type:h.Boolean,context:4,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"indirectCRL",void 0),a([l({type:h.Boolean,context:5,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsAttributeCerts",void 0);var $r;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})($r||($r={}));let Mo=class{constructor(e=$r.unspecified){this.reason=$r.unspecified,this.reason=e}toJSON(){return $r[this.reason]}toString(){return this.toJSON()}};a([l({type:h.Enumerated})],Mo.prototype,"reason",void 0),Mo=a([B({type:x.Choice})],Mo);var $o;const Lc=`${Ct}.37`;let Hi=$o=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,$o.prototype)}};Hi=$o=a([B({type:x.Sequence,itemType:h.ObjectIdentifier})],Hi);const Ff=`${ar}.1`,Kf=`${ar}.2`,qf=`${ar}.3`,zf=`${ar}.4`,Gf=`${ar}.8`,Wf=`${ar}.9`;let Uo=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:h.Integer,converter:ce})],Uo.prototype,"value",void 0),Uo=a([B({type:x.Choice})],Uo);let Lo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:h.GeneralizedTime})],Lo.prototype,"value",void 0),Lo=a([B({type:x.Choice})],Lo);var Ho;let Hc=Ho=class extends Oe{constructor(e){super(e),Object.setPrototypeOf(this,Ho.prototype)}};Hc=Ho=a([B({type:x.Sequence})],Hc);const Fc=`${Ct}.15`;var Ze;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(Ze||(Ze={}));class Fo extends _i{toJSON(){const e=this.toNumber(),t=[];return e&Ze.cRLSign&&t.push("crlSign"),e&Ze.dataEncipherment&&t.push("dataEncipherment"),e&Ze.decipherOnly&&t.push("decipherOnly"),e&Ze.digitalSignature&&t.push("digitalSignature"),e&Ze.encipherOnly&&t.push("encipherOnly"),e&Ze.keyAgreement&&t.push("keyAgreement"),e&Ze.keyCertSign&&t.push("keyCertSign"),e&Ze.keyEncipherment&&t.push("keyEncipherment"),e&Ze.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var Ko;class Fi{constructor(e={}){this.base=new Z,this.minimum=0,Object.assign(this,e)}}a([l({type:Z})],Fi.prototype,"base",void 0),a([l({type:h.Integer,context:0,defaultValue:0,implicit:!0})],Fi.prototype,"minimum",void 0),a([l({type:h.Integer,context:1,optional:!0,implicit:!0})],Fi.prototype,"maximum",void 0);let Ki=Ko=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};Ki=Ko=a([B({type:x.Sequence,itemType:Fi})],Ki);class Kc{constructor(e={}){Object.assign(this,e)}}a([l({type:Ki,context:0,optional:!0,implicit:!0})],Kc.prototype,"permittedSubtrees",void 0),a([l({type:Ki,context:1,optional:!0,implicit:!0})],Kc.prototype,"excludedSubtrees",void 0);class qc{constructor(e={}){Object.assign(this,e)}}a([l({type:h.Integer,context:0,implicit:!0,optional:!0,converter:ce})],qc.prototype,"requireExplicitPolicy",void 0),a([l({type:h.Integer,context:1,implicit:!0,optional:!0,converter:ce})],qc.prototype,"inhibitPolicyMapping",void 0);var qo;class zo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],zo.prototype,"issuerDomainPolicy",void 0),a([l({type:h.ObjectIdentifier})],zo.prototype,"subjectDomainPolicy",void 0);let zc=qo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};zc=qo=a([B({type:x.Sequence,itemType:zo})],zc);var Go;const Gc=`${Ct}.17`;let Wo=Go=class extends Oe{constructor(e){super(e),Object.setPrototypeOf(this,Go.prototype)}};Wo=Go=a([B({type:x.Sequence})],Wo);let mt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],mt.prototype,"type",void 0),a([l({type:h.Any,repeated:"set"})],mt.prototype,"values",void 0);var Jo;let Wc=Jo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Jo.prototype)}};Wc=Jo=a([B({type:x.Sequence,itemType:mt})],Wc);const Jc=`${Ct}.14`;class Bt extends Io{}class Yc{constructor(e={}){Object.assign(this,e)}}a([l({type:h.GeneralizedTime,context:0,implicit:!0,optional:!0})],Yc.prototype,"notBefore",void 0),a([l({type:h.GeneralizedTime,context:1,implicit:!0,optional:!0})],Yc.prototype,"notAfter",void 0);var Ur;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Ur||(Ur={}));class Zc extends _i{toJSON(){const e=[],t=this.toNumber();return t&Ur.pKIXCertificate&&e.push("pKIXCertificate"),t&Ur.newExtensions&&e.push("newExtensions"),t&Ur.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class Qc{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Zc,Object.assign(this,e)}}a([l({type:h.GeneralString})],Qc.prototype,"entrustVers",void 0),a([l({type:Zc})],Qc.prototype,"entrustInfoFlags",void 0);var Yo;let Xc=Yo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};Xc=Yo=a([B({type:x.Sequence,itemType:Mr})],Xc);class D{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof D&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&ka(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:h.ObjectIdentifier})],D.prototype,"algorithm",void 0),a([l({type:h.Any,optional:!0})],D.prototype,"parameters",void 0);class st{constructor(e={}){this.algorithm=new D,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:D})],st.prototype,"algorithm",void 0),a([l({type:h.BitString})],st.prototype,"subjectPublicKey",void 0);let xe=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const t=new Date(e);t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};a([l({type:h.UTCTime})],xe.prototype,"utcTime",void 0),a([l({type:h.GeneralizedTime})],xe.prototype,"generalTime",void 0),xe=a([B({type:x.Choice})],xe);class qi{constructor(e){this.notBefore=new xe(new Date),this.notAfter=new xe(new Date),e&&(this.notBefore=new xe(e.notBefore),this.notAfter=new xe(e.notAfter))}}a([l({type:xe})],qi.prototype,"notBefore",void 0),a([l({type:xe})],qi.prototype,"notAfter",void 0);var Zo;let Qe=class Wu{constructor(e={}){this.extnID="",this.critical=Wu.CRITICAL,this.extnValue=new te,Object.assign(this,e)}};Qe.CRITICAL=!1,a([l({type:h.ObjectIdentifier})],Qe.prototype,"extnID",void 0),a([l({type:h.Boolean,defaultValue:Qe.CRITICAL})],Qe.prototype,"critical",void 0),a([l({type:te})],Qe.prototype,"extnValue",void 0);let qt=Zo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Zo.prototype)}};qt=Zo=a([B({type:x.Sequence,itemType:Qe})],qt);var fr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(fr||(fr={}));class Ke{constructor(e={}){this.version=fr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new D,this.issuer=new me,this.validity=new qi,this.subject=new me,this.subjectPublicKeyInfo=new st,Object.assign(this,e)}}a([l({type:h.Integer,context:0,defaultValue:fr.v1})],Ke.prototype,"version",void 0),a([l({type:h.Integer,converter:ce})],Ke.prototype,"serialNumber",void 0),a([l({type:D})],Ke.prototype,"signature",void 0),a([l({type:me})],Ke.prototype,"issuer",void 0),a([l({type:qi})],Ke.prototype,"validity",void 0),a([l({type:me})],Ke.prototype,"subject",void 0),a([l({type:st})],Ke.prototype,"subjectPublicKeyInfo",void 0),a([l({type:h.BitString,context:1,implicit:!0,optional:!0})],Ke.prototype,"issuerUniqueID",void 0),a([l({type:h.BitString,context:2,implicit:!0,optional:!0})],Ke.prototype,"subjectUniqueID",void 0),a([l({type:qt,context:3,optional:!0})],Ke.prototype,"extensions",void 0);class dr{constructor(e={}){this.tbsCertificate=new Ke,this.signatureAlgorithm=new D,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ke})],dr.prototype,"tbsCertificate",void 0),a([l({type:D})],dr.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],dr.prototype,"signatureValue",void 0);class zi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new xe,Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],zi.prototype,"userCertificate",void 0),a([l({type:xe})],zi.prototype,"revocationDate",void 0),a([l({type:Qe,optional:!0,repeated:"sequence"})],zi.prototype,"crlEntryExtensions",void 0);class bt{constructor(e={}){this.signature=new D,this.issuer=new me,this.thisUpdate=new xe,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],bt.prototype,"version",void 0),a([l({type:D})],bt.prototype,"signature",void 0),a([l({type:me})],bt.prototype,"issuer",void 0),a([l({type:xe})],bt.prototype,"thisUpdate",void 0),a([l({type:xe,optional:!0})],bt.prototype,"nextUpdate",void 0),a([l({type:zi,repeated:"sequence",optional:!0})],bt.prototype,"revokedCertificates",void 0),a([l({type:Qe,optional:!0,context:0,repeated:"sequence"})],bt.prototype,"crlExtensions",void 0);let Qo=class{constructor(e={}){this.tbsCertList=new bt,this.signatureAlgorithm=new D,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:bt})],Qo.prototype,"tbsCertList",void 0),a([l({type:D})],Qo.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Qo.prototype,"signature",void 0);class pr{constructor(e={}){this.issuer=new me,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:me})],pr.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ce})],pr.prototype,"serialNumber",void 0);let hr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Bt,context:0,implicit:!0})],hr.prototype,"subjectKeyIdentifier",void 0),a([l({type:pr})],hr.prototype,"issuerAndSerialNumber",void 0),hr=a([B({type:x.Choice})],hr);var vt;(function(r){r[r.v0=0]="v0",r[r.v1=1]="v1",r[r.v2=2]="v2",r[r.v3=3]="v3",r[r.v4=4]="v4",r[r.v5=5]="v5"})(vt||(vt={}));let Lr=class extends D{};Lr=a([B({type:x.Sequence})],Lr);let Gi=class extends D{};Gi=a([B({type:x.Sequence})],Gi);let at=class extends D{};at=a([B({type:x.Sequence})],at);let Wi=class extends D{};Wi=a([B({type:x.Sequence})],Wi);let el=class extends D{};el=a([B({type:x.Sequence})],el);let Xo=class extends D{};Xo=a([B({type:x.Sequence})],Xo);let yr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],yr.prototype,"attrType",void 0),a([l({type:h.Any,repeated:"set"})],yr.prototype,"attrValues",void 0);var es;class ct{constructor(e={}){this.version=vt.v0,this.sid=new hr,this.digestAlgorithm=new Lr,this.signatureAlgorithm=new Gi,this.signature=new te,Object.assign(this,e)}}a([l({type:h.Integer})],ct.prototype,"version",void 0),a([l({type:hr})],ct.prototype,"sid",void 0),a([l({type:Lr})],ct.prototype,"digestAlgorithm",void 0),a([l({type:yr,repeated:"set",context:0,implicit:!0,optional:!0})],ct.prototype,"signedAttrs",void 0),a([l({type:Gi})],ct.prototype,"signatureAlgorithm",void 0),a([l({type:te})],ct.prototype,"signature",void 0),a([l({type:yr,repeated:"set",context:1,implicit:!0,optional:!0})],ct.prototype,"unsignedAttrs",void 0);let Ji=es=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,es.prototype)}};Ji=es=a([B({type:x.Set,itemType:ct})],Ji);let tl=class extends xe{};tl=a([B({type:x.Choice})],tl);let rl=class extends ct{};rl=a([B({type:x.Sequence})],rl);class ts{constructor(e={}){this.acIssuer=new Z,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:Z})],ts.prototype,"acIssuer",void 0),a([l({type:h.Integer})],ts.prototype,"acSerial",void 0),a([l({type:mt,repeated:"sequence"})],ts.prototype,"attrs",void 0);var rs;let Yi=rs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,rs.prototype)}};Yi=rs=a([B({type:x.Sequence,itemType:h.ObjectIdentifier})],Yi);class Zi{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],Zi.prototype,"pathLenConstraint",void 0),a([l({type:Yi,implicit:!0,context:0,optional:!0})],Zi.prototype,"permittedAttrs",void 0),a([l({type:Yi,implicit:!0,context:1,optional:!0})],Zi.prototype,"excludedAttrs",void 0),a([l({type:h.Boolean,defaultValue:!0})],Zi.prototype,"permitUnSpecified",void 0);class zt{constructor(e={}){this.issuer=new Oe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Oe})],zt.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ce})],zt.prototype,"serial",void 0),a([l({type:h.BitString,optional:!0})],zt.prototype,"issuerUID",void 0);var is;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(is||(is={}));class Gt{constructor(e={}){this.digestedObjectType=is.publicKey,this.digestAlgorithm=new D,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Enumerated})],Gt.prototype,"digestedObjectType",void 0),a([l({type:h.ObjectIdentifier,optional:!0})],Gt.prototype,"otherObjectTypeID",void 0),a([l({type:D})],Gt.prototype,"digestAlgorithm",void 0),a([l({type:h.BitString})],Gt.prototype,"objectDigest",void 0);class Qi{constructor(e={}){Object.assign(this,e)}}a([l({type:Oe,optional:!0})],Qi.prototype,"issuerName",void 0),a([l({type:zt,context:0,implicit:!0,optional:!0})],Qi.prototype,"baseCertificateID",void 0),a([l({type:Gt,context:1,implicit:!0,optional:!0})],Qi.prototype,"objectDigestInfo",void 0);let gr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,repeated:"sequence"})],gr.prototype,"v1Form",void 0),a([l({type:Qi,context:0,implicit:!0})],gr.prototype,"v2Form",void 0),gr=a([B({type:x.Choice})],gr);class Xi{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:h.GeneralizedTime})],Xi.prototype,"notBeforeTime",void 0),a([l({type:h.GeneralizedTime})],Xi.prototype,"notAfterTime",void 0);class Hr{constructor(e={}){Object.assign(this,e)}}a([l({type:zt,implicit:!0,context:0,optional:!0})],Hr.prototype,"baseCertificateID",void 0),a([l({type:Oe,implicit:!0,context:1,optional:!0})],Hr.prototype,"entityName",void 0),a([l({type:Gt,implicit:!0,context:2,optional:!0})],Hr.prototype,"objectDigestInfo",void 0);var ns;(function(r){r[r.v2=1]="v2"})(ns||(ns={}));class Xe{constructor(e={}){this.version=ns.v2,this.holder=new Hr,this.issuer=new gr,this.signature=new D,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Xi,this.attributes=[],Object.assign(this,e)}}a([l({type:h.Integer})],Xe.prototype,"version",void 0),a([l({type:Hr})],Xe.prototype,"holder",void 0),a([l({type:gr})],Xe.prototype,"issuer",void 0),a([l({type:D})],Xe.prototype,"signature",void 0),a([l({type:h.Integer,converter:ce})],Xe.prototype,"serialNumber",void 0),a([l({type:Xi})],Xe.prototype,"attrCertValidityPeriod",void 0),a([l({type:mt,repeated:"sequence"})],Xe.prototype,"attributes",void 0),a([l({type:h.BitString,optional:!0})],Xe.prototype,"issuerUniqueID",void 0),a([l({type:qt,optional:!0})],Xe.prototype,"extensions",void 0);class en{constructor(e={}){this.acinfo=new Xe,this.signatureAlgorithm=new D,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Xe})],en.prototype,"acinfo",void 0),a([l({type:D})],en.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],en.prototype,"signatureValue",void 0);var tn;(function(r){r[r.unmarked=1]="unmarked",r[r.unclassified=2]="unclassified",r[r.restricted=4]="restricted",r[r.confidential=8]="confidential",r[r.secret=16]="secret",r[r.topSecret=32]="topSecret"})(tn||(tn={}));class os extends _i{}class ss{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier,implicit:!0,context:0})],ss.prototype,"type",void 0),a([l({type:h.Any,implicit:!0,context:1})],ss.prototype,"value",void 0);class as{constructor(e={}){this.policyId="",this.classList=new os(tn.unclassified),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],as.prototype,"policyId",void 0),a([l({type:os,defaultValue:new os(tn.unclassified)})],as.prototype,"classList",void 0),a([l({type:ss,repeated:"set"})],as.prototype,"securityCategories",void 0);class rn{constructor(e={}){Object.assign(this,e)}}a([l({type:te})],rn.prototype,"cotets",void 0),a([l({type:h.ObjectIdentifier})],rn.prototype,"oid",void 0),a([l({type:h.Utf8String})],rn.prototype,"string",void 0);class il{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Oe,implicit:!0,context:0,optional:!0})],il.prototype,"policyAuthority",void 0),a([l({type:rn,repeated:"sequence"})],il.prototype,"values",void 0);var cs;class nn{constructor(e={}){this.targetCertificate=new zt,Object.assign(this,e)}}a([l({type:zt})],nn.prototype,"targetCertificate",void 0),a([l({type:Z,optional:!0})],nn.prototype,"targetName",void 0),a([l({type:Gt,optional:!0})],nn.prototype,"certDigestInfo",void 0);let mr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,context:0,implicit:!0})],mr.prototype,"targetName",void 0),a([l({type:Z,context:1,implicit:!0})],mr.prototype,"targetGroup",void 0),a([l({type:nn,context:2,implicit:!0})],mr.prototype,"targetCert",void 0),mr=a([B({type:x.Choice})],mr);let ls=cs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,cs.prototype)}};ls=cs=a([B({type:x.Sequence,itemType:mr})],ls);var us;let nl=us=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,us.prototype)}};nl=us=a([B({type:x.Sequence,itemType:ls})],nl);class ol{constructor(e={}){Object.assign(this,e)}}a([l({type:Oe,implicit:!0,context:0,optional:!0})],ol.prototype,"roleAuthority",void 0),a([l({type:Z,implicit:!0,context:1})],ol.prototype,"roleName",void 0);class fs{constructor(e={}){this.service=new Z,this.ident=new Z,Object.assign(this,e)}}a([l({type:Z})],fs.prototype,"service",void 0),a([l({type:Z})],fs.prototype,"ident",void 0),a([l({type:te,optional:!0})],fs.prototype,"authInfo",void 0);var ds;class ps{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ps.prototype,"otherCertFormat",void 0),a([l({type:h.Any})],ps.prototype,"otherCert",void 0);let br=class{constructor(e={}){Object.assign(this,e)}};a([l({type:dr})],br.prototype,"certificate",void 0),a([l({type:en,context:2,implicit:!0})],br.prototype,"v2AttrCert",void 0),a([l({type:ps,context:3,implicit:!0})],br.prototype,"other",void 0),br=a([B({type:x.Choice})],br);let on=ds=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ds.prototype)}};on=ds=a([B({type:x.Set,itemType:br})],on);class vr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],vr.prototype,"contentType",void 0),a([l({type:h.Any,context:0})],vr.prototype,"content",void 0);let Fr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:te})],Fr.prototype,"single",void 0),a([l({type:h.Any})],Fr.prototype,"any",void 0),Fr=a([B({type:x.Choice})],Fr);class sn{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],sn.prototype,"eContentType",void 0),a([l({type:Fr,context:0,optional:!0})],sn.prototype,"eContent",void 0);let Kr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:te,context:0,implicit:!0,optional:!0})],Kr.prototype,"value",void 0),a([l({type:te,converter:kf,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Kr.prototype,"constructedValue",void 0),Kr=a([B({type:x.Choice})],Kr);class qr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Wi,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],qr.prototype,"contentType",void 0),a([l({type:Wi})],qr.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:Kr,optional:!0})],qr.prototype,"encryptedContent",void 0);class an{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],an.prototype,"keyAttrId",void 0),a([l({type:h.Any,optional:!0})],an.prototype,"keyAttr",void 0);var hs;class cn{constructor(e={}){this.subjectKeyIdentifier=new Bt,Object.assign(this,e)}}a([l({type:Bt})],cn.prototype,"subjectKeyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],cn.prototype,"date",void 0),a([l({type:an,optional:!0})],cn.prototype,"other",void 0);let wr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:cn,context:0,implicit:!0,optional:!0})],wr.prototype,"rKeyId",void 0),a([l({type:pr,optional:!0})],wr.prototype,"issuerAndSerialNumber",void 0),wr=a([B({type:x.Choice})],wr);class ys{constructor(e={}){this.rid=new wr,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:wr})],ys.prototype,"rid",void 0),a([l({type:te})],ys.prototype,"encryptedKey",void 0);let ln=hs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,hs.prototype)}};ln=hs=a([B({type:x.Sequence,itemType:ys})],ln);class gs{constructor(e={}){this.algorithm=new D,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:D})],gs.prototype,"algorithm",void 0),a([l({type:h.BitString})],gs.prototype,"publicKey",void 0);let Wt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Bt,context:0,implicit:!0,optional:!0})],Wt.prototype,"subjectKeyIdentifier",void 0),a([l({type:gs,context:1,implicit:!0,optional:!0})],Wt.prototype,"originatorKey",void 0),a([l({type:pr,optional:!0})],Wt.prototype,"issuerAndSerialNumber",void 0),Wt=a([B({type:x.Choice})],Wt);class Ar{constructor(e={}){this.version=vt.v3,this.originator=new Wt,this.keyEncryptionAlgorithm=new at,this.recipientEncryptedKeys=new ln,Object.assign(this,e)}}a([l({type:h.Integer})],Ar.prototype,"version",void 0),a([l({type:Wt,context:0})],Ar.prototype,"originator",void 0),a([l({type:te,context:1,optional:!0})],Ar.prototype,"ukm",void 0),a([l({type:at})],Ar.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:ln})],Ar.prototype,"recipientEncryptedKeys",void 0);let Sr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Bt,context:0,implicit:!0})],Sr.prototype,"subjectKeyIdentifier",void 0),a([l({type:pr})],Sr.prototype,"issuerAndSerialNumber",void 0),Sr=a([B({type:x.Choice})],Sr);class zr{constructor(e={}){this.version=vt.v0,this.rid=new Sr,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:h.Integer})],zr.prototype,"version",void 0),a([l({type:Sr})],zr.prototype,"rid",void 0),a([l({type:at})],zr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],zr.prototype,"encryptedKey",void 0);class Gr{constructor(e={}){this.keyIdentifier=new te,Object.assign(this,e)}}a([l({type:te})],Gr.prototype,"keyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],Gr.prototype,"date",void 0),a([l({type:an,optional:!0})],Gr.prototype,"other",void 0);class Wr{constructor(e={}){this.version=vt.v4,this.kekid=new Gr,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:h.Integer})],Wr.prototype,"version",void 0),a([l({type:Gr})],Wr.prototype,"kekid",void 0),a([l({type:at})],Wr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Wr.prototype,"encryptedKey",void 0);class Jr{constructor(e={}){this.version=vt.v0,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:h.Integer})],Jr.prototype,"version",void 0),a([l({type:Xo,context:0,optional:!0})],Jr.prototype,"keyDerivationAlgorithm",void 0),a([l({type:at})],Jr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Jr.prototype,"encryptedKey",void 0);class ms{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ms.prototype,"oriType",void 0),a([l({type:h.Any})],ms.prototype,"oriValue",void 0);let Et=class{constructor(e={}){Object.assign(this,e)}};a([l({type:zr,optional:!0})],Et.prototype,"ktri",void 0),a([l({type:Ar,context:1,implicit:!0,optional:!0})],Et.prototype,"kari",void 0),a([l({type:Wr,context:2,implicit:!0,optional:!0})],Et.prototype,"kekri",void 0),a([l({type:Jr,context:3,implicit:!0,optional:!0})],Et.prototype,"pwri",void 0),a([l({type:ms,context:4,implicit:!0,optional:!0})],Et.prototype,"ori",void 0),Et=a([B({type:x.Choice})],Et);var bs;let un=bs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,bs.prototype)}};un=bs=a([B({type:x.Set,itemType:Et})],un);var vs;class fn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],fn.prototype,"otherRevInfoFormat",void 0),a([l({type:h.Any})],fn.prototype,"otherRevInfo",void 0);let dn=class{constructor(e={}){this.other=new fn,Object.assign(this,e)}};a([l({type:fn,context:1,implicit:!0})],dn.prototype,"other",void 0),dn=a([B({type:x.Choice})],dn);let pn=vs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};pn=vs=a([B({type:x.Set,itemType:dn})],pn);class ws{constructor(e={}){Object.assign(this,e)}}a([l({type:on,context:0,implicit:!0,optional:!0})],ws.prototype,"certs",void 0),a([l({type:pn,context:1,implicit:!0,optional:!0})],ws.prototype,"crls",void 0);var As;let Ss=As=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};Ss=As=a([B({type:x.Set,itemType:yr})],Ss);class Yr{constructor(e={}){this.version=vt.v0,this.recipientInfos=new un,this.encryptedContentInfo=new qr,Object.assign(this,e)}}a([l({type:h.Integer})],Yr.prototype,"version",void 0),a([l({type:ws,context:0,implicit:!0,optional:!0})],Yr.prototype,"originatorInfo",void 0),a([l({type:un})],Yr.prototype,"recipientInfos",void 0),a([l({type:qr})],Yr.prototype,"encryptedContentInfo",void 0),a([l({type:Ss,context:1,implicit:!0,optional:!0})],Yr.prototype,"unprotectedAttrs",void 0);const Jf="1.2.840.113549.1.7.2";var ks;let hn=ks=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ks.prototype)}};hn=ks=a([B({type:x.Set,itemType:Lr})],hn);class kr{constructor(e={}){this.version=vt.v0,this.digestAlgorithms=new hn,this.encapContentInfo=new sn,this.signerInfos=new Ji,Object.assign(this,e)}}a([l({type:h.Integer})],kr.prototype,"version",void 0),a([l({type:hn})],kr.prototype,"digestAlgorithms",void 0),a([l({type:sn})],kr.prototype,"encapContentInfo",void 0),a([l({type:on,context:0,implicit:!0,optional:!0})],kr.prototype,"certificates",void 0),a([l({type:pn,context:1,implicit:!0,optional:!0})],kr.prototype,"crls",void 0),a([l({type:Ji})],kr.prototype,"signerInfos",void 0);const Zr="1.2.840.10045.2.1",xs="1.2.840.10045.4.1",sl="1.2.840.10045.4.3.1",Cs="1.2.840.10045.4.3.2",Bs="1.2.840.10045.4.3.3",Es="1.2.840.10045.4.3.4",al="1.2.840.10045.3.1.7",cl="1.3.132.0.34",ll="1.3.132.0.35";function Qr(r){return new D({algorithm:r})}const Yf=Qr(xs);Qr(sl);const Zf=Qr(Cs),Qf=Qr(Bs),Xf=Qr(Es);let Xr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],Xr.prototype,"fieldType",void 0),a([l({type:h.Any})],Xr.prototype,"parameters",void 0),Xr=a([B({type:x.Sequence})],Xr);class ed extends te{}let xr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.OctetString})],xr.prototype,"a",void 0),a([l({type:h.OctetString})],xr.prototype,"b",void 0),a([l({type:h.BitString,optional:!0})],xr.prototype,"seed",void 0),xr=a([B({type:x.Sequence})],xr);var Is;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Is||(Is={}));let wt=class{constructor(e={}){this.version=Is.ecpVer1,Object.assign(this,e)}};a([l({type:h.Integer})],wt.prototype,"version",void 0),a([l({type:Xr})],wt.prototype,"fieldID",void 0),a([l({type:xr})],wt.prototype,"curve",void 0),a([l({type:ed})],wt.prototype,"base",void 0),a([l({type:h.Integer,converter:ce})],wt.prototype,"order",void 0),a([l({type:h.Integer,optional:!0})],wt.prototype,"cofactor",void 0),wt=a([B({type:x.Sequence})],wt);let It=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],It.prototype,"namedCurve",void 0),a([l({type:h.Null})],It.prototype,"implicitCurve",void 0),a([l({type:wt})],It.prototype,"specifiedCurve",void 0),It=a([B({type:x.Choice})],It);class yn{constructor(e={}){this.version=1,this.privateKey=new te,Object.assign(this,e)}}a([l({type:h.Integer})],yn.prototype,"version",void 0),a([l({type:te})],yn.prototype,"privateKey",void 0),a([l({type:It,context:0,optional:!0})],yn.prototype,"parameters",void 0),a([l({type:h.BitString,context:1,optional:!0})],yn.prototype,"publicKey",void 0);class gn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],gn.prototype,"r",void 0),a([l({type:h.Integer,converter:ce})],gn.prototype,"s",void 0);const Pe="1.2.840.113549.1.1",Jt=`${Pe}.1`,td=`${Pe}.7`,rd=`${Pe}.9`,ei=`${Pe}.10`,id=`${Pe}.2`,nd=`${Pe}.4`,mn=`${Pe}.5`,od=`${Pe}.14`,Ns=`${Pe}.11`,bn=`${Pe}.12`,vn=`${Pe}.13`,ul=`${Pe}.15`,fl=`${Pe}.16`,wn="1.3.14.3.2.26",dl="2.16.840.1.101.3.4.2.4",An="2.16.840.1.101.3.4.2.1",Sn="2.16.840.1.101.3.4.2.2",kn="2.16.840.1.101.3.4.2.3",sd="2.16.840.1.101.3.4.2.5",ad="2.16.840.1.101.3.4.2.6",cd="1.2.840.113549.2.2",ld="1.2.840.113549.2.5",xn=`${Pe}.8`;function be(r){return new D({algorithm:r,parameters:null})}be(cd),be(ld);const Yt=be(wn);be(dl),be(An),be(Sn),be(kn),be(sd),be(ad);const pl=new D({algorithm:xn,parameters:j.serialize(Yt)}),hl=new D({algorithm:rd,parameters:j.serialize(ji.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});be(Jt),be(id),be(nd),be(mn),be(ul),be(fl),be(bn),be(vn),be(ul),be(fl);class Cn{constructor(e={}){this.hashAlgorithm=new D(Yt),this.maskGenAlgorithm=new D({algorithm:xn,parameters:j.serialize(Yt)}),this.pSourceAlgorithm=new D(hl),Object.assign(this,e)}}a([l({type:D,context:0,defaultValue:Yt})],Cn.prototype,"hashAlgorithm",void 0),a([l({type:D,context:1,defaultValue:pl})],Cn.prototype,"maskGenAlgorithm",void 0),a([l({type:D,context:2,defaultValue:hl})],Cn.prototype,"pSourceAlgorithm",void 0),new D({algorithm:td,parameters:j.serialize(new Cn)});class Zt{constructor(e={}){this.hashAlgorithm=new D(Yt),this.maskGenAlgorithm=new D({algorithm:xn,parameters:j.serialize(Yt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:D,context:0,defaultValue:Yt})],Zt.prototype,"hashAlgorithm",void 0),a([l({type:D,context:1,defaultValue:pl})],Zt.prototype,"maskGenAlgorithm",void 0),a([l({type:h.Integer,context:2,defaultValue:20})],Zt.prototype,"saltLength",void 0),a([l({type:h.Integer,context:3,defaultValue:1})],Zt.prototype,"trailerField",void 0),new D({algorithm:ei,parameters:j.serialize(new Zt)});class Bn{constructor(e={}){this.digestAlgorithm=new D,this.digest=new te,Object.assign(this,e)}}a([l({type:D})],Bn.prototype,"digestAlgorithm",void 0),a([l({type:te})],Bn.prototype,"digest",void 0);var Os;class En{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],En.prototype,"prime",void 0),a([l({type:h.Integer,converter:ce})],En.prototype,"exponent",void 0),a([l({type:h.Integer,converter:ce})],En.prototype,"coefficient",void 0);let Ts=Os=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Os.prototype)}};Ts=Os=a([B({type:x.Sequence,itemType:En})],Ts);class lt{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer})],lt.prototype,"version",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"publicExponent",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"privateExponent",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"prime1",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"prime2",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"exponent1",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"exponent2",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"coefficient",void 0),a([l({type:Ts,optional:!0})],lt.prototype,"otherPrimeInfos",void 0);class Vs{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],Vs.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ce})],Vs.prototype,"publicExponent",void 0);var _s;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(_s||(_s={}));const Re=_s;/*! *****************************************************************************
75
+ `)}`:`${t} :`}}ja=je,M.Constructed=ja,je.NAME="CONSTRUCTED";class Pa extends Ne{fromBER(e,t,i){return t}toBER(e){return Je}}Pa.override="EndOfContentValueBlock";var Ra;class oo extends Se{constructor(e={}){super(e,Pa),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}Ra=oo,M.EndOfContent=Ra,oo.NAME=Vr;var Da;class Mt extends Se{constructor(e={}){super(e,Ne),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,i){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+=i,t+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+i}toBER(e,t){const i=new ArrayBuffer(2);if(!e){const n=new Uint8Array(i);n[0]=5,n[1]=0}return t&&t.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}Da=Mt,M.Null=Da,Mt.NAME="NULL";class Ma extends nt(Ne){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=V.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,i){const n=V.toUint8Array(e);return ft(this,n,t,i)?(this.valueHexView=n.subarray(t,t+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,xa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Ma.NAME="BooleanValueBlock";var $a;let bi=class extends Se{constructor(e={}){super(e,Ma),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};$a=bi,M.Boolean=$a,bi.NAME="BOOLEAN";class Ua extends nt(xt){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=xt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const c=this.value[s].constructor.NAME;if(c===Vr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==Ea)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(e,t,i),this.blockLength=i;return n}toBER(e,t){return this.isConstructed?xt.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Ua.NAME="OctetStringValueBlock";var La;let $t=class Gu extends Se{constructor({idBlock:e={},lenBlock:t={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},Ua),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){const s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+i);try{if(s.byteLength){const c=ir(s,0,s.byteLength);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?je.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof Gu&&e.push(t.valueBlock.valueHexView);return V.concat(e)}};La=$t,M.OctetString=La,$t.NAME=Ea;class Ha extends nt(xt){constructor({unusedBits:e=0,isConstructed:t=!1,...i}={}){super(i),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,i){if(!i)return t;let n=-1;if(this.isConstructed){if(n=xt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===Vr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==Ia)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const p=u.valueBlock;if(this.unusedBits>0&&p.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=p.unusedBits}return n}const s=V.toUint8Array(e);if(!ft(this,s,t,i))return-1;const c=s.subarray(t,t+i);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=c.subarray(1);try{if(u.byteLength){const f=ir(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,t+i}toBER(e,t){if(this.isConstructed)return xt.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Je;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Ha.NAME="BitStringValueBlock";var Fa;let Ut=class extends Se{constructor({idBlock:e={},lenBlock:t={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},Ha),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return je.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const n of t)e.push(n.toString(2).padStart(8,"0"));const i=e.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};Fa=Ut,M.BitString=Fa,Ut.NAME=Ia;var Ka;function pf(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const c=s.length-1,u=n.slice(0),f=u.length-1;let p=0;const b=f<c?c:f;let y=0;for(let K=b;K>=0;K--,y++){switch(!0){case y<u.length:p=s[c-y]+u[f-y]+t[0];break;default:p=s[c-y]+t[0]}switch(t[0]=p/10,!0){case y>=s.length:s=to(new Uint8Array([p%10]),s);break;default:s[c-y]=p%10}}return t[0]>0&&(s=to(t,s)),s}function qa(r){if(r>=_r.length)for(let e=_r.length;e<=r;e++){const t=new Uint8Array([0]);let i=_r[e-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+t[0]]);t[0]=s[0]/10,i[n]=s[0]%10}t[0]>0&&(i=to(t,i)),_r.push(i)}return _r[r]}function hf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),c=s.length-1,u=n.slice(0),f=u.length-1;let p,b=0;for(let y=f;y>=0;y--,b++)switch(p=s[c-b]-u[f-b]-t,!0){case p<0:t=1,s[c-b]=p+10;break;default:t=0,s[c-b]=p}if(t>0)for(let y=c-f+1;y>=0;y--,b++)if(p=s[c-b]-t,p<0)t=1,s[c-b]=p+10;else{t=0,s[c-b]=p;break}return s.slice()}class so extends nt(Ne){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}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=xa.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(ef(e))}get valueDec(){return this._valueDec}fromDER(e,t,i,n=0){const s=this.fromBER(e,t,i);if(s===-1)return s;const c=this.valueHexView;return c[0]===0&&c[1]&128?this.valueHexView=c.subarray(1):n!==0&&c.length<n&&(n-c.length>1&&(n=c.length+1),this.valueHexView=c.subarray(n-c.length)),s}toDER(e=!1){const t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(t,1),this.valueHexView=i}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,i){const n=super.fromBER(e,t,i);return n===-1||this.setValueHex(),n}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const e=this.valueHexView.length*8-1;let t=new Uint8Array(this.valueHexView.length*8/3),i=0,n;const s=this.valueHexView;let c="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let p=0;p<8;p++){if((n&1)===1)switch(i){case e:t=hf(qa(i),t),c="-";break;default:t=pf(t,qa(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(c+=Ca.charAt(t[f]));return u===!1&&(c+=Ca.charAt(0)),c}}Ka=so,so.NAME="IntegerValueBlock",Object.defineProperty(Ka.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var za;class ot extends Se{constructor(e={}){super(e,so),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return yi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){yi();const t=BigInt(e),i=new gi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const p=BigInt(`0x${L.ToHex(u)}`)+t,b=V.toUint8Array(L.FromHex(p.toString(16)));b[0]|=128,i.write(b)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new ot({valueHex:i.final()})}convertToDER(){const e=new ot({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new ot({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}za=ot,M.Integer=za,ot.NAME="INTEGER";var Ga;class vi extends ot{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ga=vi,M.Enumerated=Ga,vi.NAME="ENUMERATED";class ao extends nt(Ne){constructor({valueDec:e=-1,isFirstSid:t=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,i){if(!i)return t;const n=V.toUint8Array(e);if(!ft(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=rr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){yi();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const i=new Uint8Array(t.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(t.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Rt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Je;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=L.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}}}ao.NAME="sidBlock";class Wa extends Ne{constructor({value:e=Ve,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new ao;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e){const t=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,Je;t.push(n)}return ro(t)}fromString(e){this.value=[];let t=0,i=0,n="",s=!1;do if(i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1,s){const c=this.value[0];let u=0;switch(c.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}const f=parseInt(n,10);if(isNaN(f))return;c.valueDec=f+u,s=!1}else{const c=new ao;if(n>Number.MAX_SAFE_INTEGER){yi();const u=BigInt(n);c.valueBigInt=u}else if(c.valueDec=parseInt(n,10),isNaN(c.valueDec))return;this.value.length||(c.isFirstSid=!0,s=!0),this.value.push(c)}while(i!==-1)}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t?(n=`{${n}}`,this.value[i].isFirstSid?e=`2.{${n} - 80}`:e+=n):e+=n}return e}toJSON(){const 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}}Wa.NAME="ObjectIdentifierValueBlock";var Ja;class wi extends Se{constructor(e={}){super(e,Wa),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ja=wi,M.ObjectIdentifier=Ja,wi.NAME="OBJECT IDENTIFIER";class co extends nt(Dt){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=V.toUint8Array(e);if(!ft(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=rr(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);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Rt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Je;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=L.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}co.NAME="relativeSidBlock";class Ya extends Ne{constructor({value:e=Ve,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new co;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e,t){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,Je;i.push(s)}return ro(i)}fromString(e){this.value=[];let t=0,i=0,n="";do{i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1;const s=new co;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t&&(n=`{${n}}`),e+=n}return e}toJSON(){const 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}}Ya.NAME="RelativeObjectIdentifierValueBlock";var Za;class lo extends Se{constructor(e={}){super(e,Ya),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Za=lo,M.RelativeObjectIdentifier=Za,lo.NAME="RelativeObjectIdentifier";var Qa;class dt extends je{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Qa=dt,M.Sequence=Qa,dt.NAME="SEQUENCE";var Xa;let pt=class extends je{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Xa=pt,M.Set=Xa,pt.NAME="SET";class ec extends nt(Ne){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Ve}toJSON(){return{...super.toJSON(),value:this.value}}}ec.NAME="StringValueBlock";class tc extends ec{}tc.NAME="SimpleStringValueBlock";class Ue extends no{constructor({...e}={}){super(e,tc)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,V.toUint8Array(e))}fromString(e){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);this.valueBlock.value=e}}Ue.NAME="SIMPLE STRING";class rc extends Ue{fromBuffer(e){this.valueBlock.valueHexView=V.toUint8Array(e);try{this.valueBlock.value=L.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=L.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(e)),this.valueBlock.value=e}}rc.NAME="Utf8StringValueBlock";var ic;class ht extends rc{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ic=ht,M.Utf8String=ic,ht.NAME="UTF8String";class nc extends Ue{fromBuffer(e){this.valueBlock.value=L.ToUtf16String(e),this.valueBlock.valueHexView=V.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(e))}}nc.NAME="BmpStringValueBlock";var oc;class Ai extends nc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}oc=Ai,M.BmpString=oc,Ai.NAME="BMPString";class sc extends Ue{fromBuffer(e){const t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(t);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let n=0;n<t;n++){const s=Rt(e.charCodeAt(n),8),c=new Uint8Array(s);if(c.length>4)continue;const u=4-c.length;for(let f=c.length-1;f>=0;f--)i[n*4+f+u]=c[f]}this.valueBlock.value=e}}sc.NAME="UniversalStringValueBlock";var ac;class Si extends sc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}ac=Si,M.UniversalString=ac,Si.NAME="UniversalString";var cc;class ki extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}cc=ki,M.NumericString=cc,ki.NAME="NumericString";var lc;class xi extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}lc=xi,M.PrintableString=lc,xi.NAME="PrintableString";var uc;class Ci extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}uc=Ci,M.TeletexString=uc,Ci.NAME="TeletexString";var fc;class Bi extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}fc=Bi,M.VideotexString=fc,Bi.NAME="VideotexString";var dc;class Ei extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}dc=Ei,M.IA5String=dc,Ei.NAME="IA5String";var pc;class Ii extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}pc=Ii,M.GraphicString=pc,Ii.NAME="GraphicString";var hc;class Pr extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}hc=Pr,M.VisibleString=hc,Pr.NAME="VisibleString";var yc;class Ni extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}yc=Ni,M.GeneralString=yc,Ni.NAME="GeneralString";var gc;class Oi extends Ue{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}gc=Oi,M.CharacterString=gc,Oi.NAME="CharacterString";var mc;class Rr extends Pr{constructor({value:e,valueDate:t,...i}={}){if(super(i),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 n=0;n<e.length;n++)this.valueBlock.valueHexView[n]=e.charCodeAt(n)}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,V.toUint8Array(e)))}toBuffer(){const e=this.toString(),t=new ArrayBuffer(e.length),i=new Uint8Array(t);for(let n=0;n<e.length;n++)i[n]=e.charCodeAt(n);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){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}const n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(e="iso"){if(e==="iso"){const t=new Array(7);return t[0]=$e(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=$e(this.month,2),t[2]=$e(this.day,2),t[3]=$e(this.hour,2),t[4]=$e(this.minute,2),t[5]=$e(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}mc=Rr,M.UTCTime=mc,Rr.NAME="UTCTime";var bc;class Ti extends Rr{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,i="",n="",s=0,c,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const y=new Number(e[e.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(t){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let y=1,K=i.indexOf("+"),N="";if(K===-1&&(K=i.indexOf("-"),y=-1),K!==-1){if(N=i.substring(K+1),i=i.substring(0,K),N.length!==2&&N.length!==4)throw new Error("Wrong input string for conversion");let d=parseInt(N.substring(0,2),10);if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");if(u=y*d,N.length===4){if(d=parseInt(N.substring(2,4),10),isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");f=y*d}}}let p=i.indexOf(".");if(p===-1&&(p=i.indexOf(",")),p!==-1){const y=new Number(`0${i.substring(p)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),n=i.substring(0,p)}else n=i;switch(!0){case n.length===8:if(c=/(\d{4})(\d{2})(\d{2})/ig,p!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===12:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===14:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){const y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}const b=c.exec(n);if(b===null)throw new Error("Wrong input string for conversion");for(let y=1;y<b.length;y++)switch(y){case 1:this.year=parseInt(b[y],10);break;case 2:this.month=parseInt(b[y],10);break;case 3:this.day=parseInt(b[y],10);break;case 4:this.hour=parseInt(b[y],10)+u;break;case 5:this.minute=parseInt(b[y],10)+f;break;case 6:this.second=parseInt(b[y],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push($e(this.year,4)),t.push($e(this.month,2)),t.push($e(this.day,2)),t.push($e(this.hour,2)),t.push($e(this.minute,2)),t.push($e(this.second,2)),this.millisecond!==0&&(t.push("."),t.push($e(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}bc=Ti,M.GeneralizedTime=bc,Ti.NAME="GeneralizedTime";var vc;class uo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}vc=uo,M.DATE=vc,uo.NAME="DATE";var wc;class fo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}wc=fo,M.TimeOfDay=wc,fo.NAME="TimeOfDay";var Ac;class po extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Ac=po,M.DateTime=Ac,po.NAME="DateTime";var Sc;class ho extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Sc=ho,M.Duration=Sc,ho.NAME="Duration";var kc;class yo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}kc=yo,M.TIME=kc,yo.NAME="TIME";class Lt{constructor({name:e=Ve,optional:t=!1}={}){this.name=e,this.optional=t}}class go extends Lt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class _i extends Lt{constructor({value:e=new Lt,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class yf{constructor({data:e=mi}={}){this.dataView=V.toUint8Array(e)}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=V.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=V.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function Ht(r,e,t){if(t instanceof go){for(let s=0;s<t.value.length;s++)if(Ht(r,e,t.value[s]).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(io)&&(s.name=t.name),s}}if(t instanceof Lt)return t.hasOwnProperty(io)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(nf in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(cf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(lf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=t.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(of)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(sf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(af)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(rf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(Ba in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,c=e.idBlock.valueHexView;if(s.length!==c.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==c[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&(r[t.name]=e)),t instanceof M.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof _i&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let f=!0;for(let p=0;p<t.valueBlock.value.length;p++)f=f&&(t.valueBlock.value[p].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let f=0;f<u;f++)if(f-s>=e.valueBlock.value.length){if(t.valueBlock.value[f].optional===!1){const p={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&(delete r[t.name],p.name=t.name)),p}}else if(t.valueBlock.value[0]instanceof _i){if(c=Ht(r,e.valueBlock.value[f],t.valueBlock.value[0].value),c.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&delete r[t.name]),c;if(io in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let p={};uf in t.valueBlock.value[0]&&t.valueBlock.value[0].local?p=e:p=r,typeof p[t.valueBlock.value[0].name]>"u"&&(p[t.valueBlock.value[0].name]=[]),p[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(c=Ht(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),c.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&delete r[t.name]),c;if(c.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&Ba in e.valueBlock){const s=ir(e.valueBlock.valueHexView);if(s.offset===-1){const c={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&(delete r[t.name],c.name=t.name)),c}return Ht(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function gf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=ir(V.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Ht(t.result,t.result,e)}const xc=Object.freeze(Object.defineProperty({__proto__:null,Any:Lt,BaseBlock:Se,BaseStringBlock:no,BitString:Ut,BmpString:Ai,Boolean:bi,CharacterString:Oi,Choice:go,Constructed:je,DATE:uo,DateTime:po,Duration:ho,EndOfContent:oo,Enumerated:vi,GeneralString:Ni,GeneralizedTime:Ti,GraphicString:Ii,HexBlock:nt,IA5String:Ei,Integer:ot,Null:Mt,NumericString:ki,ObjectIdentifier:wi,OctetString:$t,Primitive:jr,PrintableString:xi,RawData:yf,RelativeObjectIdentifier:lo,Repeated:_i,Sequence:dt,Set:pt,TIME:yo,TeletexString:Ci,TimeOfDay:fo,UTCTime:Rr,UniversalString:Si,Utf8String:ht,ValueBlock:Ne,VideotexString:Bi,ViewWriter:gi,VisibleString:Pr,compareSchema:Ht,fromBER:nr,verifySchema:gf},Symbol.toStringTag,{value:"Module"}));var x;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(x||(x={}));var h;(function(r){r[r.Any=1]="Any",r[r.Boolean=2]="Boolean",r[r.OctetString=3]="OctetString",r[r.BitString=4]="BitString",r[r.Integer=5]="Integer",r[r.Enumerated=6]="Enumerated",r[r.ObjectIdentifier=7]="ObjectIdentifier",r[r.Utf8String=8]="Utf8String",r[r.BmpString=9]="BmpString",r[r.UniversalString=10]="UniversalString",r[r.NumericString=11]="NumericString",r[r.PrintableString=12]="PrintableString",r[r.TeletexString=13]="TeletexString",r[r.VideotexString=14]="VideotexString",r[r.IA5String=15]="IA5String",r[r.GraphicString=16]="GraphicString",r[r.VisibleString=17]="VisibleString",r[r.GeneralString=18]="GeneralString",r[r.CharacterString=19]="CharacterString",r[r.UTCTime=20]="UTCTime",r[r.GeneralizedTime=21]="GeneralizedTime",r[r.DATE=22]="DATE",r[r.TimeOfDay=23]="TimeOfDay",r[r.DateTime=24]="DateTime",r[r.Duration=25]="Duration",r[r.TIME=26]="TIME",r[r.Null=27]="Null"})(h||(h={}));class Vi{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(V.isBufferSource(e))this.unusedBits=t,this.value=V.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Ut))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new Ut({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ut({name:e})}toNumber(){let e="";const t=new Uint8Array(this.value);for(const i of t)e+=i.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);const i=t.length+7>>3;this.unusedBits=(i<<3)-t.length;const n=new Uint8Array(i);t=t.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(t.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}}class te{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):V.isBufferSource(e)?this.buffer=V.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof $t))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new $t({valueHex:this.buffer})}toSchema(e){return new $t({name:e})}}const mf={fromASN:r=>r instanceof Mt?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Mt;const e=nr(r);if(e.result.error)throw new Error(e.result.error);return e.result}},bf={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new ot({value:+r})},vf={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new vi({value:r})},ce={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new ot({valueHex:r})},wf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ut({valueHex:r})},Af={fromASN:r=>r.valueBlock.toString(),toASN:r=>new wi({value:r})},Sf={fromASN:r=>r.valueBlock.value,toASN:r=>new bi({value:r})},ji={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new $t({valueHex:r})},kf={fromASN:r=>new te(r.getValue()),toASN:r=>r.toASN()};function He(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Cc=He(ht),xf=He(Ai),Cf=He(Si),Bf=He(ki),Ef=He(xi),If=He(Ci),Nf=He(Bi),Of=He(Ei),Tf=He(Ii),_f=He(Pr),Vf=He(Ni),jf=He(Oi),Pf={fromASN:r=>r.toDate(),toASN:r=>new Rr({valueDate:r})},Rf={fromASN:r=>r.toDate(),toASN:r=>new Ti({valueDate:r})},Df={fromASN:()=>null,toASN:()=>new Mt};function mo(r){switch(r){case h.Any:return mf;case h.BitString:return wf;case h.BmpString:return xf;case h.Boolean:return Sf;case h.CharacterString:return jf;case h.Enumerated:return vf;case h.GeneralString:return Vf;case h.GeneralizedTime:return Rf;case h.GraphicString:return Tf;case h.IA5String:return Of;case h.Integer:return bf;case h.Null:return Df;case h.NumericString:return Bf;case h.ObjectIdentifier:return Af;case h.OctetString:return ji;case h.PrintableString:return Ef;case h.TeletexString:return If;case h.UTCTime:return Pf;case h.UniversalString:return Cf;case h.Utf8String:return Cc;case h.VideotexString:return Nf;case h.VisibleString:return _f;default:return null}}function yt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:yt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function Bc(r){var e;if(r){const t=Object.getPrototypeOf(r);return((e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:Bc(t)}return!1}function Mf(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}class $f{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){const i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:x.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(t,i),t.items=Object.assign({},t.items,i.items)),t}create(e,t){const i=this.items.get(e)||this.createDefault(e),n=[];for(const s in i.items){const c=i.items[s],u=t?s:"";let f;if(typeof c.type=="number"){const b=h[c.type],y=xc[b];if(!y)throw new Error(`Cannot get ASN1 class by name '${b}'`);f=new y({name:u})}else yt(c.type)?f=new c.type().toSchema(u):c.optional?this.get(c.type).type===x.Choice?f=new Lt({name:u}):(f=this.create(c.type,!1),f.name=u):f=new Lt({name:u});const p=!!c.optional||c.defaultValue!==void 0;if(c.repeated){f.name="";const b=c.repeated==="set"?pt:dt;f=new b({name:"",value:[new _i({name:u,value:f})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||yt(c.type)){const b=c.repeated?je:jr;n.push(new b({name:u,optional:p,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const b=!!c.repeated;let y=b?f:this.get(c.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,n.push(new je({name:b?"":u,optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:y}))}else n.push(new je({optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else f.optional=p,n.push(f)}switch(i.type){case x.Sequence:return new dt({value:n,name:""});case x.Set:return new pt({value:n,name:""});case x.Choice:return new go({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){const t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}}const Fe=new $f,B=r=>e=>{let t;Fe.has(e)?t=Fe.get(e):(t=Fe.createDefault(e),Fe.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;Fe.has(e.constructor)?i=Fe.get(e.constructor):(i=Fe.createDefault(e.constructor),Fe.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=mo(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}i.items[t]=n};class Ec extends Error{constructor(){super(...arguments),this.schemas=[]}}class Uf{static parse(e,t){const i=nr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){var i;try{if(yt(t))return new t().fromASN(e);const n=Fe.get(t);Fe.cache(t);let s=n.schema;if(e.constructor===je&&n.type!==x.Choice){s=new je({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const f in n.items)delete e[f]}const c=Ht({},e,s);if(!c.verified)throw new Ec(`Data does not match to ${t.name} ASN1 schema. ${c.result.error}`);const u=new t;if(Bc(t)){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const f=n.itemType;if(typeof f=="number"){const p=mo(f);if(!p)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);return t.from(e.valueBlock.value,b=>p.fromASN(b))}else return t.from(e.valueBlock.value,p=>this.fromASN(p,f))}for(const f in n.items){const p=c.result[f];if(!p)continue;const b=n.items[f],y=b.type;if(typeof y=="number"||yt(y)){const K=(i=b.converter)!==null&&i!==void 0?i:yt(y)?new y:null;if(!K)throw new Error("Converter is empty");if(b.repeated)if(b.implicit){const N=b.repeated==="sequence"?dt:pt,d=new N;d.valueBlock=p.valueBlock;const g=nr(d.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const A=g.result.valueBlock.value;u[f]=Array.from(A,w=>K.fromASN(w))}else u[f]=Array.from(p,N=>K.fromASN(N));else{let N=p;if(b.implicit){let d;if(yt(y))d=new y().toSchema("");else{const g=h[y],A=xc[g];if(!A)throw new Error(`Cannot get '${g}' class from asn1js module`);d=new A}d.valueBlock=N.valueBlock,N=nr(d.toBER(!1)).result}u[f]=K.fromASN(N)}}else if(b.repeated){if(!Array.isArray(p))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");u[f]=Array.from(p,K=>this.fromASN(K,y))}else u[f]=this.fromASN(p,y)}return u}catch(n){throw n instanceof Ec&&n.schemas.push(t.name),n}}}class bo{static serialize(e){return e instanceof Se?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&yt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=Fe.get(t);Fe.cache(t);let n=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const c=mo(i.itemType);if(!c)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>c.toASN(u))}else n=e.map(c=>this.toAsnItem({type:i.itemType},"[]",t,c))}else for(const c in i.items){const u=i.items[c],f=e[c];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&Mf(this.serialize(u.defaultValue),this.serialize(f)))continue;const p=bo.toAsnItem(u,c,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||yt(u.type))){const b={};b.valueHex=p instanceof Mt?p.valueBeforeDecodeView:p.valueBlock.toBER(),n.push(new jr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...b}))}else n.push(new je({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:p.valueBlock.value}));else n.push(new je({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[p]}));else u.repeated?n=n.concat(p):n.push(p)}let s;switch(i.type){case x.Sequence:s=new dt({value:n});break;case x.Set:s=new pt({value:n});break;case x.Choice:if(!n[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(e,t,i,n){let s;if(typeof e.type=="number"){const c=e.converter;if(!c)throw new Error(`Property '${t}' doesn't have converter for type ${h[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const u=Array.from(n,p=>c.toASN(p)),f=e.repeated==="sequence"?dt:pt;s=new f({value:u})}else s=c.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?dt:pt;s=new u({value:c})}else s=this.toASN(n);return s}}class oe extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class j{static serialize(e){return bo.serialize(e)}static parse(e,t){return Uf.parse(e,t)}static toString(e){const t=V.isBufferSource(e)?V.toArrayBuffer(e):j.serialize(e),i=nr(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function a(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(s=(n<3?c(s):n>3?c(e,t,s):c(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;var Ic={exports:{}};(function(r){(function(e){const t="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",f={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${c})?$`,"i")};function p(d,g){if(d.indexOf("::")!==d.lastIndexOf("::"))return null;let A=0,w=-1,I=(d.match(f.zoneIndex)||[])[0],k,E;for(I&&(I=I.substring(1),d=d.replace(/%.+$/,""));(w=d.indexOf(":",w+1))>=0;)A++;if(d.substr(0,2)==="::"&&A--,d.substr(-2,2)==="::"&&A--,A>g)return null;for(E=g-A,k=":";E--;)k+="0:";return d=d.replace("::",k),d[0]===":"&&(d=d.slice(1)),d[d.length-1]===":"&&(d=d.slice(0,-1)),g=function(){const J=d.split(":"),se=[];for(let $=0;$<J.length;$++)se.push(parseInt(J[$],16));return se}(),{parts:g,zoneId:I}}function b(d,g,A,w){if(d.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let I=0,k;for(;w>0;){if(k=A-w,k<0&&(k=0),d[I]>>k!==g[I]>>k)return!1;w-=A,I+=1}return!0}function y(d){if(s.test(d))return parseInt(d,16);if(d[0]==="0"&&!isNaN(parseInt(d[1],10))){if(n.test(d))return parseInt(d,8);throw new Error(`ipaddr: cannot parse ${d} as octal`)}return parseInt(d,10)}function K(d,g){for(;d.length<g;)d=`0${d}`;return d}const N={};N.IPv4=function(){function d(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let A,w;for(A=0;A<g.length;A++)if(w=g[A],!(0<=w&&w<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return d.prototype.SpecialRanges={unspecified:[[new d([0,0,0,0]),8]],broadcast:[[new d([255,255,255,255]),32]],multicast:[[new d([224,0,0,0]),4]],linkLocal:[[new d([169,254,0,0]),16]],loopback:[[new d([127,0,0,0]),8]],carrierGradeNat:[[new d([100,64,0,0]),10]],private:[[new d([10,0,0,0]),8],[new d([172,16,0,0]),12],[new d([192,168,0,0]),16]],reserved:[[new d([192,0,0,0]),24],[new d([192,0,2,0]),24],[new d([192,88,99,0]),24],[new d([198,18,0,0]),15],[new d([198,51,100,0]),24],[new d([203,0,113,0]),24],[new d([240,0,0,0]),4]],as112:[[new d([192,175,48,0]),24],[new d([192,31,196,0]),24]],amt:[[new d([192,52,193,0]),24]]},d.prototype.kind=function(){return"ipv4"},d.prototype.match=function(g,A){let w;if(A===void 0&&(w=g,g=w[0],A=w[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return b(this.octets,g.octets,8,A)},d.prototype.prefixLengthFromSubnetMask=function(){let g=0,A=!1;const w={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let I,k,E;for(I=3;I>=0;I-=1)if(k=this.octets[I],k in w){if(E=w[k],A&&E!==0)return null;E!==8&&(A=!0),g+=E}else return null;return 32-g},d.prototype.range=function(){return N.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){return this.octets.slice(0)},d.prototype.toIPv4MappedAddress=function(){return N.IPv6.parse(`::ffff:${this.toString()}`)},d.prototype.toNormalizedString=function(){return this.toString()},d.prototype.toString=function(){return this.octets.join(".")},d}(),N.IPv4.broadcastAddressFromCIDR=function(d){try{const g=this.parseCIDR(d),A=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),I=[];let k=0;for(;k<4;)I.push(parseInt(A[k],10)|parseInt(w[k],10)^255),k++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},N.IPv4.isIPv4=function(d){return this.parser(d)!==null},N.IPv4.isValid=function(d){try{return new this(this.parser(d)),!0}catch{return!1}},N.IPv4.isValidCIDR=function(d){try{return this.parseCIDR(d),!0}catch{return!1}},N.IPv4.isValidFourPartDecimal=function(d){return!!(N.IPv4.isValid(d)&&d.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},N.IPv4.networkAddressFromCIDR=function(d){let g,A,w,I,k;try{for(g=this.parseCIDR(d),w=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),I=[],A=0;A<4;)I.push(parseInt(w[A],10)&parseInt(k[A],10)),A++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},N.IPv4.parse=function(d){const g=this.parser(d);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},N.IPv4.parseCIDR=function(d){let g;if(g=d.match(/^(.+)\/(\d+)$/)){const A=parseInt(g[2]);if(A>=0&&A<=32){const w=[this.parse(g[1]),A];return Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},N.IPv4.parser=function(d){let g,A,w;if(g=d.match(i.fourOctet))return function(){const I=g.slice(1,6),k=[];for(let E=0;E<I.length;E++)A=I[E],k.push(y(A));return k}();if(g=d.match(i.longValue)){if(w=y(g[1]),w>4294967295||w<0)throw new Error("ipaddr: address outside defined range");return function(){const I=[];let k;for(k=0;k<=24;k+=8)I.push(w>>k&255);return I}().reverse()}else return(g=d.match(i.twoOctet))?function(){const I=g.slice(1,4),k=[];if(w=y(I[1]),w>16777215||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(I[0])),k.push(w>>16&255),k.push(w>>8&255),k.push(w&255),k}():(g=d.match(i.threeOctet))?function(){const I=g.slice(1,5),k=[];if(w=y(I[2]),w>65535||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(I[0])),k.push(y(I[1])),k.push(w>>8&255),k.push(w&255),k}():null},N.IPv4.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let A=0;const w=Math.floor(d/8);for(;A<w;)g[A]=255,A++;return w<4&&(g[w]=Math.pow(2,d%8)-1<<8-d%8),new this(g)},N.IPv6=function(){function d(g,A){let w,I;if(g.length===16)for(this.parts=[],w=0;w<=14;w+=2)this.parts.push(g[w]<<8|g[w+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(w=0;w<this.parts.length;w++)if(I=this.parts[w],!(0<=I&&I<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");A&&(this.zoneId=A)}return d.prototype.SpecialRanges={unspecified:[new d([0,0,0,0,0,0,0,0]),128],linkLocal:[new d([65152,0,0,0,0,0,0,0]),10],multicast:[new d([65280,0,0,0,0,0,0,0]),8],loopback:[new d([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new d([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new d([0,0,0,0,0,65535,0,0]),96],discard:[new d([256,0,0,0,0,0,0,0]),64],rfc6145:[new d([0,0,0,0,65535,0,0,0]),96],rfc6052:[new d([100,65435,0,0,0,0,0,0]),96],"6to4":[new d([8194,0,0,0,0,0,0,0]),16],teredo:[new d([8193,0,0,0,0,0,0,0]),32],benchmarking:[new d([8193,2,0,0,0,0,0,0]),48],amt:[new d([8193,3,0,0,0,0,0,0]),32],as112v6:[[new d([8193,4,274,0,0,0,0,0]),48],[new d([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new d([8193,16,0,0,0,0,0,0]),28],orchid2:[new d([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new d([8193,48,0,0,0,0,0,0]),28],reserved:[[new d([8193,0,0,0,0,0,0,0]),23],[new d([8193,3512,0,0,0,0,0,0]),32]]},d.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},d.prototype.kind=function(){return"ipv6"},d.prototype.match=function(g,A){let w;if(A===void 0&&(w=g,g=w[0],A=w[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return b(this.parts,g.parts,16,A)},d.prototype.prefixLengthFromSubnetMask=function(){let g=0,A=!1;const w={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let I,k;for(let E=7;E>=0;E-=1)if(I=this.parts[E],I in w){if(k=w[I],A&&k!==0)return null;k!==16&&(A=!0),g+=k}else return null;return 128-g},d.prototype.range=function(){return N.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){let g;const A=[],w=this.parts;for(let I=0;I<w.length;I++)g=w[I],A.push(g>>8),A.push(g&255);return A},d.prototype.toFixedLengthString=function(){const g=(function(){const w=[];for(let I=0;I<this.parts.length;I++)w.push(K(this.parts[I].toString(16),4));return w}).call(this).join(":");let A="";return this.zoneId&&(A=`%${this.zoneId}`),g+A},d.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),A=g[0],w=g[1];return new N.IPv4([A>>8,A&255,w>>8,w&255])},d.prototype.toNormalizedString=function(){const g=(function(){const w=[];for(let I=0;I<this.parts.length;I++)w.push(this.parts[I].toString(16));return w}).call(this).join(":");let A="";return this.zoneId&&(A=`%${this.zoneId}`),g+A},d.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,A=this.toNormalizedString();let w=0,I=-1,k;for(;k=g.exec(A);)k[0].length>I&&(w=k.index,I=k[0].length);return I<0?A:`${A.substring(0,w)}::${A.substring(w+I)}`},d.prototype.toString=function(){return this.toRFC5952String()},d}(),N.IPv6.broadcastAddressFromCIDR=function(d){try{const g=this.parseCIDR(d),A=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),I=[];let k=0;for(;k<16;)I.push(parseInt(A[k],10)|parseInt(w[k],10)^255),k++;return new this(I)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},N.IPv6.isIPv6=function(d){return this.parser(d)!==null},N.IPv6.isValid=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{const g=this.parser(d);return new this(g.parts,g.zoneId),!0}catch{return!1}},N.IPv6.isValidCIDR=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{return this.parseCIDR(d),!0}catch{return!1}},N.IPv6.networkAddressFromCIDR=function(d){let g,A,w,I,k;try{for(g=this.parseCIDR(d),w=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),I=[],A=0;A<16;)I.push(parseInt(w[A],10)&parseInt(k[A],10)),A++;return new this(I)}catch(E){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${E})`)}},N.IPv6.parse=function(d){const g=this.parser(d);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},N.IPv6.parseCIDR=function(d){let g,A,w;if((A=d.match(/^(.+)\/(\d+)$/))&&(g=parseInt(A[2]),g>=0&&g<=128))return w=[this.parse(A[1]),g],Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},N.IPv6.parser=function(d){let g,A,w,I,k,E;if(w=d.match(f.deprecatedTransitional))return this.parser(`::ffff:${w[1]}`);if(f.native.test(d))return p(d,8);if((w=d.match(f.transitional))&&(E=w[6]||"",g=w[1],w[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+E,6),g.parts)){for(k=[parseInt(w[2]),parseInt(w[3]),parseInt(w[4]),parseInt(w[5])],A=0;A<k.length;A++)if(I=k[A],!(0<=I&&I<=255))return null;return g.parts.push(k[0]<<8|k[1]),g.parts.push(k[2]<<8|k[3]),{parts:g.parts,zoneId:g.zoneId}}return null},N.IPv6.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let A=0;const w=Math.floor(d/8);for(;A<w;)g[A]=255,A++;return w<16&&(g[w]=Math.pow(2,d%8)-1<<8-d%8),new this(g)},N.fromByteArray=function(d){const g=d.length;if(g===4)return new N.IPv4(d);if(g===16)return new N.IPv6(d);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},N.isValid=function(d){return N.IPv6.isValid(d)||N.IPv4.isValid(d)},N.isValidCIDR=function(d){return N.IPv6.isValidCIDR(d)||N.IPv4.isValidCIDR(d)},N.parse=function(d){if(N.IPv6.isValid(d))return N.IPv6.parse(d);if(N.IPv4.isValid(d))return N.IPv4.parse(d);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},N.parseCIDR=function(d){try{return N.IPv6.parseCIDR(d)}catch{try{return N.IPv4.parseCIDR(d)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},N.process=function(d){const g=this.parse(d);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},N.subnetMatch=function(d,g,A){let w,I,k,E;A==null&&(A="unicast");for(I in g)if(Object.prototype.hasOwnProperty.call(g,I)){for(k=g[I],k[0]&&!(k[0]instanceof Array)&&(k=[k]),w=0;w<k.length;w++)if(E=k[w],d.kind()===E[0].kind()&&d.match.apply(d,E))return I}return A},r.exports?r.exports=N:e.ipaddr=N})(Xn)})(Ic);var Nc=Ic.exports;class Oc{static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const t=parseInt(e.slice(8),16).toString(2).split("").reduce((n,s)=>n+ +s,0);let i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${t}`}static toString(e){if(e.byteLength===4||e.byteLength===16){const t=new Uint8Array(e);return Nc.fromByteArray(Array.from(t)).toString()}return this.decodeIP(L.ToHex(e))}static fromString(e){const t=Nc.parse(e);return new Uint8Array(t.toByteArray()).buffer}}var vo,wo,Ao;let ke=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:h.TeletexString})],ke.prototype,"teletexString",void 0),a([l({type:h.PrintableString})],ke.prototype,"printableString",void 0),a([l({type:h.UniversalString})],ke.prototype,"universalString",void 0),a([l({type:h.Utf8String})],ke.prototype,"utf8String",void 0),a([l({type:h.BmpString})],ke.prototype,"bmpString",void 0),ke=a([B({type:x.Choice})],ke);let or=class extends ke{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};a([l({type:h.IA5String})],or.prototype,"ia5String",void 0),a([l({type:h.Any})],or.prototype,"anyValue",void 0),or=a([B({type:x.Choice})],or);class Pi{constructor(e={}){this.type="",this.value=new or,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Pi.prototype,"type",void 0),a([l({type:or})],Pi.prototype,"value",void 0);let sr=vo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,vo.prototype)}};sr=vo=a([B({type:x.Set,itemType:Pi})],sr);let So=wo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,wo.prototype)}};So=wo=a([B({type:x.Sequence,itemType:sr})],So);let me=Ao=class extends So{constructor(e){super(e),Object.setPrototypeOf(this,Ao.prototype)}};me=Ao=a([B({type:x.Sequence})],me);const Lf={fromASN:r=>Oc.toString(ji.fromASN(r)),toASN:r=>ji.toASN(Oc.fromString(r))};class Dr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Dr.prototype,"typeId",void 0),a([l({type:h.Any,context:0})],Dr.prototype,"value",void 0);class ko{constructor(e={}){this.partyName=new ke,Object.assign(this,e)}}a([l({type:ke,optional:!0,context:0,implicit:!0})],ko.prototype,"nameAssigner",void 0),a([l({type:ke,context:1,implicit:!0})],ko.prototype,"partyName",void 0);let Z=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Dr,context:0,implicit:!0})],Z.prototype,"otherName",void 0),a([l({type:h.IA5String,context:1,implicit:!0})],Z.prototype,"rfc822Name",void 0),a([l({type:h.IA5String,context:2,implicit:!0})],Z.prototype,"dNSName",void 0),a([l({type:h.Any,context:3,implicit:!0})],Z.prototype,"x400Address",void 0),a([l({type:me,context:4,implicit:!1})],Z.prototype,"directoryName",void 0),a([l({type:ko,context:5})],Z.prototype,"ediPartyName",void 0),a([l({type:h.IA5String,context:6,implicit:!0})],Z.prototype,"uniformResourceIdentifier",void 0),a([l({type:h.OctetString,context:7,implicit:!0,converter:Lf})],Z.prototype,"iPAddress",void 0),a([l({type:h.ObjectIdentifier,context:8,implicit:!0})],Z.prototype,"registeredID",void 0),Z=a([B({type:x.Choice})],Z);const xo="1.3.6.1.5.5.7",Hf=`${xo}.1`,ar=`${xo}.3`,Ri=`${xo}.48`,Tc=`${Ri}.1`,_c=`${Ri}.2`,Vc=`${Ri}.3`,jc=`${Ri}.5`,Ct="2.5.29";var Co;const Bo=`${Hf}.1`;class Mr{constructor(e={}){this.accessMethod="",this.accessLocation=new Z,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Mr.prototype,"accessMethod",void 0),a([l({type:Z})],Mr.prototype,"accessLocation",void 0);let cr=Co=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Co.prototype)}};cr=Co=a([B({type:x.Sequence,itemType:Mr})],cr);const Eo=`${Ct}.35`;class Io extends te{}class Ft{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:Io,context:0,optional:!0,implicit:!0})],Ft.prototype,"keyIdentifier",void 0),a([l({type:Z,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ft.prototype,"authorityCertIssuer",void 0),a([l({type:h.Integer,context:2,optional:!0,implicit:!0,converter:ce})],Ft.prototype,"authorityCertSerialNumber",void 0);const Pc=`${Ct}.19`;class Di{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:h.Boolean,defaultValue:!1})],Di.prototype,"cA",void 0),a([l({type:h.Integer,optional:!0})],Di.prototype,"pathLenConstraint",void 0);var No;let Oe=No=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,No.prototype)}};Oe=No=a([B({type:x.Sequence,itemType:Z})],Oe);var Oo;let Rc=Oo=class extends Oe{constructor(e){super(e),Object.setPrototypeOf(this,Oo.prototype)}};Rc=Oo=a([B({type:x.Sequence})],Rc);var To;const Dc=`${Ct}.32`;let gt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:h.IA5String})],gt.prototype,"ia5String",void 0),a([l({type:h.VisibleString})],gt.prototype,"visibleString",void 0),a([l({type:h.BmpString})],gt.prototype,"bmpString",void 0),a([l({type:h.Utf8String})],gt.prototype,"utf8String",void 0),gt=a([B({type:x.Choice})],gt);class _o{constructor(e={}){this.organization=new gt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:gt})],_o.prototype,"organization",void 0),a([l({type:h.Integer,repeated:"sequence"})],_o.prototype,"noticeNumbers",void 0);class Vo{constructor(e={}){Object.assign(this,e)}}a([l({type:_o,optional:!0})],Vo.prototype,"noticeRef",void 0),a([l({type:gt,optional:!0})],Vo.prototype,"explicitText",void 0);let Mi=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.IA5String})],Mi.prototype,"cPSuri",void 0),a([l({type:Vo})],Mi.prototype,"userNotice",void 0),Mi=a([B({type:x.Choice})],Mi);class jo{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],jo.prototype,"policyQualifierId",void 0),a([l({type:h.Any})],jo.prototype,"qualifier",void 0);class $i{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],$i.prototype,"policyIdentifier",void 0),a([l({type:jo,repeated:"sequence",optional:!0})],$i.prototype,"policyQualifiers",void 0);let Ui=To=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,To.prototype)}};Ui=To=a([B({type:x.Sequence,itemType:$i})],Ui);let Li=class{constructor(e=0){this.value=e}};a([l({type:h.Integer})],Li.prototype,"value",void 0),Li=a([B({type:x.Choice})],Li);let Mc=class extends Li{};Mc=a([B({type:x.Choice})],Mc);var Po;const Ro=`${Ct}.31`;var Ye;(function(r){r[r.unused=1]="unused",r[r.keyCompromise=2]="keyCompromise",r[r.cACompromise=4]="cACompromise",r[r.affiliationChanged=8]="affiliationChanged",r[r.superseded=16]="superseded",r[r.cessationOfOperation=32]="cessationOfOperation",r[r.certificateHold=64]="certificateHold",r[r.privilegeWithdrawn=128]="privilegeWithdrawn",r[r.aACompromise=256]="aACompromise"})(Ye||(Ye={}));class $c extends Vi{toJSON(){const e=[],t=this.toNumber();return t&Ye.aACompromise&&e.push("aACompromise"),t&Ye.affiliationChanged&&e.push("affiliationChanged"),t&Ye.cACompromise&&e.push("cACompromise"),t&Ye.certificateHold&&e.push("certificateHold"),t&Ye.cessationOfOperation&&e.push("cessationOfOperation"),t&Ye.keyCompromise&&e.push("keyCompromise"),t&Ye.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Ye.superseded&&e.push("superseded"),t&Ye.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Kt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,context:0,repeated:"sequence",implicit:!0})],Kt.prototype,"fullName",void 0),a([l({type:sr,context:1,implicit:!0})],Kt.prototype,"nameRelativeToCRLIssuer",void 0),Kt=a([B({type:x.Choice})],Kt);class lr{constructor(e={}){Object.assign(this,e)}}a([l({type:Kt,context:0,optional:!0})],lr.prototype,"distributionPoint",void 0),a([l({type:$c,context:1,optional:!0,implicit:!0})],lr.prototype,"reasons",void 0),a([l({type:Z,context:2,optional:!0,repeated:"sequence",implicit:!0})],lr.prototype,"cRLIssuer",void 0);let ur=Po=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Po.prototype)}};ur=Po=a([B({type:x.Sequence,itemType:lr})],ur);var Do;let Uc=Do=class extends ur{constructor(e){super(e),Object.setPrototypeOf(this,Do.prototype)}};Uc=Do=a([B({type:x.Sequence,itemType:lr})],Uc);class Ee{constructor(e={}){this.onlyContainsUserCerts=Ee.ONLY,this.onlyContainsCACerts=Ee.ONLY,this.indirectCRL=Ee.ONLY,this.onlyContainsAttributeCerts=Ee.ONLY,Object.assign(this,e)}}Ee.ONLY=!1,a([l({type:Kt,context:0,optional:!0})],Ee.prototype,"distributionPoint",void 0),a([l({type:h.Boolean,context:1,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsUserCerts",void 0),a([l({type:h.Boolean,context:2,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsCACerts",void 0),a([l({type:$c,context:3,optional:!0,implicit:!0})],Ee.prototype,"onlySomeReasons",void 0),a([l({type:h.Boolean,context:4,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"indirectCRL",void 0),a([l({type:h.Boolean,context:5,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsAttributeCerts",void 0);var $r;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})($r||($r={}));let Mo=class{constructor(e=$r.unspecified){this.reason=$r.unspecified,this.reason=e}toJSON(){return $r[this.reason]}toString(){return this.toJSON()}};a([l({type:h.Enumerated})],Mo.prototype,"reason",void 0),Mo=a([B({type:x.Choice})],Mo);var $o;const Lc=`${Ct}.37`;let Hi=$o=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,$o.prototype)}};Hi=$o=a([B({type:x.Sequence,itemType:h.ObjectIdentifier})],Hi);const Ff=`${ar}.1`,Kf=`${ar}.2`,qf=`${ar}.3`,zf=`${ar}.4`,Gf=`${ar}.8`,Wf=`${ar}.9`;let Uo=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:h.Integer,converter:ce})],Uo.prototype,"value",void 0),Uo=a([B({type:x.Choice})],Uo);let Lo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:h.GeneralizedTime})],Lo.prototype,"value",void 0),Lo=a([B({type:x.Choice})],Lo);var Ho;let Hc=Ho=class extends Oe{constructor(e){super(e),Object.setPrototypeOf(this,Ho.prototype)}};Hc=Ho=a([B({type:x.Sequence})],Hc);const Fc=`${Ct}.15`;var Ze;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(Ze||(Ze={}));class Fo extends Vi{toJSON(){const e=this.toNumber(),t=[];return e&Ze.cRLSign&&t.push("crlSign"),e&Ze.dataEncipherment&&t.push("dataEncipherment"),e&Ze.decipherOnly&&t.push("decipherOnly"),e&Ze.digitalSignature&&t.push("digitalSignature"),e&Ze.encipherOnly&&t.push("encipherOnly"),e&Ze.keyAgreement&&t.push("keyAgreement"),e&Ze.keyCertSign&&t.push("keyCertSign"),e&Ze.keyEncipherment&&t.push("keyEncipherment"),e&Ze.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var Ko;class Fi{constructor(e={}){this.base=new Z,this.minimum=0,Object.assign(this,e)}}a([l({type:Z})],Fi.prototype,"base",void 0),a([l({type:h.Integer,context:0,defaultValue:0,implicit:!0})],Fi.prototype,"minimum",void 0),a([l({type:h.Integer,context:1,optional:!0,implicit:!0})],Fi.prototype,"maximum",void 0);let Ki=Ko=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};Ki=Ko=a([B({type:x.Sequence,itemType:Fi})],Ki);class Kc{constructor(e={}){Object.assign(this,e)}}a([l({type:Ki,context:0,optional:!0,implicit:!0})],Kc.prototype,"permittedSubtrees",void 0),a([l({type:Ki,context:1,optional:!0,implicit:!0})],Kc.prototype,"excludedSubtrees",void 0);class qc{constructor(e={}){Object.assign(this,e)}}a([l({type:h.Integer,context:0,implicit:!0,optional:!0,converter:ce})],qc.prototype,"requireExplicitPolicy",void 0),a([l({type:h.Integer,context:1,implicit:!0,optional:!0,converter:ce})],qc.prototype,"inhibitPolicyMapping",void 0);var qo;class zo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],zo.prototype,"issuerDomainPolicy",void 0),a([l({type:h.ObjectIdentifier})],zo.prototype,"subjectDomainPolicy",void 0);let zc=qo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};zc=qo=a([B({type:x.Sequence,itemType:zo})],zc);var Go;const Gc=`${Ct}.17`;let Wo=Go=class extends Oe{constructor(e){super(e),Object.setPrototypeOf(this,Go.prototype)}};Wo=Go=a([B({type:x.Sequence})],Wo);let mt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],mt.prototype,"type",void 0),a([l({type:h.Any,repeated:"set"})],mt.prototype,"values",void 0);var Jo;let Wc=Jo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Jo.prototype)}};Wc=Jo=a([B({type:x.Sequence,itemType:mt})],Wc);const Jc=`${Ct}.14`;class Bt extends Io{}class Yc{constructor(e={}){Object.assign(this,e)}}a([l({type:h.GeneralizedTime,context:0,implicit:!0,optional:!0})],Yc.prototype,"notBefore",void 0),a([l({type:h.GeneralizedTime,context:1,implicit:!0,optional:!0})],Yc.prototype,"notAfter",void 0);var Ur;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Ur||(Ur={}));class Zc extends Vi{toJSON(){const e=[],t=this.toNumber();return t&Ur.pKIXCertificate&&e.push("pKIXCertificate"),t&Ur.newExtensions&&e.push("newExtensions"),t&Ur.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class Qc{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Zc,Object.assign(this,e)}}a([l({type:h.GeneralString})],Qc.prototype,"entrustVers",void 0),a([l({type:Zc})],Qc.prototype,"entrustInfoFlags",void 0);var Yo;let Xc=Yo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};Xc=Yo=a([B({type:x.Sequence,itemType:Mr})],Xc);class D{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof D&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&ka(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:h.ObjectIdentifier})],D.prototype,"algorithm",void 0),a([l({type:h.Any,optional:!0})],D.prototype,"parameters",void 0);class st{constructor(e={}){this.algorithm=new D,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:D})],st.prototype,"algorithm",void 0),a([l({type:h.BitString})],st.prototype,"subjectPublicKey",void 0);let xe=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const t=new Date(e);t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};a([l({type:h.UTCTime})],xe.prototype,"utcTime",void 0),a([l({type:h.GeneralizedTime})],xe.prototype,"generalTime",void 0),xe=a([B({type:x.Choice})],xe);class qi{constructor(e){this.notBefore=new xe(new Date),this.notAfter=new xe(new Date),e&&(this.notBefore=new xe(e.notBefore),this.notAfter=new xe(e.notAfter))}}a([l({type:xe})],qi.prototype,"notBefore",void 0),a([l({type:xe})],qi.prototype,"notAfter",void 0);var Zo;let Qe=class Wu{constructor(e={}){this.extnID="",this.critical=Wu.CRITICAL,this.extnValue=new te,Object.assign(this,e)}};Qe.CRITICAL=!1,a([l({type:h.ObjectIdentifier})],Qe.prototype,"extnID",void 0),a([l({type:h.Boolean,defaultValue:Qe.CRITICAL})],Qe.prototype,"critical",void 0),a([l({type:te})],Qe.prototype,"extnValue",void 0);let qt=Zo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Zo.prototype)}};qt=Zo=a([B({type:x.Sequence,itemType:Qe})],qt);var fr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(fr||(fr={}));class Ke{constructor(e={}){this.version=fr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new D,this.issuer=new me,this.validity=new qi,this.subject=new me,this.subjectPublicKeyInfo=new st,Object.assign(this,e)}}a([l({type:h.Integer,context:0,defaultValue:fr.v1})],Ke.prototype,"version",void 0),a([l({type:h.Integer,converter:ce})],Ke.prototype,"serialNumber",void 0),a([l({type:D})],Ke.prototype,"signature",void 0),a([l({type:me})],Ke.prototype,"issuer",void 0),a([l({type:qi})],Ke.prototype,"validity",void 0),a([l({type:me})],Ke.prototype,"subject",void 0),a([l({type:st})],Ke.prototype,"subjectPublicKeyInfo",void 0),a([l({type:h.BitString,context:1,implicit:!0,optional:!0})],Ke.prototype,"issuerUniqueID",void 0),a([l({type:h.BitString,context:2,implicit:!0,optional:!0})],Ke.prototype,"subjectUniqueID",void 0),a([l({type:qt,context:3,optional:!0})],Ke.prototype,"extensions",void 0);class dr{constructor(e={}){this.tbsCertificate=new Ke,this.signatureAlgorithm=new D,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ke})],dr.prototype,"tbsCertificate",void 0),a([l({type:D})],dr.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],dr.prototype,"signatureValue",void 0);class zi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new xe,Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],zi.prototype,"userCertificate",void 0),a([l({type:xe})],zi.prototype,"revocationDate",void 0),a([l({type:Qe,optional:!0,repeated:"sequence"})],zi.prototype,"crlEntryExtensions",void 0);class bt{constructor(e={}){this.signature=new D,this.issuer=new me,this.thisUpdate=new xe,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],bt.prototype,"version",void 0),a([l({type:D})],bt.prototype,"signature",void 0),a([l({type:me})],bt.prototype,"issuer",void 0),a([l({type:xe})],bt.prototype,"thisUpdate",void 0),a([l({type:xe,optional:!0})],bt.prototype,"nextUpdate",void 0),a([l({type:zi,repeated:"sequence",optional:!0})],bt.prototype,"revokedCertificates",void 0),a([l({type:Qe,optional:!0,context:0,repeated:"sequence"})],bt.prototype,"crlExtensions",void 0);let Qo=class{constructor(e={}){this.tbsCertList=new bt,this.signatureAlgorithm=new D,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:bt})],Qo.prototype,"tbsCertList",void 0),a([l({type:D})],Qo.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Qo.prototype,"signature",void 0);class pr{constructor(e={}){this.issuer=new me,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:me})],pr.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ce})],pr.prototype,"serialNumber",void 0);let hr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Bt,context:0,implicit:!0})],hr.prototype,"subjectKeyIdentifier",void 0),a([l({type:pr})],hr.prototype,"issuerAndSerialNumber",void 0),hr=a([B({type:x.Choice})],hr);var vt;(function(r){r[r.v0=0]="v0",r[r.v1=1]="v1",r[r.v2=2]="v2",r[r.v3=3]="v3",r[r.v4=4]="v4",r[r.v5=5]="v5"})(vt||(vt={}));let Lr=class extends D{};Lr=a([B({type:x.Sequence})],Lr);let Gi=class extends D{};Gi=a([B({type:x.Sequence})],Gi);let at=class extends D{};at=a([B({type:x.Sequence})],at);let Wi=class extends D{};Wi=a([B({type:x.Sequence})],Wi);let el=class extends D{};el=a([B({type:x.Sequence})],el);let Xo=class extends D{};Xo=a([B({type:x.Sequence})],Xo);let yr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],yr.prototype,"attrType",void 0),a([l({type:h.Any,repeated:"set"})],yr.prototype,"attrValues",void 0);var es;class ct{constructor(e={}){this.version=vt.v0,this.sid=new hr,this.digestAlgorithm=new Lr,this.signatureAlgorithm=new Gi,this.signature=new te,Object.assign(this,e)}}a([l({type:h.Integer})],ct.prototype,"version",void 0),a([l({type:hr})],ct.prototype,"sid",void 0),a([l({type:Lr})],ct.prototype,"digestAlgorithm",void 0),a([l({type:yr,repeated:"set",context:0,implicit:!0,optional:!0})],ct.prototype,"signedAttrs",void 0),a([l({type:Gi})],ct.prototype,"signatureAlgorithm",void 0),a([l({type:te})],ct.prototype,"signature",void 0),a([l({type:yr,repeated:"set",context:1,implicit:!0,optional:!0})],ct.prototype,"unsignedAttrs",void 0);let Ji=es=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,es.prototype)}};Ji=es=a([B({type:x.Set,itemType:ct})],Ji);let tl=class extends xe{};tl=a([B({type:x.Choice})],tl);let rl=class extends ct{};rl=a([B({type:x.Sequence})],rl);class ts{constructor(e={}){this.acIssuer=new Z,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:Z})],ts.prototype,"acIssuer",void 0),a([l({type:h.Integer})],ts.prototype,"acSerial",void 0),a([l({type:mt,repeated:"sequence"})],ts.prototype,"attrs",void 0);var rs;let Yi=rs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,rs.prototype)}};Yi=rs=a([B({type:x.Sequence,itemType:h.ObjectIdentifier})],Yi);class Zi{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],Zi.prototype,"pathLenConstraint",void 0),a([l({type:Yi,implicit:!0,context:0,optional:!0})],Zi.prototype,"permittedAttrs",void 0),a([l({type:Yi,implicit:!0,context:1,optional:!0})],Zi.prototype,"excludedAttrs",void 0),a([l({type:h.Boolean,defaultValue:!0})],Zi.prototype,"permitUnSpecified",void 0);class zt{constructor(e={}){this.issuer=new Oe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Oe})],zt.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ce})],zt.prototype,"serial",void 0),a([l({type:h.BitString,optional:!0})],zt.prototype,"issuerUID",void 0);var is;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(is||(is={}));class Gt{constructor(e={}){this.digestedObjectType=is.publicKey,this.digestAlgorithm=new D,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Enumerated})],Gt.prototype,"digestedObjectType",void 0),a([l({type:h.ObjectIdentifier,optional:!0})],Gt.prototype,"otherObjectTypeID",void 0),a([l({type:D})],Gt.prototype,"digestAlgorithm",void 0),a([l({type:h.BitString})],Gt.prototype,"objectDigest",void 0);class Qi{constructor(e={}){Object.assign(this,e)}}a([l({type:Oe,optional:!0})],Qi.prototype,"issuerName",void 0),a([l({type:zt,context:0,implicit:!0,optional:!0})],Qi.prototype,"baseCertificateID",void 0),a([l({type:Gt,context:1,implicit:!0,optional:!0})],Qi.prototype,"objectDigestInfo",void 0);let gr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,repeated:"sequence"})],gr.prototype,"v1Form",void 0),a([l({type:Qi,context:0,implicit:!0})],gr.prototype,"v2Form",void 0),gr=a([B({type:x.Choice})],gr);class Xi{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:h.GeneralizedTime})],Xi.prototype,"notBeforeTime",void 0),a([l({type:h.GeneralizedTime})],Xi.prototype,"notAfterTime",void 0);class Hr{constructor(e={}){Object.assign(this,e)}}a([l({type:zt,implicit:!0,context:0,optional:!0})],Hr.prototype,"baseCertificateID",void 0),a([l({type:Oe,implicit:!0,context:1,optional:!0})],Hr.prototype,"entityName",void 0),a([l({type:Gt,implicit:!0,context:2,optional:!0})],Hr.prototype,"objectDigestInfo",void 0);var ns;(function(r){r[r.v2=1]="v2"})(ns||(ns={}));class Xe{constructor(e={}){this.version=ns.v2,this.holder=new Hr,this.issuer=new gr,this.signature=new D,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Xi,this.attributes=[],Object.assign(this,e)}}a([l({type:h.Integer})],Xe.prototype,"version",void 0),a([l({type:Hr})],Xe.prototype,"holder",void 0),a([l({type:gr})],Xe.prototype,"issuer",void 0),a([l({type:D})],Xe.prototype,"signature",void 0),a([l({type:h.Integer,converter:ce})],Xe.prototype,"serialNumber",void 0),a([l({type:Xi})],Xe.prototype,"attrCertValidityPeriod",void 0),a([l({type:mt,repeated:"sequence"})],Xe.prototype,"attributes",void 0),a([l({type:h.BitString,optional:!0})],Xe.prototype,"issuerUniqueID",void 0),a([l({type:qt,optional:!0})],Xe.prototype,"extensions",void 0);class en{constructor(e={}){this.acinfo=new Xe,this.signatureAlgorithm=new D,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Xe})],en.prototype,"acinfo",void 0),a([l({type:D})],en.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],en.prototype,"signatureValue",void 0);var tn;(function(r){r[r.unmarked=1]="unmarked",r[r.unclassified=2]="unclassified",r[r.restricted=4]="restricted",r[r.confidential=8]="confidential",r[r.secret=16]="secret",r[r.topSecret=32]="topSecret"})(tn||(tn={}));class os extends Vi{}class ss{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier,implicit:!0,context:0})],ss.prototype,"type",void 0),a([l({type:h.Any,implicit:!0,context:1})],ss.prototype,"value",void 0);class as{constructor(e={}){this.policyId="",this.classList=new os(tn.unclassified),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],as.prototype,"policyId",void 0),a([l({type:os,defaultValue:new os(tn.unclassified)})],as.prototype,"classList",void 0),a([l({type:ss,repeated:"set"})],as.prototype,"securityCategories",void 0);class rn{constructor(e={}){Object.assign(this,e)}}a([l({type:te})],rn.prototype,"cotets",void 0),a([l({type:h.ObjectIdentifier})],rn.prototype,"oid",void 0),a([l({type:h.Utf8String})],rn.prototype,"string",void 0);class il{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Oe,implicit:!0,context:0,optional:!0})],il.prototype,"policyAuthority",void 0),a([l({type:rn,repeated:"sequence"})],il.prototype,"values",void 0);var cs;class nn{constructor(e={}){this.targetCertificate=new zt,Object.assign(this,e)}}a([l({type:zt})],nn.prototype,"targetCertificate",void 0),a([l({type:Z,optional:!0})],nn.prototype,"targetName",void 0),a([l({type:Gt,optional:!0})],nn.prototype,"certDigestInfo",void 0);let mr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,context:0,implicit:!0})],mr.prototype,"targetName",void 0),a([l({type:Z,context:1,implicit:!0})],mr.prototype,"targetGroup",void 0),a([l({type:nn,context:2,implicit:!0})],mr.prototype,"targetCert",void 0),mr=a([B({type:x.Choice})],mr);let ls=cs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,cs.prototype)}};ls=cs=a([B({type:x.Sequence,itemType:mr})],ls);var us;let nl=us=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,us.prototype)}};nl=us=a([B({type:x.Sequence,itemType:ls})],nl);class ol{constructor(e={}){Object.assign(this,e)}}a([l({type:Oe,implicit:!0,context:0,optional:!0})],ol.prototype,"roleAuthority",void 0),a([l({type:Z,implicit:!0,context:1})],ol.prototype,"roleName",void 0);class fs{constructor(e={}){this.service=new Z,this.ident=new Z,Object.assign(this,e)}}a([l({type:Z})],fs.prototype,"service",void 0),a([l({type:Z})],fs.prototype,"ident",void 0),a([l({type:te,optional:!0})],fs.prototype,"authInfo",void 0);var ds;class ps{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ps.prototype,"otherCertFormat",void 0),a([l({type:h.Any})],ps.prototype,"otherCert",void 0);let br=class{constructor(e={}){Object.assign(this,e)}};a([l({type:dr})],br.prototype,"certificate",void 0),a([l({type:en,context:2,implicit:!0})],br.prototype,"v2AttrCert",void 0),a([l({type:ps,context:3,implicit:!0})],br.prototype,"other",void 0),br=a([B({type:x.Choice})],br);let on=ds=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ds.prototype)}};on=ds=a([B({type:x.Set,itemType:br})],on);class vr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],vr.prototype,"contentType",void 0),a([l({type:h.Any,context:0})],vr.prototype,"content",void 0);let Fr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:te})],Fr.prototype,"single",void 0),a([l({type:h.Any})],Fr.prototype,"any",void 0),Fr=a([B({type:x.Choice})],Fr);class sn{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],sn.prototype,"eContentType",void 0),a([l({type:Fr,context:0,optional:!0})],sn.prototype,"eContent",void 0);let Kr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:te,context:0,implicit:!0,optional:!0})],Kr.prototype,"value",void 0),a([l({type:te,converter:kf,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Kr.prototype,"constructedValue",void 0),Kr=a([B({type:x.Choice})],Kr);class qr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Wi,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],qr.prototype,"contentType",void 0),a([l({type:Wi})],qr.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:Kr,optional:!0})],qr.prototype,"encryptedContent",void 0);class an{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],an.prototype,"keyAttrId",void 0),a([l({type:h.Any,optional:!0})],an.prototype,"keyAttr",void 0);var hs;class cn{constructor(e={}){this.subjectKeyIdentifier=new Bt,Object.assign(this,e)}}a([l({type:Bt})],cn.prototype,"subjectKeyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],cn.prototype,"date",void 0),a([l({type:an,optional:!0})],cn.prototype,"other",void 0);let wr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:cn,context:0,implicit:!0,optional:!0})],wr.prototype,"rKeyId",void 0),a([l({type:pr,optional:!0})],wr.prototype,"issuerAndSerialNumber",void 0),wr=a([B({type:x.Choice})],wr);class ys{constructor(e={}){this.rid=new wr,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:wr})],ys.prototype,"rid",void 0),a([l({type:te})],ys.prototype,"encryptedKey",void 0);let ln=hs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,hs.prototype)}};ln=hs=a([B({type:x.Sequence,itemType:ys})],ln);class gs{constructor(e={}){this.algorithm=new D,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:D})],gs.prototype,"algorithm",void 0),a([l({type:h.BitString})],gs.prototype,"publicKey",void 0);let Wt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Bt,context:0,implicit:!0,optional:!0})],Wt.prototype,"subjectKeyIdentifier",void 0),a([l({type:gs,context:1,implicit:!0,optional:!0})],Wt.prototype,"originatorKey",void 0),a([l({type:pr,optional:!0})],Wt.prototype,"issuerAndSerialNumber",void 0),Wt=a([B({type:x.Choice})],Wt);class Ar{constructor(e={}){this.version=vt.v3,this.originator=new Wt,this.keyEncryptionAlgorithm=new at,this.recipientEncryptedKeys=new ln,Object.assign(this,e)}}a([l({type:h.Integer})],Ar.prototype,"version",void 0),a([l({type:Wt,context:0})],Ar.prototype,"originator",void 0),a([l({type:te,context:1,optional:!0})],Ar.prototype,"ukm",void 0),a([l({type:at})],Ar.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:ln})],Ar.prototype,"recipientEncryptedKeys",void 0);let Sr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Bt,context:0,implicit:!0})],Sr.prototype,"subjectKeyIdentifier",void 0),a([l({type:pr})],Sr.prototype,"issuerAndSerialNumber",void 0),Sr=a([B({type:x.Choice})],Sr);class zr{constructor(e={}){this.version=vt.v0,this.rid=new Sr,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:h.Integer})],zr.prototype,"version",void 0),a([l({type:Sr})],zr.prototype,"rid",void 0),a([l({type:at})],zr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],zr.prototype,"encryptedKey",void 0);class Gr{constructor(e={}){this.keyIdentifier=new te,Object.assign(this,e)}}a([l({type:te})],Gr.prototype,"keyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],Gr.prototype,"date",void 0),a([l({type:an,optional:!0})],Gr.prototype,"other",void 0);class Wr{constructor(e={}){this.version=vt.v4,this.kekid=new Gr,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:h.Integer})],Wr.prototype,"version",void 0),a([l({type:Gr})],Wr.prototype,"kekid",void 0),a([l({type:at})],Wr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Wr.prototype,"encryptedKey",void 0);class Jr{constructor(e={}){this.version=vt.v0,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:h.Integer})],Jr.prototype,"version",void 0),a([l({type:Xo,context:0,optional:!0})],Jr.prototype,"keyDerivationAlgorithm",void 0),a([l({type:at})],Jr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Jr.prototype,"encryptedKey",void 0);class ms{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ms.prototype,"oriType",void 0),a([l({type:h.Any})],ms.prototype,"oriValue",void 0);let Et=class{constructor(e={}){Object.assign(this,e)}};a([l({type:zr,optional:!0})],Et.prototype,"ktri",void 0),a([l({type:Ar,context:1,implicit:!0,optional:!0})],Et.prototype,"kari",void 0),a([l({type:Wr,context:2,implicit:!0,optional:!0})],Et.prototype,"kekri",void 0),a([l({type:Jr,context:3,implicit:!0,optional:!0})],Et.prototype,"pwri",void 0),a([l({type:ms,context:4,implicit:!0,optional:!0})],Et.prototype,"ori",void 0),Et=a([B({type:x.Choice})],Et);var bs;let un=bs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,bs.prototype)}};un=bs=a([B({type:x.Set,itemType:Et})],un);var vs;class fn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],fn.prototype,"otherRevInfoFormat",void 0),a([l({type:h.Any})],fn.prototype,"otherRevInfo",void 0);let dn=class{constructor(e={}){this.other=new fn,Object.assign(this,e)}};a([l({type:fn,context:1,implicit:!0})],dn.prototype,"other",void 0),dn=a([B({type:x.Choice})],dn);let pn=vs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};pn=vs=a([B({type:x.Set,itemType:dn})],pn);class ws{constructor(e={}){Object.assign(this,e)}}a([l({type:on,context:0,implicit:!0,optional:!0})],ws.prototype,"certs",void 0),a([l({type:pn,context:1,implicit:!0,optional:!0})],ws.prototype,"crls",void 0);var As;let Ss=As=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};Ss=As=a([B({type:x.Set,itemType:yr})],Ss);class Yr{constructor(e={}){this.version=vt.v0,this.recipientInfos=new un,this.encryptedContentInfo=new qr,Object.assign(this,e)}}a([l({type:h.Integer})],Yr.prototype,"version",void 0),a([l({type:ws,context:0,implicit:!0,optional:!0})],Yr.prototype,"originatorInfo",void 0),a([l({type:un})],Yr.prototype,"recipientInfos",void 0),a([l({type:qr})],Yr.prototype,"encryptedContentInfo",void 0),a([l({type:Ss,context:1,implicit:!0,optional:!0})],Yr.prototype,"unprotectedAttrs",void 0);const Jf="1.2.840.113549.1.7.2";var ks;let hn=ks=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ks.prototype)}};hn=ks=a([B({type:x.Set,itemType:Lr})],hn);class kr{constructor(e={}){this.version=vt.v0,this.digestAlgorithms=new hn,this.encapContentInfo=new sn,this.signerInfos=new Ji,Object.assign(this,e)}}a([l({type:h.Integer})],kr.prototype,"version",void 0),a([l({type:hn})],kr.prototype,"digestAlgorithms",void 0),a([l({type:sn})],kr.prototype,"encapContentInfo",void 0),a([l({type:on,context:0,implicit:!0,optional:!0})],kr.prototype,"certificates",void 0),a([l({type:pn,context:1,implicit:!0,optional:!0})],kr.prototype,"crls",void 0),a([l({type:Ji})],kr.prototype,"signerInfos",void 0);const Zr="1.2.840.10045.2.1",xs="1.2.840.10045.4.1",sl="1.2.840.10045.4.3.1",Cs="1.2.840.10045.4.3.2",Bs="1.2.840.10045.4.3.3",Es="1.2.840.10045.4.3.4",al="1.2.840.10045.3.1.7",cl="1.3.132.0.34",ll="1.3.132.0.35";function Qr(r){return new D({algorithm:r})}const Yf=Qr(xs);Qr(sl);const Zf=Qr(Cs),Qf=Qr(Bs),Xf=Qr(Es);let Xr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],Xr.prototype,"fieldType",void 0),a([l({type:h.Any})],Xr.prototype,"parameters",void 0),Xr=a([B({type:x.Sequence})],Xr);class ed extends te{}let xr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.OctetString})],xr.prototype,"a",void 0),a([l({type:h.OctetString})],xr.prototype,"b",void 0),a([l({type:h.BitString,optional:!0})],xr.prototype,"seed",void 0),xr=a([B({type:x.Sequence})],xr);var Is;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Is||(Is={}));let wt=class{constructor(e={}){this.version=Is.ecpVer1,Object.assign(this,e)}};a([l({type:h.Integer})],wt.prototype,"version",void 0),a([l({type:Xr})],wt.prototype,"fieldID",void 0),a([l({type:xr})],wt.prototype,"curve",void 0),a([l({type:ed})],wt.prototype,"base",void 0),a([l({type:h.Integer,converter:ce})],wt.prototype,"order",void 0),a([l({type:h.Integer,optional:!0})],wt.prototype,"cofactor",void 0),wt=a([B({type:x.Sequence})],wt);let It=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],It.prototype,"namedCurve",void 0),a([l({type:h.Null})],It.prototype,"implicitCurve",void 0),a([l({type:wt})],It.prototype,"specifiedCurve",void 0),It=a([B({type:x.Choice})],It);class yn{constructor(e={}){this.version=1,this.privateKey=new te,Object.assign(this,e)}}a([l({type:h.Integer})],yn.prototype,"version",void 0),a([l({type:te})],yn.prototype,"privateKey",void 0),a([l({type:It,context:0,optional:!0})],yn.prototype,"parameters",void 0),a([l({type:h.BitString,context:1,optional:!0})],yn.prototype,"publicKey",void 0);class gn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],gn.prototype,"r",void 0),a([l({type:h.Integer,converter:ce})],gn.prototype,"s",void 0);const Pe="1.2.840.113549.1.1",Jt=`${Pe}.1`,td=`${Pe}.7`,rd=`${Pe}.9`,ei=`${Pe}.10`,id=`${Pe}.2`,nd=`${Pe}.4`,mn=`${Pe}.5`,od=`${Pe}.14`,Ns=`${Pe}.11`,bn=`${Pe}.12`,vn=`${Pe}.13`,ul=`${Pe}.15`,fl=`${Pe}.16`,wn="1.3.14.3.2.26",dl="2.16.840.1.101.3.4.2.4",An="2.16.840.1.101.3.4.2.1",Sn="2.16.840.1.101.3.4.2.2",kn="2.16.840.1.101.3.4.2.3",sd="2.16.840.1.101.3.4.2.5",ad="2.16.840.1.101.3.4.2.6",cd="1.2.840.113549.2.2",ld="1.2.840.113549.2.5",xn=`${Pe}.8`;function be(r){return new D({algorithm:r,parameters:null})}be(cd),be(ld);const Yt=be(wn);be(dl),be(An),be(Sn),be(kn),be(sd),be(ad);const pl=new D({algorithm:xn,parameters:j.serialize(Yt)}),hl=new D({algorithm:rd,parameters:j.serialize(ji.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});be(Jt),be(id),be(nd),be(mn),be(ul),be(fl),be(bn),be(vn),be(ul),be(fl);class Cn{constructor(e={}){this.hashAlgorithm=new D(Yt),this.maskGenAlgorithm=new D({algorithm:xn,parameters:j.serialize(Yt)}),this.pSourceAlgorithm=new D(hl),Object.assign(this,e)}}a([l({type:D,context:0,defaultValue:Yt})],Cn.prototype,"hashAlgorithm",void 0),a([l({type:D,context:1,defaultValue:pl})],Cn.prototype,"maskGenAlgorithm",void 0),a([l({type:D,context:2,defaultValue:hl})],Cn.prototype,"pSourceAlgorithm",void 0),new D({algorithm:td,parameters:j.serialize(new Cn)});class Zt{constructor(e={}){this.hashAlgorithm=new D(Yt),this.maskGenAlgorithm=new D({algorithm:xn,parameters:j.serialize(Yt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:D,context:0,defaultValue:Yt})],Zt.prototype,"hashAlgorithm",void 0),a([l({type:D,context:1,defaultValue:pl})],Zt.prototype,"maskGenAlgorithm",void 0),a([l({type:h.Integer,context:2,defaultValue:20})],Zt.prototype,"saltLength",void 0),a([l({type:h.Integer,context:3,defaultValue:1})],Zt.prototype,"trailerField",void 0),new D({algorithm:ei,parameters:j.serialize(new Zt)});class Bn{constructor(e={}){this.digestAlgorithm=new D,this.digest=new te,Object.assign(this,e)}}a([l({type:D})],Bn.prototype,"digestAlgorithm",void 0),a([l({type:te})],Bn.prototype,"digest",void 0);var Os;class En{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],En.prototype,"prime",void 0),a([l({type:h.Integer,converter:ce})],En.prototype,"exponent",void 0),a([l({type:h.Integer,converter:ce})],En.prototype,"coefficient",void 0);let Ts=Os=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Os.prototype)}};Ts=Os=a([B({type:x.Sequence,itemType:En})],Ts);class lt{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer})],lt.prototype,"version",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"publicExponent",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"privateExponent",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"prime1",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"prime2",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"exponent1",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"exponent2",void 0),a([l({type:h.Integer,converter:ce})],lt.prototype,"coefficient",void 0),a([l({type:Ts,optional:!0})],lt.prototype,"otherPrimeInfos",void 0);class _s{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],_s.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ce})],_s.prototype,"publicExponent",void 0);var Vs;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(Vs||(Vs={}));const Re=Vs;/*! *****************************************************************************
76
76
  Copyright (c) Microsoft Corporation.
77
77
 
78
78
  Permission to use, copy, modify, and/or distribute this software for any
@@ -87,7 +87,7 @@ ${e.join(`
87
87
  PERFORMANCE OF THIS SOFTWARE.
88
88
  ***************************************************************************** */var js=function(r,e){return js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},js(r,e)};function Ps(r,e){js(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ud(r,e,t,i){function n(s){return s instanceof t?s:new t(function(c){c(s)})}return new(t||(t=Promise))(function(s,c){function u(b){try{p(i.next(b))}catch(y){c(y)}}function f(b){try{p(i.throw(b))}catch(y){c(y)}}function p(b){b.done?s(b.value):n(b.value).then(u,f)}p((i=i.apply(r,[])).next())})}function fd(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(b){return f([p,b])}}function f(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=p[0]&2?n.return:p[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,p[1])).done)return s;switch(n=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){t.label=p[1];break}if(p[0]===6&&t.label<s[1]){t.label=s[1],s=p;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(p);break}s[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(b){p=[6,b],n=0}finally{i=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function In(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Nn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],c;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){c={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}return s}function Qt(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Nn(arguments[e]));return r}var dd="injectionTokens";function pd(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(dd,r)||{};return Object.keys(t).forEach(function(i){e[+i]=t[i]}),e}function yl(r){return!!r.useClass}function Rs(r){return!!r.useFactory}var gl=function(){function r(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return r.prototype.createProxy=function(e){var t=this,i={},n=!1,s,c=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(i,this.createHandler(c))},r.prototype.createHandler=function(e){var t={},i=function(n){t[n]=function(){for(var s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];s[0]=e();var u=Reflect[n];return u.apply(void 0,Qt(s))}};return this.reflectMethods.forEach(i),t},r}();function Cr(r){return typeof r=="string"||typeof r=="symbol"}function hd(r){return typeof r=="object"&&"token"in r&&"multiple"in r}function ml(r){return typeof r=="object"&&"token"in r&&"transform"in r}function yd(r){return typeof r=="function"||r instanceof gl}function On(r){return!!r.useToken}function Tn(r){return r.useValue!=null}function gd(r){return yl(r)||Tn(r)||On(r)||Rs(r)}var Ds=function(){function r(){this._registryMap=new Map}return r.prototype.entries=function(){return this._registryMap.entries()},r.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},r.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},r.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},r.prototype.setAll=function(e,t){this._registryMap.set(e,t)},r.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},r.prototype.clear=function(){this._registryMap.clear()},r.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},r}(),md=function(r){Ps(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ds),bl=function(){function r(){this.scopedResolutions=new Map}return r}();function bd(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}function vd(r,e,t){return t===void 0&&(t=" "),Qt([r],e.message.split(`
89
89
  `).map(function(i){return t+i})).join(`
90
- `)}function wd(r,e,t){var i=Nn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,c=bd(s,e);return vd("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function Ad(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var Sd=function(r){Ps(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ds),kd=function(r){Ps(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ds),xd=function(){function r(){this.preResolution=new Sd,this.postResolution=new kd}return r}(),vl=new Map,Cd=function(){function r(e){this.parent=e,this._registry=new md,this.interceptors=new xd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:Re.Transient}),this.ensureNotDisposed();var n;if(gd(t)?n=t:n={useClass:t},On(n))for(var s=[e],c=n;c!=null;){var u=c.useToken;if(s.includes(u))throw new Error("Token registration cycle detected! "+Qt(s,[u]).join(" -> "));s.push(u);var f=this._registry.get(u);f&&On(f.provider)?c=f.provider:c=null}if((i.lifecycle===Re.Singleton||i.lifecycle==Re.ContainerScoped||i.lifecycle==Re.ResolutionScoped)&&(Tn(n)||Rs(n)))throw new Error('Cannot use lifecycle "'+Re[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:i}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),Cr(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},r.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},r.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),Cr(e)){if(Cr(t))return this.register(e,{useToken:t},{lifecycle:Re.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Re.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!Cr(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:Re.Singleton})},r.prototype.resolve=function(e,t){t===void 0&&(t=new bl),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&Cr(e))throw new 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(yd(e)){var n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var i,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var c=In(this.interceptors.preResolution.getAll(e)),u=c.next();!u.done;u=c.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(p){i={error:p}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(e,s)}},r.prototype.executePostResolutionInterceptor=function(e,t,i){var n,s;if(this.interceptors.postResolution.has(e)){var c=[];try{for(var u=In(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var p=f.value;p.options.frequency!="Once"&&c.push(p),p.callback(e,t,i)}}catch(b){n={error:b}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,c)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Re.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===Re.Singleton,n=e.options.lifecycle===Re.ContainerScoped,s=i||n,c;return Tn(e.provider)?c=e.provider.useValue:On(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):yl(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Rs(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===Re.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t){var i=this;t===void 0&&(t=new bl),this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&Cr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),n){var s=n.map(function(u){return i.resolveRegistration(u,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var c=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,c,"All"),c},r.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},r.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},r.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var i=In(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Nn(n.value,2),c=s[0],u=s[1];this._registry.setAll(c,u.filter(function(f){return!Tn(f.provider)}).map(function(f){return f.instance=void 0,f}))}}catch(f){e={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var i=new r(this);try{for(var n=In(this._registry.entries()),s=n.next();!s.done;s=n.next()){var c=Nn(s.value,2),u=c[0],f=c[1];f.some(function(p){var b=p.options;return b.lifecycle===Re.ContainerScoped})&&i._registry.setAll(u,f.map(function(p){return p.options.lifecycle===Re.ContainerScoped?{provider:p.provider,options:p.options}:p}))}}catch(p){e={error:p}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return i},r.prototype.beforeResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:i})},r.prototype.afterResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:i})},r.prototype.dispose=function(){return ud(this,void 0,void 0,function(){var e;return fd(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(i){var n=i.dispose();n&&e.push(n)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},r.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},r.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},r.prototype.construct=function(e,t){var i=this;if(e instanceof gl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=vl.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var c=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Qt([void 0],c)))}();return Ad(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var c,u,f;try{return hd(n)?ml(n)?n.multiple?(c=i.resolve(n.transform)).transform.apply(c,Qt([i.resolveAll(n.token)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Qt([i.resolve(n.token,e)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,e):ml(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Qt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(p){throw new Error(wd(t,s,p))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),Te=new Cd;function Vn(){return function(r){vl.set(r,pd(r))}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var Ms;class _n{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:h.ObjectIdentifier})],_n.prototype,"attrId",void 0),a([l({type:h.Any,repeated:"set"})],_n.prototype,"attrValues",void 0);let wl=Ms=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ms.prototype)}};wl=Ms=a([B({type:x.Sequence,itemType:_n})],wl);var $s;let Al=$s=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,$s.prototype)}};Al=$s=a([B({type:x.Sequence,itemType:vr})],Al);class Sl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Sl.prototype,"certId",void 0),a([l({type:h.Any,context:0})],Sl.prototype,"certValue",void 0);class kl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],kl.prototype,"crlId",void 0),a([l({type:h.Any,context:0})],kl.prototype,"crltValue",void 0);class xl extends te{}let jn=class{constructor(e={}){this.encryptionAlgorithm=new D,this.encryptedData=new xl,Object.assign(this,e)}};a([l({type:D})],jn.prototype,"encryptionAlgorithm",void 0),a([l({type:xl})],jn.prototype,"encryptedData",void 0);var Us,Ls;(function(r){r[r.v1=0]="v1"})(Ls||(Ls={}));class Cl extends te{}let Hs=Us=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Us.prototype)}};Hs=Us=a([B({type:x.Sequence,itemType:mt})],Hs);class ti{constructor(e={}){this.version=Ls.v1,this.privateKeyAlgorithm=new D,this.privateKey=new Cl,Object.assign(this,e)}}a([l({type:h.Integer})],ti.prototype,"version",void 0),a([l({type:D})],ti.prototype,"privateKeyAlgorithm",void 0),a([l({type:Cl})],ti.prototype,"privateKey",void 0),a([l({type:Hs,implicit:!0,context:0,optional:!0})],ti.prototype,"attributes",void 0);let Bl=class extends ti{};Bl=a([B({type:x.Sequence})],Bl);let El=class extends jn{};El=a([B({type:x.Sequence})],El);class Il{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Il.prototype,"secretTypeId",void 0),a([l({type:h.Any,context:0})],Il.prototype,"secretValue",void 0);class ri{constructor(e={}){this.mac=new Bn,this.macSalt=new te,this.iterations=1,Object.assign(this,e)}}a([l({type:Bn})],ri.prototype,"mac",void 0),a([l({type:te})],ri.prototype,"macSalt",void 0),a([l({type:h.Integer,defaultValue:1})],ri.prototype,"iterations",void 0);class Pn{constructor(e={}){this.version=3,this.authSafe=new vr,this.macData=new ri,Object.assign(this,e)}}a([l({type:h.Integer})],Pn.prototype,"version",void 0),a([l({type:vr})],Pn.prototype,"authSafe",void 0),a([l({type:ri,optional:!0})],Pn.prototype,"macData",void 0);var Fs;class Rn{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Rn.prototype,"bagId",void 0),a([l({type:h.Any,context:0})],Rn.prototype,"bagValue",void 0),a([l({type:_n,repeated:"set",optional:!0})],Rn.prototype,"bagAttributes",void 0);let Nl=Fs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Fs.prototype)}};Nl=Fs=a([B({type:x.Sequence,itemType:Rn})],Nl);var Ks,qs,zs;const Ol="1.2.840.113549.1.9",Tl=`${Ol}.7`,Gs=`${Ol}.14`;let Dn=class extends ke{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:h.IA5String})],Dn.prototype,"ia5String",void 0),Dn=a([B({type:x.Choice})],Dn);let Vl=class extends vr{};Vl=a([B({type:x.Sequence})],Vl);let _l=class extends Pn{};_l=a([B({type:x.Sequence})],_l);let jl=class extends jn{};jl=a([B({type:x.Sequence})],jl);let Ws=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.IA5String})],Ws.prototype,"value",void 0),Ws=a([B({type:x.Choice})],Ws);let Pl=class extends Dn{};Pl=a([B({type:x.Choice})],Pl);let Rl=class extends ke{};Rl=a([B({type:x.Choice})],Rl);let Js=class{constructor(e=new Date){this.value=e}};a([l({type:h.GeneralizedTime})],Js.prototype,"value",void 0),Js=a([B({type:x.Choice})],Js);let Dl=class extends ke{};Dl=a([B({type:x.Choice})],Dl);let Ys=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],Ys.prototype,"value",void 0),Ys=a([B({type:x.Choice})],Ys);let Mn=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],Mn.prototype,"value",void 0),Mn=a([B({type:x.Choice})],Mn);let Ml=class extends Mn{};Ml=a([B({type:x.Choice})],Ml);let $l=class extends ke{};$l=a([B({type:x.Choice})],$l);let Zs=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.ObjectIdentifier})],Zs.prototype,"value",void 0),Zs=a([B({type:x.Choice})],Zs);let Ul=class extends xe{};Ul=a([B({type:x.Choice})],Ul);let Qs=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:h.Integer})],Qs.prototype,"value",void 0),Qs=a([B({type:x.Choice})],Qs);let Ll=class extends ct{};Ll=a([B({type:x.Sequence})],Ll);let $n=class extends ke{};$n=a([B({type:x.Choice})],$n);let Hl=Ks=class extends qt{constructor(e){super(e),Object.setPrototypeOf(this,Ks.prototype)}};Hl=Ks=a([B({type:x.Sequence})],Hl);let Fl=qs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,qs.prototype)}};Fl=qs=a([B({type:x.Set,itemType:yr})],Fl);let Xs=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.BmpString})],Xs.prototype,"value",void 0),Xs=a([B({type:x.Choice})],Xs);let ea=class extends D{};ea=a([B({type:x.Sequence})],ea);let Kl=zs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,zs.prototype)}};Kl=zs=a([B({type:x.Sequence,itemType:ea})],Kl);var ta;let Un=ta=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ta.prototype)}};Un=ta=a([B({type:x.Sequence,itemType:mt})],Un);class Br{constructor(e={}){this.version=0,this.subject=new me,this.subjectPKInfo=new st,this.attributes=new Un,Object.assign(this,e)}}a([l({type:h.Integer})],Br.prototype,"version",void 0),a([l({type:me})],Br.prototype,"subject",void 0),a([l({type:st})],Br.prototype,"subjectPKInfo",void 0),a([l({type:Un,implicit:!0,context:0})],Br.prototype,"attributes",void 0);class ii{constructor(e={}){this.certificationRequestInfo=new Br,this.signatureAlgorithm=new D,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Br})],ii.prototype,"certificationRequestInfo",void 0),a([l({type:D})],ii.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],ii.prototype,"signature",void 0);/*!
90
+ `)}function wd(r,e,t){var i=Nn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,c=bd(s,e);return vd("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function Ad(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var Sd=function(r){Ps(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ds),kd=function(r){Ps(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ds),xd=function(){function r(){this.preResolution=new Sd,this.postResolution=new kd}return r}(),vl=new Map,Cd=function(){function r(e){this.parent=e,this._registry=new md,this.interceptors=new xd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:Re.Transient}),this.ensureNotDisposed();var n;if(gd(t)?n=t:n={useClass:t},On(n))for(var s=[e],c=n;c!=null;){var u=c.useToken;if(s.includes(u))throw new Error("Token registration cycle detected! "+Qt(s,[u]).join(" -> "));s.push(u);var f=this._registry.get(u);f&&On(f.provider)?c=f.provider:c=null}if((i.lifecycle===Re.Singleton||i.lifecycle==Re.ContainerScoped||i.lifecycle==Re.ResolutionScoped)&&(Tn(n)||Rs(n)))throw new Error('Cannot use lifecycle "'+Re[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:i}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),Cr(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},r.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},r.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),Cr(e)){if(Cr(t))return this.register(e,{useToken:t},{lifecycle:Re.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Re.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!Cr(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:Re.Singleton})},r.prototype.resolve=function(e,t){t===void 0&&(t=new bl),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&Cr(e))throw new 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(yd(e)){var n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var i,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var c=In(this.interceptors.preResolution.getAll(e)),u=c.next();!u.done;u=c.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(p){i={error:p}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(e,s)}},r.prototype.executePostResolutionInterceptor=function(e,t,i){var n,s;if(this.interceptors.postResolution.has(e)){var c=[];try{for(var u=In(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var p=f.value;p.options.frequency!="Once"&&c.push(p),p.callback(e,t,i)}}catch(b){n={error:b}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,c)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Re.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===Re.Singleton,n=e.options.lifecycle===Re.ContainerScoped,s=i||n,c;return Tn(e.provider)?c=e.provider.useValue:On(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):yl(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Rs(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===Re.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t){var i=this;t===void 0&&(t=new bl),this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&Cr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),n){var s=n.map(function(u){return i.resolveRegistration(u,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var c=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,c,"All"),c},r.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},r.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},r.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var i=In(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Nn(n.value,2),c=s[0],u=s[1];this._registry.setAll(c,u.filter(function(f){return!Tn(f.provider)}).map(function(f){return f.instance=void 0,f}))}}catch(f){e={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var i=new r(this);try{for(var n=In(this._registry.entries()),s=n.next();!s.done;s=n.next()){var c=Nn(s.value,2),u=c[0],f=c[1];f.some(function(p){var b=p.options;return b.lifecycle===Re.ContainerScoped})&&i._registry.setAll(u,f.map(function(p){return p.options.lifecycle===Re.ContainerScoped?{provider:p.provider,options:p.options}:p}))}}catch(p){e={error:p}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return i},r.prototype.beforeResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:i})},r.prototype.afterResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:i})},r.prototype.dispose=function(){return ud(this,void 0,void 0,function(){var e;return fd(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(i){var n=i.dispose();n&&e.push(n)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},r.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},r.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},r.prototype.construct=function(e,t){var i=this;if(e instanceof gl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=vl.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var c=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Qt([void 0],c)))}();return Ad(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var c,u,f;try{return hd(n)?ml(n)?n.multiple?(c=i.resolve(n.transform)).transform.apply(c,Qt([i.resolveAll(n.token)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Qt([i.resolve(n.token,e)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,e):ml(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Qt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(p){throw new Error(wd(t,s,p))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),Te=new Cd;function _n(){return function(r){vl.set(r,pd(r))}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var Ms;class Vn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:h.ObjectIdentifier})],Vn.prototype,"attrId",void 0),a([l({type:h.Any,repeated:"set"})],Vn.prototype,"attrValues",void 0);let wl=Ms=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ms.prototype)}};wl=Ms=a([B({type:x.Sequence,itemType:Vn})],wl);var $s;let Al=$s=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,$s.prototype)}};Al=$s=a([B({type:x.Sequence,itemType:vr})],Al);class Sl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Sl.prototype,"certId",void 0),a([l({type:h.Any,context:0})],Sl.prototype,"certValue",void 0);class kl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],kl.prototype,"crlId",void 0),a([l({type:h.Any,context:0})],kl.prototype,"crltValue",void 0);class xl extends te{}let jn=class{constructor(e={}){this.encryptionAlgorithm=new D,this.encryptedData=new xl,Object.assign(this,e)}};a([l({type:D})],jn.prototype,"encryptionAlgorithm",void 0),a([l({type:xl})],jn.prototype,"encryptedData",void 0);var Us,Ls;(function(r){r[r.v1=0]="v1"})(Ls||(Ls={}));class Cl extends te{}let Hs=Us=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Us.prototype)}};Hs=Us=a([B({type:x.Sequence,itemType:mt})],Hs);class ti{constructor(e={}){this.version=Ls.v1,this.privateKeyAlgorithm=new D,this.privateKey=new Cl,Object.assign(this,e)}}a([l({type:h.Integer})],ti.prototype,"version",void 0),a([l({type:D})],ti.prototype,"privateKeyAlgorithm",void 0),a([l({type:Cl})],ti.prototype,"privateKey",void 0),a([l({type:Hs,implicit:!0,context:0,optional:!0})],ti.prototype,"attributes",void 0);let Bl=class extends ti{};Bl=a([B({type:x.Sequence})],Bl);let El=class extends jn{};El=a([B({type:x.Sequence})],El);class Il{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Il.prototype,"secretTypeId",void 0),a([l({type:h.Any,context:0})],Il.prototype,"secretValue",void 0);class ri{constructor(e={}){this.mac=new Bn,this.macSalt=new te,this.iterations=1,Object.assign(this,e)}}a([l({type:Bn})],ri.prototype,"mac",void 0),a([l({type:te})],ri.prototype,"macSalt",void 0),a([l({type:h.Integer,defaultValue:1})],ri.prototype,"iterations",void 0);class Pn{constructor(e={}){this.version=3,this.authSafe=new vr,this.macData=new ri,Object.assign(this,e)}}a([l({type:h.Integer})],Pn.prototype,"version",void 0),a([l({type:vr})],Pn.prototype,"authSafe",void 0),a([l({type:ri,optional:!0})],Pn.prototype,"macData",void 0);var Fs;class Rn{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Rn.prototype,"bagId",void 0),a([l({type:h.Any,context:0})],Rn.prototype,"bagValue",void 0),a([l({type:Vn,repeated:"set",optional:!0})],Rn.prototype,"bagAttributes",void 0);let Nl=Fs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Fs.prototype)}};Nl=Fs=a([B({type:x.Sequence,itemType:Rn})],Nl);var Ks,qs,zs;const Ol="1.2.840.113549.1.9",Tl=`${Ol}.7`,Gs=`${Ol}.14`;let Dn=class extends ke{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:h.IA5String})],Dn.prototype,"ia5String",void 0),Dn=a([B({type:x.Choice})],Dn);let _l=class extends vr{};_l=a([B({type:x.Sequence})],_l);let Vl=class extends Pn{};Vl=a([B({type:x.Sequence})],Vl);let jl=class extends jn{};jl=a([B({type:x.Sequence})],jl);let Ws=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.IA5String})],Ws.prototype,"value",void 0),Ws=a([B({type:x.Choice})],Ws);let Pl=class extends Dn{};Pl=a([B({type:x.Choice})],Pl);let Rl=class extends ke{};Rl=a([B({type:x.Choice})],Rl);let Js=class{constructor(e=new Date){this.value=e}};a([l({type:h.GeneralizedTime})],Js.prototype,"value",void 0),Js=a([B({type:x.Choice})],Js);let Dl=class extends ke{};Dl=a([B({type:x.Choice})],Dl);let Ys=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],Ys.prototype,"value",void 0),Ys=a([B({type:x.Choice})],Ys);let Mn=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],Mn.prototype,"value",void 0),Mn=a([B({type:x.Choice})],Mn);let Ml=class extends Mn{};Ml=a([B({type:x.Choice})],Ml);let $l=class extends ke{};$l=a([B({type:x.Choice})],$l);let Zs=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.ObjectIdentifier})],Zs.prototype,"value",void 0),Zs=a([B({type:x.Choice})],Zs);let Ul=class extends xe{};Ul=a([B({type:x.Choice})],Ul);let Qs=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:h.Integer})],Qs.prototype,"value",void 0),Qs=a([B({type:x.Choice})],Qs);let Ll=class extends ct{};Ll=a([B({type:x.Sequence})],Ll);let $n=class extends ke{};$n=a([B({type:x.Choice})],$n);let Hl=Ks=class extends qt{constructor(e){super(e),Object.setPrototypeOf(this,Ks.prototype)}};Hl=Ks=a([B({type:x.Sequence})],Hl);let Fl=qs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,qs.prototype)}};Fl=qs=a([B({type:x.Set,itemType:yr})],Fl);let Xs=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.BmpString})],Xs.prototype,"value",void 0),Xs=a([B({type:x.Choice})],Xs);let ea=class extends D{};ea=a([B({type:x.Sequence})],ea);let Kl=zs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,zs.prototype)}};Kl=zs=a([B({type:x.Sequence,itemType:ea})],Kl);var ta;let Un=ta=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ta.prototype)}};Un=ta=a([B({type:x.Sequence,itemType:mt})],Un);class Br{constructor(e={}){this.version=0,this.subject=new me,this.subjectPKInfo=new st,this.attributes=new Un,Object.assign(this,e)}}a([l({type:h.Integer})],Br.prototype,"version",void 0),a([l({type:me})],Br.prototype,"subject",void 0),a([l({type:st})],Br.prototype,"subjectPKInfo",void 0),a([l({type:Un,implicit:!0,context:0})],Br.prototype,"attributes",void 0);class ii{constructor(e={}){this.certificationRequestInfo=new Br,this.signatureAlgorithm=new D,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Br})],ii.prototype,"certificationRequestInfo",void 0),a([l({type:D})],ii.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],ii.prototype,"signature",void 0);/*!
91
91
  * MIT License
92
92
  *
93
93
  * Copyright (c) Peculiar Ventures. All rights reserved.
@@ -110,8 +110,8 @@ ${e.join(`
110
110
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
111
111
  * SOFTWARE.
112
112
  *
113
- */const ni="crypto.algorithm";class Bd{getAlgorithms(){return Te.resolveAll(ni)}toAsnAlgorithm(e){({...e});for(const t of this.getAlgorithms()){const i=t.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){const t=new D({algorithm:e.name});if("parameters"in e){const i=e;t.parameters=i.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const i of this.getAlgorithms()){const n=i.toWebAlgorithm(e);if(n)return n}return{name:e.algorithm,parameters:e.parameters}}}const Er="crypto.algorithmProvider";Te.registerSingleton(Er,Bd);var Ln;const De="1.3.36.3.3.2.8.1.1",ql=`${De}.1`,zl=`${De}.2`,Gl=`${De}.3`,Wl=`${De}.4`,Jl=`${De}.5`,Yl=`${De}.6`,Zl=`${De}.7`,Ql=`${De}.8`,Xl=`${De}.9`,eu=`${De}.10`,tu=`${De}.11`,ru=`${De}.12`,iu=`${De}.13`,nu=`${De}.14`,ou="brainpoolP160r1",su="brainpoolP160t1",au="brainpoolP192r1",cu="brainpoolP192t1",lu="brainpoolP224r1",uu="brainpoolP224t1",fu="brainpoolP256r1",du="brainpoolP256t1",pu="brainpoolP320r1",hu="brainpoolP320t1",yu="brainpoolP384r1",gu="brainpoolP384t1",mu="brainpoolP512r1",bu="brainpoolP512t1",de="ECDSA";let oi=Ln=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case de.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Yf;case"sha-256":return Zf;case"sha-384":return Qf;case"sha-512":return Xf}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=al;break;case"K-256":t=Ln.SECP256K1;break;case"P-384":t=cl;break;case"P-521":t=ll;break;case ou:t=ql;break;case su:t=zl;break;case au:t=Gl;break;case cu:t=Wl;break;case lu:t=Jl;break;case uu:t=Yl;break;case fu:t=Zl;break;case du:t=Ql;break;case pu:t=Xl;break;case hu:t=eu;break;case yu:t=tu;break;case gu:t=ru;break;case mu:t=iu;break;case bu:t=nu;break}if(t)return new D({algorithm:Zr,parameters:j.serialize(new It({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case xs:return{name:de,hash:{name:"SHA-1"}};case Cs:return{name:de,hash:{name:"SHA-256"}};case Bs:return{name:de,hash:{name:"SHA-384"}};case Es:return{name:de,hash:{name:"SHA-512"}};case Zr:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(j.parse(e.parameters,It).namedCurve){case al:return{name:de,namedCurve:"P-256"};case Ln.SECP256K1:return{name:de,namedCurve:"K-256"};case cl:return{name:de,namedCurve:"P-384"};case ll:return{name:de,namedCurve:"P-521"};case ql:return{name:de,namedCurve:ou};case zl:return{name:de,namedCurve:su};case Gl:return{name:de,namedCurve:au};case Wl:return{name:de,namedCurve:cu};case Jl:return{name:de,namedCurve:lu};case Yl:return{name:de,namedCurve:uu};case Zl:return{name:de,namedCurve:fu};case Ql:return{name:de,namedCurve:du};case Xl:return{name:de,namedCurve:pu};case eu:return{name:de,namedCurve:hu};case tu:return{name:de,namedCurve:yu};case ru:return{name:de,namedCurve:gu};case iu:return{name:de,namedCurve:mu};case nu:return{name:de,namedCurve:bu}}}}return null}};oi.SECP256K1="1.3.132.0.10",oi=Ln=a([Vn()],oi),Te.registerSingleton(ni,oi);const vu=Symbol("name"),wu=Symbol("value");class re{constructor(e,t={},i=""){this[vu]=e,this[wu]=i;for(const n in t)this[n]=t[n]}}re.NAME=vu,re.VALUE=wu;class Ed{static toTextObject(e){const t=new re("Algorithm Identifier",{},Nt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case Zr:{const i=new oi().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class Nt{static toString(e){const t=this.items[e];return t||e}}Nt.items={[wn]:"sha1",[dl]:"sha224",[An]:"sha256",[Sn]:"sha384",[kn]:"sha512",[Jt]:"rsaEncryption",[mn]:"sha1WithRSAEncryption",[od]:"sha224WithRSAEncryption",[Ns]:"sha256WithRSAEncryption",[bn]:"sha384WithRSAEncryption",[vn]:"sha512WithRSAEncryption",[Zr]:"ecPublicKey",[xs]:"ecdsaWithSHA1",[sl]:"ecdsaWithSHA224",[Cs]:"ecdsaWithSHA256",[Bs]:"ecdsaWithSHA384",[Es]:"ecdsaWithSHA512",[Ff]:"TLS WWW server authentication",[Kf]:"TLS WWW client authentication",[qf]:"Code Signing",[zf]:"E-mail Protection",[Gf]:"Time Stamping",[Wf]:"OCSP Signing",[Jf]:"Signed Data"};class Xt{static serialize(e){return this.serializeObj(e).join(`
114
- `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const i=[];let n=this.pad(t++),s="";const c=e[re.VALUE];c&&(s=` ${c}`),i.push(`${n}${e[re.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],p=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${p}${f}`);else if(f instanceof Date)i.push(`${n}${p}${f.toUTCString()}`);else if(Array.isArray(f))for(const b of f)b[re.NAME]=u,i.push(...this.serializeObj(b,t));else if(f instanceof re)f[re.NAME]=u,i.push(...this.serializeObj(f,t));else if(_.isBufferSource(f))u?(i.push(`${n}${p}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const b=f.toTextObject();b[re.NAME]=u,i.push(...this.serializeObj(b,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(e,t=0){const i=this.pad(t),n=_.toUint8Array(e),s=[];for(let c=0;c<n.length;){const u=[];for(let f=0;f<16&&c<n.length;f++){f===8&&u.push("");const p=n[c++].toString(16).padStart(2,"0");u.push(p)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Xt.oidSerializer=Nt,Xt.algorithmSerializer=Ed;class Ot{constructor(...e){if(e.length===1){const t=e[0];this.rawData=j.serialize(t),this.onInit(t)}else{const t=j.parse(e[0],e[1]);this.rawData=_.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof Ot?ka(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return j.toString(this.rawData);case"text":return Xt.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new re(this.getTextName(),{},e)}}Ot.NAME="ASN";class qe extends Ot{constructor(...e){let t;_.isBufferSource(e[0])?t=_.toArrayBuffer(e[0]):t=j.serialize(new Qe({extnID:e[0],critical:e[1],extnValue:new te(_.toArrayBuffer(e[2]))})),super(t,Qe)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[re.NAME]===qe.NAME&&(e[re.NAME]=Nt.toString(this.type)),e}}var Au;class Tt{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[Au]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(Tt.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(Tt.DEFAULT,global.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=Tt.DEFAULT){const t=this.items.get(e.toLowerCase());if(!t)throw new Error(`Cannot get Crypto by name '${e}'`);return t}set(e,t){if(typeof e=="string"){if(!t)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),t)}else this.items.set(Tt.DEFAULT,e);return this}}Au=Symbol.toStringTag,Tt.DEFAULT="default";const Ve=new Tt,Id=/^[0-2](?:\.[1-9][0-9]*)+$/;function Nd(r){return new RegExp(Id).test(r)}class Su{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Nd(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Me=new Su;Me.register("CN","2.5.4.3"),Me.register("L","2.5.4.7"),Me.register("ST","2.5.4.8"),Me.register("O","2.5.4.10"),Me.register("OU","2.5.4.11"),Me.register("C","2.5.4.6"),Me.register("DC","0.9.2342.19200300.100.1.25"),Me.register("E","1.2.840.113549.1.9.1"),Me.register("G","2.5.4.42"),Me.register("I","2.5.4.43"),Me.register("SN","2.5.4.4"),Me.register("T","2.5.4.12");function Od(r,e){return`\\${L.ToHex(L.FromUtf8String(e)).toUpperCase()}`}function Td(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Od)}class Vt{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={}){this.extraNames=new Su,this.asn=new me;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];this.extraNames.register(i,n)}typeof e=="string"?this.asn=this.fromString(e):e instanceof me?this.asn=e:_.isBufferSource(e)?this.asn=j.parse(e,me):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Me.findId(e),i=[];for(const n of this.asn)for(const s of n)s.type===t&&i.push(s.value.toString());return i}getName(e){return this.extraNames.get(e)||Me.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${L.ToHex(t.value.anyValue)}`:Td(t.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var e;const t=[];for(const i of this.asn){const n={};for(const s of i){const c=this.getName(s.type)||s.type;(e=n[c])!==null&&e!==void 0||(n[c]=[]),n[c].push(s.value.anyValue?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(n)}return t}fromString(e){const t=new me,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${e},`);){let[,c,u]=n;const f=u[u.length-1];(f===","||f==="+")&&(u=u.slice(0,u.length-1),n[3]=f);const p=n[3];c=this.getTypeOid(c);const b=this.createAttribute(c,u);s==="+"?t[t.length-1].push(b):t.push(new sr([b])),s=p}return t}fromJSON(e){const t=new me;for(const i of e){const n=new sr;for(const s in i){const c=this.getTypeOid(s),u=i[s];for(const f of u){const p=this.createAttribute(c,f);n.push(p)}}t.push(n)}return t}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw new Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,t){const i=new Pi({type:e});if(typeof t=="object")for(const n in t)switch(n){case"ia5String":i.value.ia5String=t[n];break;case"utf8String":i.value.utf8String=t[n];break;case"universalString":i.value.universalString=t[n];break;case"bmpString":i.value.bmpString=t[n];break;case"printableString":i.value.printableString=t[n];break}else if(t[0]==="#")i.value.anyValue=L.FromHex(t.slice(1));else{const n=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:Vt.isPrintableString(n)?i.value.printableString=n:i.value.utf8String=n}return i}processStringValue(e){const t=/"(.*?[^\\])?"/.exec(e);return t&&(e=t[1]),e.replace(/\\0a/ig,`
115
- `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return j.serialize(this.asn)}async getThumbprint(...e){var t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||Ve.get()):i=e[0]||Ve.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const ku="Cannot initialize GeneralName from ASN.1 data.",xu=`${ku} Unsupported string format in use.`,Vd=`${ku} Value doesn't match to GUID regular expression.`,Cu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Bu="1.3.6.1.4.1.311.25.1",Eu="1.3.6.1.4.1.311.20.2.3",ra="dns",ia="dn",na="email",oa="ip",sa="url",aa="guid",ca="upn",Hn="id";class _t extends Ot{constructor(...e){let t;if(e.length===2)switch(e[0]){case ia:{const i=new Vt(e[1]).toArrayBuffer(),n=j.parse(i,me);t=new Z({directoryName:n});break}case ra:t=new Z({dNSName:e[1]});break;case na:t=new Z({rfc822Name:e[1]});break;case aa:{const i=new RegExp(Cu,"i").exec(e[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,c)=>c<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");t=new Z({otherName:new Dr({typeId:Bu,value:j.serialize(new te(L.FromHex(n)))})});break}case oa:t=new Z({iPAddress:e[1]});break;case Hn:t=new Z({registeredID:e[1]});break;case ca:{t=new Z({otherName:new Dr({typeId:Eu,value:j.serialize(Cc.toASN(e[1]))})});break}case sa:t=new Z({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else _.isBufferSource(e[0])?t=j.parse(e[0],Z):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=ra,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=na,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=oa,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=sa,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Hn,this.value=e.registeredID;else if(e.directoryName!=null)this.type=ia,this.value=new Vt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===Bu){this.type=aa;const t=j.parse(e.otherName.value,te),i=new RegExp(Cu,"i").exec(L.ToHex(t));if(!i)throw new Error(Vd);this.value=i.slice(1).map((n,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===Eu)this.type=ca,this.value=j.parse(e.otherName.value,ke).toString();else throw new Error(xu);else throw new Error(xu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case ia:case ra:case aa:case oa:case Hn:case ca:case sa:e=this.type.toUpperCase();break;case na:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Hn&&(t=Nt.toString(t)),new re(e,void 0,t)}}class si extends Ot{constructor(e){let t;if(e instanceof Oe)t=e;else if(Array.isArray(e)){const i=[];for(const n of e)if(n instanceof Z)i.push(n);else{const s=j.parse(new _t(n.type,n.value).rawData,Z);i.push(s)}t=new Oe(i)}else if(_.isBufferSource(e))t=j.parse(e,Oe);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){const t=[];for(const i of e){let n=null;try{n=new _t(i)}catch{continue}t.push(n)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const t of this.items){const i=t.toTextObject();let n=e[i[re.NAME]];Array.isArray(n)||(n=[],e[i[re.NAME]]=n),n.push(i)}return e}}si.NAME="GeneralNames";const ai="-{5}",ci="\\n",_d=`[^${ci}]+`,jd=`${ai}BEGIN (${_d}(?=${ai}))${ai}`,Pd=`${ai}END \\1${ai}`,Ir="\\n",Rd=`[^:${ci}]+`,Dd=`(?:[^${ci}]+${Ir}(?: +[^${ci}]+${Ir})*)`,Md=`(?:[a-zA-Z0-9=+/]+${Ir})+`,Iu=`${jd}${Ir}(?:((?:${Rd}: ${Dd})+))?${Ir}?(${Md})${Pd}`;class Le{static isPem(e){return typeof e=="string"&&new RegExp(Iu,"g").test(e)}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(Iu,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${ci}]+`,"g"),""),c={type:n[1],headers:[],rawData:L.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(Ir,"g"));let p=null;for(const b of f){const[y,K]=b.split(/:(.*)/);if(K===void 0){if(!p)throw new Error("Cannot parse PEM string. Incorrect header value");p.value+=y.trim()}else p&&c.headers.push(p),p={key:y,value:K.trim()}}p&&c.headers.push(p)}i.push(c)}return i}static decode(e){return this.decodeWithHeaders(e).map(i=>i.rawData)}static decodeFirst(e){const t=this.decode(e);if(!t.length)throw new RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){const i=new Array;return t?e.forEach(n=>{if(!_.isBufferSource(n))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:t,rawData:_.toArrayBuffer(n)}))}):e.forEach(n=>{if(!("type"in n))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(n))}),i.join(`
116
- `)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:_.toArrayBuffer(e)})}}static encodeStruct(e){var t;const i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(const p of e.headers)n.push(`${p.key}: ${p.value}`);n.push("")}const s=L.ToBase64(e.rawData);let c,u=0;const f=Array();for(;u<s.length&&(s.length-u<64?c=s.substring(u):(c=s.substring(u,u+64),u+=64),c.length!==0);)if(f.push(c),c.length<64)break;return n.push(...f),n.push(`-----END ${i}-----`),n.join(`
117
- `)}}Le.CertificateTag="CERTIFICATE",Le.CrlTag="CRL",Le.CertificateRequestTag="CERTIFICATE REQUEST",Le.PublicKeyTag="PUBLIC KEY",Le.PrivateKeyTag="PRIVATE KEY";class At extends Ot{static isAsnEncoded(e){return _.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Le.isPem(e))return Le.decode(e)[0];if(L.isHex(e))return L.FromHex(e);if(L.isBase64(e))return L.FromBase64(e);if(L.isBase64Url(e))return L.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=L.ToBinary(e);return Le.isPem(t)?Le.decode(t)[0]:L.isHex(t)?L.FromHex(t):L.isBase64(t)?L.FromBase64(t):L.isBase64Url(t)?L.FromBase64Url(t):_.toArrayBuffer(e)}}constructor(...e){At.isAsnEncoded(e[0])?super(At.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return Le.encode(this.rawData,this.tag);default:return super.toString(e)}}}class ut extends At{static async create(e,t=Ve.get()){if(e instanceof ut)return e;if(Tt.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new ut(i)}else{if(e.publicKey)return e.publicKey;if(_.isBufferSource(e))return new ut(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){At.isAsnEncoded(e)?super(e,st):super(e),this.tag=Le.PublicKeyTag}async export(...e){let t,i=["verify"],n={hash:"SHA-256",...this.algorithm};e.length>1?(n=e[0]||n,i=e[1]||i,t=e[2]||Ve.get()):t=e[0]||Ve.get();let s=this.rawData;const c=j.parse(this.rawData,st);return c.algorithm.algorithm===ei&&(s=$d(c,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=Te.resolve(Er),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Jt:{const n=j.parse(e.subjectPublicKey,Vs),s=_.toUint8Array(n.modulus);i.publicExponent=_.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...e){var t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||Ve.get()):i=e[0]||Ve.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(...e){let t,i="SHA-1";e.length===1?typeof e[0]=="string"?(i=e[0],t=Ve.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Ve.get();const n=j.parse(this.rawData,st);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,st);switch(e.Algorithm=Xt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case Zr:e["EC Point"]=t.subjectPublicKey;break;case Jt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function $d(r,e){return r.algorithm=new D({algorithm:Jt,parameters:null}),e=j.serialize(r),e}class li extends qe{static async create(e,t=!1,i=Ve.get()){if("name"in e&&"serialNumber"in e)return new li(e,t);const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new li(L.ToHex(s),t)}constructor(...e){if(_.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Ft({keyIdentifier:new Io(L.FromHex(e[0]))});super(Eo,e[1],j.serialize(t))}else{const t=e[0],i=t.name instanceof si?j.parse(t.name.rawData,Oe):t.name,n=new Ft({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(t.serialNumber)});super(Eo,e[1],j.serialize(n))}}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,Ft);t.keyIdentifier&&(this.keyId=L.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?L.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,Ft);return t.authorityCertIssuer&&(e["Authority Issuer"]=new si(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}li.NAME="Authority Key Identifier";class Nu extends qe{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Di);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Di({cA:e[0],pathLenConstraint:e[1]});super(Pc,e[2],j.serialize(t)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}}Nu.NAME="Basic Constraints";var Ou;(function(r){r.serverAuth="1.3.6.1.5.5.7.3.1",r.clientAuth="1.3.6.1.5.5.7.3.2",r.codeSigning="1.3.6.1.5.5.7.3.3",r.emailProtection="1.3.6.1.5.5.7.3.4",r.timeStamping="1.3.6.1.5.5.7.3.8",r.ocspSigning="1.3.6.1.5.5.7.3.9"})(Ou||(Ou={}));class Tu extends qe{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Hi);this.usages=t.map(i=>i)}else{const t=new Hi(e[0]);super(Lc,e[1],j.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Nt.toString(t)).join(", "),e}}Tu.NAME="Extended Key Usages";var la;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(la||(la={}));class ua extends qe{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Fo);this.usages=t.toNumber()}else{const t=new Fo(e[0]);super(Fc,e[1],j.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,Fo);return e[""]=t.toJSON().join(", "),e}}ua.NAME="Key Usages";class Fn extends qe{static async create(e,t=!1,i=Ve.get()){const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new Fn(L.ToHex(s),t)}constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Bt);this.keyId=L.ToHex(t)}else{const t=typeof e[0]=="string"?L.FromHex(e[0]):e[0],i=new Bt(t);super(Jc,e[1],j.serialize(i)),this.keyId=L.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,Bt);return e[""]=t,e}}Fn.NAME="Subject Key Identifier";class fa extends qe{constructor(...e){_.isBufferSource(e[0])?super(e[0]):super(Gc,e[1],new si(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,Wo);this.names=new si(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}fa.NAME="Subject Alternative Name";class ze{static register(e,t){this.items.set(e,t)}static create(e){const t=new qe(e),i=this.items.get(t.type);return i?new i(e):t}}ze.items=new Map;class Vu extends qe{constructor(...e){var t;if(_.isBufferSource(e[0])){super(e[0]);const i=j.parse(this.value,Ui);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new Ui(i.map(c=>new $i({policyIdentifier:c})));super(Dc,n,j.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new re("",{},Nt.toString(t))),e}}Vu.NAME="Certificate Policies",ze.register(Dc,Vu);class _u extends qe{constructor(...e){var t;if(_.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(c=>new lr({distributionPoint:new Kt({fullName:[new Z({uniformResourceIdentifier:c})]})})),s=new ur(n);super(Ro,e[1],j.serialize(s))}else{const i=new ur(e[0]);super(Ro,e[1],j.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,ur);this.distributionPoints=t}toTextObject(){const e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(t=>{var i;const n={};return t.distributionPoint&&(n[""]=(i=t.distributionPoint.fullName)===null||i===void 0?void 0:i.map(s=>new _t(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}_u.NAME="CRL Distribution Points";class ju extends qe{constructor(...e){var t,i,n,s;if(_.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof cr){const c=new cr(e[0]);super(Bo,e[1],j.serialize(c))}else{const c=e[0],u=new cr;qn(u,c,Tc,"ocsp"),qn(u,c,Vc,"caIssuers"),qn(u,c,_c,"timeStamping"),qn(u,c,jc,"caRepository"),super(Bo,e[1],j.serialize(u))}(t=this.ocsp)!==null&&t!==void 0||(this.ocsp=[]),(i=this.caIssuers)!==null&&i!==void 0||(this.caIssuers=[]),(n=this.timeStamping)!==null&&n!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],j.parse(e.extnValue,cr).forEach(i=>{switch(i.accessMethod){case Tc:this.ocsp.push(new _t(i.accessLocation));break;case Vc:this.caIssuers.push(new _t(i.accessLocation));break;case _c:this.timeStamping.push(new _t(i.accessLocation));break;case jc:this.caRepository.push(new _t(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&Kn(e,"OCSP",this.ocsp),this.caIssuers.length&&Kn(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&Kn(e,"Time Stamping",this.timeStamping),this.caRepository.length&&Kn(e,"CA Repository",this.caRepository),e}}ju.NAME="Authority Info Access";function Kn(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new re("");t.forEach((n,s)=>{const c=n.toTextObject(),u=`${c[re.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(c)}),r[e]=i}}function qn(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(c=>{typeof c=="string"&&(c=new _t("url",c)),r.push(new Mr({accessMethod:t,accessLocation:j.parse(c.rawData,Z)}))})}class Nr extends Ot{constructor(...e){let t;if(_.isBufferSource(e[0]))t=_.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>_.toArrayBuffer(s)):[];t=j.serialize(new mt({type:i,values:n}))}super(t,mt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new re("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[re.NAME]===Nr.NAME&&(e[re.NAME]=Nt.toString(this.type)),e}}Nr.NAME="Attribute";class Pu extends Nr{constructor(...e){var t;if(_.isBufferSource(e[0]))super(e[0]);else{const i=new $n({printableString:e[0]});super(Tl,[j.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=j.parse(this.values[0],$n);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[re.VALUE]=this.password,e}}Pu.NAME="Challenge Password";class da extends Nr{constructor(...e){var t;if(_.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new qt;for(const s of i)n.push(j.parse(s.rawData,Qe));super(Gs,[j.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=j.parse(this.values[0],qt);this.items=t.map(i=>ze.create(j.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[re.NAME]]=i;return e}}da.NAME="Extensions";class zn{static register(e,t){this.items.set(e,t)}static create(e){const t=new Nr(e),i=this.items.get(t.type);return i?new i(e):t}}zn.items=new Map;const Gn="crypto.signatureFormatter";class Ud{toAsnSignature(e,t){return _.toArrayBuffer(t)}toWebSignature(e,t){return _.toArrayBuffer(t)}}var Wn;let pa=Wn=class{static createPssParams(e,t){const i=Wn.getHashAlgorithm(e);return i?new Zt({hashAlgorithm:i,maskGenAlgorithm:new D({algorithm:xn,parameters:j.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=Te.resolve(Er);return typeof e=="string"?t.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?t.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let t;if(typeof e.hash=="string")t=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")t=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(t.toLowerCase()){case"sha-1":return new D({algorithm:mn,parameters:null});case"sha-256":return new D({algorithm:Ns,parameters:null});case"sha-384":return new D({algorithm:bn,parameters:null});case"sha-512":return new D({algorithm:vn,parameters:null})}}else return new D({algorithm:Jt,parameters:null});break;case"rsa-pss":if("hash"in e){if(!("saltLength"in e&&typeof e.saltLength=="number"))throw new Error("Cannot get 'saltLength' from 'alg' argument");const t=Wn.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new D({algorithm:ei,parameters:j.serialize(t)})}else return new D({algorithm:ei,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Jt:return{name:"RSASSA-PKCS1-v1_5"};case mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Ns:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case bn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case vn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case ei:if(e.parameters){const t=j.parse(e.parameters,Zt);return{name:"RSA-PSS",hash:Te.resolve(Er).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};pa=Wn=a([Vn()],pa),Te.registerSingleton(ni,pa);let ha=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new D({algorithm:wn});case"sha-256":return new D({algorithm:An});case"sha-384":return new D({algorithm:Sn});case"sha-512":return new D({algorithm:kn})}return null}toWebAlgorithm(e){switch(e.algorithm){case wn:return{name:"SHA-1"};case An:return{name:"SHA-256"};case Sn:return{name:"SHA-384"};case kn:return{name:"SHA-512"}}return null}};ha=a([Vn()],ha),Te.registerSingleton(ni,ha);class Ge{addPadding(e,t){const i=_.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}removePadding(e,t=!1){let i=_.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(t&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){const i=e.namedCurve,n=Ge.namedCurveSize.get(i)||Ge.defaultNamedCurveSize,s=new gn,c=_.toUint8Array(t);return s.r=this.removePadding(c.slice(0,n),!0),s.s=this.removePadding(c.slice(n,n+n),!0),j.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=j.parse(t,gn),n=e.namedCurve,s=Ge.namedCurveSize.get(n)||Ge.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return Xu(c,u)}return null}}Ge.namedCurveSize=new Map,Ge.defaultNamedCurveSize=32;const ya="1.3.101.110",Ru="1.3.101.111",ga="1.3.101.112",Du="1.3.101.113";let ma=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=ga;break;case"x25519":t=ya;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=ga;break;case"ed448":t=Du;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=ya;break;case"x448":t=Ru;break}}return t?new D({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case ga:return{name:"Ed25519"};case Du:return{name:"EdDSA",namedCurve:"Ed448"};case ya:return{name:"X25519"};case Ru:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};ma=a([Vn()],ma),Te.registerSingleton(ni,ma);class Ld extends At{constructor(e){At.isAsnEncoded(e)?super(e,ii):super(e),this.tag=Le.CertificateRequestTag}onInit(e){this.tbs=j.serialize(e.certificationRequestInfo),this.publicKey=new ut(e.certificationRequestInfo.subjectPKInfo);const t=Te.resolve(Er);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>zn.create(j.serialize(n)));const i=this.getAttribute(Gs);this.extensions=[],i instanceof da&&(this.extensions=i.items),this.subjectName=new Vt(e.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(e){for(const 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(const 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=Ve.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=Te.resolveAll(Gn).reverse();let s=null;for(const u of n)if(s=u.toWebSignature(t,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,ii),i=t.certificationRequestInfo,n=new re("",{Version:`${fr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new re("");for(const c of this.attributes){const u=c.toTextObject();s[u[re.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new re("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}Ld.NAME="PKCS#10 Certificate Request";class Mu extends At{constructor(e){At.isAsnEncoded(e)?super(e,dr):super(e),this.tag=Le.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=j.serialize(t),this.serialNumber=L.ToHex(t.serialNumber),this.subjectName=new Vt(t.subject),this.subject=new Vt(t.subject).toString(),this.issuerName=new Vt(t.issuer),this.issuer=this.issuerName.toString();const i=Te.resolve(Er);this.signatureAlgorithm=i.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const n=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;const s=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(c=>ze.create(j.serialize(c)))),this.publicKey=new ut(t.subjectPublicKeyInfo)}getExtension(e){for(const t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e={},t=Ve.get()){let i,n;const s=e.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],t);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],t);else if(s instanceof ut)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(_.isBufferSource(s)){const p=new ut(s);i={...p.algorithm,...this.signatureAlgorithm},n=await p.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const c=Te.resolveAll(Gn).reverse();let u=null;for(const p of c)if(u=p.toWebSignature(i,this.signature),u)break;if(!u)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const f=await t.subtle.verify(this.signatureAlgorithm,n,u,this.tbs);if(e.signatureOnly)return f;{const b=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<b&&b<this.notAfter.getTime()}}async getThumbprint(...e){let t,i="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(i=e[0]||i,t=e[1])),t??(t=Ve.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Ve.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,dr),i=t.tbsCertificate,n=new re("",{Version:`${fr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Xt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new re("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new re("");for(const c of this.extensions){const u=c.toTextObject();s[u[re.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new re("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}Mu.NAME="Certificate";var $u;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})($u||($u={})),ze.register(Pc,Nu),ze.register(Lc,Tu),ze.register(Fc,ua),ze.register(Jc,Fn),ze.register(Eo,li),ze.register(Gc,fa),ze.register(Ro,_u),ze.register(Bo,ju),zn.register(Tl,Pu),zn.register(Gs,da),Te.registerSingleton(Gn,Ud),Te.registerSingleton(Gn,Ge),Ge.namedCurveSize.set("P-256",32),Ge.namedCurveSize.set("K-256",32),Ge.namedCurveSize.set("P-384",48),Ge.namedCurveSize.set("P-521",66);function Uu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new Mu(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof fa){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,p)=>{const b=p.type,y=f[b]??[];return{...f,[b]:[...y,p.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof ua){const s=Object.values(la),c=Array(s.length/2).fill(null).reduce((u,f,p)=>{const b=s[s.length/2+p];if(n.usages&b){const y=s[p];u.push(y)}return u},[]);i.keyUsage=c}return i}}}function Hd(){const r=Uu(),e=o.ref({}),t=n=>{if(!(n.id in e.value))try{e.value[n.id]=r.parseMetaCertificateData(n.cert)}catch{e.value[n.id]=void 0}return e.value[n.id]};return{certificateDataCache:e,getCertificateData:n=>{const s=t(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Fd={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Kd(){const r=wa.createI18n("en-us",Fd);return{i18n:r,i18nT:wa.i18nTComponent(r)}}const et={useCertificate:Hd,useI18n:Kd,useX509:Uu},Jn="/v2/control-planes/{controlPlaneId}/core-entities",Yn="/{workspace}",ui={list:{konnect:`${Jn}/certificates`,kongManager:`${Yn}/certificates`},form:{konnect:{create:`${Jn}/certificates`,edit:`${Jn}/certificates/{id}`,validate:`${Jn}/v1/schemas/json/certificate/validate`},kongManager:{create:`${Yn}/certificates`,edit:`${Yn}/certificates/{id}`,validate:`${Yn}/schemas/certificates/validate`}}},qd={class:"kong-ui-entities-certificates-list"},zd={key:0},Gd={key:1},Wd={key:0},Jd={key:1},Yd={key:0},Zd={key:1},Qd={key:1},Xd={key:1},ep=o.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var le;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),u=pi.useRouter(),{axiosInstance:f}=T.useAxios((le=i.config)==null?void 0:le.axiosRequestConfig),p=o.ref(1),b=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),K={subject:{label:n("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:n("certificates.list.table_headers.expiry")},san:{label:n("certificates.list.table_headers.san")},cert:{label:n("certificates.list.table_headers.cert")},tags:{label:n("certificates.list.table_headers.tags"),sortable:!0}},N=o.computed(()=>{var ne,ue;let O=`${i.config.apiBaseUrl}${ui.list[i.config.app]}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((ne=i.config)==null?void 0:ne.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(ue=i.config)!=null&&ue.workspace?`/${i.config.workspace}`:"")),O}),d=o.ref(""),g=o.computed(()=>{const O=i.config.app==="konnect"||i.config.isExactMatch;return O?{isExactMatch:O,placeholder:n("certificates.search.placeholder")}:{isExactMatch:O,schema:i.config.filterSchema}}),{fetcher:A,fetcherState:w}=T.useFetcher(i.config,N.value),I=()=>{d.value=""},k=()=>{p.value++},E=o.ref(null),J=o.ref(!1),se=(O,ne)=>{const ue=O.id;if(!ne(ue)){t("copy:error",{entity:O,field:"id",message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,field:"id",message:n("certificates.copy.success",{val:ue})})},$=(O,ne)=>{const ue=JSON.stringify(O);if(!ne(ue)){t("copy:error",{entity:O,message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,message:n("certificates.copy.success_brief")})},C=async O=>{var ue;await((ue=i.canRetrieve)==null?void 0:ue.call(i,O))&&u.push(i.config.getViewRoute(O.id))},P=O=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(O)}),ye=O=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(O)}),ie=O=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(O)}},Ie=o.ref(void 0),ae=o.ref(!1),pe=o.ref(!1),tt=o.ref(""),X=T.useDeleteUrlBuilder(i.config,N.value),{certificateDataCache:Or,getCertificateData:St}=et.useCertificate(),Tr=O=>{Ie.value=O,ae.value=!0},tr=()=>{ae.value=!1},jt=async()=>{var O,ne,ue;if((O=Ie.value)!=null&&O.id){pe.value=!0;try{await f.delete(X(Ie.value.id)),pe.value=!1,ae.value=!1,p.value++,t("delete:success",Ie.value)}catch(Ce){tt.value=((ue=(ne=Ce.response)==null?void 0:ne.data)==null?void 0:ue.message)||Ce.message||n("certificates.errors.delete"),t("error",Ce)}finally{pe.value=!1}}},q=o.ref(!1);o.watch(w,O=>{var ne,ue,Ce,kt;if(Array.isArray((ne=O==null?void 0:O.response)==null?void 0:ne.data)&&(q.value=O.response.data.length>0),O.status===T.FetcherStatus.NoRecords?J.value=!0:J.value=!1,O.status===T.FetcherStatus.Error){E.value={title:n("certificates.errors.general")},(kt=(Ce=(ue=O.error)==null?void 0:ue.response)==null?void 0:Ce.data)!=null&&kt.message&&(E.value.message=O.error.response.data.message),t("error",O.error);return}Or.value={},E.value=null});const z=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(z.value.title=n("certificates.list.empty_state.title"),z.value.ctaText=n("certificates.actions.create"))}),(O,ne)=>{const ue=o.resolveComponent("KButton"),Ce=o.resolveComponent("KCopy"),kt=o.resolveComponent("KBadge"),Y=o.resolveComponent("KTruncate"),he=o.resolveComponent("KDropdownItem"),We=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",qd,[o.createVNode(o.unref(T.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":b.value,"empty-state-options":z.value,"enable-entity-actions":"","error-message":E.value,fetcher:o.unref(A),"fetcher-cache-key":p.value,"hide-toolbar":J.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:d.value,"table-headers":o.unref(K),onClearSearchInput:I,"onClick:row":ne[2]||(ne[2]=W=>C(W)),onSort:k},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(T.EntityFilter),{modelValue:d.value,"onUpdate:modelValue":ne[0]||(ne[0]=W=>d.value=W),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(ue,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(hi.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["size","to"]),[[o.vShow,q.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:o.withCtx(({row:W})=>{var we;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",zd,o.toDisplayString((we=W==null?void 0:W.metadata)!=null&&we.subject?W.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",Gd,o.toDisplayString(o.unref(St)(W).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:W})=>{var we;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Wd,o.toDisplayString((we=W==null?void 0:W.metadata)!=null&&we.expiry?o.unref(s)(W.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Jd,o.toDisplayString(o.unref(St)(W).schemaExpiry?o.unref(s)(o.unref(St)(W).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:W})=>{var we;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Yd,o.toDisplayString((we=W==null?void 0:W.metadata)!=null&&we.dns_names?`dns=${W.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",Zd,o.toDisplayString(o.unref(St)(W).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:W})=>[W!=null&&W.cert?(o.openBlock(),o.createBlock(Ce,{key:0,"data-testid":"copy-certificate-cert",text:W.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Qd,"-"))]),tags:o.withCtx(({row:W})=>{var we;return[((we=W==null?void 0:W.tags)==null?void 0:we.length)>0?(o.openBlock(),o.createBlock(Y,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(W==null?void 0:W.tags,Pt=>(o.openBlock(),o.createBlock(kt,{key:Pt,onClick:ne[1]||(ne[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Pt),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",Xd,"-"))]}),actions:o.withCtx(({row:W})=>[o.createVNode(We,null,{default:o.withCtx(({copyToClipboard:we})=>[o.createVNode(he,{"data-testid":"action-entity-copy-id",onClick:Pt=>se(W,we)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(We,null,{default:o.withCtx(({copyToClipboard:we})=>[o.createVNode(he,{"data-testid":"action-entity-copy-json",onClick:Pt=>$(W,we)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(W)},{default:o.withCtx(()=>[o.createVNode(he,{"data-testid":"action-entity-view","has-divider":"",item:P(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canEdit(W)},{default:o.withCtx(()=>[o.createVNode(he,{"data-testid":"action-entity-edit",item:ye(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(T.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(he,{"data-testid":"action-entity-add-sni",item:ie(W.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canDelete(W)},{default:o.withCtx(()=>[o.createVNode(he,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:we=>Tr(W)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-toolbar","query","table-headers"]),o.createVNode(o.unref(T.EntityDeleteModal),{"action-pending":pe.value,"entity-type":o.unref(T.EntityTypes).Certificate,error:tt.value,title:o.unref(n)("certificates.delete.title"),visible:ae.value,onCancel:tr,onProceed:jt},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),er=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},tp=er(ep,[["__scopeId","data-v-f98fb157"]]),rp="#d60027",ip={class:"sni-field-container"},np={key:1,class:"sni-field-controls-container"},op={key:0},sp=er(o.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{i18nT:n,i18n:{t:s}}=et.useI18n(),c=o.ref([]);return o.watch(t.modelValue,u=>{c.value=[...u]},{immediate:!0,deep:!0}),o.watch(c,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const p=o.resolveComponent("KLabel"),b=o.resolveComponent("KInput"),y=o.resolveComponent("KButton"),K=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",ip,[o.createVNode(p,{info:o.unref(s)("certificates.form.fields.snis.tooltip")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,(N,d)=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"sni-field-input"},[!r.isEditing||c.value[d]?(o.openBlock(),o.createBlock(b,{key:0,modelValue:c.value[d],"onUpdate:modelValue":g=>c.value[d]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${d+1}`,disabled:r.isEditing,placeholder:o.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):o.createCommentVNode("",!0),r.isEditing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",np,[o.createVNode(y,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>u.$emit("remove",d)},{default:o.withCtx(()=>[o.createVNode(o.unref(hi.TrashIcon),{color:o.unref(rp)},null,8,["color"])]),_:2},1032,["onClick"]),o.createVNode(y,{appearance:"tertiary","data-testid":"add-sni",disabled:d!==c.value.length-1,icon:"",onClick:f[0]||(f[0]=g=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(hi.AddIcon))]),_:2},1032,["disabled"])]))]))),128)),c.value.length===0?(o.openBlock(),o.createElementBlock("div",op,[o.createVNode(y,{onClick:f[1]||(f[1]=N=>u.$emit("add"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):o.createCommentVNode("",!0),r.isEditing?(o.openBlock(),o.createBlock(o.unref(n),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:o.withCtx(()=>[o.createVNode(K,{to:r.sniListRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):o.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),ap={class:"kong-ui-entities-certificates-form"},cp=er(o.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(r,{emit:e}){var se;const t=e,i=r,n=pi.useRouter(),{i18nT:s,i18n:{t:c}}=et.useI18n(),{getMessageFromError:u}=T.useErrors(),{axiosInstance:f}=T.useAxios((se=i.config)==null?void 0:se.axiosRequestConfig),p=o.computed(()=>ui.form[i.config.app].edit),b=o.computed(()=>i.certificateId?T.EntityBaseFormType.Edit:T.EntityBaseFormType.Create),y=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),K=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),N=o.computed(()=>(b.value===T.EntityBaseFormType.Create||JSON.stringify(y.fields)!==JSON.stringify(K))&&!!y.fields.cert&&!!y.fields.key),d=$=>{var C,P;y.fields.cert=($==null?void 0:$.cert)||"",y.fields.key=($==null?void 0:$.key)||"",y.fields.certAlt=($==null?void 0:$.cert_alt)||"",y.fields.keyAlt=($==null?void 0:$.key_alt)||"",y.fields.snis=(C=$==null?void 0:$.snis)!=null&&C.length?$.snis:[""],y.fields.tags=((P=$==null?void 0:$.tags)==null?void 0:P.join(", "))||"",Object.assign(K,y.fields)},g=()=>{n.push(i.config.cancelRoute)},A=()=>{y.fields.snis.push("")},w=$=>{y.fields.snis.splice($,1)},I=o.computed(()=>{var C,P;let $=`${i.config.apiBaseUrl}${ui.form[i.config.app].validate}`;return i.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(P=i.config)!=null&&P.workspace?`/${i.config.workspace}`:"")),$=$.replace(/{id}/gi,i.certificateId),$}),k=o.computed(()=>{var C,P;let $=`${i.config.apiBaseUrl}${ui.form[i.config.app][b.value]}`;return i.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(P=i.config)!=null&&P.workspace?`/${i.config.workspace}`:"")),$=$.replace(/{id}/gi,i.certificateId),$}),E=o.computed(()=>{var $,C;return{cert:y.fields.cert,key:y.fields.key,cert_alt:y.fields.certAlt||null,key_alt:y.fields.keyAlt||null,...i.showSnisField?{snis:y.fields.snis.filter(Boolean)}:{},tags:(C=($=y.fields.tags.split(","))==null?void 0:$.map(P=>String(P||"").trim()))==null?void 0:C.filter(P=>P!=="")}}),J=async()=>{var $,C,P,ye,ie,Ie,ae,pe,tt;try{y.isReadonly=!0;let X;await f.post(I.value,E.value),b.value==="create"?X=await f.post(k.value,E.value):b.value==="edit"&&(X=(($=i.config)==null?void 0:$.app)==="konnect"?await f.put(k.value,E.value):await f.patch(k.value,E.value)),y.fields.cert=((C=X==null?void 0:X.data)==null?void 0:C.cert)||"",y.fields.key=((P=X==null?void 0:X.data)==null?void 0:P.key)||"",y.fields.certAlt=((ye=X==null?void 0:X.data)==null?void 0:ye.cert_alt)||"",y.fields.keyAlt=((ie=X==null?void 0:X.data)==null?void 0:ie.key_alt)||"",y.fields.snis=(ae=(Ie=X==null?void 0:X.data)==null?void 0:Ie.snis)!=null&&ae.length?X.data.snis:[""],y.fields.tags=((tt=(pe=X==null?void 0:X.data)==null?void 0:pe.tags)==null?void 0:tt.join(", "))||"",Object.assign(K,y.fields),t("update",X==null?void 0:X.data)}catch(X){y.errorMessage=u(X),t("error",X)}finally{y.isReadonly=!1}};return($,C)=>{const P=o.resolveComponent("KTextArea"),ye=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",ap,[o.createVNode(o.unref(T.EntityBaseForm),{"can-submit":N.value,config:r.config,"edit-id":r.certificateId,"enable-terraform":r.enableTerraform,"entity-type":o.unref(T.SupportedEntityType).Certificate,"error-message":y.errorMessage,"fetch-url":p.value,"form-fields":E.value,"is-readonly":y.isReadonly,onCancel:g,"onFetch:error":C[7]||(C[7]=ie=>$.$emit("error",ie)),"onFetch:success":d,onLoading:C[8]||(C[8]=ie=>$.$emit("loading",ie)),onSubmit:J},{default:o.withCtx(()=>[o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(c)("certificates.form.sections.ssl.description"),title:o.unref(c)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(P,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=ie=>y.fields.cert=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(c)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(P,{modelValue:y.fields.key,"onUpdate:modelValue":C[1]||(C[1]=ie=>y.fields.key=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(c)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(P,{modelValue:y.fields.certAlt,"onUpdate:modelValue":C[2]||(C[2]=ie=>y.fields.certAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(c)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(P,{modelValue:y.fields.keyAlt,"onUpdate:modelValue":C[3]||(C[3]=ie=>y.fields.keyAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(c)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(sp,{key:0,modelValue:y.fields.snis,"onUpdate:modelValue":C[4]||(C[4]=ie=>y.fields.snis=ie),"is-editing":b.value===o.unref(T.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:A,onRemove:C[5]||(C[5]=ie=>w(ie))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(c)("certificates.form.sections.general.description"),title:o.unref(c)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(ye,{modelValue:y.fields.tags,"onUpdate:modelValue":C[6]||(C[6]=ie=>y.fields.tags=ie),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(c)("certificates.form.fields.tags.help"),label:o.unref(c)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(c)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(c)("certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-db6ee71c"]]),Zn="/v2/control-planes/{controlPlaneId}/core-entities",Qn="/{workspace}",fi={list:{konnect:`${Zn}/ca_certificates`,kongManager:`${Qn}/ca_certificates`},form:{konnect:{create:`${Zn}/ca_certificates`,edit:`${Zn}/ca_certificates/{id}`,validate:`${Zn}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${Qn}/ca_certificates`,edit:`${Qn}/ca_certificates/{id}`,validate:`${Qn}/schemas/ca_certificates/validate`}}},lp={class:"kong-ui-ca-certificate-entity-config-card"},up={key:0},fp=er(o.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=["dns_names","san_names","subject"],i=e,n=r,{i18n:{t:s,formatUnixTimeStamp:c}}=et.useI18n(),{convertKeyToTitle:u}=T.useStringHelpers(),{getPropValue:f}=T.useHelpers(),{getCertificateData:p}=et.useCertificate(),b=o.computed(()=>fi.form[n.config.app].edit),y=o.ref(),K=o.computed(()=>{if(y.value)return p(y.value)}),N=o.computed(()=>{var k;return((k=K.value)==null?void 0:k.schemaIssuer)||""}),d=o.computed(()=>{var k,E;return(k=K.value)!=null&&k.schemaExpiry?c((E=K.value)==null?void 0:E.schemaExpiry):""}),g=o.computed(()=>{var k;return((k=K.value)==null?void 0:k.schemaKeyUsages)||[]}),A=(k,E)=>{const J=f("rowValue",E);if(k==="expiry")return d.value;if(k==="key_usages")return g.value;if(J)return J[k]},w=k=>{y.value=k,i("fetch:success",k)},I=o.ref({id:{},updated_at:{},created_at:{},cert:{section:T.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:T.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:T.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:T.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:T.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(k,E)=>{const J=o.resolveComponent("KCodeBlock"),se=o.resolveComponent("KLabel"),$=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",lp,[o.createVNode(o.unref(T.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":I.value,"enable-terraform":r.enableTerraform,"entity-type":o.unref(T.SupportedEntityType).CaCertificate,"fetch-url":b.value,"hide-title":r.hideTitle,"onFetch:error":E[0]||(E[0]=C=>k.$emit("fetch:error",C)),"onFetch:success":w,onLoading:E[1]||(E[1]=C=>k.$emit("loading",C))},{cert:o.withCtx(C=>[o.unref(f)("rowValue",C)?(o.openBlock(),o.createBlock(J,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",C),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(se,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(C=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",C)).filter(P=>!t.includes(P)),P=>(o.openBlock(),o.createBlock(o.unref(T.ConfigCardItem),{key:P,"data-testid":`ca-cert-metadata-${P}`,item:{key:P,label:o.unref(u)(P),value:A(P,C),type:P==="key_usages"?o.unref(T.ConfigurationSchemaType).BadgeTag:o.unref(T.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(N.value||"–"),1)]),key_usages:o.withCtx(()=>[g.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",up,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,(C,P)=>(o.openBlock(),o.createBlock($,{key:`key_usages-badge-tag-${P}`,class:"config-badge","data-testid":`key_usages-badge-tag-${P}`,tooltip:C,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-46ffa2f8"]]),dp={class:"kong-ui-entities-ca-certificates-list"},pp={key:0},hp={key:1},yp={key:0},gp={key:1},mp={key:1},bp=er(o.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var q;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),u=pi.useRouter(),{axiosInstance:f}=T.useAxios((q=i.config)==null?void 0:q.axiosRequestConfig),p=o.ref(1),b=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),K={issuer:{label:n("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},N=o.computed(()=>{var le,O;let z=`${i.config.apiBaseUrl}${fi.list[i.config.app]}`;return i.config.app==="konnect"?z=z.replace(/{controlPlaneId}/gi,((le=i.config)==null?void 0:le.controlPlaneId)||""):i.config.app==="kongManager"&&(z=z.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),z}),d=o.ref(""),g=o.computed(()=>{const z=i.config.app==="konnect"||i.config.isExactMatch;return z?{isExactMatch:z,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:z,schema:i.config.filterSchema}}),{fetcher:A,fetcherState:w}=T.useFetcher(i.config,N.value),I=()=>{d.value=""},k=()=>{p.value++},E=o.ref(null),J=(z,le)=>{const O=z.id;if(!le(O)){t("copy:error",{entity:z,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:z,field:"id",message:n("ca-certificates.copy.success",{val:O})})},se=(z,le)=>{const O=JSON.stringify(z);if(!le(O)){t("copy:error",{entity:z,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:z,message:n("ca-certificates.copy.success_brief")})},$=async z=>{var O;await((O=i.canRetrieve)==null?void 0:O.call(i,z))&&u.push(i.config.getViewRoute(z.id))},C=z=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(z)}),P=z=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(z)}),ye=o.ref(void 0),ie=o.ref(!1),Ie=o.ref(!1),ae=o.ref(""),pe=T.useDeleteUrlBuilder(i.config,N.value),{certificateDataCache:tt,getCertificateData:X}=et.useCertificate(),Or=z=>{ye.value=z,ie.value=!0},St=()=>{ie.value=!1},Tr=async()=>{var z,le,O;if((z=ye.value)!=null&&z.id){Ie.value=!0;try{await f.delete(pe(ye.value.id)),Ie.value=!1,ie.value=!1,p.value++,t("delete:success",ye.value)}catch(ne){ae.value=((O=(le=ne.response)==null?void 0:le.data)==null?void 0:O.message)||ne.message||n("ca-certificates.errors.delete"),t("error",ne)}finally{Ie.value=!1}}},tr=o.ref(!1);o.watch(w,z=>{var le,O,ne,ue;if(Array.isArray((le=z==null?void 0:z.response)==null?void 0:le.data)&&(tr.value=z.response.data.length>0),z.status===T.FetcherStatus.Error){E.value={title:n("ca-certificates.errors.general")},(ue=(ne=(O=z.error)==null?void 0:O.response)==null?void 0:ne.data)!=null&&ue.message&&(E.value.message=z.error.response.data.message),t("error",z.error);return}tt.value={},E.value=null});const jt=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("ca-certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(jt.value.title=n("ca-certificates.list.empty_state.title"),jt.value.ctaText=n("ca-certificates.actions.create"))}),(z,le)=>{const O=o.resolveComponent("KButton"),ne=o.resolveComponent("KBadge"),ue=o.resolveComponent("KTruncate"),Ce=o.resolveComponent("KDropdownItem"),kt=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",dp,[o.createVNode(o.unref(T.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":b.value,"empty-state-options":jt.value,"enable-entity-actions":"","error-message":E.value,fetcher:o.unref(A),"fetcher-cache-key":p.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:d.value,"table-headers":o.unref(K),onClearSearchInput:I,"onClick:row":le[2]||(le[2]=Y=>$(Y)),onSort:k},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(T.EntityFilter),{modelValue:d.value,"onUpdate:modelValue":le[0]||(le[0]=Y=>d.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(O,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(hi.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["size","to"]),[[o.vShow,tr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:o.withCtx(({row:Y})=>{var he;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",pp,o.toDisplayString((he=Y==null?void 0:Y.metadata)!=null&&he.issuer?Y.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",hp,o.toDisplayString(o.unref(X)(Y).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:Y})=>{var he;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",yp,o.toDisplayString((he=Y==null?void 0:Y.metadata)!=null&&he.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",gp,o.toDisplayString(o.unref(X)(Y).schemaExpiry?o.unref(s)(o.unref(X)(Y).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:Y})=>{var he;return[((he=Y==null?void 0:Y.tags)==null?void 0:he.length)>0?(o.openBlock(),o.createBlock(ue,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Y==null?void 0:Y.tags,We=>(o.openBlock(),o.createBlock(ne,{key:We,onClick:le[1]||(le[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(We),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",mp,"-"))]}),actions:o.withCtx(({row:Y})=>[o.createVNode(kt,null,{default:o.withCtx(({copyToClipboard:he})=>[o.createVNode(Ce,{"data-testid":"action-entity-copy-id",onClick:We=>J(Y,he)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(kt,null,{default:o.withCtx(({copyToClipboard:he})=>[o.createVNode(Ce,{"data-testid":"action-entity-copy-json",onClick:We=>se(Y,he)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(Y)},{default:o.withCtx(()=>[o.createVNode(Ce,{"data-testid":"action-entity-view","has-divider":"",item:C(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canEdit(Y)},{default:o.withCtx(()=>[o.createVNode(Ce,{"data-testid":"action-entity-edit",item:P(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canDelete(Y)},{default:o.withCtx(()=>[o.createVNode(Ce,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:he=>Or(Y)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),o.createVNode(o.unref(T.EntityDeleteModal),{"action-pending":Ie.value,"entity-type":o.unref(T.EntityTypes).CACertificate,error:ae.value,title:o.unref(n)("ca-certificates.delete.title"),visible:ie.value,onCancel:St,onProceed:Tr},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-299a0fc8"]]),vp={class:"kong-ui-entities-ca-certificates-form"},wp=er(o.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(r,{emit:e}){var k;const t=e,i=r,n=pi.useRouter(),{i18n:{t:s}}=et.useI18n(),{getMessageFromError:c}=T.useErrors(),{axiosInstance:u}=T.useAxios((k=i.config)==null?void 0:k.axiosRequestConfig),f=o.computed(()=>fi.form[i.config.app].edit),p=o.computed(()=>i.certificateId?T.EntityBaseFormType.Edit:T.EntityBaseFormType.Create),b=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),y=o.reactive({cert:"",certDigest:"",tags:""}),K=o.computed(()=>(p.value===T.EntityBaseFormType.Create||JSON.stringify(b.fields)!==JSON.stringify(y))&&!!b.fields.cert),N=E=>{var J;b.fields.cert=(E==null?void 0:E.cert)||"",b.fields.certDigest=(E==null?void 0:E.cert_digest)||"",b.fields.tags=((J=E==null?void 0:E.tags)==null?void 0:J.join(", "))||"",Object.assign(y,b.fields)},d=()=>{n.push(i.config.cancelRoute)},g=o.computed(()=>{var J,se;let E=`${i.config.apiBaseUrl}${fi.form[i.config.app].validate}`;return i.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((J=i.config)==null?void 0:J.controlPlaneId)||""):i.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),E=E.replace(/{id}/gi,i.certificateId),E}),A=o.computed(()=>{var J,se;let E=`${i.config.apiBaseUrl}${fi.form[i.config.app][p.value]}`;return i.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((J=i.config)==null?void 0:J.controlPlaneId)||""):i.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),E=E.replace(/{id}/gi,i.certificateId),E}),w=o.computed(()=>{var E,J;return{cert:b.fields.cert,cert_digest:b.fields.certDigest||null,tags:(J=(E=b.fields.tags.split(","))==null?void 0:E.map(se=>String(se||"").trim()))==null?void 0:J.filter(se=>se!=="")}}),I=async()=>{var E,J,se,$,C;try{b.isReadonly=!0;let P;await u.post(g.value,w.value),p.value==="create"?P=await u.post(A.value,w.value):p.value==="edit"&&(P=((E=i.config)==null?void 0:E.app)==="konnect"?await u.put(A.value,w.value):await u.patch(A.value,w.value)),b.fields.cert=((J=P==null?void 0:P.data)==null?void 0:J.cert)||"",b.fields.certDigest=((se=P==null?void 0:P.data)==null?void 0:se.cert_digest)||"",b.fields.tags=((C=($=P==null?void 0:P.data)==null?void 0:$.tags)==null?void 0:C.join(", "))||"",Object.assign(y,b.fields),t("update",P==null?void 0:P.data)}catch(P){b.errorMessage=c(P),t("error",P)}finally{b.isReadonly=!1}};return(E,J)=>{const se=o.resolveComponent("KTextArea"),$=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",vp,[o.createVNode(o.unref(T.EntityBaseForm),{"can-submit":K.value,config:r.config,"edit-id":r.certificateId,"enable-terraform":r.enableTerraform,"entity-type":o.unref(T.SupportedEntityType).CaCertificate,"error-message":b.errorMessage,"fetch-url":f.value,"form-fields":w.value,"is-readonly":b.isReadonly,onCancel:d,"onFetch:error":J[3]||(J[3]=C=>E.$emit("error",C)),"onFetch:success":N,onLoading:J[4]||(J[4]=C=>E.$emit("loading",C)),onSubmit:I},{default:o.withCtx(()=>[o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.cert.description"),title:o.unref(s)("ca-certificates.form.sections.cert.title")},{default:o.withCtx(()=>[o.createVNode(se,{modelValue:b.fields.cert,"onUpdate:modelValue":J[0]||(J[0]=C=>b.fields.cert=C),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:o.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.cert.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:b.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode($,{modelValue:b.fields.certDigest,"onUpdate:modelValue":J[1]||(J[1]=C=>b.fields.certDigest=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:b.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.general.description"),title:o.unref(s)("ca-certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode($,{modelValue:b.fields.tags,"onUpdate:modelValue":J[2]||(J[2]=C=>b.fields.tags=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:o.unref(s)("ca-certificates.form.fields.tags.help"),label:o.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:b.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-1ee1bc34"]]),Ap={class:"kong-ui-certificate-entity-config-card"},Sp={key:0},kp=er(o.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),{convertKeyToTitle:u}=T.useStringHelpers(),{getPropValue:f}=T.useHelpers(),{getCertificateData:p}=et.useCertificate(),b=o.computed(()=>ui.form[i.config.app].edit),y=o.ref(),K=o.ref({id:{},cert:{section:T.ConfigurationSchemaSection.Basic},key:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Redacted},metadata:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Json},snis:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:T.ConfigurationSchemaSection.Advanced},key_alt:{section:T.ConfigurationSchemaSection.Advanced,type:T.ConfigurationSchemaType.Redacted}}),N=C=>{y.value=C,t("fetch:success",C)},d=(C,P)=>{const ye=f("rowValue",P);if(C==="expiry")return A.value;if(C==="key_usages")return E.value;if(C==="san_names")return I.value;if(ye)return ye[C]},g=o.computed(()=>{if(y.value)return p(y.value)}),A=o.computed(()=>{var C,P;return(C=g.value)!=null&&C.schemaExpiry?s((P=g.value)==null?void 0:P.schemaExpiry):""}),w=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaIssuer)||""}),I=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaSanNames)||""}),k=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaSubject)||""}),E=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaKeyUsages)||[]}),J=o.computed(()=>{var C,P;return((P=(C=y==null?void 0:y.value)==null?void 0:C.snis)==null?void 0:P.length)>0}),se=o.computed(()=>{var C;return!!((C=y==null?void 0:y.value)!=null&&C.cert_alt)}),$=C=>{var P,ye;return C==="san_names"?n("certificates.list.table_headers.san"):((ye=(P=K.value)==null?void 0:P[C])==null?void 0:ye.label)||u(C)};return(C,P)=>{const ye=o.resolveComponent("KCodeBlock"),ie=o.resolveComponent("KLabel"),Ie=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",Ap,[o.createVNode(o.unref(T.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":K.value,"enable-terraform":r.enableTerraform,"entity-type":o.unref(T.SupportedEntityType).Certificate,"fetch-url":b.value,"hide-title":r.hideTitle,"onFetch:error":P[0]||(P[0]=ae=>C.$emit("fetch:error",ae)),"onFetch:success":N,onLoading:P[1]||(P[1]=ae=>C.$emit("loading",ae))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:o.withCtx(ae=>[o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(ye,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":o.withCtx(()=>[o.createVNode(ie,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(ae=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",ae)),pe=>(o.openBlock(),o.createBlock(o.unref(T.ConfigCardItem),{key:pe,item:{key:pe,value:d(pe,ae),label:$(pe),type:pe==="key_usages"||pe==="snis"||pe==="dns_names"?o.unref(T.ConfigurationSchemaType).BadgeTag:o.unref(T.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(A.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(I.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:o.withCtx(()=>[E.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Sp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(E.value,(ae,pe)=>(o.openBlock(),o.createBlock(Ie,{key:`key_usages-badge-tag-${pe}`,class:"config-badge","data-testid":`key_usages-badge-tag-${pe}`,tooltip:ae,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ae),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[J.value?void 0:{name:"snis",fn:o.withCtx(()=>[o.createTextVNode(" – ")]),key:"0"},se.value?{name:"cert_alt",fn:o.withCtx(ae=>[o.createTextVNode(" > "),o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(ye,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-c65f3278"]]);Be.CACertificateConfigCard=fp,Be.CACertificateForm=wp,Be.CACertificateList=bp,Be.CertificateConfigCard=kp,Be.CertificateForm=cp,Be.CertificateList=tp,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})});
113
+ */const ni="crypto.algorithm";class Bd{getAlgorithms(){return Te.resolveAll(ni)}toAsnAlgorithm(e){({...e});for(const t of this.getAlgorithms()){const i=t.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){const t=new D({algorithm:e.name});if("parameters"in e){const i=e;t.parameters=i.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const i of this.getAlgorithms()){const n=i.toWebAlgorithm(e);if(n)return n}return{name:e.algorithm,parameters:e.parameters}}}const Er="crypto.algorithmProvider";Te.registerSingleton(Er,Bd);var Ln;const De="1.3.36.3.3.2.8.1.1",ql=`${De}.1`,zl=`${De}.2`,Gl=`${De}.3`,Wl=`${De}.4`,Jl=`${De}.5`,Yl=`${De}.6`,Zl=`${De}.7`,Ql=`${De}.8`,Xl=`${De}.9`,eu=`${De}.10`,tu=`${De}.11`,ru=`${De}.12`,iu=`${De}.13`,nu=`${De}.14`,ou="brainpoolP160r1",su="brainpoolP160t1",au="brainpoolP192r1",cu="brainpoolP192t1",lu="brainpoolP224r1",uu="brainpoolP224t1",fu="brainpoolP256r1",du="brainpoolP256t1",pu="brainpoolP320r1",hu="brainpoolP320t1",yu="brainpoolP384r1",gu="brainpoolP384t1",mu="brainpoolP512r1",bu="brainpoolP512t1",de="ECDSA";let oi=Ln=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case de.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Yf;case"sha-256":return Zf;case"sha-384":return Qf;case"sha-512":return Xf}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=al;break;case"K-256":t=Ln.SECP256K1;break;case"P-384":t=cl;break;case"P-521":t=ll;break;case ou:t=ql;break;case su:t=zl;break;case au:t=Gl;break;case cu:t=Wl;break;case lu:t=Jl;break;case uu:t=Yl;break;case fu:t=Zl;break;case du:t=Ql;break;case pu:t=Xl;break;case hu:t=eu;break;case yu:t=tu;break;case gu:t=ru;break;case mu:t=iu;break;case bu:t=nu;break}if(t)return new D({algorithm:Zr,parameters:j.serialize(new It({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case xs:return{name:de,hash:{name:"SHA-1"}};case Cs:return{name:de,hash:{name:"SHA-256"}};case Bs:return{name:de,hash:{name:"SHA-384"}};case Es:return{name:de,hash:{name:"SHA-512"}};case Zr:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(j.parse(e.parameters,It).namedCurve){case al:return{name:de,namedCurve:"P-256"};case Ln.SECP256K1:return{name:de,namedCurve:"K-256"};case cl:return{name:de,namedCurve:"P-384"};case ll:return{name:de,namedCurve:"P-521"};case ql:return{name:de,namedCurve:ou};case zl:return{name:de,namedCurve:su};case Gl:return{name:de,namedCurve:au};case Wl:return{name:de,namedCurve:cu};case Jl:return{name:de,namedCurve:lu};case Yl:return{name:de,namedCurve:uu};case Zl:return{name:de,namedCurve:fu};case Ql:return{name:de,namedCurve:du};case Xl:return{name:de,namedCurve:pu};case eu:return{name:de,namedCurve:hu};case tu:return{name:de,namedCurve:yu};case ru:return{name:de,namedCurve:gu};case iu:return{name:de,namedCurve:mu};case nu:return{name:de,namedCurve:bu}}}}return null}};oi.SECP256K1="1.3.132.0.10",oi=Ln=a([_n()],oi),Te.registerSingleton(ni,oi);const vu=Symbol("name"),wu=Symbol("value");class re{constructor(e,t={},i=""){this[vu]=e,this[wu]=i;for(const n in t)this[n]=t[n]}}re.NAME=vu,re.VALUE=wu;class Ed{static toTextObject(e){const t=new re("Algorithm Identifier",{},Nt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case Zr:{const i=new oi().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class Nt{static toString(e){const t=this.items[e];return t||e}}Nt.items={[wn]:"sha1",[dl]:"sha224",[An]:"sha256",[Sn]:"sha384",[kn]:"sha512",[Jt]:"rsaEncryption",[mn]:"sha1WithRSAEncryption",[od]:"sha224WithRSAEncryption",[Ns]:"sha256WithRSAEncryption",[bn]:"sha384WithRSAEncryption",[vn]:"sha512WithRSAEncryption",[Zr]:"ecPublicKey",[xs]:"ecdsaWithSHA1",[sl]:"ecdsaWithSHA224",[Cs]:"ecdsaWithSHA256",[Bs]:"ecdsaWithSHA384",[Es]:"ecdsaWithSHA512",[Ff]:"TLS WWW server authentication",[Kf]:"TLS WWW client authentication",[qf]:"Code Signing",[zf]:"E-mail Protection",[Gf]:"Time Stamping",[Wf]:"OCSP Signing",[Jf]:"Signed Data"};class Xt{static serialize(e){return this.serializeObj(e).join(`
114
+ `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const i=[];let n=this.pad(t++),s="";const c=e[re.VALUE];c&&(s=` ${c}`),i.push(`${n}${e[re.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],p=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${p}${f}`);else if(f instanceof Date)i.push(`${n}${p}${f.toUTCString()}`);else if(Array.isArray(f))for(const b of f)b[re.NAME]=u,i.push(...this.serializeObj(b,t));else if(f instanceof re)f[re.NAME]=u,i.push(...this.serializeObj(f,t));else if(V.isBufferSource(f))u?(i.push(`${n}${p}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const b=f.toTextObject();b[re.NAME]=u,i.push(...this.serializeObj(b,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(e,t=0){const i=this.pad(t),n=V.toUint8Array(e),s=[];for(let c=0;c<n.length;){const u=[];for(let f=0;f<16&&c<n.length;f++){f===8&&u.push("");const p=n[c++].toString(16).padStart(2,"0");u.push(p)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Xt.oidSerializer=Nt,Xt.algorithmSerializer=Ed;class Ot{constructor(...e){if(e.length===1){const t=e[0];this.rawData=j.serialize(t),this.onInit(t)}else{const t=j.parse(e[0],e[1]);this.rawData=V.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof Ot?ka(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return j.toString(this.rawData);case"text":return Xt.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new re(this.getTextName(),{},e)}}Ot.NAME="ASN";class qe extends Ot{constructor(...e){let t;V.isBufferSource(e[0])?t=V.toArrayBuffer(e[0]):t=j.serialize(new Qe({extnID:e[0],critical:e[1],extnValue:new te(V.toArrayBuffer(e[2]))})),super(t,Qe)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[re.NAME]===qe.NAME&&(e[re.NAME]=Nt.toString(this.type)),e}}var Au;class Tt{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[Au]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(Tt.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(Tt.DEFAULT,global.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=Tt.DEFAULT){const t=this.items.get(e.toLowerCase());if(!t)throw new Error(`Cannot get Crypto by name '${e}'`);return t}set(e,t){if(typeof e=="string"){if(!t)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),t)}else this.items.set(Tt.DEFAULT,e);return this}}Au=Symbol.toStringTag,Tt.DEFAULT="default";const _e=new Tt,Id=/^[0-2](?:\.[1-9][0-9]*)+$/;function Nd(r){return new RegExp(Id).test(r)}class Su{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Nd(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Me=new Su;Me.register("CN","2.5.4.3"),Me.register("L","2.5.4.7"),Me.register("ST","2.5.4.8"),Me.register("O","2.5.4.10"),Me.register("OU","2.5.4.11"),Me.register("C","2.5.4.6"),Me.register("DC","0.9.2342.19200300.100.1.25"),Me.register("E","1.2.840.113549.1.9.1"),Me.register("G","2.5.4.42"),Me.register("I","2.5.4.43"),Me.register("SN","2.5.4.4"),Me.register("T","2.5.4.12");function Od(r,e){return`\\${L.ToHex(L.FromUtf8String(e)).toUpperCase()}`}function Td(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Od)}class _t{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={}){this.extraNames=new Su,this.asn=new me;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];this.extraNames.register(i,n)}typeof e=="string"?this.asn=this.fromString(e):e instanceof me?this.asn=e:V.isBufferSource(e)?this.asn=j.parse(e,me):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Me.findId(e),i=[];for(const n of this.asn)for(const s of n)s.type===t&&i.push(s.value.toString());return i}getName(e){return this.extraNames.get(e)||Me.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${L.ToHex(t.value.anyValue)}`:Td(t.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var e;const t=[];for(const i of this.asn){const n={};for(const s of i){const c=this.getName(s.type)||s.type;(e=n[c])!==null&&e!==void 0||(n[c]=[]),n[c].push(s.value.anyValue?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(n)}return t}fromString(e){const t=new me,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${e},`);){let[,c,u]=n;const f=u[u.length-1];(f===","||f==="+")&&(u=u.slice(0,u.length-1),n[3]=f);const p=n[3];c=this.getTypeOid(c);const b=this.createAttribute(c,u);s==="+"?t[t.length-1].push(b):t.push(new sr([b])),s=p}return t}fromJSON(e){const t=new me;for(const i of e){const n=new sr;for(const s in i){const c=this.getTypeOid(s),u=i[s];for(const f of u){const p=this.createAttribute(c,f);n.push(p)}}t.push(n)}return t}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw new Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,t){const i=new Pi({type:e});if(typeof t=="object")for(const n in t)switch(n){case"ia5String":i.value.ia5String=t[n];break;case"utf8String":i.value.utf8String=t[n];break;case"universalString":i.value.universalString=t[n];break;case"bmpString":i.value.bmpString=t[n];break;case"printableString":i.value.printableString=t[n];break}else if(t[0]==="#")i.value.anyValue=L.FromHex(t.slice(1));else{const n=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:_t.isPrintableString(n)?i.value.printableString=n:i.value.utf8String=n}return i}processStringValue(e){const t=/"(.*?[^\\])?"/.exec(e);return t&&(e=t[1]),e.replace(/\\0a/ig,`
115
+ `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return j.serialize(this.asn)}async getThumbprint(...e){var t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||_e.get()):i=e[0]||_e.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const ku="Cannot initialize GeneralName from ASN.1 data.",xu=`${ku} Unsupported string format in use.`,_d=`${ku} Value doesn't match to GUID regular expression.`,Cu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Bu="1.3.6.1.4.1.311.25.1",Eu="1.3.6.1.4.1.311.20.2.3",ra="dns",ia="dn",na="email",oa="ip",sa="url",aa="guid",ca="upn",Hn="id";class Vt extends Ot{constructor(...e){let t;if(e.length===2)switch(e[0]){case ia:{const i=new _t(e[1]).toArrayBuffer(),n=j.parse(i,me);t=new Z({directoryName:n});break}case ra:t=new Z({dNSName:e[1]});break;case na:t=new Z({rfc822Name:e[1]});break;case aa:{const i=new RegExp(Cu,"i").exec(e[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,c)=>c<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");t=new Z({otherName:new Dr({typeId:Bu,value:j.serialize(new te(L.FromHex(n)))})});break}case oa:t=new Z({iPAddress:e[1]});break;case Hn:t=new Z({registeredID:e[1]});break;case ca:{t=new Z({otherName:new Dr({typeId:Eu,value:j.serialize(Cc.toASN(e[1]))})});break}case sa:t=new Z({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else V.isBufferSource(e[0])?t=j.parse(e[0],Z):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=ra,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=na,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=oa,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=sa,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Hn,this.value=e.registeredID;else if(e.directoryName!=null)this.type=ia,this.value=new _t(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===Bu){this.type=aa;const t=j.parse(e.otherName.value,te),i=new RegExp(Cu,"i").exec(L.ToHex(t));if(!i)throw new Error(_d);this.value=i.slice(1).map((n,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===Eu)this.type=ca,this.value=j.parse(e.otherName.value,ke).toString();else throw new Error(xu);else throw new Error(xu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case ia:case ra:case aa:case oa:case Hn:case ca:case sa:e=this.type.toUpperCase();break;case na:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Hn&&(t=Nt.toString(t)),new re(e,void 0,t)}}class si extends Ot{constructor(e){let t;if(e instanceof Oe)t=e;else if(Array.isArray(e)){const i=[];for(const n of e)if(n instanceof Z)i.push(n);else{const s=j.parse(new Vt(n.type,n.value).rawData,Z);i.push(s)}t=new Oe(i)}else if(V.isBufferSource(e))t=j.parse(e,Oe);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){const t=[];for(const i of e){let n=null;try{n=new Vt(i)}catch{continue}t.push(n)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const t of this.items){const i=t.toTextObject();let n=e[i[re.NAME]];Array.isArray(n)||(n=[],e[i[re.NAME]]=n),n.push(i)}return e}}si.NAME="GeneralNames";const ai="-{5}",ci="\\n",Vd=`[^${ci}]+`,jd=`${ai}BEGIN (${Vd}(?=${ai}))${ai}`,Pd=`${ai}END \\1${ai}`,Ir="\\n",Rd=`[^:${ci}]+`,Dd=`(?:[^${ci}]+${Ir}(?: +[^${ci}]+${Ir})*)`,Md=`(?:[a-zA-Z0-9=+/]+${Ir})+`,Iu=`${jd}${Ir}(?:((?:${Rd}: ${Dd})+))?${Ir}?(${Md})${Pd}`;class Le{static isPem(e){return typeof e=="string"&&new RegExp(Iu,"g").test(e)}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(Iu,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${ci}]+`,"g"),""),c={type:n[1],headers:[],rawData:L.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(Ir,"g"));let p=null;for(const b of f){const[y,K]=b.split(/:(.*)/);if(K===void 0){if(!p)throw new Error("Cannot parse PEM string. Incorrect header value");p.value+=y.trim()}else p&&c.headers.push(p),p={key:y,value:K.trim()}}p&&c.headers.push(p)}i.push(c)}return i}static decode(e){return this.decodeWithHeaders(e).map(i=>i.rawData)}static decodeFirst(e){const t=this.decode(e);if(!t.length)throw new RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){const i=new Array;return t?e.forEach(n=>{if(!V.isBufferSource(n))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:t,rawData:V.toArrayBuffer(n)}))}):e.forEach(n=>{if(!("type"in n))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(n))}),i.join(`
116
+ `)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:V.toArrayBuffer(e)})}}static encodeStruct(e){var t;const i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(const p of e.headers)n.push(`${p.key}: ${p.value}`);n.push("")}const s=L.ToBase64(e.rawData);let c,u=0;const f=Array();for(;u<s.length&&(s.length-u<64?c=s.substring(u):(c=s.substring(u,u+64),u+=64),c.length!==0);)if(f.push(c),c.length<64)break;return n.push(...f),n.push(`-----END ${i}-----`),n.join(`
117
+ `)}}Le.CertificateTag="CERTIFICATE",Le.CrlTag="CRL",Le.CertificateRequestTag="CERTIFICATE REQUEST",Le.PublicKeyTag="PUBLIC KEY",Le.PrivateKeyTag="PRIVATE KEY";class At extends Ot{static isAsnEncoded(e){return V.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Le.isPem(e))return Le.decode(e)[0];if(L.isHex(e))return L.FromHex(e);if(L.isBase64(e))return L.FromBase64(e);if(L.isBase64Url(e))return L.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=L.ToBinary(e);return Le.isPem(t)?Le.decode(t)[0]:L.isHex(t)?L.FromHex(t):L.isBase64(t)?L.FromBase64(t):L.isBase64Url(t)?L.FromBase64Url(t):V.toArrayBuffer(e)}}constructor(...e){At.isAsnEncoded(e[0])?super(At.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return Le.encode(this.rawData,this.tag);default:return super.toString(e)}}}class ut extends At{static async create(e,t=_e.get()){if(e instanceof ut)return e;if(Tt.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new ut(i)}else{if(e.publicKey)return e.publicKey;if(V.isBufferSource(e))return new ut(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){At.isAsnEncoded(e)?super(e,st):super(e),this.tag=Le.PublicKeyTag}async export(...e){let t,i=["verify"],n={hash:"SHA-256",...this.algorithm};e.length>1?(n=e[0]||n,i=e[1]||i,t=e[2]||_e.get()):t=e[0]||_e.get();let s=this.rawData;const c=j.parse(this.rawData,st);return c.algorithm.algorithm===ei&&(s=$d(c,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=Te.resolve(Er),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Jt:{const n=j.parse(e.subjectPublicKey,_s),s=V.toUint8Array(n.modulus);i.publicExponent=V.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...e){var t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||_e.get()):i=e[0]||_e.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(...e){let t,i="SHA-1";e.length===1?typeof e[0]=="string"?(i=e[0],t=_e.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=_e.get();const n=j.parse(this.rawData,st);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,st);switch(e.Algorithm=Xt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case Zr:e["EC Point"]=t.subjectPublicKey;break;case Jt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function $d(r,e){return r.algorithm=new D({algorithm:Jt,parameters:null}),e=j.serialize(r),e}class li extends qe{static async create(e,t=!1,i=_e.get()){if("name"in e&&"serialNumber"in e)return new li(e,t);const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new li(L.ToHex(s),t)}constructor(...e){if(V.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Ft({keyIdentifier:new Io(L.FromHex(e[0]))});super(Eo,e[1],j.serialize(t))}else{const t=e[0],i=t.name instanceof si?j.parse(t.name.rawData,Oe):t.name,n=new Ft({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(t.serialNumber)});super(Eo,e[1],j.serialize(n))}}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,Ft);t.keyIdentifier&&(this.keyId=L.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?L.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,Ft);return t.authorityCertIssuer&&(e["Authority Issuer"]=new si(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}li.NAME="Authority Key Identifier";class Nu extends qe{constructor(...e){if(V.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Di);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Di({cA:e[0],pathLenConstraint:e[1]});super(Pc,e[2],j.serialize(t)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}}Nu.NAME="Basic Constraints";var Ou;(function(r){r.serverAuth="1.3.6.1.5.5.7.3.1",r.clientAuth="1.3.6.1.5.5.7.3.2",r.codeSigning="1.3.6.1.5.5.7.3.3",r.emailProtection="1.3.6.1.5.5.7.3.4",r.timeStamping="1.3.6.1.5.5.7.3.8",r.ocspSigning="1.3.6.1.5.5.7.3.9"})(Ou||(Ou={}));class Tu extends qe{constructor(...e){if(V.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Hi);this.usages=t.map(i=>i)}else{const t=new Hi(e[0]);super(Lc,e[1],j.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Nt.toString(t)).join(", "),e}}Tu.NAME="Extended Key Usages";var la;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(la||(la={}));class ua extends qe{constructor(...e){if(V.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Fo);this.usages=t.toNumber()}else{const t=new Fo(e[0]);super(Fc,e[1],j.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,Fo);return e[""]=t.toJSON().join(", "),e}}ua.NAME="Key Usages";class Fn extends qe{static async create(e,t=!1,i=_e.get()){const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new Fn(L.ToHex(s),t)}constructor(...e){if(V.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Bt);this.keyId=L.ToHex(t)}else{const t=typeof e[0]=="string"?L.FromHex(e[0]):e[0],i=new Bt(t);super(Jc,e[1],j.serialize(i)),this.keyId=L.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,Bt);return e[""]=t,e}}Fn.NAME="Subject Key Identifier";class fa extends qe{constructor(...e){V.isBufferSource(e[0])?super(e[0]):super(Gc,e[1],new si(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,Wo);this.names=new si(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}fa.NAME="Subject Alternative Name";class ze{static register(e,t){this.items.set(e,t)}static create(e){const t=new qe(e),i=this.items.get(t.type);return i?new i(e):t}}ze.items=new Map;class _u extends qe{constructor(...e){var t;if(V.isBufferSource(e[0])){super(e[0]);const i=j.parse(this.value,Ui);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new Ui(i.map(c=>new $i({policyIdentifier:c})));super(Dc,n,j.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new re("",{},Nt.toString(t))),e}}_u.NAME="Certificate Policies",ze.register(Dc,_u);class Vu extends qe{constructor(...e){var t;if(V.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(c=>new lr({distributionPoint:new Kt({fullName:[new Z({uniformResourceIdentifier:c})]})})),s=new ur(n);super(Ro,e[1],j.serialize(s))}else{const i=new ur(e[0]);super(Ro,e[1],j.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,ur);this.distributionPoints=t}toTextObject(){const e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(t=>{var i;const n={};return t.distributionPoint&&(n[""]=(i=t.distributionPoint.fullName)===null||i===void 0?void 0:i.map(s=>new Vt(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}Vu.NAME="CRL Distribution Points";class ju extends qe{constructor(...e){var t,i,n,s;if(V.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof cr){const c=new cr(e[0]);super(Bo,e[1],j.serialize(c))}else{const c=e[0],u=new cr;qn(u,c,Tc,"ocsp"),qn(u,c,_c,"caIssuers"),qn(u,c,Vc,"timeStamping"),qn(u,c,jc,"caRepository"),super(Bo,e[1],j.serialize(u))}(t=this.ocsp)!==null&&t!==void 0||(this.ocsp=[]),(i=this.caIssuers)!==null&&i!==void 0||(this.caIssuers=[]),(n=this.timeStamping)!==null&&n!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],j.parse(e.extnValue,cr).forEach(i=>{switch(i.accessMethod){case Tc:this.ocsp.push(new Vt(i.accessLocation));break;case _c:this.caIssuers.push(new Vt(i.accessLocation));break;case Vc:this.timeStamping.push(new Vt(i.accessLocation));break;case jc:this.caRepository.push(new Vt(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&Kn(e,"OCSP",this.ocsp),this.caIssuers.length&&Kn(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&Kn(e,"Time Stamping",this.timeStamping),this.caRepository.length&&Kn(e,"CA Repository",this.caRepository),e}}ju.NAME="Authority Info Access";function Kn(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new re("");t.forEach((n,s)=>{const c=n.toTextObject(),u=`${c[re.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(c)}),r[e]=i}}function qn(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(c=>{typeof c=="string"&&(c=new Vt("url",c)),r.push(new Mr({accessMethod:t,accessLocation:j.parse(c.rawData,Z)}))})}class Nr extends Ot{constructor(...e){let t;if(V.isBufferSource(e[0]))t=V.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>V.toArrayBuffer(s)):[];t=j.serialize(new mt({type:i,values:n}))}super(t,mt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new re("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[re.NAME]===Nr.NAME&&(e[re.NAME]=Nt.toString(this.type)),e}}Nr.NAME="Attribute";class Pu extends Nr{constructor(...e){var t;if(V.isBufferSource(e[0]))super(e[0]);else{const i=new $n({printableString:e[0]});super(Tl,[j.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=j.parse(this.values[0],$n);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[re.VALUE]=this.password,e}}Pu.NAME="Challenge Password";class da extends Nr{constructor(...e){var t;if(V.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new qt;for(const s of i)n.push(j.parse(s.rawData,Qe));super(Gs,[j.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=j.parse(this.values[0],qt);this.items=t.map(i=>ze.create(j.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[re.NAME]]=i;return e}}da.NAME="Extensions";class zn{static register(e,t){this.items.set(e,t)}static create(e){const t=new Nr(e),i=this.items.get(t.type);return i?new i(e):t}}zn.items=new Map;const Gn="crypto.signatureFormatter";class Ud{toAsnSignature(e,t){return V.toArrayBuffer(t)}toWebSignature(e,t){return V.toArrayBuffer(t)}}var Wn;let pa=Wn=class{static createPssParams(e,t){const i=Wn.getHashAlgorithm(e);return i?new Zt({hashAlgorithm:i,maskGenAlgorithm:new D({algorithm:xn,parameters:j.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=Te.resolve(Er);return typeof e=="string"?t.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?t.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let t;if(typeof e.hash=="string")t=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")t=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(t.toLowerCase()){case"sha-1":return new D({algorithm:mn,parameters:null});case"sha-256":return new D({algorithm:Ns,parameters:null});case"sha-384":return new D({algorithm:bn,parameters:null});case"sha-512":return new D({algorithm:vn,parameters:null})}}else return new D({algorithm:Jt,parameters:null});break;case"rsa-pss":if("hash"in e){if(!("saltLength"in e&&typeof e.saltLength=="number"))throw new Error("Cannot get 'saltLength' from 'alg' argument");const t=Wn.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new D({algorithm:ei,parameters:j.serialize(t)})}else return new D({algorithm:ei,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Jt:return{name:"RSASSA-PKCS1-v1_5"};case mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Ns:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case bn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case vn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case ei:if(e.parameters){const t=j.parse(e.parameters,Zt);return{name:"RSA-PSS",hash:Te.resolve(Er).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};pa=Wn=a([_n()],pa),Te.registerSingleton(ni,pa);let ha=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new D({algorithm:wn});case"sha-256":return new D({algorithm:An});case"sha-384":return new D({algorithm:Sn});case"sha-512":return new D({algorithm:kn})}return null}toWebAlgorithm(e){switch(e.algorithm){case wn:return{name:"SHA-1"};case An:return{name:"SHA-256"};case Sn:return{name:"SHA-384"};case kn:return{name:"SHA-512"}}return null}};ha=a([_n()],ha),Te.registerSingleton(ni,ha);class Ge{addPadding(e,t){const i=V.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}removePadding(e,t=!1){let i=V.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(t&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){const i=e.namedCurve,n=Ge.namedCurveSize.get(i)||Ge.defaultNamedCurveSize,s=new gn,c=V.toUint8Array(t);return s.r=this.removePadding(c.slice(0,n),!0),s.s=this.removePadding(c.slice(n,n+n),!0),j.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=j.parse(t,gn),n=e.namedCurve,s=Ge.namedCurveSize.get(n)||Ge.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return Xu(c,u)}return null}}Ge.namedCurveSize=new Map,Ge.defaultNamedCurveSize=32;const ya="1.3.101.110",Ru="1.3.101.111",ga="1.3.101.112",Du="1.3.101.113";let ma=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=ga;break;case"x25519":t=ya;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=ga;break;case"ed448":t=Du;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=ya;break;case"x448":t=Ru;break}}return t?new D({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case ga:return{name:"Ed25519"};case Du:return{name:"EdDSA",namedCurve:"Ed448"};case ya:return{name:"X25519"};case Ru:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};ma=a([_n()],ma),Te.registerSingleton(ni,ma);class Ld extends At{constructor(e){At.isAsnEncoded(e)?super(e,ii):super(e),this.tag=Le.CertificateRequestTag}onInit(e){this.tbs=j.serialize(e.certificationRequestInfo),this.publicKey=new ut(e.certificationRequestInfo.subjectPKInfo);const t=Te.resolve(Er);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>zn.create(j.serialize(n)));const i=this.getAttribute(Gs);this.extensions=[],i instanceof da&&(this.extensions=i.items),this.subjectName=new _t(e.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(e){for(const 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(const 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=_e.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=Te.resolveAll(Gn).reverse();let s=null;for(const u of n)if(s=u.toWebSignature(t,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,ii),i=t.certificationRequestInfo,n=new re("",{Version:`${fr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new re("");for(const c of this.attributes){const u=c.toTextObject();s[u[re.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new re("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}Ld.NAME="PKCS#10 Certificate Request";class Mu extends At{constructor(e){At.isAsnEncoded(e)?super(e,dr):super(e),this.tag=Le.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=j.serialize(t),this.serialNumber=L.ToHex(t.serialNumber),this.subjectName=new _t(t.subject),this.subject=new _t(t.subject).toString(),this.issuerName=new _t(t.issuer),this.issuer=this.issuerName.toString();const i=Te.resolve(Er);this.signatureAlgorithm=i.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const n=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;const s=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(c=>ze.create(j.serialize(c)))),this.publicKey=new ut(t.subjectPublicKeyInfo)}getExtension(e){for(const t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e={},t=_e.get()){let i,n;const s=e.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],t);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],t);else if(s instanceof ut)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(V.isBufferSource(s)){const p=new ut(s);i={...p.algorithm,...this.signatureAlgorithm},n=await p.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const c=Te.resolveAll(Gn).reverse();let u=null;for(const p of c)if(u=p.toWebSignature(i,this.signature),u)break;if(!u)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const f=await t.subtle.verify(this.signatureAlgorithm,n,u,this.tbs);if(e.signatureOnly)return f;{const b=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<b&&b<this.notAfter.getTime()}}async getThumbprint(...e){let t,i="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(i=e[0]||i,t=e[1])),t??(t=_e.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=_e.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,dr),i=t.tbsCertificate,n=new re("",{Version:`${fr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Xt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new re("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new re("");for(const c of this.extensions){const u=c.toTextObject();s[u[re.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new re("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}Mu.NAME="Certificate";var $u;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})($u||($u={})),ze.register(Pc,Nu),ze.register(Lc,Tu),ze.register(Fc,ua),ze.register(Jc,Fn),ze.register(Eo,li),ze.register(Gc,fa),ze.register(Ro,Vu),ze.register(Bo,ju),zn.register(Tl,Pu),zn.register(Gs,da),Te.registerSingleton(Gn,Ud),Te.registerSingleton(Gn,Ge),Ge.namedCurveSize.set("P-256",32),Ge.namedCurveSize.set("K-256",32),Ge.namedCurveSize.set("P-384",48),Ge.namedCurveSize.set("P-521",66);function Uu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new Mu(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof fa){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,p)=>{const b=p.type,y=f[b]??[];return{...f,[b]:[...y,p.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof ua){const s=Object.values(la),c=Array(s.length/2).fill(null).reduce((u,f,p)=>{const b=s[s.length/2+p];if(n.usages&b){const y=s[p];u.push(y)}return u},[]);i.keyUsage=c}return i}}}function Hd(){const r=Uu(),e=o.ref({}),t=n=>{if(!(n.id in e.value))try{e.value[n.id]=r.parseMetaCertificateData(n.cert)}catch{e.value[n.id]=void 0}return e.value[n.id]};return{certificateDataCache:e,getCertificateData:n=>{const s=t(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Fd={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Kd(){const r=wa.createI18n("en-us",Fd);return{i18n:r,i18nT:wa.i18nTComponent(r)}}const et={useCertificate:Hd,useI18n:Kd,useX509:Uu},Jn="/v2/control-planes/{controlPlaneId}/core-entities",Yn="/{workspace}",ui={list:{konnect:`${Jn}/certificates`,kongManager:`${Yn}/certificates`},form:{konnect:{create:`${Jn}/certificates`,edit:`${Jn}/certificates/{id}`,validate:`${Jn}/v1/schemas/json/certificate/validate`},kongManager:{create:`${Yn}/certificates`,edit:`${Yn}/certificates/{id}`,validate:`${Yn}/schemas/certificates/validate`}}},qd={class:"kong-ui-entities-certificates-list"},zd={key:0},Gd={key:1},Wd={key:0},Jd={key:1},Yd={key:0},Zd={key:1},Qd={key:1},Xd={key:1},ep=o.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var le;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),u=pi.useRouter(),{axiosInstance:f}=T.useAxios((le=i.config)==null?void 0:le.axiosRequestConfig),p=o.ref(1),b=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),K={subject:{label:n("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:n("certificates.list.table_headers.expiry")},san:{label:n("certificates.list.table_headers.san")},cert:{label:n("certificates.list.table_headers.cert")},tags:{label:n("certificates.list.table_headers.tags"),sortable:!0}},N=o.computed(()=>{var ne,ue;let O=`${i.config.apiBaseUrl}${ui.list[i.config.app]}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((ne=i.config)==null?void 0:ne.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(ue=i.config)!=null&&ue.workspace?`/${i.config.workspace}`:"")),O}),d=o.ref(""),g=o.computed(()=>{const O=i.config.app==="konnect"||i.config.isExactMatch;return O?{isExactMatch:O,placeholder:n("certificates.search.placeholder")}:{isExactMatch:O,schema:i.config.filterSchema}}),{fetcher:A,fetcherState:w}=T.useFetcher(i.config,N.value),I=()=>{d.value=""},k=()=>{p.value++},E=o.ref(null),J=o.ref(!1),se=(O,ne)=>{const ue=O.id;if(!ne(ue)){t("copy:error",{entity:O,field:"id",message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,field:"id",message:n("certificates.copy.success",{val:ue})})},$=(O,ne)=>{const ue=JSON.stringify(O);if(!ne(ue)){t("copy:error",{entity:O,message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,message:n("certificates.copy.success_brief")})},C=async O=>{var ue;await((ue=i.canRetrieve)==null?void 0:ue.call(i,O))&&u.push(i.config.getViewRoute(O.id))},P=O=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(O)}),ye=O=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(O)}),ie=O=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(O)}},Ie=o.ref(void 0),ae=o.ref(!1),pe=o.ref(!1),tt=o.ref(""),X=T.useDeleteUrlBuilder(i.config,N.value),{certificateDataCache:Or,getCertificateData:St}=et.useCertificate(),Tr=O=>{Ie.value=O,ae.value=!0},tr=()=>{ae.value=!1},jt=async()=>{var O,ne,ue;if((O=Ie.value)!=null&&O.id){pe.value=!0;try{await f.delete(X(Ie.value.id)),pe.value=!1,ae.value=!1,p.value++,t("delete:success",Ie.value)}catch(Ce){tt.value=((ue=(ne=Ce.response)==null?void 0:ne.data)==null?void 0:ue.message)||Ce.message||n("certificates.errors.delete"),t("error",Ce)}finally{pe.value=!1}}},q=o.ref(!1);o.watch(w,O=>{var ne,ue,Ce,kt;if(Array.isArray((ne=O==null?void 0:O.response)==null?void 0:ne.data)&&(q.value=O.response.data.length>0),O.status===T.FetcherStatus.NoRecords?J.value=!0:J.value=!1,O.status===T.FetcherStatus.Error){E.value={title:n("certificates.errors.general")},(kt=(Ce=(ue=O.error)==null?void 0:ue.response)==null?void 0:Ce.data)!=null&&kt.message&&(E.value.message=O.error.response.data.message),t("error",O.error);return}Or.value={},E.value=null});const z=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(z.value.title=n("certificates.list.empty_state.title"),z.value.ctaText=n("certificates.actions.create"))}),(O,ne)=>{const ue=o.resolveComponent("KButton"),Ce=o.resolveComponent("KCopy"),kt=o.resolveComponent("KBadge"),Y=o.resolveComponent("KTruncate"),he=o.resolveComponent("KDropdownItem"),We=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",qd,[o.createVNode(o.unref(T.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":b.value,"empty-state-options":z.value,"enable-entity-actions":"","error-message":E.value,fetcher:o.unref(A),"fetcher-cache-key":p.value,"hide-toolbar":J.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:d.value,"table-headers":o.unref(K),onClearSearchInput:I,"onClick:row":ne[2]||(ne[2]=W=>C(W)),onSort:k},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(T.EntityFilter),{modelValue:d.value,"onUpdate:modelValue":ne[0]||(ne[0]=W=>d.value=W),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(ue,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(hi.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["size","to"]),[[o.vShow,q.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:o.withCtx(({row:W})=>{var we;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",zd,o.toDisplayString((we=W==null?void 0:W.metadata)!=null&&we.subject?W.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",Gd,o.toDisplayString(o.unref(St)(W).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:W})=>{var we;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Wd,o.toDisplayString((we=W==null?void 0:W.metadata)!=null&&we.expiry?o.unref(s)(W.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Jd,o.toDisplayString(o.unref(St)(W).schemaExpiry?o.unref(s)(o.unref(St)(W).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:W})=>{var we;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Yd,o.toDisplayString((we=W==null?void 0:W.metadata)!=null&&we.dns_names?`dns=${W.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",Zd,o.toDisplayString(o.unref(St)(W).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:W})=>[W!=null&&W.cert?(o.openBlock(),o.createBlock(Ce,{key:0,"data-testid":"copy-certificate-cert",text:W.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Qd,"-"))]),tags:o.withCtx(({row:W})=>{var we;return[((we=W==null?void 0:W.tags)==null?void 0:we.length)>0?(o.openBlock(),o.createBlock(Y,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(W==null?void 0:W.tags,Pt=>(o.openBlock(),o.createBlock(kt,{key:Pt,onClick:ne[1]||(ne[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Pt),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",Xd,"-"))]}),actions:o.withCtx(({row:W})=>[o.createVNode(We,null,{default:o.withCtx(({copyToClipboard:we})=>[o.createVNode(he,{"data-testid":"action-entity-copy-id",onClick:Pt=>se(W,we)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(We,null,{default:o.withCtx(({copyToClipboard:we})=>[o.createVNode(he,{"data-testid":"action-entity-copy-json",onClick:Pt=>$(W,we)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(W)},{default:o.withCtx(()=>[o.createVNode(he,{"data-testid":"action-entity-view","has-divider":"",item:P(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canEdit(W)},{default:o.withCtx(()=>[o.createVNode(he,{"data-testid":"action-entity-edit",item:ye(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(T.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(he,{"data-testid":"action-entity-add-sni",item:ie(W.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canDelete(W)},{default:o.withCtx(()=>[o.createVNode(he,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:we=>Tr(W)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","hide-toolbar","query","table-headers"]),o.createVNode(o.unref(T.EntityDeleteModal),{"action-pending":pe.value,"entity-type":o.unref(T.EntityTypes).Certificate,error:tt.value,title:o.unref(n)("certificates.delete.title"),visible:ae.value,onCancel:tr,onProceed:jt},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),er=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},tp=er(ep,[["__scopeId","data-v-f98fb157"]]),rp="#d60027",ip={class:"sni-field-container"},np={key:1,class:"sni-field-controls-container"},op={key:0},sp=er(o.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{i18nT:n,i18n:{t:s}}=et.useI18n(),c=o.ref([]);return o.watch(t.modelValue,u=>{c.value=[...u]},{immediate:!0,deep:!0}),o.watch(c,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const p=o.resolveComponent("KLabel"),b=o.resolveComponent("KInput"),y=o.resolveComponent("KButton"),K=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",ip,[o.createVNode(p,{info:o.unref(s)("certificates.form.fields.snis.tooltip")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,(N,d)=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"sni-field-input"},[!r.isEditing||c.value[d]?(o.openBlock(),o.createBlock(b,{key:0,modelValue:c.value[d],"onUpdate:modelValue":g=>c.value[d]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${d+1}`,disabled:r.isEditing,placeholder:o.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):o.createCommentVNode("",!0),r.isEditing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",np,[o.createVNode(y,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>u.$emit("remove",d)},{default:o.withCtx(()=>[o.createVNode(o.unref(hi.TrashIcon),{color:o.unref(rp)},null,8,["color"])]),_:2},1032,["onClick"]),o.createVNode(y,{appearance:"tertiary","data-testid":"add-sni",disabled:d!==c.value.length-1,icon:"",onClick:f[0]||(f[0]=g=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(hi.AddIcon))]),_:2},1032,["disabled"])]))]))),128)),c.value.length===0?(o.openBlock(),o.createElementBlock("div",op,[o.createVNode(y,{onClick:f[1]||(f[1]=N=>u.$emit("add"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):o.createCommentVNode("",!0),r.isEditing?(o.openBlock(),o.createBlock(o.unref(n),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:o.withCtx(()=>[o.createVNode(K,{to:r.sniListRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):o.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),ap={class:"kong-ui-entities-certificates-form"},cp=er(o.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading"],setup(r,{emit:e}){var se;const t=e,i=r,n=pi.useRouter(),{i18nT:s,i18n:{t:c}}=et.useI18n(),{getMessageFromError:u}=T.useErrors(),{axiosInstance:f}=T.useAxios((se=i.config)==null?void 0:se.axiosRequestConfig),p=o.computed(()=>ui.form[i.config.app].edit),b=o.computed(()=>i.certificateId?T.EntityBaseFormType.Edit:T.EntityBaseFormType.Create),y=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),K=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),N=o.computed(()=>(b.value===T.EntityBaseFormType.Create||JSON.stringify(y.fields)!==JSON.stringify(K))&&!!y.fields.cert&&!!y.fields.key),d=$=>{var C,P;y.fields.cert=($==null?void 0:$.cert)||"",y.fields.key=($==null?void 0:$.key)||"",y.fields.certAlt=($==null?void 0:$.cert_alt)||"",y.fields.keyAlt=($==null?void 0:$.key_alt)||"",y.fields.snis=(C=$==null?void 0:$.snis)!=null&&C.length?$.snis:[""],y.fields.tags=((P=$==null?void 0:$.tags)==null?void 0:P.join(", "))||"",Object.assign(K,y.fields)},g=()=>{n.push(i.config.cancelRoute)},A=()=>{y.fields.snis.push("")},w=$=>{y.fields.snis.splice($,1)},I=o.computed(()=>{var C,P;let $=`${i.config.apiBaseUrl}${ui.form[i.config.app].validate}`;return i.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(P=i.config)!=null&&P.workspace?`/${i.config.workspace}`:"")),$=$.replace(/{id}/gi,i.certificateId),$}),k=o.computed(()=>{var C,P;let $=`${i.config.apiBaseUrl}${ui.form[i.config.app][b.value]}`;return i.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(P=i.config)!=null&&P.workspace?`/${i.config.workspace}`:"")),$=$.replace(/{id}/gi,i.certificateId),$}),E=o.computed(()=>{var $,C;return{cert:y.fields.cert,key:y.fields.key,cert_alt:y.fields.certAlt||null,key_alt:y.fields.keyAlt||null,...i.showSnisField?{snis:y.fields.snis.filter(Boolean)}:{},tags:(C=($=y.fields.tags.split(","))==null?void 0:$.map(P=>String(P||"").trim()))==null?void 0:C.filter(P=>P!=="")}}),J=async()=>{var $,C,P,ye,ie,Ie,ae,pe,tt;try{y.isReadonly=!0;let X;await f.post(I.value,E.value),b.value==="create"?X=await f.post(k.value,E.value):b.value==="edit"&&(X=(($=i.config)==null?void 0:$.app)==="konnect"?await f.put(k.value,E.value):await f.patch(k.value,E.value)),y.fields.cert=((C=X==null?void 0:X.data)==null?void 0:C.cert)||"",y.fields.key=((P=X==null?void 0:X.data)==null?void 0:P.key)||"",y.fields.certAlt=((ye=X==null?void 0:X.data)==null?void 0:ye.cert_alt)||"",y.fields.keyAlt=((ie=X==null?void 0:X.data)==null?void 0:ie.key_alt)||"",y.fields.snis=(ae=(Ie=X==null?void 0:X.data)==null?void 0:Ie.snis)!=null&&ae.length?X.data.snis:[""],y.fields.tags=((tt=(pe=X==null?void 0:X.data)==null?void 0:pe.tags)==null?void 0:tt.join(", "))||"",Object.assign(K,y.fields),t("update",X==null?void 0:X.data)}catch(X){y.errorMessage=u(X),t("error",X)}finally{y.isReadonly=!1}};return($,C)=>{const P=o.resolveComponent("KTextArea"),ye=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",ap,[o.createVNode(o.unref(T.EntityBaseForm),{"can-submit":N.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(T.SupportedEntityType).Certificate,"error-message":y.errorMessage,"fetch-url":p.value,"form-fields":E.value,"is-readonly":y.isReadonly,onCancel:g,"onFetch:error":C[7]||(C[7]=ie=>$.$emit("error",ie)),"onFetch:success":d,onLoading:C[8]||(C[8]=ie=>$.$emit("loading",ie)),onSubmit:J},{default:o.withCtx(()=>[o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(c)("certificates.form.sections.ssl.description"),title:o.unref(c)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(P,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=ie=>y.fields.cert=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(c)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(P,{modelValue:y.fields.key,"onUpdate:modelValue":C[1]||(C[1]=ie=>y.fields.key=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(c)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(P,{modelValue:y.fields.certAlt,"onUpdate:modelValue":C[2]||(C[2]=ie=>y.fields.certAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(c)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(P,{modelValue:y.fields.keyAlt,"onUpdate:modelValue":C[3]||(C[3]=ie=>y.fields.keyAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(c)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(sp,{key:0,modelValue:y.fields.snis,"onUpdate:modelValue":C[4]||(C[4]=ie=>y.fields.snis=ie),"is-editing":b.value===o.unref(T.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:A,onRemove:C[5]||(C[5]=ie=>w(ie))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(c)("certificates.form.sections.general.description"),title:o.unref(c)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(ye,{modelValue:y.fields.tags,"onUpdate:modelValue":C[6]||(C[6]=ie=>y.fields.tags=ie),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(c)("certificates.form.fields.tags.help"),label:o.unref(c)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(c)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(c)("certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-fc596de1"]]),Zn="/v2/control-planes/{controlPlaneId}/core-entities",Qn="/{workspace}",fi={list:{konnect:`${Zn}/ca_certificates`,kongManager:`${Qn}/ca_certificates`},form:{konnect:{create:`${Zn}/ca_certificates`,edit:`${Zn}/ca_certificates/{id}`,validate:`${Zn}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${Qn}/ca_certificates`,edit:`${Qn}/ca_certificates/{id}`,validate:`${Qn}/schemas/ca_certificates/validate`}}},lp={class:"kong-ui-ca-certificate-entity-config-card"},up={key:0},fp=er(o.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=["dns_names","san_names","subject"],i=e,n=r,{i18n:{t:s,formatUnixTimeStamp:c}}=et.useI18n(),{convertKeyToTitle:u}=T.useStringHelpers(),{getPropValue:f}=T.useHelpers(),{getCertificateData:p}=et.useCertificate(),b=o.computed(()=>fi.form[n.config.app].edit),y=o.ref(),K=o.computed(()=>{if(y.value)return p(y.value)}),N=o.computed(()=>{var k;return((k=K.value)==null?void 0:k.schemaIssuer)||""}),d=o.computed(()=>{var k,E;return(k=K.value)!=null&&k.schemaExpiry?c((E=K.value)==null?void 0:E.schemaExpiry):""}),g=o.computed(()=>{var k;return((k=K.value)==null?void 0:k.schemaKeyUsages)||[]}),A=(k,E)=>{const J=f("rowValue",E);if(k==="expiry")return d.value;if(k==="key_usages")return g.value;if(J)return J[k]},w=k=>{y.value=k,i("fetch:success",k)},I=o.ref({id:{},updated_at:{},created_at:{},cert:{section:T.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:T.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:T.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:T.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:T.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(k,E)=>{const J=o.resolveComponent("KCodeBlock"),se=o.resolveComponent("KLabel"),$=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",lp,[o.createVNode(o.unref(T.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":I.value,"entity-type":o.unref(T.SupportedEntityType).CaCertificate,"fetch-url":b.value,"hide-title":r.hideTitle,"onFetch:error":E[0]||(E[0]=C=>k.$emit("fetch:error",C)),"onFetch:success":w,onLoading:E[1]||(E[1]=C=>k.$emit("loading",C))},{cert:o.withCtx(C=>[o.unref(f)("rowValue",C)?(o.openBlock(),o.createBlock(J,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",C),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(se,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(C=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",C)).filter(P=>!t.includes(P)),P=>(o.openBlock(),o.createBlock(o.unref(T.ConfigCardItem),{key:P,"data-testid":`ca-cert-metadata-${P}`,item:{key:P,label:o.unref(u)(P),value:A(P,C),type:P==="key_usages"?o.unref(T.ConfigurationSchemaType).BadgeTag:o.unref(T.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(N.value||"–"),1)]),key_usages:o.withCtx(()=>[g.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",up,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,(C,P)=>(o.openBlock(),o.createBlock($,{key:`key_usages-badge-tag-${P}`,class:"config-badge","data-testid":`key_usages-badge-tag-${P}`,tooltip:C,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-1d42f61b"]]),dp={class:"kong-ui-entities-ca-certificates-list"},pp={key:0},hp={key:1},yp={key:0},gp={key:1},mp={key:1},bp=er(o.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var q;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),u=pi.useRouter(),{axiosInstance:f}=T.useAxios((q=i.config)==null?void 0:q.axiosRequestConfig),p=o.ref(1),b=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),K={issuer:{label:n("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},N=o.computed(()=>{var le,O;let z=`${i.config.apiBaseUrl}${fi.list[i.config.app]}`;return i.config.app==="konnect"?z=z.replace(/{controlPlaneId}/gi,((le=i.config)==null?void 0:le.controlPlaneId)||""):i.config.app==="kongManager"&&(z=z.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),z}),d=o.ref(""),g=o.computed(()=>{const z=i.config.app==="konnect"||i.config.isExactMatch;return z?{isExactMatch:z,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:z,schema:i.config.filterSchema}}),{fetcher:A,fetcherState:w}=T.useFetcher(i.config,N.value),I=()=>{d.value=""},k=()=>{p.value++},E=o.ref(null),J=(z,le)=>{const O=z.id;if(!le(O)){t("copy:error",{entity:z,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:z,field:"id",message:n("ca-certificates.copy.success",{val:O})})},se=(z,le)=>{const O=JSON.stringify(z);if(!le(O)){t("copy:error",{entity:z,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:z,message:n("ca-certificates.copy.success_brief")})},$=async z=>{var O;await((O=i.canRetrieve)==null?void 0:O.call(i,z))&&u.push(i.config.getViewRoute(z.id))},C=z=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(z)}),P=z=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(z)}),ye=o.ref(void 0),ie=o.ref(!1),Ie=o.ref(!1),ae=o.ref(""),pe=T.useDeleteUrlBuilder(i.config,N.value),{certificateDataCache:tt,getCertificateData:X}=et.useCertificate(),Or=z=>{ye.value=z,ie.value=!0},St=()=>{ie.value=!1},Tr=async()=>{var z,le,O;if((z=ye.value)!=null&&z.id){Ie.value=!0;try{await f.delete(pe(ye.value.id)),Ie.value=!1,ie.value=!1,p.value++,t("delete:success",ye.value)}catch(ne){ae.value=((O=(le=ne.response)==null?void 0:le.data)==null?void 0:O.message)||ne.message||n("ca-certificates.errors.delete"),t("error",ne)}finally{Ie.value=!1}}},tr=o.ref(!1);o.watch(w,z=>{var le,O,ne,ue;if(Array.isArray((le=z==null?void 0:z.response)==null?void 0:le.data)&&(tr.value=z.response.data.length>0),z.status===T.FetcherStatus.Error){E.value={title:n("ca-certificates.errors.general")},(ue=(ne=(O=z.error)==null?void 0:O.response)==null?void 0:ne.data)!=null&&ue.message&&(E.value.message=z.error.response.data.message),t("error",z.error);return}tt.value={},E.value=null});const jt=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("ca-certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(jt.value.title=n("ca-certificates.list.empty_state.title"),jt.value.ctaText=n("ca-certificates.actions.create"))}),(z,le)=>{const O=o.resolveComponent("KButton"),ne=o.resolveComponent("KBadge"),ue=o.resolveComponent("KTruncate"),Ce=o.resolveComponent("KDropdownItem"),kt=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",dp,[o.createVNode(o.unref(T.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":b.value,"empty-state-options":jt.value,"enable-entity-actions":"","error-message":E.value,fetcher:o.unref(A),"fetcher-cache-key":p.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:d.value,"table-headers":o.unref(K),onClearSearchInput:I,"onClick:row":le[2]||(le[2]=Y=>$(Y)),onSort:k},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(T.EntityFilter),{modelValue:d.value,"onUpdate:modelValue":le[0]||(le[0]=Y=>d.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(O,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(hi.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["size","to"]),[[o.vShow,tr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:o.withCtx(({row:Y})=>{var he;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",pp,o.toDisplayString((he=Y==null?void 0:Y.metadata)!=null&&he.issuer?Y.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",hp,o.toDisplayString(o.unref(X)(Y).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:Y})=>{var he;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",yp,o.toDisplayString((he=Y==null?void 0:Y.metadata)!=null&&he.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",gp,o.toDisplayString(o.unref(X)(Y).schemaExpiry?o.unref(s)(o.unref(X)(Y).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:Y})=>{var he;return[((he=Y==null?void 0:Y.tags)==null?void 0:he.length)>0?(o.openBlock(),o.createBlock(ue,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Y==null?void 0:Y.tags,We=>(o.openBlock(),o.createBlock(ne,{key:We,onClick:le[1]||(le[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(We),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",mp,"-"))]}),actions:o.withCtx(({row:Y})=>[o.createVNode(kt,null,{default:o.withCtx(({copyToClipboard:he})=>[o.createVNode(Ce,{"data-testid":"action-entity-copy-id",onClick:We=>J(Y,he)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(kt,null,{default:o.withCtx(({copyToClipboard:he})=>[o.createVNode(Ce,{"data-testid":"action-entity-copy-json",onClick:We=>se(Y,he)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(Y)},{default:o.withCtx(()=>[o.createVNode(Ce,{"data-testid":"action-entity-view","has-divider":"",item:C(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canEdit(Y)},{default:o.withCtx(()=>[o.createVNode(Ce,{"data-testid":"action-entity-edit",item:P(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canDelete(Y)},{default:o.withCtx(()=>[o.createVNode(Ce,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:he=>Or(Y)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),o.createVNode(o.unref(T.EntityDeleteModal),{"action-pending":Ie.value,"entity-type":o.unref(T.EntityTypes).CACertificate,error:ae.value,title:o.unref(n)("ca-certificates.delete.title"),visible:ie.value,onCancel:St,onProceed:Tr},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-299a0fc8"]]),vp={class:"kong-ui-entities-ca-certificates-form"},wp=er(o.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(r,{emit:e}){var k;const t=e,i=r,n=pi.useRouter(),{i18n:{t:s}}=et.useI18n(),{getMessageFromError:c}=T.useErrors(),{axiosInstance:u}=T.useAxios((k=i.config)==null?void 0:k.axiosRequestConfig),f=o.computed(()=>fi.form[i.config.app].edit),p=o.computed(()=>i.certificateId?T.EntityBaseFormType.Edit:T.EntityBaseFormType.Create),b=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),y=o.reactive({cert:"",certDigest:"",tags:""}),K=o.computed(()=>(p.value===T.EntityBaseFormType.Create||JSON.stringify(b.fields)!==JSON.stringify(y))&&!!b.fields.cert),N=E=>{var J;b.fields.cert=(E==null?void 0:E.cert)||"",b.fields.certDigest=(E==null?void 0:E.cert_digest)||"",b.fields.tags=((J=E==null?void 0:E.tags)==null?void 0:J.join(", "))||"",Object.assign(y,b.fields)},d=()=>{n.push(i.config.cancelRoute)},g=o.computed(()=>{var J,se;let E=`${i.config.apiBaseUrl}${fi.form[i.config.app].validate}`;return i.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((J=i.config)==null?void 0:J.controlPlaneId)||""):i.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),E=E.replace(/{id}/gi,i.certificateId),E}),A=o.computed(()=>{var J,se;let E=`${i.config.apiBaseUrl}${fi.form[i.config.app][p.value]}`;return i.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((J=i.config)==null?void 0:J.controlPlaneId)||""):i.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),E=E.replace(/{id}/gi,i.certificateId),E}),w=o.computed(()=>{var E,J;return{cert:b.fields.cert,cert_digest:b.fields.certDigest||null,tags:(J=(E=b.fields.tags.split(","))==null?void 0:E.map(se=>String(se||"").trim()))==null?void 0:J.filter(se=>se!=="")}}),I=async()=>{var E,J,se,$,C;try{b.isReadonly=!0;let P;await u.post(g.value,w.value),p.value==="create"?P=await u.post(A.value,w.value):p.value==="edit"&&(P=((E=i.config)==null?void 0:E.app)==="konnect"?await u.put(A.value,w.value):await u.patch(A.value,w.value)),b.fields.cert=((J=P==null?void 0:P.data)==null?void 0:J.cert)||"",b.fields.certDigest=((se=P==null?void 0:P.data)==null?void 0:se.cert_digest)||"",b.fields.tags=((C=($=P==null?void 0:P.data)==null?void 0:$.tags)==null?void 0:C.join(", "))||"",Object.assign(y,b.fields),t("update",P==null?void 0:P.data)}catch(P){b.errorMessage=c(P),t("error",P)}finally{b.isReadonly=!1}};return(E,J)=>{const se=o.resolveComponent("KTextArea"),$=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",vp,[o.createVNode(o.unref(T.EntityBaseForm),{"can-submit":K.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(T.SupportedEntityType).CaCertificate,"error-message":b.errorMessage,"fetch-url":f.value,"form-fields":w.value,"is-readonly":b.isReadonly,onCancel:d,"onFetch:error":J[3]||(J[3]=C=>E.$emit("error",C)),"onFetch:success":N,onLoading:J[4]||(J[4]=C=>E.$emit("loading",C)),onSubmit:I},{default:o.withCtx(()=>[o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.cert.description"),title:o.unref(s)("ca-certificates.form.sections.cert.title")},{default:o.withCtx(()=>[o.createVNode(se,{modelValue:b.fields.cert,"onUpdate:modelValue":J[0]||(J[0]=C=>b.fields.cert=C),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:o.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.cert.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:b.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode($,{modelValue:b.fields.certDigest,"onUpdate:modelValue":J[1]||(J[1]=C=>b.fields.certDigest=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:b.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.general.description"),title:o.unref(s)("ca-certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode($,{modelValue:b.fields.tags,"onUpdate:modelValue":J[2]||(J[2]=C=>b.fields.tags=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:o.unref(s)("ca-certificates.form.fields.tags.help"),label:o.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:b.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-2a3f488f"]]),Ap={class:"kong-ui-certificate-entity-config-card"},Sp={key:0},kp=er(o.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),{convertKeyToTitle:u}=T.useStringHelpers(),{getPropValue:f}=T.useHelpers(),{getCertificateData:p}=et.useCertificate(),b=o.computed(()=>ui.form[i.config.app].edit),y=o.ref(),K=o.ref({id:{},cert:{section:T.ConfigurationSchemaSection.Basic},key:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Redacted},metadata:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Json},snis:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:T.ConfigurationSchemaSection.Advanced},key_alt:{section:T.ConfigurationSchemaSection.Advanced,type:T.ConfigurationSchemaType.Redacted}}),N=C=>{y.value=C,t("fetch:success",C)},d=(C,P)=>{const ye=f("rowValue",P);if(C==="expiry")return A.value;if(C==="key_usages")return E.value;if(C==="san_names")return I.value;if(ye)return ye[C]},g=o.computed(()=>{if(y.value)return p(y.value)}),A=o.computed(()=>{var C,P;return(C=g.value)!=null&&C.schemaExpiry?s((P=g.value)==null?void 0:P.schemaExpiry):""}),w=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaIssuer)||""}),I=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaSanNames)||""}),k=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaSubject)||""}),E=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaKeyUsages)||[]}),J=o.computed(()=>{var C,P;return((P=(C=y==null?void 0:y.value)==null?void 0:C.snis)==null?void 0:P.length)>0}),se=o.computed(()=>{var C;return!!((C=y==null?void 0:y.value)!=null&&C.cert_alt)}),$=C=>{var P,ye;return C==="san_names"?n("certificates.list.table_headers.san"):((ye=(P=K.value)==null?void 0:P[C])==null?void 0:ye.label)||u(C)};return(C,P)=>{const ye=o.resolveComponent("KCodeBlock"),ie=o.resolveComponent("KLabel"),Ie=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",Ap,[o.createVNode(o.unref(T.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":K.value,"entity-type":o.unref(T.SupportedEntityType).Certificate,"fetch-url":b.value,"hide-title":r.hideTitle,"onFetch:error":P[0]||(P[0]=ae=>C.$emit("fetch:error",ae)),"onFetch:success":N,onLoading:P[1]||(P[1]=ae=>C.$emit("loading",ae))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:o.withCtx(ae=>[o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(ye,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":o.withCtx(()=>[o.createVNode(ie,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(ae=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",ae)),pe=>(o.openBlock(),o.createBlock(o.unref(T.ConfigCardItem),{key:pe,item:{key:pe,value:d(pe,ae),label:$(pe),type:pe==="key_usages"||pe==="snis"||pe==="dns_names"?o.unref(T.ConfigurationSchemaType).BadgeTag:o.unref(T.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(A.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(I.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:o.withCtx(()=>[E.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Sp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(E.value,(ae,pe)=>(o.openBlock(),o.createBlock(Ie,{key:`key_usages-badge-tag-${pe}`,class:"config-badge","data-testid":`key_usages-badge-tag-${pe}`,tooltip:ae,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ae),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[J.value?void 0:{name:"snis",fn:o.withCtx(()=>[o.createTextVNode(" – ")]),key:"0"},se.value?{name:"cert_alt",fn:o.withCtx(ae=>[o.createTextVNode(" > "),o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(ye,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-401d92d6"]]);Be.CACertificateConfigCard=fp,Be.CACertificateForm=wp,Be.CACertificateList=bp,Be.CertificateConfigCard=kp,Be.CertificateForm=cp,Be.CertificateList=tp,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})});