@kong-ui-public/entities-certificates 3.11.30 → 3.11.31
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.
- package/dist/entities-certificates.es.js +4477 -4272
- package/dist/entities-certificates.umd.js +13 -13
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Be,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],o):(Be=typeof globalThis<"u"?globalThis:Be||self,o(Be["kong-ui-public-entities-certificates"]={},Be.Vue,Be.VueRouter,Be.KongIcons,Be["kong-ui-public-i18n"],Be["kong-ui-public-entities-shared"]))})(this,function(Be,o,Ui,je,za,A){"use strict";var Ja=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
|
|
2
2
|
Copyright (C) Microsoft. All rights reserved.
|
|
3
3
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
4
|
this file except in compliance with the License. You may obtain a copy of the
|
|
@@ -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 Ea;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Ba=="object"?Ba: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,d){return function(g,h){Object.defineProperty(f,g,{configurable:!0,writable:!0,value:h}),d&&d(g,h)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||a()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,d=!u&&!f,g={create:u?function(){return Ca(Object.create(null))}:f?function(){return Ca({__proto__:null})}:function(){return Ca({})},has:d?function(y,m){return i.call(y,m)}:function(y,m){return m in y},get:d?function(y,m){return i.call(y,m)?y[m]:void 0}:function(y,m){return y[m]}},h=Object.getPrototypeOf(Function),L=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ep(),ne=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Np(),re=typeof WeakMap=="function"?WeakMap:Ip(),X=n?Symbol.for("@reflect-metadata:registry"):void 0,ie=Cp(),Me=xp(ie);function Se(y,m,b,k){if(U(b)){if(!Ae(y))throw new TypeError;if(!K(m))throw new TypeError;return ut(y,m)}else{if(!Ae(y))throw new TypeError;if(!ae(m))throw new TypeError;if(!ae(k)&&!U(k)&&!dt(k))throw new TypeError;return dt(k)&&(k=void 0),b=G(b),se(y,m,b,k)}}e("decorate",Se);function P(y,m){function b(k,$){if(!ae(k))throw new TypeError;if(!U($)&&!Ee($))throw new TypeError;Vr(y,m,k,$)}return b}e("metadata",P);function M(y,m,b,k){if(!ae(b))throw new TypeError;return U(k)||(k=G(k)),Vr(y,m,b,k)}e("defineMetadata",M);function oe(y,m,b){if(!ae(m))throw new TypeError;return U(b)||(b=G(b)),ce(y,m,b)}e("hasMetadata",oe);function R(y,m,b){if(!ae(m))throw new TypeError;return U(b)||(b=G(b)),z(y,m,b)}e("hasOwnMetadata",R);function j(y,m,b){if(!ae(m))throw new TypeError;return U(b)||(b=G(b)),ft(y,m,b)}e("getMetadata",j);function S(y,m,b){if(!ae(m))throw new TypeError;return U(b)||(b=G(b)),rr(y,m,b)}e("getOwnMetadata",S);function F(y,m){if(!ae(y))throw new TypeError;return U(m)||(m=G(m)),Pt(y,m)}e("getMetadataKeys",F);function Z(y,m){if(!ae(y))throw new TypeError;return U(m)||(m=G(m)),kt(y,m)}e("getOwnMetadataKeys",Z);function lt(y,m,b){if(!ae(m))throw new TypeError;if(U(b)||(b=G(b)),!ae(m))throw new TypeError;U(b)||(b=G(b));var k=yi(m,b,!1);return U(k)?!1:k.OrdinaryDeleteMetadata(y,m,b)}e("deleteMetadata",lt);function ut(y,m){for(var b=y.length-1;b>=0;--b){var k=y[b],$=k(m);if(!U($)&&!dt($)){if(!K($))throw new TypeError;m=$}}return m}function se(y,m,b,k){for(var $=y.length-1;$>=0;--$){var de=y[$],me=de(m,b,k);if(!U(me)&&!dt(me)){if(!ae(me))throw new TypeError;k=me}}return k}function ce(y,m,b){var k=z(y,m,b);if(k)return!0;var $=ka(m);return dt($)?!1:ce(y,$,b)}function z(y,m,b){var k=yi(m,b,!1);return U(k)?!1:O(k.OrdinaryHasOwnMetadata(y,m,b))}function ft(y,m,b){var k=z(y,m,b);if(k)return rr(y,m,b);var $=ka(m);if(!dt($))return ft(y,$,b)}function rr(y,m,b){var k=yi(m,b,!1);if(!U(k))return k.OrdinaryGetOwnMetadata(y,m,b)}function Vr(y,m,b,k){var $=yi(b,k,!0);$.OrdinaryDefineOwnMetadata(y,m,b,k)}function Pt(y,m){var b=kt(y,m),k=ka(y);if(k===null)return b;var $=Pt(k,m);if($.length<=0)return b;if(b.length<=0)return $;for(var de=new ne,me=[],J=0,B=b;J<B.length;J++){var I=B[J],_=de.has(I);_||(de.add(I),me.push(I))}for(var V=0,Y=$;V<Y.length;V++){var I=Y[V],_=de.has(I);_||(de.add(I),me.push(I))}return me}function kt(y,m){var b=yi(y,m,!1);return b?b.OrdinaryOwnMetadataKeys(y,m):[]}function jr(y){if(y===null)return 1;switch(typeof y){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return y===null?1:6;default:return 6}}function U(y){return y===void 0}function dt(y){return y===null}function ir(y){return typeof y=="symbol"}function ae(y){return typeof y=="object"?y!==null:typeof y=="function"}function Rt(y,m){switch(jr(y)){case 0:return y;case 1:return y;case 2:return y;case 3:return y;case 4:return y;case 5:return y}var b="string",k=ke(y,s);if(k!==void 0){var $=k.call(y,b);if(ae($))throw new TypeError;return $}return W(y)}function W(y,m){var b,k,$;{var de=y.toString;if(Ct(de)){var k=de.call(y);if(!ae(k))return k}var b=y.valueOf;if(Ct(b)){var k=b.call(y);if(!ae(k))return k}}throw new TypeError}function O(y){return!!y}function H(y){return""+y}function G(y){var m=Rt(y);return ir(m)?m:H(m)}function Ae(y){return Array.isArray?Array.isArray(y):y instanceof Object?y instanceof Array:Object.prototype.toString.call(y)==="[object Array]"}function Ct(y){return typeof y=="function"}function K(y){return typeof y=="function"}function Ee(y){switch(jr(y)){case 3:return!0;case 4:return!0;default:return!1}}function D(y,m){return y===m||y!==y&&m!==m}function ke(y,m){var b=y[m];if(b!=null){if(!Ct(b))throw new TypeError;return b}}function eo(y){var m=ke(y,a);if(!Ct(m))throw new TypeError;var b=m.call(y);if(!ae(b))throw new TypeError;return b}function Fu(y){return y.value}function qu(y){var m=y.next();return m.done?!1:m}function Ku(y){var m=y.return;m&&m.call(y)}function ka(y){var m=Object.getPrototypeOf(y);if(typeof y!="function"||y===h||m!==h)return m;var b=y.prototype,k=b&&Object.getPrototypeOf(b);if(k==null||k===Object.prototype)return m;var $=k.constructor;return typeof $!="function"||$===y?m:$}function kp(){var y;!U(X)&&typeof t.Reflect<"u"&&!(X in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(y=Bp(t.Reflect));var m,b,k,$=new re,de={registerProvider:me,getProvider:B,setProvider:_};return de;function me(V){if(!Object.isExtensible(de))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case y===V:break;case U(m):m=V;break;case m===V:break;case U(b):b=V;break;case b===V:break;default:k===void 0&&(k=new ne),k.add(V);break}}function J(V,Y){if(!U(m)){if(m.isProviderFor(V,Y))return m;if(!U(b)){if(b.isProviderFor(V,Y))return m;if(!U(k))for(var ue=eo(k);;){var pe=qu(ue);if(!pe)return;var et=Fu(pe);if(et.isProviderFor(V,Y))return Ku(ue),et}}}if(!U(y)&&y.isProviderFor(V,Y))return y}function B(V,Y){var ue=$.get(V),pe;return U(ue)||(pe=ue.get(Y)),U(pe)&&(pe=J(V,Y),U(pe)||(U(ue)&&(ue=new L,$.set(V,ue)),ue.set(Y,pe))),pe}function I(V){if(U(V))throw new TypeError;return m===V||b===V||!U(k)&&k.has(V)}function _(V,Y,ue){if(!I(ue))throw new Error("Metadata provider not registered.");var pe=B(V,Y);if(pe!==ue){if(!U(pe))return!1;var et=$.get(V);U(et)&&(et=new L,$.set(V,et)),et.set(Y,ue)}return!0}}function Cp(){var y;return!U(X)&&ae(t.Reflect)&&Object.isExtensible(t.Reflect)&&(y=t.Reflect[X]),U(y)&&(y=kp()),!U(X)&&ae(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,X,{enumerable:!1,configurable:!1,writable:!1,value:y}),y}function xp(y){var m=new re,b={isProviderFor:function(I,_){var V=m.get(I);return U(V)?!1:V.has(_)},OrdinaryDefineOwnMetadata:me,OrdinaryHasOwnMetadata:$,OrdinaryGetOwnMetadata:de,OrdinaryOwnMetadataKeys:J,OrdinaryDeleteMetadata:B};return ie.registerProvider(b),b;function k(I,_,V){var Y=m.get(I),ue=!1;if(U(Y)){if(!V)return;Y=new L,m.set(I,Y),ue=!0}var pe=Y.get(_);if(U(pe)){if(!V)return;if(pe=new L,Y.set(_,pe),!y.setProvider(I,_,b))throw Y.delete(_),ue&&m.delete(I),new Error("Wrong provider for target.")}return pe}function $(I,_,V){var Y=k(_,V,!1);return U(Y)?!1:O(Y.has(I))}function de(I,_,V){var Y=k(_,V,!1);if(!U(Y))return Y.get(I)}function me(I,_,V,Y){var ue=k(V,Y,!0);ue.set(I,_)}function J(I,_){var V=[],Y=k(I,_,!1);if(U(Y))return V;for(var ue=Y.keys(),pe=eo(ue),et=0;;){var Wu=qu(pe);if(!Wu)return V.length=et,V;var Op=Fu(Wu);try{V[et]=Op}catch(Tp){try{Ku(pe)}finally{throw Tp}}et++}}function B(I,_,V){var Y=k(_,V,!1);if(U(Y)||!Y.delete(I))return!1;if(Y.size===0){var ue=m.get(_);U(ue)||(ue.delete(V),ue.size===0&&m.delete(ue))}return!0}}function Bp(y){var m=y.defineMetadata,b=y.hasOwnMetadata,k=y.getOwnMetadata,$=y.getOwnMetadataKeys,de=y.deleteMetadata,me=new re,J={isProviderFor:function(B,I){var _=me.get(B);return!U(_)&&_.has(I)?!0:$(B,I).length?(U(_)&&(_=new ne,me.set(B,_)),_.add(I),!0):!1},OrdinaryDefineOwnMetadata:m,OrdinaryHasOwnMetadata:b,OrdinaryGetOwnMetadata:k,OrdinaryOwnMetadataKeys:$,OrdinaryDeleteMetadata:de};return J}function yi(y,m,b){var k=ie.getProvider(y,m);if(!U(k))return k;if(b){if(ie.setProvider(y,m,Me))return Me;throw new Error("Illegal state.")}}function Ep(){var y={},m=[],b=function(){function J(B,I,_){this._index=0,this._keys=B,this._values=I,this._selector=_}return J.prototype["@@iterator"]=function(){return this},J.prototype[a]=function(){return this},J.prototype.next=function(){var B=this._index;if(B>=0&&B<this._keys.length){var I=this._selector(this._keys[B],this._values[B]);return B+1>=this._keys.length?(this._index=-1,this._keys=m,this._values=m):this._index++,{value:I,done:!1}}return{value:void 0,done:!0}},J.prototype.throw=function(B){throw this._index>=0&&(this._index=-1,this._keys=m,this._values=m),B},J.prototype.return=function(B){return this._index>=0&&(this._index=-1,this._keys=m,this._values=m),{value:B,done:!0}},J}(),k=function(){function J(){this._keys=[],this._values=[],this._cacheKey=y,this._cacheIndex=-2}return Object.defineProperty(J.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),J.prototype.has=function(B){return this._find(B,!1)>=0},J.prototype.get=function(B){var I=this._find(B,!1);return I>=0?this._values[I]:void 0},J.prototype.set=function(B,I){var _=this._find(B,!0);return this._values[_]=I,this},J.prototype.delete=function(B){var I=this._find(B,!1);if(I>=0){for(var _=this._keys.length,V=I+1;V<_;V++)this._keys[V-1]=this._keys[V],this._values[V-1]=this._values[V];return this._keys.length--,this._values.length--,D(B,this._cacheKey)&&(this._cacheKey=y,this._cacheIndex=-2),!0}return!1},J.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=y,this._cacheIndex=-2},J.prototype.keys=function(){return new b(this._keys,this._values,$)},J.prototype.values=function(){return new b(this._keys,this._values,de)},J.prototype.entries=function(){return new b(this._keys,this._values,me)},J.prototype["@@iterator"]=function(){return this.entries()},J.prototype[a]=function(){return this.entries()},J.prototype._find=function(B,I){if(!D(this._cacheKey,B)){this._cacheIndex=-1;for(var _=0;_<this._keys.length;_++)if(D(this._keys[_],B)){this._cacheIndex=_;break}}return this._cacheIndex<0&&I&&(this._cacheIndex=this._keys.length,this._keys.push(B),this._values.push(void 0)),this._cacheIndex},J}();return k;function $(J,B){return J}function de(J,B){return B}function me(J,B){return[J,B]}}function Np(){var y=function(){function m(){this._map=new L}return Object.defineProperty(m.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),m.prototype.has=function(b){return this._map.has(b)},m.prototype.add=function(b){return this._map.set(b,b),this},m.prototype.delete=function(b){return this._map.delete(b)},m.prototype.clear=function(){this._map.clear()},m.prototype.keys=function(){return this._map.keys()},m.prototype.values=function(){return this._map.keys()},m.prototype.entries=function(){return this._map.entries()},m.prototype["@@iterator"]=function(){return this.keys()},m.prototype[a]=function(){return this.keys()},m}();return y}function Ip(){var y=16,m=g.create(),b=k();return function(){function B(){this._key=k()}return B.prototype.has=function(I){var _=$(I,!1);return _!==void 0?g.has(_,this._key):!1},B.prototype.get=function(I){var _=$(I,!1);return _!==void 0?g.get(_,this._key):void 0},B.prototype.set=function(I,_){var V=$(I,!0);return V[this._key]=_,this},B.prototype.delete=function(I){var _=$(I,!1);return _!==void 0?delete _[this._key]:!1},B.prototype.clear=function(){this._key=k()},B}();function k(){var B;do B="@@WeakMap@@"+J();while(g.has(m,B));return m[B]=!0,B}function $(B,I){if(!i.call(B,b)){if(!I)return;Object.defineProperty(B,b,{value:g.create()})}return B[b]}function de(B,I){for(var _=0;_<I;++_)B[_]=Math.random()*255|0;return B}function me(B){if(typeof Uint8Array=="function"){var I=new Uint8Array(B);return typeof crypto<"u"?crypto.getRandomValues(I):typeof msCrypto<"u"?msCrypto.getRandomValues(I):de(I,B),I}return de(new Array(B),B)}function J(){var B=me(y);B[6]=B[6]&79|64,B[8]=B[8]&191|128;for(var I="",_=0;_<y;++_){var V=B[_];(_===4||_===6||_===8)&&(I+="-"),V<16&&(I+="0"),I+=V.toString(16).toLowerCase()}return I}}function Ca(y){return y.__=void 0,delete y.__,y}})})(Ea||(Ea={}));/*!
|
|
14
|
+
***************************************************************************** */var Ya;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Ja=="object"?Ja: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(m,y){Object.defineProperty(f,m,{configurable:!0,writable:!0,value:y}),p&&p(m,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,m={create:u?function(){return Ga(Object.create(null))}:f?function(){return Ga({__proto__:null})}:function(){return Ga({})},has:p?function(h,g){return i.call(h,g)}:function(h,g){return g in h},get:p?function(h,g){return i.call(h,g)?h[g]:void 0}:function(h,g){return h[g]}},y=Object.getPrototypeOf(Function),L=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Yp(),oe=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Zp(),ie=typeof WeakMap=="function"?WeakMap:Xp(),ee=n?Symbol.for("@reflect-metadata:registry"):void 0,ne=Gp(),$e=zp(ne);function ke(h,g,b,k){if(U(b)){if(!Ce(h))throw new TypeError;if(!K(g))throw new TypeError;return dt(h,g)}else{if(!Ce(h))throw new TypeError;if(!ce(g))throw new TypeError;if(!ce(k)&&!U(k)&&!ht(k))throw new TypeError;return ht(k)&&(k=void 0),b=z(b),ae(h,g,b,k)}}e("decorate",ke);function P(h,g){function b(k,$){if(!ce(k))throw new TypeError;if(!U($)&&!Ie($))throw new TypeError;Mr(h,g,k,$)}return b}e("metadata",P);function M(h,g,b,k){if(!ce(b))throw new TypeError;return U(k)||(k=z(k)),Mr(h,g,b,k)}e("defineMetadata",M);function se(h,g,b){if(!ce(g))throw new TypeError;return U(b)||(b=z(b)),le(h,g,b)}e("hasMetadata",se);function R(h,g,b){if(!ce(g))throw new TypeError;return U(b)||(b=z(b)),J(h,g,b)}e("hasOwnMetadata",R);function j(h,g,b){if(!ce(g))throw new TypeError;return U(b)||(b=z(b)),pt(h,g,b)}e("getMetadata",j);function S(h,g,b){if(!ce(g))throw new TypeError;return U(b)||(b=z(b)),nr(h,g,b)}e("getOwnMetadata",S);function F(h,g){if(!ce(h))throw new TypeError;return U(g)||(g=z(g)),Rt(h,g)}e("getMetadataKeys",F);function X(h,g){if(!ce(h))throw new TypeError;return U(g)||(g=z(g)),xt(h,g)}e("getOwnMetadataKeys",X);function ft(h,g,b){if(!ce(g))throw new TypeError;if(U(b)||(b=z(b)),!ce(g))throw new TypeError;U(b)||(b=z(b));var k=Mi(g,b,!1);return U(k)?!1:k.OrdinaryDeleteMetadata(h,g,b)}e("deleteMetadata",ft);function dt(h,g){for(var b=h.length-1;b>=0;--b){var k=h[b],$=k(g);if(!U($)&&!ht($)){if(!K($))throw new TypeError;g=$}}return g}function ae(h,g,b,k){for(var $=h.length-1;$>=0;--$){var he=h[$],be=he(g,b,k);if(!U(be)&&!ht(be)){if(!ce(be))throw new TypeError;k=be}}return k}function le(h,g,b){var k=J(h,g,b);if(k)return!0;var $=Wa(g);return ht($)?!1:le(h,$,b)}function J(h,g,b){var k=Mi(g,b,!1);return U(k)?!1:O(k.OrdinaryHasOwnMetadata(h,g,b))}function pt(h,g,b){var k=J(h,g,b);if(k)return nr(h,g,b);var $=Wa(g);if(!ht($))return pt(h,$,b)}function nr(h,g,b){var k=Mi(g,b,!1);if(!U(k))return k.OrdinaryGetOwnMetadata(h,g,b)}function Mr(h,g,b,k){var $=Mi(b,k,!0);$.OrdinaryDefineOwnMetadata(h,g,b,k)}function Rt(h,g){var b=xt(h,g),k=Wa(h);if(k===null)return b;var $=Rt(k,g);if($.length<=0)return b;if(b.length<=0)return $;for(var he=new oe,be=[],Y=0,B=b;Y<B.length;Y++){var I=B[Y],T=he.has(I);T||(he.add(I),be.push(I))}for(var V=0,Z=$;V<Z.length;V++){var I=Z[V],T=he.has(I);T||(he.add(I),be.push(I))}return be}function xt(h,g){var b=Mi(h,g,!1);return b?b.OrdinaryOwnMetadataKeys(h,g):[]}function Ur(h){if(h===null)return 1;switch(typeof h){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return h===null?1:6;default:return 6}}function U(h){return h===void 0}function ht(h){return h===null}function or(h){return typeof h=="symbol"}function ce(h){return typeof h=="object"?h!==null:typeof h=="function"}function Dt(h,g){switch(Ur(h)){case 0:return h;case 1:return h;case 2:return h;case 3:return h;case 4:return h;case 5:return h}var b="string",k=xe(h,s);if(k!==void 0){var $=k.call(h,b);if(ce($))throw new TypeError;return $}return G(h)}function G(h,g){var b,k,$;{var he=h.toString;if(Bt(he)){var k=he.call(h);if(!ce(k))return k}var b=h.valueOf;if(Bt(b)){var k=b.call(h);if(!ce(k))return k}}throw new TypeError}function O(h){return!!h}function H(h){return""+h}function z(h){var g=Dt(h);return or(g)?g:H(g)}function Ce(h){return Array.isArray?Array.isArray(h):h instanceof Object?h instanceof Array:Object.prototype.toString.call(h)==="[object Array]"}function Bt(h){return typeof h=="function"}function K(h){return typeof h=="function"}function Ie(h){switch(Ur(h)){case 3:return!0;case 4:return!0;default:return!1}}function D(h,g){return h===g||h!==h&&g!==g}function xe(h,g){var b=h[g];if(b!=null){if(!Bt(b))throw new TypeError;return b}}function Co(h){var g=xe(h,c);if(!Bt(g))throw new TypeError;var b=g.call(h);if(!ce(b))throw new TypeError;return b}function pf(h){return h.value}function hf(h){var g=h.next();return g.done?!1:g}function yf(h){var g=h.return;g&&g.call(h)}function Wa(h){var g=Object.getPrototypeOf(h);if(typeof h!="function"||h===y||g!==y)return g;var b=h.prototype,k=b&&Object.getPrototypeOf(b);if(k==null||k===Object.prototype)return g;var $=k.constructor;return typeof $!="function"||$===h?g:$}function Wp(){var h;!U(ee)&&typeof t.Reflect<"u"&&!(ee in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(h=Jp(t.Reflect));var g,b,k,$=new ie,he={registerProvider:be,getProvider:B,setProvider:T};return he;function be(V){if(!Object.isExtensible(he))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case h===V:break;case U(g):g=V;break;case g===V:break;case U(b):b=V;break;case b===V:break;default:k===void 0&&(k=new oe),k.add(V);break}}function Y(V,Z){if(!U(g)){if(g.isProviderFor(V,Z))return g;if(!U(b)){if(b.isProviderFor(V,Z))return g;if(!U(k))for(var fe=Co(k);;){var ye=hf(fe);if(!ye)return;var rt=pf(ye);if(rt.isProviderFor(V,Z))return yf(fe),rt}}}if(!U(h)&&h.isProviderFor(V,Z))return h}function B(V,Z){var fe=$.get(V),ye;return U(fe)||(ye=fe.get(Z)),U(ye)&&(ye=Y(V,Z),U(ye)||(U(fe)&&(fe=new L,$.set(V,fe)),fe.set(Z,ye))),ye}function I(V){if(U(V))throw new TypeError;return g===V||b===V||!U(k)&&k.has(V)}function T(V,Z,fe){if(!I(fe))throw new Error("Metadata provider not registered.");var ye=B(V,Z);if(ye!==fe){if(!U(ye))return!1;var rt=$.get(V);U(rt)&&(rt=new L,$.set(V,rt)),rt.set(Z,fe)}return!0}}function Gp(){var h;return!U(ee)&&ce(t.Reflect)&&Object.isExtensible(t.Reflect)&&(h=t.Reflect[ee]),U(h)&&(h=Wp()),!U(ee)&&ce(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,ee,{enumerable:!1,configurable:!1,writable:!1,value:h}),h}function zp(h){var g=new ie,b={isProviderFor:function(I,T){var V=g.get(I);return U(V)?!1:V.has(T)},OrdinaryDefineOwnMetadata:be,OrdinaryHasOwnMetadata:$,OrdinaryGetOwnMetadata:he,OrdinaryOwnMetadataKeys:Y,OrdinaryDeleteMetadata:B};return ne.registerProvider(b),b;function k(I,T,V){var Z=g.get(I),fe=!1;if(U(Z)){if(!V)return;Z=new L,g.set(I,Z),fe=!0}var ye=Z.get(T);if(U(ye)){if(!V)return;if(ye=new L,Z.set(T,ye),!h.setProvider(I,T,b))throw Z.delete(T),fe&&g.delete(I),new Error("Wrong provider for target.")}return ye}function $(I,T,V){var Z=k(T,V,!1);return U(Z)?!1:O(Z.has(I))}function he(I,T,V){var Z=k(T,V,!1);if(!U(Z))return Z.get(I)}function be(I,T,V,Z){var fe=k(V,Z,!0);fe.set(I,T)}function Y(I,T){var V=[],Z=k(I,T,!1);if(U(Z))return V;for(var fe=Z.keys(),ye=Co(fe),rt=0;;){var gf=hf(ye);if(!gf)return V.length=rt,V;var Qp=pf(gf);try{V[rt]=Qp}catch(eh){try{yf(ye)}finally{throw eh}}rt++}}function B(I,T,V){var Z=k(T,V,!1);if(U(Z)||!Z.delete(I))return!1;if(Z.size===0){var fe=g.get(T);U(fe)||(fe.delete(V),fe.size===0&&g.delete(fe))}return!0}}function Jp(h){var g=h.defineMetadata,b=h.hasOwnMetadata,k=h.getOwnMetadata,$=h.getOwnMetadataKeys,he=h.deleteMetadata,be=new ie,Y={isProviderFor:function(B,I){var T=be.get(B);return!U(T)&&T.has(I)?!0:$(B,I).length?(U(T)&&(T=new oe,be.set(B,T)),T.add(I),!0):!1},OrdinaryDefineOwnMetadata:g,OrdinaryHasOwnMetadata:b,OrdinaryGetOwnMetadata:k,OrdinaryOwnMetadataKeys:$,OrdinaryDeleteMetadata:he};return Y}function Mi(h,g,b){var k=ne.getProvider(h,g);if(!U(k))return k;if(b){if(ne.setProvider(h,g,$e))return $e;throw new Error("Illegal state.")}}function Yp(){var h={},g=[],b=function(){function Y(B,I,T){this._index=0,this._keys=B,this._values=I,this._selector=T}return Y.prototype["@@iterator"]=function(){return this},Y.prototype[c]=function(){return this},Y.prototype.next=function(){var B=this._index;if(B>=0&&B<this._keys.length){var I=this._selector(this._keys[B],this._values[B]);return B+1>=this._keys.length?(this._index=-1,this._keys=g,this._values=g):this._index++,{value:I,done:!1}}return{value:void 0,done:!0}},Y.prototype.throw=function(B){throw this._index>=0&&(this._index=-1,this._keys=g,this._values=g),B},Y.prototype.return=function(B){return this._index>=0&&(this._index=-1,this._keys=g,this._values=g),{value:B,done:!0}},Y}(),k=function(){function Y(){this._keys=[],this._values=[],this._cacheKey=h,this._cacheIndex=-2}return Object.defineProperty(Y.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Y.prototype.has=function(B){return this._find(B,!1)>=0},Y.prototype.get=function(B){var I=this._find(B,!1);return I>=0?this._values[I]:void 0},Y.prototype.set=function(B,I){var T=this._find(B,!0);return this._values[T]=I,this},Y.prototype.delete=function(B){var I=this._find(B,!1);if(I>=0){for(var T=this._keys.length,V=I+1;V<T;V++)this._keys[V-1]=this._keys[V],this._values[V-1]=this._values[V];return this._keys.length--,this._values.length--,D(B,this._cacheKey)&&(this._cacheKey=h,this._cacheIndex=-2),!0}return!1},Y.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=h,this._cacheIndex=-2},Y.prototype.keys=function(){return new b(this._keys,this._values,$)},Y.prototype.values=function(){return new b(this._keys,this._values,he)},Y.prototype.entries=function(){return new b(this._keys,this._values,be)},Y.prototype["@@iterator"]=function(){return this.entries()},Y.prototype[c]=function(){return this.entries()},Y.prototype._find=function(B,I){if(!D(this._cacheKey,B)){this._cacheIndex=-1;for(var T=0;T<this._keys.length;T++)if(D(this._keys[T],B)){this._cacheIndex=T;break}}return this._cacheIndex<0&&I&&(this._cacheIndex=this._keys.length,this._keys.push(B),this._values.push(void 0)),this._cacheIndex},Y}();return k;function $(Y,B){return Y}function he(Y,B){return B}function be(Y,B){return[Y,B]}}function Zp(){var h=function(){function g(){this._map=new L}return Object.defineProperty(g.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),g.prototype.has=function(b){return this._map.has(b)},g.prototype.add=function(b){return this._map.set(b,b),this},g.prototype.delete=function(b){return this._map.delete(b)},g.prototype.clear=function(){this._map.clear()},g.prototype.keys=function(){return this._map.keys()},g.prototype.values=function(){return this._map.keys()},g.prototype.entries=function(){return this._map.entries()},g.prototype["@@iterator"]=function(){return this.keys()},g.prototype[c]=function(){return this.keys()},g}();return h}function Xp(){var h=16,g=m.create(),b=k();return function(){function B(){this._key=k()}return B.prototype.has=function(I){var T=$(I,!1);return T!==void 0?m.has(T,this._key):!1},B.prototype.get=function(I){var T=$(I,!1);return T!==void 0?m.get(T,this._key):void 0},B.prototype.set=function(I,T){var V=$(I,!0);return V[this._key]=T,this},B.prototype.delete=function(I){var T=$(I,!1);return T!==void 0?delete T[this._key]:!1},B.prototype.clear=function(){this._key=k()},B}();function k(){var B;do B="@@WeakMap@@"+Y();while(m.has(g,B));return g[B]=!0,B}function $(B,I){if(!i.call(B,b)){if(!I)return;Object.defineProperty(B,b,{value:m.create()})}return B[b]}function he(B,I){for(var T=0;T<I;++T)B[T]=Math.random()*255|0;return B}function be(B){if(typeof Uint8Array=="function"){var I=new Uint8Array(B);return typeof crypto<"u"?crypto.getRandomValues(I):typeof msCrypto<"u"?msCrypto.getRandomValues(I):he(I,B),I}return he(new Array(B),B)}function Y(){var B=be(h);B[6]=B[6]&79|64,B[8]=B[8]&191|128;for(var I="",T=0;T<h;++T){var V=B[T];(T===4||T===6||T===8)&&(I+="-"),V<16&&(I+="0"),I+=V.toString(16).toLowerCase()}return I}}function Ga(h){return h.__=void 0,delete h.__,h}})})(Ya||(Ya={}));/*!
|
|
15
15
|
* MIT License
|
|
16
16
|
*
|
|
17
17
|
* Copyright (c) 2017-2024 Peculiar Ventures, LLC
|
|
@@ -34,9 +34,9 @@
|
|
|
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
|
|
37
|
+
*/const bf="[object ArrayBuffer]";class C{static isArrayBuffer(e){return Object.prototype.toString.call(e)===bf}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=C.toUint8Array(e),n=C.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 xo="string",vf=/^[0-9a-f\s]+$/i,wf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Sf=/^[a-zA-Z0-9-_]+$/;class Za{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=C.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=C.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 _{static isHex(e){return typeof e===xo&&vf.test(e)}static isBase64(e){return typeof e===xo&&wf.test(e)}static isBase64Url(e){return typeof e===xo&&Sf.test(e)}static ToString(e,t="utf8"){const i=C.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=C.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(!_.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(!_.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=_.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Za.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=_.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Za.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=C.toUint8Array(e);let i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){const t=C.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(!_.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,""))||""}}_.DEFAULT_UTF8_ENCODING="utf8";function Af(...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 Xa(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
|
-
*/function
|
|
39
|
+
*/function sr(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 Mt(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 m=u-1;m>=0;m--){const y=Math.pow(2,m*e);p[s-m-1]=Math.floor(n/y),n-=p[s-m-1]*y}return f}c*=Math.pow(2,e)}return new ArrayBuffer(0)}function Bo(...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 Qa(){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=sr(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,sr(s,8)-i}function kf(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=Mt(c,8,i),f=new Uint8Array(u);return f[0]|=128,u}let n=Mt(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 Cf(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 He(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
|
|
41
41
|
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
42
42
|
* All rights reserved.
|
|
@@ -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 mi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function io(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 pt(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 bi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return io(this.items)}}const Pr=[new Uint8Array([1])],Ta="0123456789",no="name",_a="valueHexView",tf="isHexOnly",rf="idBlock",nf="tagClass",of="tagNumber",sf="isConstructed",af="fromBER",cf="toBER",lf="local",Ve="",Ge=new ArrayBuffer(0),vi=new Uint8Array(0),Rr="EndOfContent",Va="OCTET STRING",ja="BIT STRING";function rt(r){var e;return e=class extends r{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}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?C.toUint8Array(s.valueHex):vi}fromBER(i,n,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!pt(this,a,n,s))return-1;const u=n+s;return this.valueHexView=a.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",Ge)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:T.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Mt{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Ve,warnings:i=[],valueBeforeDecode:n=vi}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=C.toUint8Array(n)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:T.ToHex(this.valueBeforeDecodeView)}}}Mt.NAME="baseBlock";class Ne extends Mt{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 Pa extends rt(Mt){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?C.toUint8Array(e.valueHex):vi,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",Ge}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=Dt(this.tagNumber,7),s=new Uint8Array(n),a=n.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let f=0;f<a-1;f++)u[f+1]=s[f]|128;u[a]=s[a-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=C.toUint8Array(e);if(!pt(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,d=this.valueHexView=new Uint8Array(255),g=255;for(;s[f]&128;){if(d[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===g){g+=255;const L=new Uint8Array(g);for(let ne=0;ne<d.length;ne++)L[ne]=d[ne];d=this.valueHexView=new Uint8Array(g)}}this.blockLength=f+1,d[f-1]=s[f]&127;const h=new Uint8Array(f);for(let L=0;L<f;L++)h[L]=d[L];d=this.valueHexView=new Uint8Array(f),d.set(h),this.blockLength<=9?this.tagNumber=nr(d,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}}}Pa.NAME="identificationBlock";class Ra extends Mt{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=C.toUint8Array(e);if(!pt(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 a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+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+a);return f[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=nr(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,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=Dt(this.length,8);if(n.byteLength>127)return this.error="Too big length",Ge;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 a=0;a<n.byteLength;a++)i[a+1]=s[a];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}}}Ra.NAME="lengthBlock";const N={};class be extends Mt{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 Pa(n),this.lenBlock=new Ra(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 bi;t||Da(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 a=this.lenBlock.toBER(e);i.write(a),i.write(s)}return t?Ge: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():T.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,t=T.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return ef(t,i)}}be.NAME="BaseBlock";function Da(r){var e;if(r instanceof N.Constructed)for(const t of r.valueBlock.value)Da(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class oo extends be{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Ve,...t}={},i){super(t,i),e&&this.fromString(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}'`}}oo.NAME="BaseStringBlock";class Ma extends rt(Ne){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}Ma.NAME="PrimitiveValueBlock";var Ua;class Dr extends be{constructor(e={}){super(e,Ma),this.idBlock.isConstructed=!1}}Ua=Dr,N.Primitive=Ua,Dr.NAME="PRIMITIVE";function uf(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 or(r,e=0,t=r.length){const i=e;let n=new be({},Ne);const s=new Mt;if(!pt(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=be;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=N.EndOfContent;break;case 1:f=N.Boolean;break;case 2:f=N.Integer;break;case 3:f=N.BitString;break;case 4:f=N.OctetString;break;case 5:f=N.Null;break;case 6:f=N.ObjectIdentifier;break;case 10:f=N.Enumerated;break;case 12:f=N.Utf8String;break;case 13:f=N.RelativeObjectIdentifier;break;case 14:f=N.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=N.Sequence;break;case 17:f=N.Set;break;case 18:f=N.NumericString;break;case 19:f=N.PrintableString;break;case 20:f=N.TeletexString;break;case 21:f=N.VideotexString;break;case 22:f=N.IA5String;break;case 23:f=N.UTCTime;break;case 24:f=N.GeneralizedTime;break;case 25:f=N.GraphicString;break;case 26:f=N.VisibleString;break;case 27:f=N.GeneralString;break;case 28:f=N.UniversalString;break;case 29:f=N.CharacterString;break;case 30:f=N.BmpString;break;case 31:f=N.DATE;break;case 32:f=N.TimeOfDay;break;case 33:f=N.DateTime;break;case 34:f=N.Duration;break;default:{const d=n.idBlock.isConstructed?new N.Constructed:new N.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?N.Constructed:N.Primitive}return n=uf(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 sr(r){if(!r.byteLength){const e=new be({},Ne);return e.error="Input buffer has zero length",{offset:-1,result:e}}return or(C.toUint8Array(r).slice(),0,r.byteLength)}function ff(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=C.toUint8Array(e);if(!pt(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(;ff(this.isIndefiniteForm,i)>0;){const a=or(n,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Rr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Rr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new bi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?Ge: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 $a;class Ie extends be{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 $i(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Eo(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 yt(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 Hi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Eo(this.items)}}const $r=[new Uint8Array([1])],ec="0123456789",No="name",tc="valueHexView",xf="isHexOnly",Bf="idBlock",Ef="tagClass",Nf="tagNumber",If="isConstructed",Of="fromBER",_f="toBER",Tf="local",Pe="",Je=new ArrayBuffer(0),Li=new Uint8Array(0),Hr="EndOfContent",rc="OCTET STRING",ic="BIT STRING";function nt(r){var e;return e=class extends r{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}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?C.toUint8Array(s.valueHex):Li}fromBER(i,n,s){const c=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!yt(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:_.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Ut{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Pe,warnings:i=[],valueBeforeDecode:n=Li}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=C.toUint8Array(n)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:_.ToHex(this.valueBeforeDecodeView)}}}Ut.NAME="baseBlock";class Oe extends Ut{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'")}}Oe.NAME="valueBlock";class nc extends nt(Ut){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?C.toUint8Array(e.valueHex):Li,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=Mt(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=C.toUint8Array(e);if(!yt(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),m=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===m){m+=255;const L=new Uint8Array(m);for(let oe=0;oe<p.length;oe++)L[oe]=p[oe];p=this.valueHexView=new Uint8Array(m)}}this.blockLength=f+1,p[f-1]=s[f]&127;const y=new Uint8Array(f);for(let L=0;L<f;L++)y[L]=p[L];p=this.valueHexView=new Uint8Array(f),p.set(y),this.blockLength<=9?this.tagNumber=sr(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}}}nc.NAME="identificationBlock";class oc extends Ut{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=C.toUint8Array(e);if(!yt(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=sr(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=Mt(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}}}oc.NAME="lengthBlock";const N={};class ve extends Ut{constructor({name:e=Pe,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new nc(n),this.lenBlock=new oc(n),this.valueBlock=s?new s(n):new Oe(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 Hi;t||sc(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():_.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,t=_.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return Cf(t,i)}}ve.NAME="BaseBlock";function sc(r){var e;if(r instanceof N.Constructed)for(const t of r.valueBlock.value)sc(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class Io extends ve{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Pe,...t}={},i){super(t,i),e&&this.fromString(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}'`}}Io.NAME="BaseStringBlock";class ac extends nt(Oe){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}ac.NAME="PrimitiveValueBlock";var cc;class Lr extends ve{constructor(e={}){super(e,ac),this.idBlock.isConstructed=!1}}cc=Lr,N.Primitive=cc,Lr.NAME="PRIMITIVE";function Vf(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 ar(r,e=0,t=r.length){const i=e;let n=new ve({},Oe);const s=new Ut;if(!yt(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=ve;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=N.EndOfContent;break;case 1:f=N.Boolean;break;case 2:f=N.Integer;break;case 3:f=N.BitString;break;case 4:f=N.OctetString;break;case 5:f=N.Null;break;case 6:f=N.ObjectIdentifier;break;case 10:f=N.Enumerated;break;case 12:f=N.Utf8String;break;case 13:f=N.RelativeObjectIdentifier;break;case 14:f=N.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=N.Sequence;break;case 17:f=N.Set;break;case 18:f=N.NumericString;break;case 19:f=N.PrintableString;break;case 20:f=N.TeletexString;break;case 21:f=N.VideotexString;break;case 22:f=N.IA5String;break;case 23:f=N.UTCTime;break;case 24:f=N.GeneralizedTime;break;case 25:f=N.GraphicString;break;case 26:f=N.VisibleString;break;case 27:f=N.GeneralString;break;case 28:f=N.UniversalString;break;case 29:f=N.CharacterString;break;case 30:f=N.BmpString;break;case 31:f=N.DATE;break;case 32:f=N.TimeOfDay;break;case 33:f=N.DateTime;break;case 34:f=N.Duration;break;default:{const p=n.idBlock.isConstructed?new N.Constructed:new N.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?N.Constructed:N.Primitive}return n=Vf(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 cr(r){if(!r.byteLength){const e=new ve({},Oe);return e.error="Input buffer has zero length",{offset:-1,result:e}}return ar(C.toUint8Array(r).slice(),0,r.byteLength)}function jf(r,e){return r?1:e}class Et extends Oe{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=C.toUint8Array(e);if(!yt(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(;jf(this.isIndefiniteForm,i)>0;){const c=ar(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===Hr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Hr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new Hi;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}}Et.NAME="ConstructedValueBlock";var lc;class _e extends ve{constructor(e={}){super(e,Et),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} :`}}$a=Ie,N.Constructed=$a,Ie.NAME="CONSTRUCTED";class Ha extends Ne{fromBER(e,t,i){return t}toBER(e){return Ge}}Ha.override="EndOfContentValueBlock";var La;class so extends be{constructor(e={}){super(e,Ha),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}La=so,N.EndOfContent=La,so.NAME=Rr;var Fa;class Ut extends be{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}`}}Fa=Ut,N.Null=Fa,Ut.NAME="NULL";class qa extends rt(Ne){get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=C.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,i){const n=C.toUint8Array(e);return pt(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,Oa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}qa.NAME="BooleanValueBlock";var Ka;let wi=class extends be{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Ka=wi,N.Boolean=Ka,wi.NAME="BOOLEAN";class Wa extends rt(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 a=this.value[s].constructor.NAME;if(a===Rr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Va)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}}}Wa.NAME="OctetStringValueBlock";var ao;let $t=class extends be{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},Wa),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 a=or(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ie.prototype.onAsciiEncoding.call(this);const e=this.constructor.NAME,t=T.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof ao&&e.push(t.valueBlock.valueHexView);return C.concat(e)}};ao=$t,N.OctetString=ao,$t.NAME=Va;class Ga extends rt(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===Rr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==ja)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=u.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return n}const s=C.toUint8Array(e);if(!pt(this,s,t,i))return-1;const a=s.subarray(t,t+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=a.subarray(1);try{if(u.byteLength){const f=or(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.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 Ge;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}}}Ga.NAME="BitStringValueBlock";var za;let Ht=class extends be{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},Ga),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 Ie.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const a of t)e.push(a.toString(2).padStart(8,"0"));const i=e.join(""),n=this.constructor.NAME,s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${n} : ${s}`}}};za=Ht,N.BitString=za,Ht.NAME=ja;var Ja;function df(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const a=s.length-1,u=n.slice(0),f=u.length-1;let d=0;const g=f<a?a:f;let h=0;for(let L=g;L>=0;L--,h++){switch(!0){case h<u.length:d=s[a-h]+u[f-h]+t[0];break;default:d=s[a-h]+t[0]}switch(t[0]=d/10,!0){case h>=s.length:s=ro(new Uint8Array([d%10]),s);break;default:s[a-h]=d%10}}return t[0]>0&&(s=ro(t,s)),s}function Ya(r){if(r>=Pr.length)for(let e=Pr.length;e<=r;e++){const t=new Uint8Array([0]);let i=Pr[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=ro(t,i)),Pr.push(i)}return Pr[r]}function pf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),a=s.length-1,u=n.slice(0),f=u.length-1;let d,g=0;for(let h=f;h>=0;h--,g++)switch(d=s[a-g]-u[f-g]-t,!0){case d<0:t=1,s[a-g]=d+10;break;default:t=0,s[a-g]=d}if(t>0)for(let h=a-f+1;h>=0;h--,g++)if(d=s[a-g]-t,d<0)t=1,s[a-g]=d+10;else{t=0,s[a-g]=d;break}return s.slice()}class co extends rt(Ne){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=Oa.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Xu(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 a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):n!==0&&a.length<n&&(n-a.length>1&&(n=a.length+1),this.valueHexView=a.subarray(n-a.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 a="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case e:t=pf(Ya(i),t),a="-";break;default:t=df(t,Ya(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(a+=Ta.charAt(t[f]));return u===!1&&(a+=Ta.charAt(0)),a}}Ja=co,co.NAME="IntegerValueBlock",Object.defineProperty(Ja.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Mr;class ar extends be{constructor(e={}){super(e,co),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return mi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){mi();const t=BigInt(e),i=new bi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(T.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const d=BigInt(`0x${T.ToHex(u)}`)+t,g=C.toUint8Array(T.FromHex(d.toString(16)));g[0]|=128,i.write(g)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new Mr({valueHex:i.final()})}convertToDER(){const e=new Mr({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Mr({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Mr=ar,N.Integer=Mr,ar.NAME="INTEGER";var Za;class Si extends ar{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Za=Si,N.Enumerated=Za,Si.NAME="ENUMERATED";class lo extends rt(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=C.toUint8Array(e);if(!pt(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 a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,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=nr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){mi();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 a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Dt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ge;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=T.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}}}lo.NAME="sidBlock";class Qa 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 lo;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,Ge;t.push(n)}return io(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 a=this.value[0];let u=0;switch(a.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;a.valueDec=f+u,s=!1}else{const a=new lo;if(n>Number.MAX_SAFE_INTEGER){mi();const u=BigInt(n);a.valueBigInt=u}else if(a.valueDec=parseInt(n,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}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}}Qa.NAME="ObjectIdentifierValueBlock";var Xa;class Ai extends be{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Xa=Ai,N.ObjectIdentifier=Xa,Ai.NAME="OBJECT IDENTIFIER";class uo extends rt(Mt){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=C.toUint8Array(e);if(!pt(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 a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,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=nr(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 a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Dt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ge;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=T.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}uo.NAME="relativeSidBlock";class ec 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 uo;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,Ge;i.push(s)}return io(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 uo;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}}ec.NAME="RelativeObjectIdentifierValueBlock";var tc;class fo extends be{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,ec),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}tc=fo,N.RelativeObjectIdentifier=tc,fo.NAME="RelativeObjectIdentifier";var rc;class ze extends Ie{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}rc=ze,N.Sequence=rc,ze.NAME="SEQUENCE";var ic;let it=class extends Ie{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};ic=it,N.Set=ic,it.NAME="SET";class nc extends rt(Ne){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Ve}toJSON(){return{...super.toJSON(),value:this.value}}}nc.NAME="StringValueBlock";class oc extends nc{}oc.NAME="SimpleStringValueBlock";class $e extends oo{constructor({...e}={}){super(e,oc)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,C.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}}$e.NAME="SIMPLE STRING";class sc extends $e{fromBuffer(e){this.valueBlock.valueHexView=C.toUint8Array(e);try{this.valueBlock.value=T.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=T.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(T.FromUtf8String(e)),this.valueBlock.value=e}}sc.NAME="Utf8StringValueBlock";var ac;class ht extends sc{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ac=ht,N.Utf8String=ac,ht.NAME="UTF8String";class cc extends $e{fromBuffer(e){this.valueBlock.value=T.ToUtf16String(e),this.valueBlock.valueHexView=C.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(T.FromUtf16String(e))}}cc.NAME="BmpStringValueBlock";var lc;class ki extends cc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}lc=ki,N.BmpString=lc,ki.NAME="BMPString";class uc extends $e{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=Dt(e.charCodeAt(n),8),a=new Uint8Array(s);if(a.length>4)continue;const u=4-a.length;for(let f=a.length-1;f>=0;f--)i[n*4+f+u]=a[f]}this.valueBlock.value=e}}uc.NAME="UniversalStringValueBlock";var fc;class Ci extends uc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}fc=Ci,N.UniversalString=fc,Ci.NAME="UniversalString";var dc;class xi extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}dc=xi,N.NumericString=dc,xi.NAME="NumericString";var pc;class Bi extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}pc=Bi,N.PrintableString=pc,Bi.NAME="PrintableString";var hc;class Ei extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}hc=Ei,N.TeletexString=hc,Ei.NAME="TeletexString";var yc;class Ni extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}yc=Ni,N.VideotexString=yc,Ni.NAME="VideotexString";var gc;class Ii extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}gc=Ii,N.IA5String=gc,Ii.NAME="IA5String";var mc;class Oi extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}mc=Oi,N.GraphicString=mc,Oi.NAME="GraphicString";var bc;class Ur extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}bc=Ur,N.VisibleString=bc,Ur.NAME="VisibleString";var vc;class Ti extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}vc=Ti,N.GeneralString=vc,Ti.NAME="GeneralString";var wc;class _i extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}wc=_i,N.CharacterString=wc,_i.NAME="CharacterString";var Sc;class $r extends Ur{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,C.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]=Ue(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Ue(this.month,2),t[2]=Ue(this.day,2),t[3]=Ue(this.hour,2),t[4]=Ue(this.minute,2),t[5]=Ue(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}}}Sc=$r,N.UTCTime=Sc,$r.NAME="UTCTime";var Ac;class Vi extends $r{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(){const e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,i="",n="",s=0,a,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const h=new Number(e[e.length-1]);if(isNaN(h.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 h=1,L=i.indexOf("+"),ne="";if(L===-1&&(L=i.indexOf("-"),h=-1),L!==-1){if(ne=i.substring(L+1),i=i.substring(0,L),ne.length!==2&&ne.length!==4)throw new Error("Wrong input string for conversion");let re=parseInt(ne.substring(0,2),10);if(isNaN(re.valueOf()))throw new Error("Wrong input string for conversion");if(u=h*re,ne.length===4){if(re=parseInt(ne.substring(2,4),10),isNaN(re.valueOf()))throw new Error("Wrong input string for conversion");f=h*re}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const h=new Number(`0${i.substring(d)}`);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");s=h.valueOf(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let h=60*s;this.minute=Math.floor(h),h=60*(h-this.minute),this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let h=60*s;this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const h=1e3*s;this.millisecond=Math.floor(h)}break;default:throw new Error("Wrong input string for conversion")}const g=a.exec(n);if(g===null)throw new Error("Wrong input string for conversion");for(let h=1;h<g.length;h++)switch(h){case 1:this.year=parseInt(g[h],10);break;case 2:this.month=parseInt(g[h],10);break;case 3:this.day=parseInt(g[h],10);break;case 4:this.hour=parseInt(g[h],10)+u;break;case 5:this.minute=parseInt(g[h],10)+f;break;case 6:this.second=parseInt(g[h],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const h=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=h.getUTCFullYear(),this.month=h.getUTCMonth(),this.day=h.getUTCDay(),this.hour=h.getUTCHours(),this.minute=h.getUTCMinutes(),this.second=h.getUTCSeconds(),this.millisecond=h.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push(Ue(this.year,4)),t.push(Ue(this.month,2)),t.push(Ue(this.day,2)),t.push(Ue(this.hour,2)),t.push(Ue(this.minute,2)),t.push(Ue(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(Ue(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Ac=Vi,N.GeneralizedTime=Ac,Vi.NAME="GeneralizedTime";var kc;class po extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}kc=po,N.DATE=kc,po.NAME="DATE";var Cc;class ho extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Cc=ho,N.TimeOfDay=Cc,ho.NAME="TimeOfDay";var xc;class yo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}xc=yo,N.DateTime=xc,yo.NAME="DateTime";var Bc;class go extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Bc=go,N.Duration=Bc,go.NAME="Duration";var Ec;class mo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Ec=mo,N.TIME=Ec,mo.NAME="TIME";class Lt{constructor({name:e=Ve,optional:t=!1}={}){this.name=e,this.optional=t}}class bo extends Lt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class ji extends Lt{constructor({value:e=new Lt,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class hf{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=C.toUint8Array(e)}constructor({data:e=vi}={}){this.dataView=C.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=C.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function Bt(r,e,t){if(t instanceof bo){for(const s of t.value)if(Bt(r,e,s).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(no)&&(s.name=t.name),s}}if(t instanceof Lt)return t.hasOwnProperty(no)&&(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(!(rf in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(af in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(cf 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(nf)===!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(of)===!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(sf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(tf 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(!(_a in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,a=e.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==a[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 N.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof ji&&(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 d=0;d<t.valueBlock.value.length;d++)f=f&&(t.valueBlock.value[d].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 d={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],d.name=t.name)),d}}else if(t.valueBlock.value[0]instanceof ji){if(a=Bt(r,e.valueBlock.value[f],t.valueBlock.value[0].value),a.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]),a;if(no in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let d={};lf in t.valueBlock.value[0]&&t.valueBlock.value[0].local?d=e:d=r,typeof d[t.valueBlock.value[0].name]>"u"&&(d[t.valueBlock.value[0].name]=[]),d[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(a=Bt(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),a.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]),a;if(a.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&&_a in e.valueBlock){const s=or(e.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&(delete r[t.name],a.name=t.name)),a}return Bt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function yf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=or(C.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Bt(t.result,t.result,e)}const Nc=Object.freeze(Object.defineProperty({__proto__:null,Any:Lt,BaseBlock:be,BaseStringBlock:oo,BitString:Ht,BmpString:ki,Boolean:wi,CharacterString:_i,Choice:bo,Constructed:Ie,DATE:po,DateTime:yo,Duration:go,EndOfContent:so,Enumerated:Si,GeneralString:Ti,GeneralizedTime:Vi,GraphicString:Oi,HexBlock:rt,IA5String:Ii,Integer:ar,Null:Ut,NumericString:xi,ObjectIdentifier:Ai,OctetString:$t,Primitive:Dr,PrintableString:Bi,RawData:hf,RelativeObjectIdentifier:fo,Repeated:ji,Sequence:ze,Set:it,TIME:mo,TeletexString:Ei,TimeOfDay:ho,UTCTime:$r,UniversalString:Ci,Utf8String:ht,ValueBlock:Ne,VideotexString:Ni,ViewWriter:bi,VisibleString:Ur,compareSchema:Bt,fromBER:sr,verifySchema:yf},Symbol.toStringTag,{value:"Module"}));var v;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(v||(v={}));var p;(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"})(p||(p={}));class Pi{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(C.isBufferSource(e))this.unusedBits=t,this.value=C.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Ht))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 Ht({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ht({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 Q{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):C.isBufferSource(e)?this.buffer=C.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 gf={fromASN:r=>r instanceof Ut?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Ut;const e=sr(r);if(e.result.error)throw new Error(e.result.error);return e.result}},mf={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new ar({value:+r})},bf={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new Si({value:r})},le={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new ar({valueHex:r})},vf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ht({valueHex:r})},wf={fromASN:r=>r.valueBlock.toString(),toASN:r=>new Ai({value:r})},Sf={fromASN:r=>r.valueBlock.value,toASN:r=>new wi({value:r})},Ri={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new $t({valueHex:r})},Af={fromASN:r=>new Q(r.getValue()),toASN:r=>r.toASN()};function qe(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Ic=qe(ht),kf=qe(ki),Cf=qe(Ci),xf=qe(xi),Bf=qe(Bi),Ef=qe(Ei),Nf=qe(Ni),If=qe(Ii),Of=qe(Oi),Tf=qe(Ur),_f=qe(Ti),Vf=qe(_i),jf={fromASN:r=>r.toDate(),toASN:r=>new $r({valueDate:r})},Pf={fromASN:r=>r.toDate(),toASN:r=>new Vi({valueDate:r})},Rf={fromASN:()=>null,toASN:()=>new Ut};function Hr(r){switch(r){case p.Any:return gf;case p.BitString:return vf;case p.BmpString:return kf;case p.Boolean:return Sf;case p.CharacterString:return Vf;case p.Enumerated:return bf;case p.GeneralString:return _f;case p.GeneralizedTime:return Pf;case p.GraphicString:return Of;case p.IA5String:return If;case p.Integer:return mf;case p.Null:return Rf;case p.NumericString:return xf;case p.ObjectIdentifier:return wf;case p.OctetString:return Ri;case p.PrintableString:return Bf;case p.TeletexString:return Ef;case p.UTCTime:return jf;case p.UniversalString:return Cf;case p.Utf8String:return Ic;case p.VideotexString:return Nf;case p.VisibleString:return Tf;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 Oc(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:Oc(t)}return!1}function Df(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 Mf{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:v.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 a=i.items[s],u=t?s:"";let f;if(typeof a.type=="number"){const g=p[a.type],h=Nc[g];if(!h)throw new Error(`Cannot get ASN1 class by name '${g}'`);f=new h({name:u})}else yt(a.type)?f=new a.type().toSchema(u):a.optional?this.get(a.type).type===v.Choice?f=new Lt({name:u}):(f=this.create(a.type,!1),f.name=u):f=new Lt({name:u});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){f.name="";const g=a.repeated==="set"?it:ze;f=new g({name:"",value:[new ji({name:u,value:f})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||yt(a.type)){const g=a.repeated?Ie:Dr;n.push(new g({name:u,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const g=!!a.repeated;let h=g?f:this.get(a.type,!0).schema;h="valueBlock"in h?h.valueBlock.value:h.value,n.push(new Ie({name:g?"":u,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:h}))}else n.push(new Ie({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[f]}));else f.optional=d,n.push(f)}switch(i.type){case v.Sequence:return new ze({value:n,name:""});case v.Set:return new it({value:n,name:""});case v.Choice:return new bo({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 he=new Mf,w=r=>e=>{let t;he.has(e)?t=he.get(e):(t=he.createDefault(e),he.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;he.has(e.constructor)?i=he.get(e.constructor):(i=he.createDefault(e.constructor),he.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=Hr(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 Lr extends Error{constructor(){super(...arguments),this.schemas=[]}}class Uf{static parse(e,t){const i=sr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){try{if(yt(t))return new t().fromASN(e);const i=he.get(t);he.cache(t);let n=i.schema;const s=this.handleChoiceTypes(e,i,t,n);if(s!=null&&s.result)return s.result;s!=null&&s.targetSchema&&(n=s.targetSchema);const a=this.handleSequenceTypes(e,i,t,n);if(a&&"isManualMapping"in a)return a.result;const u=a,f=new t;return Oc(t)?this.handleArrayTypes(e,i,t):(this.processSchemaItems(i,u,f),f)}catch(i){throw i instanceof Lr&&i.schemas.push(t.name),i}}static handleChoiceTypes(e,t,i,n){if(e.constructor===Ie&&t.type===v.Choice&&e.idBlock.tagClass===3)for(const s in t.items){const a=t.items[s];if(a.context===e.idBlock.tagNumber&&a.implicit&&typeof a.type=="function"&&he.has(a.type)){const u=he.get(a.type);if(u&&u.type===v.Sequence){const f=new ze;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in f.valueBlock){f.valueBlock.value=e.valueBlock.value;const d=this.fromASN(f,a.type),g=new i;return g[s]=d,{result:g}}}}}else if(e.constructor===Ie&&t.type!==v.Choice){const s=new Ie({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(const a in t.items)delete e[a];return{targetSchema:s}}return null}static handleSequenceTypes(e,t,i,n){if(t.type===v.Sequence){if(Object.keys(t.items).filter(u=>{const f=t.items[u];return f.optional&&typeof f.type=="function"&&he.has(f.type)&&he.get(f.type).type===v.Choice}).length>0&&"value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&i.name==="CertReqMsg")return this.handleManualMapping(e,t,i);const a=Bt({},e,n);if(!a.verified)throw new Lr(`Data does not match to ${i.name} ASN1 schema. ${a.result.error}`);return a}else{const s=Bt({},e,n);if(!s.verified)throw new Lr(`Data does not match to ${i.name} ASN1 schema. ${s.result.error}`);return s}}static handleManualMapping(e,t,i){const n=new i,s=e.valueBlock.value,a=Object.keys(t.items);let u=0;for(let f=0;f<a.length;f++){const d=a[f],g=t.items[d];if(u>=s.length)break;if(g.repeated){n[d]=this.processRepeatedField(s,u,g);break}else if(typeof g.type=="number")n[d]=this.processPrimitiveField(s[u],g),u++;else if(this.isOptionalChoiceField(g)){const h=this.processOptionalChoiceField(s[u],g);h.processed&&(n[d]=h.value,u++)}else n[d]=this.fromASN(s[u],g.type),u++}return{result:n,verified:!0,isManualMapping:!0}}static processRepeatedField(e,t,i){let n=e.slice(t);if(n.length===1&&n[0].constructor.name==="Sequence"){const s=n[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(n=s.valueBlock.value)}if(typeof i.type=="number"){const s=Hr(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(a=>a&&a.valueBlock).map(a=>{try{return s.fromASN(a)}catch{return}}).filter(a=>a!==void 0)}else return n.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,i.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,t){const i=Hr(t.type);if(!i)throw new Error(`No converter for ASN.1 type ${t.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&he.has(e.type)&&he.get(e.type).type===v.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(i){if(i instanceof Lr&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,t,i){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 n=t.itemType;if(typeof n=="number"){const s=Hr(n);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,a=>s.fromASN(a))}else return i.from(e.valueBlock.value,s=>this.fromASN(s,n))}static processSchemaItems(e,t,i){for(const n in e.items){const s=t.result[n];if(!s)continue;const a=e.items[n],u=a.type;typeof u=="number"||yt(u)?i[n]=this.processPrimitiveSchemaItem(s,a,u):i[n]=this.processComplexSchemaItem(s,a,u)}}static processPrimitiveSchemaItem(e,t,i){var n;const s=(n=t.converter)!==null&&n!==void 0?n:yt(i)?new i:null;if(!s)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,s):this.processSinglePrimitiveItem(e,t,i,s)}static processRepeatedPrimitiveItem(e,t,i){if(t.implicit){const n=t.repeated==="sequence"?ze:it,s=new n;s.valueBlock=e.valueBlock;const a=sr(s.toBER(!1));if(a.offset===-1)throw new Error(`Cannot parse the child item. ${a.result.error}`);if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const u=a.result.valueBlock.value;return Array.from(u,f=>i.fromASN(f))}else return Array.from(e,n=>i.fromASN(n))}static processSinglePrimitiveItem(e,t,i,n){let s=e;if(t.implicit){let a;if(yt(i))a=new i().toSchema("");else{const u=p[i],f=Nc[u];if(!f)throw new Error(`Cannot get '${u}' class from asn1js module`);a=new f}a.valueBlock=s.valueBlock,s=sr(a.toBER(!1)).result}return n.fromASN(s)}static processComplexSchemaItem(e,t,i){if(t.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,n=>this.fromASN(n,i))}else{const n=this.handleImplicitTagging(e,t,i);if(this.isOptionalChoiceField(t))try{return this.fromASN(n,i)}catch(s){if(s instanceof Lr&&/Wrong values for Choice type/.test(s.message))return;throw s}else return this.fromASN(n,i)}}static handleImplicitTagging(e,t,i){if(t.implicit&&typeof t.context=="number"){const n=he.get(i);if(n.type===v.Sequence){const s=new ze;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(n.type===v.Set){const s=new it;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}}class vo{static serialize(e){return e instanceof be?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=he.get(t);he.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 a=Hr(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>a.toASN(u))}else n=e.map(a=>this.toAsnItem({type:i.itemType},"[]",t,a))}else for(const a in i.items){const u=i.items[a],f=e[a];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&Df(this.serialize(u.defaultValue),this.serialize(f)))continue;const d=vo.toAsnItem(u,a,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||yt(u.type))){const g={};g.valueHex=d instanceof Ut?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Dr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...g}))}else n.push(new Ie({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:d.valueBlock.value}));else n.push(new Ie({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[d]}));else u.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case v.Sequence:s=new ze({value:n});break;case v.Set:s=new it({value:n});break;case v.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 a=e.converter;if(!a)throw new Error(`Property '${t}' doesn't have converter for type ${p[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,d=>a.toASN(d)),f=e.repeated==="sequence"?ze:it;s=new f({value:u})}else s=a.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?ze:it;s=new u({value:a})}else s=this.toASN(n);return s}}class te extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class x{static serialize(e){return vo.serialize(e)}static parse(e,t){return Uf.parse(e,t)}static toString(e){const t=C.isBufferSource(e)?C.toArrayBuffer(e):x.serialize(e),i=sr(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function c(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;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--)(a=r[u])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;class Tc{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){const t=e.split(".");if(t.length!==4)throw new Error("Invalid IPv4 address");return t.map(i=>{const n=parseInt(i,10);if(isNaN(n)||n<0||n>255)throw new Error("Invalid IPv4 address part");return n})}static parseIPv6(e){const i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((n,s)=>{const a=parseInt(s,16);if(isNaN(a)||a<0||a>65535)throw new Error("Invalid IPv6 address part");return n.push(a>>8&255),n.push(a&255),n},[])}static expandIPv6(e){if(!e.includes("::"))return e;const t=e.split("::");if(t.length>2)throw new Error("Invalid IPv6 address");const i=t[0]?t[0].split(":"):[],n=t[1]?t[1].split(":"):[],s=8-(i.length+n.length);if(s<0)throw new Error("Invalid IPv6 address");return[...i,...Array(s).fill("0"),...n].join(":")}static formatIPv6(e){const t=[];for(let i=0;i<16;i+=2)t.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){const t=e.split(":");let i=-1,n=0,s=-1,a=0;for(let u=0;u<t.length;u++)t[u]==="0"?(s===-1&&(s=u),a++):(a>n&&(i=s,n=a),s=-1,a=0);if(a>n&&(i=s,n=a),n>1){const u=t.slice(0,i).join(":"),f=t.slice(i+n).join(":");return`${u}::${f}`}return e}static parseCIDR(e){const[t,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(t)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),n]}else{if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),n]}}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){const t=new Uint8Array(e);if(t.length===4)return Array.from(t).join(".");if(t.length===16)return this.formatIPv6(t);if(t.length===8||t.length===32){const i=t.length/2,n=t.slice(0,i),s=t.slice(i);if(t.every(f=>f===0))return t.length===8?"0.0.0.0/0":"::/0";const u=s.reduce((f,d)=>f+(d.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(n).join(".")}/${u}`:`${this.formatIPv6(n)}/${u}`}return this.decodeIP(T.ToHex(e))}static fromString(e){if(e.includes("/")){const[i,n]=this.parseCIDR(e),s=new Uint8Array(i.length);let a=n;for(let f=0;f<s.length;f++)a>=8?(s[f]=255,a-=8):a>0&&(s[f]=255<<8-a,a=0);const u=new Uint8Array(i.length*2);return u.set(i,0),u.set(s,i.length),u.buffer}const t=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(t).buffer}}var wo,So,Ao;let ve=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};c([l({type:p.TeletexString})],ve.prototype,"teletexString",void 0),c([l({type:p.PrintableString})],ve.prototype,"printableString",void 0),c([l({type:p.UniversalString})],ve.prototype,"universalString",void 0),c([l({type:p.Utf8String})],ve.prototype,"utf8String",void 0),c([l({type:p.BmpString})],ve.prototype,"bmpString",void 0),ve=c([w({type:v.Choice})],ve);let cr=class extends ve{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?T.ToHex(this.anyValue):super.toString())}};c([l({type:p.IA5String})],cr.prototype,"ia5String",void 0),c([l({type:p.Any})],cr.prototype,"anyValue",void 0),cr=c([w({type:v.Choice})],cr);class Di{constructor(e={}){this.type="",this.value=new cr,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Di.prototype,"type",void 0),c([l({type:cr})],Di.prototype,"value",void 0);let lr=wo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,wo.prototype)}};lr=wo=c([w({type:v.Set,itemType:Di})],lr);let ko=So=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,So.prototype)}};ko=So=c([w({type:v.Sequence,itemType:lr})],ko);let ye=Ao=class extends ko{constructor(e){super(e),Object.setPrototypeOf(this,Ao.prototype)}};ye=Ao=c([w({type:v.Sequence})],ye);const $f={fromASN:r=>Tc.toString(Ri.fromASN(r)),toASN:r=>Ri.toASN(Tc.fromString(r))};class Fr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Fr.prototype,"typeId",void 0),c([l({type:p.Any,context:0})],Fr.prototype,"value",void 0);class Co{constructor(e={}){this.partyName=new ve,Object.assign(this,e)}}c([l({type:ve,optional:!0,context:0,implicit:!0})],Co.prototype,"nameAssigner",void 0),c([l({type:ve,context:1,implicit:!0})],Co.prototype,"partyName",void 0);let q=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Fr,context:0,implicit:!0})],q.prototype,"otherName",void 0),c([l({type:p.IA5String,context:1,implicit:!0})],q.prototype,"rfc822Name",void 0),c([l({type:p.IA5String,context:2,implicit:!0})],q.prototype,"dNSName",void 0),c([l({type:p.Any,context:3,implicit:!0})],q.prototype,"x400Address",void 0),c([l({type:ye,context:4,implicit:!1})],q.prototype,"directoryName",void 0),c([l({type:Co,context:5})],q.prototype,"ediPartyName",void 0),c([l({type:p.IA5String,context:6,implicit:!0})],q.prototype,"uniformResourceIdentifier",void 0),c([l({type:p.OctetString,context:7,implicit:!0,converter:$f})],q.prototype,"iPAddress",void 0),c([l({type:p.ObjectIdentifier,context:8,implicit:!0})],q.prototype,"registeredID",void 0),q=c([w({type:v.Choice})],q);const xo="1.3.6.1.5.5.7",Hf=`${xo}.1`,ur=`${xo}.3`,Mi=`${xo}.48`,_c=`${Mi}.1`,Vc=`${Mi}.2`,jc=`${Mi}.3`,Pc=`${Mi}.5`,gt="2.5.29";var Bo;const Eo=`${Hf}.1`;class qr{constructor(e={}){this.accessMethod="",this.accessLocation=new q,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],qr.prototype,"accessMethod",void 0),c([l({type:q})],qr.prototype,"accessLocation",void 0);let fr=Bo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Bo.prototype)}};fr=Bo=c([w({type:v.Sequence,itemType:qr})],fr);const No=`${gt}.35`;class Io extends Q{}class Ft{constructor(e={}){e&&Object.assign(this,e)}}c([l({type:Io,context:0,optional:!0,implicit:!0})],Ft.prototype,"keyIdentifier",void 0),c([l({type:q,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ft.prototype,"authorityCertIssuer",void 0),c([l({type:p.Integer,context:2,optional:!0,implicit:!0,converter:le})],Ft.prototype,"authorityCertSerialNumber",void 0);const Rc=`${gt}.19`;class Ui{constructor(e={}){this.cA=!1,Object.assign(this,e)}}c([l({type:p.Boolean,defaultValue:!1})],Ui.prototype,"cA",void 0),c([l({type:p.Integer,optional:!0})],Ui.prototype,"pathLenConstraint",void 0);var Oo;let xe=Oo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Oo.prototype)}};xe=Oo=c([w({type:v.Sequence,itemType:q})],xe);var To;let Dc=To=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,To.prototype)}};Dc=To=c([w({type:v.Sequence})],Dc);var _o;const Mc=`${gt}.32`;let mt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};c([l({type:p.IA5String})],mt.prototype,"ia5String",void 0),c([l({type:p.VisibleString})],mt.prototype,"visibleString",void 0),c([l({type:p.BmpString})],mt.prototype,"bmpString",void 0),c([l({type:p.Utf8String})],mt.prototype,"utf8String",void 0),mt=c([w({type:v.Choice})],mt);class Vo{constructor(e={}){this.organization=new mt,this.noticeNumbers=[],Object.assign(this,e)}}c([l({type:mt})],Vo.prototype,"organization",void 0),c([l({type:p.Integer,repeated:"sequence"})],Vo.prototype,"noticeNumbers",void 0);class jo{constructor(e={}){Object.assign(this,e)}}c([l({type:Vo,optional:!0})],jo.prototype,"noticeRef",void 0),c([l({type:mt,optional:!0})],jo.prototype,"explicitText",void 0);let $i=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.IA5String})],$i.prototype,"cPSuri",void 0),c([l({type:jo})],$i.prototype,"userNotice",void 0),$i=c([w({type:v.Choice})],$i);class Po{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Po.prototype,"policyQualifierId",void 0),c([l({type:p.Any})],Po.prototype,"qualifier",void 0);class Hi{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Hi.prototype,"policyIdentifier",void 0),c([l({type:Po,repeated:"sequence",optional:!0})],Hi.prototype,"policyQualifiers",void 0);let Li=_o=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,_o.prototype)}};Li=_o=c([w({type:v.Sequence,itemType:Hi})],Li);let Fi=class{constructor(e=0){this.value=e}};c([l({type:p.Integer})],Fi.prototype,"value",void 0),Fi=c([w({type:v.Choice})],Fi);let Uc=class extends Fi{};Uc=c([w({type:v.Choice})],Uc);var Ro;const Do=`${gt}.31`;var Je;(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"})(Je||(Je={}));class $c extends Pi{toJSON(){const e=[],t=this.toNumber();return t&Je.aACompromise&&e.push("aACompromise"),t&Je.affiliationChanged&&e.push("affiliationChanged"),t&Je.cACompromise&&e.push("cACompromise"),t&Je.certificateHold&&e.push("certificateHold"),t&Je.cessationOfOperation&&e.push("cessationOfOperation"),t&Je.keyCompromise&&e.push("keyCompromise"),t&Je.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Je.superseded&&e.push("superseded"),t&Je.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let qt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:q,context:0,repeated:"sequence",implicit:!0})],qt.prototype,"fullName",void 0),c([l({type:lr,context:1,implicit:!0})],qt.prototype,"nameRelativeToCRLIssuer",void 0),qt=c([w({type:v.Choice})],qt);class dr{constructor(e={}){Object.assign(this,e)}}c([l({type:qt,context:0,optional:!0})],dr.prototype,"distributionPoint",void 0),c([l({type:$c,context:1,optional:!0,implicit:!0})],dr.prototype,"reasons",void 0),c([l({type:q,context:2,optional:!0,repeated:"sequence",implicit:!0})],dr.prototype,"cRLIssuer",void 0);let pr=Ro=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ro.prototype)}};pr=Ro=c([w({type:v.Sequence,itemType:dr})],pr);var Mo;let Hc=Mo=class extends pr{constructor(e){super(e),Object.setPrototypeOf(this,Mo.prototype)}};Hc=Mo=c([w({type:v.Sequence,itemType:dr})],Hc);class Be{constructor(e={}){this.onlyContainsUserCerts=Be.ONLY,this.onlyContainsCACerts=Be.ONLY,this.indirectCRL=Be.ONLY,this.onlyContainsAttributeCerts=Be.ONLY,Object.assign(this,e)}}Be.ONLY=!1,c([l({type:qt,context:0,optional:!0})],Be.prototype,"distributionPoint",void 0),c([l({type:p.Boolean,context:1,defaultValue:Be.ONLY,implicit:!0})],Be.prototype,"onlyContainsUserCerts",void 0),c([l({type:p.Boolean,context:2,defaultValue:Be.ONLY,implicit:!0})],Be.prototype,"onlyContainsCACerts",void 0),c([l({type:$c,context:3,optional:!0,implicit:!0})],Be.prototype,"onlySomeReasons",void 0),c([l({type:p.Boolean,context:4,defaultValue:Be.ONLY,implicit:!0})],Be.prototype,"indirectCRL",void 0),c([l({type:p.Boolean,context:5,defaultValue:Be.ONLY,implicit:!0})],Be.prototype,"onlyContainsAttributeCerts",void 0);var Kr;(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"})(Kr||(Kr={}));let Uo=class{constructor(e=Kr.unspecified){this.reason=Kr.unspecified,this.reason=e}toJSON(){return Kr[this.reason]}toString(){return this.toJSON()}};c([l({type:p.Enumerated})],Uo.prototype,"reason",void 0),Uo=c([w({type:v.Choice})],Uo);var $o;const Lc=`${gt}.37`;let qi=$o=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,$o.prototype)}};qi=$o=c([w({type:v.Sequence,itemType:p.ObjectIdentifier})],qi);const Lf=`${ur}.1`,Ff=`${ur}.2`,qf=`${ur}.3`,Kf=`${ur}.4`,Wf=`${ur}.8`,Gf=`${ur}.9`;let Ho=class{constructor(e=new ArrayBuffer(0)){this.value=e}};c([l({type:p.Integer,converter:le})],Ho.prototype,"value",void 0),Ho=c([w({type:v.Choice})],Ho);let Lo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};c([l({type:p.GeneralizedTime})],Lo.prototype,"value",void 0),Lo=c([w({type:v.Choice})],Lo);var Fo;const Fc=`${gt}.18`;let qc=Fo=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,Fo.prototype)}};qc=Fo=c([w({type:v.Sequence})],qc);const Kc=`${gt}.15`;var Ye;(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"})(Ye||(Ye={}));class qo extends Pi{toJSON(){const e=this.toNumber(),t=[];return e&Ye.cRLSign&&t.push("crlSign"),e&Ye.dataEncipherment&&t.push("dataEncipherment"),e&Ye.decipherOnly&&t.push("decipherOnly"),e&Ye.digitalSignature&&t.push("digitalSignature"),e&Ye.encipherOnly&&t.push("encipherOnly"),e&Ye.keyAgreement&&t.push("keyAgreement"),e&Ye.keyCertSign&&t.push("keyCertSign"),e&Ye.keyEncipherment&&t.push("keyEncipherment"),e&Ye.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var Ko;class Ki{constructor(e={}){this.base=new q,this.minimum=0,Object.assign(this,e)}}c([l({type:q})],Ki.prototype,"base",void 0),c([l({type:p.Integer,context:0,defaultValue:0,implicit:!0})],Ki.prototype,"minimum",void 0),c([l({type:p.Integer,context:1,optional:!0,implicit:!0})],Ki.prototype,"maximum",void 0);let Wi=Ko=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};Wi=Ko=c([w({type:v.Sequence,itemType:Ki})],Wi);class Wc{constructor(e={}){Object.assign(this,e)}}c([l({type:Wi,context:0,optional:!0,implicit:!0})],Wc.prototype,"permittedSubtrees",void 0),c([l({type:Wi,context:1,optional:!0,implicit:!0})],Wc.prototype,"excludedSubtrees",void 0);class Gc{constructor(e={}){Object.assign(this,e)}}c([l({type:p.Integer,context:0,implicit:!0,optional:!0,converter:le})],Gc.prototype,"requireExplicitPolicy",void 0),c([l({type:p.Integer,context:1,implicit:!0,optional:!0,converter:le})],Gc.prototype,"inhibitPolicyMapping",void 0);var Wo;class Go{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Go.prototype,"issuerDomainPolicy",void 0),c([l({type:p.ObjectIdentifier})],Go.prototype,"subjectDomainPolicy",void 0);let zc=Wo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Wo.prototype)}};zc=Wo=c([w({type:v.Sequence,itemType:Go})],zc);var zo;const Jc=`${gt}.17`;let Jo=zo=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,zo.prototype)}};Jo=zo=c([w({type:v.Sequence})],Jo);let bt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],bt.prototype,"type",void 0),c([l({type:p.Any,repeated:"set"})],bt.prototype,"values",void 0);var Yo;let Yc=Yo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};Yc=Yo=c([w({type:v.Sequence,itemType:bt})],Yc);const Zc=`${gt}.14`;class Et extends Io{}class Qc{constructor(e={}){Object.assign(this,e)}}c([l({type:p.GeneralizedTime,context:0,implicit:!0,optional:!0})],Qc.prototype,"notBefore",void 0),c([l({type:p.GeneralizedTime,context:1,implicit:!0,optional:!0})],Qc.prototype,"notAfter",void 0);var Wr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Wr||(Wr={}));class Xc extends Pi{toJSON(){const e=[],t=this.toNumber();return t&Wr.pKIXCertificate&&e.push("pKIXCertificate"),t&Wr.newExtensions&&e.push("newExtensions"),t&Wr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class el{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Xc,Object.assign(this,e)}}c([l({type:p.GeneralString})],el.prototype,"entrustVers",void 0),c([l({type:Xc})],el.prototype,"entrustInfoFlags",void 0);var Zo;let tl=Zo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Zo.prototype)}};tl=Zo=c([w({type:v.Sequence,itemType:qr})],tl);class E{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof E&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Ia(e.parameters,this.parameters)||e.parameters===this.parameters)}}c([l({type:p.ObjectIdentifier})],E.prototype,"algorithm",void 0),c([l({type:p.Any,optional:!0})],E.prototype,"parameters",void 0);class nt{constructor(e={}){this.algorithm=new E,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:E})],nt.prototype,"algorithm",void 0),c([l({type:p.BitString})],nt.prototype,"subjectPublicKey",void 0);let we=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}};c([l({type:p.UTCTime})],we.prototype,"utcTime",void 0),c([l({type:p.GeneralizedTime})],we.prototype,"generalTime",void 0),we=c([w({type:v.Choice})],we);class Gi{constructor(e){this.notBefore=new we(new Date),this.notAfter=new we(new Date),e&&(this.notBefore=new we(e.notBefore),this.notAfter=new we(e.notAfter))}}c([l({type:we})],Gi.prototype,"notBefore",void 0),c([l({type:we})],Gi.prototype,"notAfter",void 0);var Qo;let Ze=class Gu{constructor(e={}){this.extnID="",this.critical=Gu.CRITICAL,this.extnValue=new Q,Object.assign(this,e)}};Ze.CRITICAL=!1,c([l({type:p.ObjectIdentifier})],Ze.prototype,"extnID",void 0),c([l({type:p.Boolean,defaultValue:Ze.CRITICAL})],Ze.prototype,"critical",void 0),c([l({type:Q})],Ze.prototype,"extnValue",void 0);let Kt=Qo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Kt=Qo=c([w({type:v.Sequence,itemType:Ze})],Kt);var hr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(hr||(hr={}));class Ke{constructor(e={}){this.version=hr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new E,this.issuer=new ye,this.validity=new Gi,this.subject=new ye,this.subjectPublicKeyInfo=new nt,Object.assign(this,e)}}c([l({type:p.Integer,context:0,defaultValue:hr.v1})],Ke.prototype,"version",void 0),c([l({type:p.Integer,converter:le})],Ke.prototype,"serialNumber",void 0),c([l({type:E})],Ke.prototype,"signature",void 0),c([l({type:ye})],Ke.prototype,"issuer",void 0),c([l({type:Gi})],Ke.prototype,"validity",void 0),c([l({type:ye})],Ke.prototype,"subject",void 0),c([l({type:nt})],Ke.prototype,"subjectPublicKeyInfo",void 0),c([l({type:p.BitString,context:1,implicit:!0,optional:!0})],Ke.prototype,"issuerUniqueID",void 0),c([l({type:p.BitString,context:2,implicit:!0,optional:!0})],Ke.prototype,"subjectUniqueID",void 0),c([l({type:Kt,context:3,optional:!0})],Ke.prototype,"extensions",void 0);class yr{constructor(e={}){this.tbsCertificate=new Ke,this.signatureAlgorithm=new E,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Ke})],yr.prototype,"tbsCertificate",void 0),c([l({type:E})],yr.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],yr.prototype,"signatureValue",void 0);class zi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new we,Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],zi.prototype,"userCertificate",void 0),c([l({type:we})],zi.prototype,"revocationDate",void 0),c([l({type:Ze,optional:!0,repeated:"sequence"})],zi.prototype,"crlEntryExtensions",void 0);class vt{constructor(e={}){this.signature=new E,this.issuer=new ye,this.thisUpdate=new we,Object.assign(this,e)}}c([l({type:p.Integer,optional:!0})],vt.prototype,"version",void 0),c([l({type:E})],vt.prototype,"signature",void 0),c([l({type:ye})],vt.prototype,"issuer",void 0),c([l({type:we})],vt.prototype,"thisUpdate",void 0),c([l({type:we,optional:!0})],vt.prototype,"nextUpdate",void 0),c([l({type:zi,repeated:"sequence",optional:!0})],vt.prototype,"revokedCertificates",void 0),c([l({type:Ze,optional:!0,context:0,repeated:"sequence"})],vt.prototype,"crlExtensions",void 0);let Xo=class{constructor(e={}){this.tbsCertList=new vt,this.signatureAlgorithm=new E,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};c([l({type:vt})],Xo.prototype,"tbsCertList",void 0),c([l({type:E})],Xo.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],Xo.prototype,"signature",void 0);class gr{constructor(e={}){this.issuer=new ye,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:ye})],gr.prototype,"issuer",void 0),c([l({type:p.Integer,converter:le})],gr.prototype,"serialNumber",void 0);let mr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0})],mr.prototype,"subjectKeyIdentifier",void 0),c([l({type:gr})],mr.prototype,"issuerAndSerialNumber",void 0),mr=c([w({type:v.Choice})],mr);var wt;(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"})(wt||(wt={}));let Gr=class extends E{};Gr=c([w({type:v.Sequence})],Gr);let Ji=class extends E{};Ji=c([w({type:v.Sequence})],Ji);let ot=class extends E{};ot=c([w({type:v.Sequence})],ot);let Yi=class extends E{};Yi=c([w({type:v.Sequence})],Yi);let rl=class extends E{};rl=c([w({type:v.Sequence})],rl);let es=class extends E{};es=c([w({type:v.Sequence})],es);let br=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],br.prototype,"attrType",void 0),c([l({type:p.Any,repeated:"set"})],br.prototype,"attrValues",void 0);var ts;class st{constructor(e={}){this.version=wt.v0,this.sid=new mr,this.digestAlgorithm=new Gr,this.signatureAlgorithm=new Ji,this.signature=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],st.prototype,"version",void 0),c([l({type:mr})],st.prototype,"sid",void 0),c([l({type:Gr})],st.prototype,"digestAlgorithm",void 0),c([l({type:br,repeated:"set",context:0,implicit:!0,optional:!0})],st.prototype,"signedAttrs",void 0),c([l({type:Ji})],st.prototype,"signatureAlgorithm",void 0),c([l({type:Q})],st.prototype,"signature",void 0),c([l({type:br,repeated:"set",context:1,implicit:!0,optional:!0})],st.prototype,"unsignedAttrs",void 0);let Zi=ts=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ts.prototype)}};Zi=ts=c([w({type:v.Set,itemType:st})],Zi);let il=class extends we{};il=c([w({type:v.Choice})],il);let nl=class extends st{};nl=c([w({type:v.Sequence})],nl);class rs{constructor(e={}){this.acIssuer=new q,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}c([l({type:q})],rs.prototype,"acIssuer",void 0),c([l({type:p.Integer})],rs.prototype,"acSerial",void 0),c([l({type:bt,repeated:"sequence"})],rs.prototype,"attrs",void 0);var is;let Qi=is=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,is.prototype)}};Qi=is=c([w({type:v.Sequence,itemType:p.ObjectIdentifier})],Qi);class Xi{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}c([l({type:p.Integer,optional:!0})],Xi.prototype,"pathLenConstraint",void 0),c([l({type:Qi,implicit:!0,context:0,optional:!0})],Xi.prototype,"permittedAttrs",void 0),c([l({type:Qi,implicit:!0,context:1,optional:!0})],Xi.prototype,"excludedAttrs",void 0),c([l({type:p.Boolean,defaultValue:!0})],Xi.prototype,"permitUnSpecified",void 0);class Wt{constructor(e={}){this.issuer=new xe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:xe})],Wt.prototype,"issuer",void 0),c([l({type:p.Integer,converter:le})],Wt.prototype,"serial",void 0),c([l({type:p.BitString,optional:!0})],Wt.prototype,"issuerUID",void 0);var ns;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(ns||(ns={}));class Gt{constructor(e={}){this.digestedObjectType=ns.publicKey,this.digestAlgorithm=new E,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Enumerated})],Gt.prototype,"digestedObjectType",void 0),c([l({type:p.ObjectIdentifier,optional:!0})],Gt.prototype,"otherObjectTypeID",void 0),c([l({type:E})],Gt.prototype,"digestAlgorithm",void 0),c([l({type:p.BitString})],Gt.prototype,"objectDigest",void 0);class en{constructor(e={}){Object.assign(this,e)}}c([l({type:xe,optional:!0})],en.prototype,"issuerName",void 0),c([l({type:Wt,context:0,implicit:!0,optional:!0})],en.prototype,"baseCertificateID",void 0),c([l({type:Gt,context:1,implicit:!0,optional:!0})],en.prototype,"objectDigestInfo",void 0);let vr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:q,repeated:"sequence"})],vr.prototype,"v1Form",void 0),c([l({type:en,context:0,implicit:!0})],vr.prototype,"v2Form",void 0),vr=c([w({type:v.Choice})],vr);class tn{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}c([l({type:p.GeneralizedTime})],tn.prototype,"notBeforeTime",void 0),c([l({type:p.GeneralizedTime})],tn.prototype,"notAfterTime",void 0);class zr{constructor(e={}){Object.assign(this,e)}}c([l({type:Wt,implicit:!0,context:0,optional:!0})],zr.prototype,"baseCertificateID",void 0),c([l({type:xe,implicit:!0,context:1,optional:!0})],zr.prototype,"entityName",void 0),c([l({type:Gt,implicit:!0,context:2,optional:!0})],zr.prototype,"objectDigestInfo",void 0);var os;(function(r){r[r.v2=1]="v2"})(os||(os={}));class Qe{constructor(e={}){this.version=os.v2,this.holder=new zr,this.issuer=new vr,this.signature=new E,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new tn,this.attributes=[],Object.assign(this,e)}}c([l({type:p.Integer})],Qe.prototype,"version",void 0),c([l({type:zr})],Qe.prototype,"holder",void 0),c([l({type:vr})],Qe.prototype,"issuer",void 0),c([l({type:E})],Qe.prototype,"signature",void 0),c([l({type:p.Integer,converter:le})],Qe.prototype,"serialNumber",void 0),c([l({type:tn})],Qe.prototype,"attrCertValidityPeriod",void 0),c([l({type:bt,repeated:"sequence"})],Qe.prototype,"attributes",void 0),c([l({type:p.BitString,optional:!0})],Qe.prototype,"issuerUniqueID",void 0),c([l({type:Kt,optional:!0})],Qe.prototype,"extensions",void 0);class rn{constructor(e={}){this.acinfo=new Qe,this.signatureAlgorithm=new E,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Qe})],rn.prototype,"acinfo",void 0),c([l({type:E})],rn.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],rn.prototype,"signatureValue",void 0);var nn;(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"})(nn||(nn={}));class ss extends Pi{}class as{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier,implicit:!0,context:0})],as.prototype,"type",void 0),c([l({type:p.Any,implicit:!0,context:1})],as.prototype,"value",void 0);class cs{constructor(e={}){this.policyId="",this.classList=new ss(nn.unclassified),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],cs.prototype,"policyId",void 0),c([l({type:ss,defaultValue:new ss(nn.unclassified)})],cs.prototype,"classList",void 0),c([l({type:as,repeated:"set"})],cs.prototype,"securityCategories",void 0);class on{constructor(e={}){Object.assign(this,e)}}c([l({type:Q})],on.prototype,"cotets",void 0),c([l({type:p.ObjectIdentifier})],on.prototype,"oid",void 0),c([l({type:p.Utf8String})],on.prototype,"string",void 0);class ol{constructor(e={}){this.values=[],Object.assign(this,e)}}c([l({type:xe,implicit:!0,context:0,optional:!0})],ol.prototype,"policyAuthority",void 0),c([l({type:on,repeated:"sequence"})],ol.prototype,"values",void 0);var ls;class sn{constructor(e={}){this.targetCertificate=new Wt,Object.assign(this,e)}}c([l({type:Wt})],sn.prototype,"targetCertificate",void 0),c([l({type:q,optional:!0})],sn.prototype,"targetName",void 0),c([l({type:Gt,optional:!0})],sn.prototype,"certDigestInfo",void 0);let wr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:q,context:0,implicit:!0})],wr.prototype,"targetName",void 0),c([l({type:q,context:1,implicit:!0})],wr.prototype,"targetGroup",void 0),c([l({type:sn,context:2,implicit:!0})],wr.prototype,"targetCert",void 0),wr=c([w({type:v.Choice})],wr);let us=ls=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};us=ls=c([w({type:v.Sequence,itemType:wr})],us);var fs;let sl=fs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,fs.prototype)}};sl=fs=c([w({type:v.Sequence,itemType:us})],sl);class al{constructor(e={}){Object.assign(this,e)}}c([l({type:xe,implicit:!0,context:0,optional:!0})],al.prototype,"roleAuthority",void 0),c([l({type:q,implicit:!0,context:1})],al.prototype,"roleName",void 0);class ds{constructor(e={}){this.service=new q,this.ident=new q,Object.assign(this,e)}}c([l({type:q})],ds.prototype,"service",void 0),c([l({type:q})],ds.prototype,"ident",void 0),c([l({type:Q,optional:!0})],ds.prototype,"authInfo",void 0);var ps;class hs{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],hs.prototype,"otherCertFormat",void 0),c([l({type:p.Any})],hs.prototype,"otherCert",void 0);let Sr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:yr})],Sr.prototype,"certificate",void 0),c([l({type:rn,context:2,implicit:!0})],Sr.prototype,"v2AttrCert",void 0),c([l({type:hs,context:3,implicit:!0})],Sr.prototype,"other",void 0),Sr=c([w({type:v.Choice})],Sr);let an=ps=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ps.prototype)}};an=ps=c([w({type:v.Set,itemType:Sr})],an);class Ar{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Ar.prototype,"contentType",void 0),c([l({type:p.Any,context:0})],Ar.prototype,"content",void 0);let Jr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Q})],Jr.prototype,"single",void 0),c([l({type:p.Any})],Jr.prototype,"any",void 0),Jr=c([w({type:v.Choice})],Jr);class cn{constructor(e={}){this.eContentType="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],cn.prototype,"eContentType",void 0),c([l({type:Jr,context:0,optional:!0})],cn.prototype,"eContent",void 0);let Yr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Q,context:0,implicit:!0,optional:!0})],Yr.prototype,"value",void 0),c([l({type:Q,converter:Af,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Yr.prototype,"constructedValue",void 0),Yr=c([w({type:v.Choice})],Yr);class Zr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Yi,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Zr.prototype,"contentType",void 0),c([l({type:Yi})],Zr.prototype,"contentEncryptionAlgorithm",void 0),c([l({type:Yr,optional:!0})],Zr.prototype,"encryptedContent",void 0);class ln{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],ln.prototype,"keyAttrId",void 0),c([l({type:p.Any,optional:!0})],ln.prototype,"keyAttr",void 0);var ys;class un{constructor(e={}){this.subjectKeyIdentifier=new Et,Object.assign(this,e)}}c([l({type:Et})],un.prototype,"subjectKeyIdentifier",void 0),c([l({type:p.GeneralizedTime,optional:!0})],un.prototype,"date",void 0),c([l({type:ln,optional:!0})],un.prototype,"other",void 0);let kr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:un,context:0,implicit:!0,optional:!0})],kr.prototype,"rKeyId",void 0),c([l({type:gr,optional:!0})],kr.prototype,"issuerAndSerialNumber",void 0),kr=c([w({type:v.Choice})],kr);class gs{constructor(e={}){this.rid=new kr,this.encryptedKey=new Q,Object.assign(this,e)}}c([l({type:kr})],gs.prototype,"rid",void 0),c([l({type:Q})],gs.prototype,"encryptedKey",void 0);let fn=ys=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ys.prototype)}};fn=ys=c([w({type:v.Sequence,itemType:gs})],fn);class ms{constructor(e={}){this.algorithm=new E,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:E})],ms.prototype,"algorithm",void 0),c([l({type:p.BitString})],ms.prototype,"publicKey",void 0);let zt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0,optional:!0})],zt.prototype,"subjectKeyIdentifier",void 0),c([l({type:ms,context:1,implicit:!0,optional:!0})],zt.prototype,"originatorKey",void 0),c([l({type:gr,optional:!0})],zt.prototype,"issuerAndSerialNumber",void 0),zt=c([w({type:v.Choice})],zt);class Cr{constructor(e={}){this.version=wt.v3,this.originator=new zt,this.keyEncryptionAlgorithm=new ot,this.recipientEncryptedKeys=new fn,Object.assign(this,e)}}c([l({type:p.Integer})],Cr.prototype,"version",void 0),c([l({type:zt,context:0})],Cr.prototype,"originator",void 0),c([l({type:Q,context:1,optional:!0})],Cr.prototype,"ukm",void 0),c([l({type:ot})],Cr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:fn})],Cr.prototype,"recipientEncryptedKeys",void 0);let xr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0})],xr.prototype,"subjectKeyIdentifier",void 0),c([l({type:gr})],xr.prototype,"issuerAndSerialNumber",void 0),xr=c([w({type:v.Choice})],xr);class Qr{constructor(e={}){this.version=wt.v0,this.rid=new xr,this.keyEncryptionAlgorithm=new ot,this.encryptedKey=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],Qr.prototype,"version",void 0),c([l({type:xr})],Qr.prototype,"rid",void 0),c([l({type:ot})],Qr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Q})],Qr.prototype,"encryptedKey",void 0);class Xr{constructor(e={}){this.keyIdentifier=new Q,Object.assign(this,e)}}c([l({type:Q})],Xr.prototype,"keyIdentifier",void 0),c([l({type:p.GeneralizedTime,optional:!0})],Xr.prototype,"date",void 0),c([l({type:ln,optional:!0})],Xr.prototype,"other",void 0);class ei{constructor(e={}){this.version=wt.v4,this.kekid=new Xr,this.keyEncryptionAlgorithm=new ot,this.encryptedKey=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],ei.prototype,"version",void 0),c([l({type:Xr})],ei.prototype,"kekid",void 0),c([l({type:ot})],ei.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Q})],ei.prototype,"encryptedKey",void 0);class ti{constructor(e={}){this.version=wt.v0,this.keyEncryptionAlgorithm=new ot,this.encryptedKey=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],ti.prototype,"version",void 0),c([l({type:es,context:0,optional:!0})],ti.prototype,"keyDerivationAlgorithm",void 0),c([l({type:ot})],ti.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Q})],ti.prototype,"encryptedKey",void 0);class bs{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],bs.prototype,"oriType",void 0),c([l({type:p.Any})],bs.prototype,"oriValue",void 0);let Nt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Qr,optional:!0})],Nt.prototype,"ktri",void 0),c([l({type:Cr,context:1,implicit:!0,optional:!0})],Nt.prototype,"kari",void 0),c([l({type:ei,context:2,implicit:!0,optional:!0})],Nt.prototype,"kekri",void 0),c([l({type:ti,context:3,implicit:!0,optional:!0})],Nt.prototype,"pwri",void 0),c([l({type:bs,context:4,implicit:!0,optional:!0})],Nt.prototype,"ori",void 0),Nt=c([w({type:v.Choice})],Nt);var vs;let dn=vs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};dn=vs=c([w({type:v.Set,itemType:Nt})],dn);var ws;class pn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],pn.prototype,"otherRevInfoFormat",void 0),c([l({type:p.Any})],pn.prototype,"otherRevInfo",void 0);let hn=class{constructor(e={}){this.other=new pn,Object.assign(this,e)}};c([l({type:pn,context:1,implicit:!0})],hn.prototype,"other",void 0),hn=c([w({type:v.Choice})],hn);let yn=ws=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};yn=ws=c([w({type:v.Set,itemType:hn})],yn);class Ss{constructor(e={}){Object.assign(this,e)}}c([l({type:an,context:0,implicit:!0,optional:!0})],Ss.prototype,"certs",void 0),c([l({type:yn,context:1,implicit:!0,optional:!0})],Ss.prototype,"crls",void 0);var As;let ks=As=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};ks=As=c([w({type:v.Set,itemType:br})],ks);class ri{constructor(e={}){this.version=wt.v0,this.recipientInfos=new dn,this.encryptedContentInfo=new Zr,Object.assign(this,e)}}c([l({type:p.Integer})],ri.prototype,"version",void 0),c([l({type:Ss,context:0,implicit:!0,optional:!0})],ri.prototype,"originatorInfo",void 0),c([l({type:dn})],ri.prototype,"recipientInfos",void 0),c([l({type:Zr})],ri.prototype,"encryptedContentInfo",void 0),c([l({type:ks,context:1,implicit:!0,optional:!0})],ri.prototype,"unprotectedAttrs",void 0);const zf="1.2.840.113549.1.7.2";var Cs;let gn=Cs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};gn=Cs=c([w({type:v.Set,itemType:Gr})],gn);class Br{constructor(e={}){this.version=wt.v0,this.digestAlgorithms=new gn,this.encapContentInfo=new cn,this.signerInfos=new Zi,Object.assign(this,e)}}c([l({type:p.Integer})],Br.prototype,"version",void 0),c([l({type:gn})],Br.prototype,"digestAlgorithms",void 0),c([l({type:cn})],Br.prototype,"encapContentInfo",void 0),c([l({type:an,context:0,implicit:!0,optional:!0})],Br.prototype,"certificates",void 0),c([l({type:yn,context:1,implicit:!0,optional:!0})],Br.prototype,"crls",void 0),c([l({type:Zi})],Br.prototype,"signerInfos",void 0);const ii="1.2.840.10045.2.1",xs="1.2.840.10045.4.1",cl="1.2.840.10045.4.3.1",Bs="1.2.840.10045.4.3.2",Es="1.2.840.10045.4.3.3",Ns="1.2.840.10045.4.3.4",ll="1.2.840.10045.3.1.7",ul="1.3.132.0.34",fl="1.3.132.0.35";function ni(r){return new E({algorithm:r})}const Jf=ni(xs);ni(cl);const Yf=ni(Bs),Zf=ni(Es),Qf=ni(Ns);let oi=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],oi.prototype,"fieldType",void 0),c([l({type:p.Any})],oi.prototype,"parameters",void 0),oi=c([w({type:v.Sequence})],oi);class Xf extends Q{}let Er=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.OctetString})],Er.prototype,"a",void 0),c([l({type:p.OctetString})],Er.prototype,"b",void 0),c([l({type:p.BitString,optional:!0})],Er.prototype,"seed",void 0),Er=c([w({type:v.Sequence})],Er);var Is;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Is||(Is={}));let St=class{constructor(e={}){this.version=Is.ecpVer1,Object.assign(this,e)}};c([l({type:p.Integer})],St.prototype,"version",void 0),c([l({type:oi})],St.prototype,"fieldID",void 0),c([l({type:Er})],St.prototype,"curve",void 0),c([l({type:Xf})],St.prototype,"base",void 0),c([l({type:p.Integer,converter:le})],St.prototype,"order",void 0),c([l({type:p.Integer,optional:!0})],St.prototype,"cofactor",void 0),St=c([w({type:v.Sequence})],St);let It=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],It.prototype,"namedCurve",void 0),c([l({type:p.Null})],It.prototype,"implicitCurve",void 0),c([l({type:St})],It.prototype,"specifiedCurve",void 0),It=c([w({type:v.Choice})],It);class mn{constructor(e={}){this.version=1,this.privateKey=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],mn.prototype,"version",void 0),c([l({type:Q})],mn.prototype,"privateKey",void 0),c([l({type:It,context:0,optional:!0})],mn.prototype,"parameters",void 0),c([l({type:p.BitString,context:1,optional:!0})],mn.prototype,"publicKey",void 0);class bn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],bn.prototype,"r",void 0),c([l({type:p.Integer,converter:le})],bn.prototype,"s",void 0);const je="1.2.840.113549.1.1",Jt=`${je}.1`,ed=`${je}.7`,td=`${je}.9`,si=`${je}.10`,rd=`${je}.2`,id=`${je}.4`,vn=`${je}.5`,nd=`${je}.14`,Os=`${je}.11`,wn=`${je}.12`,Sn=`${je}.13`,dl=`${je}.15`,pl=`${je}.16`,An="1.3.14.3.2.26",hl="2.16.840.1.101.3.4.2.4",kn="2.16.840.1.101.3.4.2.1",Cn="2.16.840.1.101.3.4.2.2",xn="2.16.840.1.101.3.4.2.3",od="2.16.840.1.101.3.4.2.5",sd="2.16.840.1.101.3.4.2.6",ad="1.2.840.113549.2.2",cd="1.2.840.113549.2.5",Bn=`${je}.8`;function ge(r){return new E({algorithm:r,parameters:null})}ge(ad),ge(cd);const Yt=ge(An);ge(hl),ge(kn),ge(Cn),ge(xn),ge(od),ge(sd);const yl=new E({algorithm:Bn,parameters:x.serialize(Yt)}),gl=new E({algorithm:td,parameters:x.serialize(Ri.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ge(Jt),ge(rd),ge(id),ge(vn),ge(dl),ge(pl),ge(wn),ge(Sn),ge(dl),ge(pl);class En{constructor(e={}){this.hashAlgorithm=new E(Yt),this.maskGenAlgorithm=new E({algorithm:Bn,parameters:x.serialize(Yt)}),this.pSourceAlgorithm=new E(gl),Object.assign(this,e)}}c([l({type:E,context:0,defaultValue:Yt})],En.prototype,"hashAlgorithm",void 0),c([l({type:E,context:1,defaultValue:yl})],En.prototype,"maskGenAlgorithm",void 0),c([l({type:E,context:2,defaultValue:gl})],En.prototype,"pSourceAlgorithm",void 0),new E({algorithm:ed,parameters:x.serialize(new En)});class Zt{constructor(e={}){this.hashAlgorithm=new E(Yt),this.maskGenAlgorithm=new E({algorithm:Bn,parameters:x.serialize(Yt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}c([l({type:E,context:0,defaultValue:Yt})],Zt.prototype,"hashAlgorithm",void 0),c([l({type:E,context:1,defaultValue:yl})],Zt.prototype,"maskGenAlgorithm",void 0),c([l({type:p.Integer,context:2,defaultValue:20})],Zt.prototype,"saltLength",void 0),c([l({type:p.Integer,context:3,defaultValue:1})],Zt.prototype,"trailerField",void 0),new E({algorithm:si,parameters:x.serialize(new Zt)});class Nn{constructor(e={}){this.digestAlgorithm=new E,this.digest=new Q,Object.assign(this,e)}}c([l({type:E})],Nn.prototype,"digestAlgorithm",void 0),c([l({type:Q})],Nn.prototype,"digest",void 0);var Ts;class In{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],In.prototype,"prime",void 0),c([l({type:p.Integer,converter:le})],In.prototype,"exponent",void 0),c([l({type:p.Integer,converter:le})],In.prototype,"coefficient",void 0);let _s=Ts=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ts.prototype)}};_s=Ts=c([w({type:v.Sequence,itemType:In})],_s);class at{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)}}c([l({type:p.Integer})],at.prototype,"version",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"modulus",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"publicExponent",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"privateExponent",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"prime1",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"prime2",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"exponent1",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"exponent2",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"coefficient",void 0),c([l({type:_s,optional:!0})],at.prototype,"otherPrimeInfos",void 0);class Vs{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],Vs.prototype,"modulus",void 0),c([l({type:p.Integer,converter:le})],Vs.prototype,"publicExponent",void 0);var js;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(js||(js={}));const Pe=js;/*! *****************************************************************************
|
|
75
|
+
`)}`:`${t} :`}}lc=_e,N.Constructed=lc,_e.NAME="CONSTRUCTED";class uc extends Oe{fromBER(e,t,i){return t}toBER(e){return Je}}uc.override="EndOfContentValueBlock";var fc;class Oo extends ve{constructor(e={}){super(e,uc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}fc=Oo,N.EndOfContent=fc,Oo.NAME=Hr;var dc;class $t extends ve{constructor(e={}){super(e,Oe),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}`}}dc=$t,N.Null=dc,$t.NAME="NULL";class pc extends nt(Oe){get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=C.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,i){const n=C.toUint8Array(e);return yt(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,Qa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}pc.NAME="BooleanValueBlock";var hc;let Fi=class extends ve{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,pc),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};hc=Fi,N.Boolean=hc,Fi.NAME="BOOLEAN";class yc extends nt(Et){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=Et.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===Hr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==rc)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?Et.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}yc.NAME="OctetStringValueBlock";var _o;let Ht=class extends ve{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},yc),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=ar(s,0,s.byteLength);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return _e.prototype.onAsciiEncoding.call(this);const e=this.constructor.NAME,t=_.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof _o&&e.push(t.valueBlock.valueHexView);return C.concat(e)}};_o=Ht,N.OctetString=_o,Ht.NAME=rc;class gc extends nt(Et){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=Et.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===Hr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==ic)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=C.toUint8Array(e);if(!yt(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=ar(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 Et.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}}}gc.NAME="BitStringValueBlock";var mc;let Lt=class extends ve{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},gc),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 _e.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const c of t)e.push(c.toString(2).padStart(8,"0"));const i=e.join(""),n=this.constructor.NAME,s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${n} : ${s}`}}};mc=Lt,N.BitString=mc,Lt.NAME=ic;var bc;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 m=f<c?c:f;let y=0;for(let L=m;L>=0;L--,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=Bo(new Uint8Array([p%10]),s);break;default:s[c-y]=p%10}}return t[0]>0&&(s=Bo(t,s)),s}function vc(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=Bo(t,i)),$r.push(i)}return $r[r]}function Rf(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,m=0;for(let y=f;y>=0;y--,m++)switch(p=s[c-m]-u[f-m]-t,!0){case p<0:t=1,s[c-m]=p+10;break;default:t=0,s[c-m]=p}if(t>0)for(let y=c-f+1;y>=0;y--,m++)if(p=s[c-m]-t,p<0)t=1,s[c-m]=p+10;else{t=0,s[c-m]=p;break}return s.slice()}class To extends nt(Oe){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=Qa.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(kf(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=Rf(vc(i),t),c="-";break;default:t=Pf(t,vc(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(c+=ec.charAt(t[f]));return u===!1&&(c+=ec.charAt(0)),c}}bc=To,To.NAME="IntegerValueBlock",Object.defineProperty(bc.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Fr;class lr extends ve{constructor(e={}){super(e,To),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return $i(),BigInt(this.valueBlock.toString())}static fromBigInt(e){$i();const t=BigInt(e),i=new Hi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(_.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const p=BigInt(`0x${_.ToHex(u)}`)+t,m=C.toUint8Array(_.FromHex(p.toString(16)));m[0]|=128,i.write(m)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new Fr({valueHex:i.final()})}convertToDER(){const e=new Fr({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Fr({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Fr=lr,N.Integer=Fr,lr.NAME="INTEGER";var wc;class qi extends lr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}wc=qi,N.Enumerated=wc,qi.NAME="ENUMERATED";class Vo extends nt(Oe){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=C.toUint8Array(e);if(!yt(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=sr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){$i();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=Mt(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=_.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}}}Vo.NAME="sidBlock";class Sc extends Oe{constructor({value:e=Pe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new Vo;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 Eo(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 Vo;if(n>Number.MAX_SAFE_INTEGER){$i();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}}Sc.NAME="ObjectIdentifierValueBlock";var Ac;class Ki extends ve{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Sc),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ac=Ki,N.ObjectIdentifier=Ac,Ki.NAME="OBJECT IDENTIFIER";class jo extends nt(Ut){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=C.toUint8Array(e);if(!yt(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=sr(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=Mt(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=_.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}jo.NAME="relativeSidBlock";class kc extends Oe{constructor({value:e=Pe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new jo;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 Eo(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 jo;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}}kc.NAME="RelativeObjectIdentifierValueBlock";var Cc;class Po extends ve{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,kc),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Cc=Po,N.RelativeObjectIdentifier=Cc,Po.NAME="RelativeObjectIdentifier";var xc;class Ye extends _e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}xc=Ye,N.Sequence=xc,Ye.NAME="SEQUENCE";var Bc;let ot=class extends _e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Bc=ot,N.Set=Bc,ot.NAME="SET";class Ec extends nt(Oe){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Pe}toJSON(){return{...super.toJSON(),value:this.value}}}Ec.NAME="StringValueBlock";class Nc extends Ec{}Nc.NAME="SimpleStringValueBlock";class Le extends Io{constructor({...e}={}){super(e,Nc)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,C.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}}Le.NAME="SIMPLE STRING";class Ic extends Le{fromBuffer(e){this.valueBlock.valueHexView=C.toUint8Array(e);try{this.valueBlock.value=_.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=_.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(_.FromUtf8String(e)),this.valueBlock.value=e}}Ic.NAME="Utf8StringValueBlock";var Oc;class gt extends Ic{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Oc=gt,N.Utf8String=Oc,gt.NAME="UTF8String";class _c extends Le{fromBuffer(e){this.valueBlock.value=_.ToUtf16String(e),this.valueBlock.valueHexView=C.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(_.FromUtf16String(e))}}_c.NAME="BmpStringValueBlock";var Tc;class Wi extends _c{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Tc=Wi,N.BmpString=Tc,Wi.NAME="BMPString";class Vc extends Le{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=Mt(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}}Vc.NAME="UniversalStringValueBlock";var jc;class Gi extends Vc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}jc=Gi,N.UniversalString=jc,Gi.NAME="UniversalString";var Pc;class zi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Pc=zi,N.NumericString=Pc,zi.NAME="NumericString";var Rc;class Ji extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Rc=Ji,N.PrintableString=Rc,Ji.NAME="PrintableString";var Dc;class Yi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Dc=Yi,N.TeletexString=Dc,Yi.NAME="TeletexString";var Mc;class Zi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Mc=Zi,N.VideotexString=Mc,Zi.NAME="VideotexString";var Uc;class Xi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Uc=Xi,N.IA5String=Uc,Xi.NAME="IA5String";var $c;class Qi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}$c=Qi,N.GraphicString=$c,Qi.NAME="GraphicString";var Hc;class qr extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Hc=qr,N.VisibleString=Hc,qr.NAME="VisibleString";var Lc;class en extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Lc=en,N.GeneralString=Lc,en.NAME="GeneralString";var Fc;class tn extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Fc=tn,N.CharacterString=Fc,tn.NAME="CharacterString";var qc;class Kr extends qr{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,C.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]=He(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=He(this.month,2),t[2]=He(this.day,2),t[3]=He(this.hour,2),t[4]=He(this.minute,2),t[5]=He(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}}}qc=Kr,N.UTCTime=qc,Kr.NAME="UTCTime";var Kc;class rn extends Kr{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(){const e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,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,L=i.indexOf("+"),oe="";if(L===-1&&(L=i.indexOf("-"),y=-1),L!==-1){if(oe=i.substring(L+1),i=i.substring(0,L),oe.length!==2&&oe.length!==4)throw new Error("Wrong input string for conversion");let ie=parseInt(oe.substring(0,2),10);if(isNaN(ie.valueOf()))throw new Error("Wrong input string for conversion");if(u=y*ie,oe.length===4){if(ie=parseInt(oe.substring(2,4),10),isNaN(ie.valueOf()))throw new Error("Wrong input string for conversion");f=y*ie}}}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 m=c.exec(n);if(m===null)throw new Error("Wrong input string for conversion");for(let y=1;y<m.length;y++)switch(y){case 1:this.year=parseInt(m[y],10);break;case 2:this.month=parseInt(m[y],10);break;case 3:this.day=parseInt(m[y],10);break;case 4:this.hour=parseInt(m[y],10)+u;break;case 5:this.minute=parseInt(m[y],10)+f;break;case 6:this.second=parseInt(m[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(He(this.year,4)),t.push(He(this.month,2)),t.push(He(this.day,2)),t.push(He(this.hour,2)),t.push(He(this.minute,2)),t.push(He(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(He(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Kc=rn,N.GeneralizedTime=Kc,rn.NAME="GeneralizedTime";var Wc;class Ro extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Wc=Ro,N.DATE=Wc,Ro.NAME="DATE";var Gc;class Do extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Gc=Do,N.TimeOfDay=Gc,Do.NAME="TimeOfDay";var zc;class Mo extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}zc=Mo,N.DateTime=zc,Mo.NAME="DateTime";var Jc;class Uo extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Jc=Uo,N.Duration=Jc,Uo.NAME="Duration";var Yc;class $o extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Yc=$o,N.TIME=Yc,$o.NAME="TIME";class Ft{constructor({name:e=Pe,optional:t=!1}={}){this.name=e,this.optional=t}}class Ho extends Ft{constructor({value:e=[],...t}={}){super(t),this.value=e}}class nn extends Ft{constructor({value:e=new Ft,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class Df{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=C.toUint8Array(e)}constructor({data:e=Li}={}){this.dataView=C.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=C.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function Nt(r,e,t){if(t instanceof Ho){for(const s of t.value)if(Nt(r,e,s).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(No)&&(s.name=t.name),s}}if(t instanceof Ft)return t.hasOwnProperty(No)&&(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(!(Bf in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Of in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(_f 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(Ef)===!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(Nf)===!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(If)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(xf 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(!(tc 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,Pe),t.name&&(r[t.name]=e)),t instanceof N.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof nn&&(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,Pe),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,Pe),t.name&&(delete r[t.name],p.name=t.name)),p}}else if(t.valueBlock.value[0]instanceof nn){if(c=Nt(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,Pe),t.name&&delete r[t.name]),c;if(No in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let p={};Tf 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=Nt(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,Pe),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,Pe),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&tc in e.valueBlock){const s=ar(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,Pe),t.name&&(delete r[t.name],c.name=t.name)),c}return Nt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function Mf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=ar(C.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Nt(t.result,t.result,e)}const Zc=Object.freeze(Object.defineProperty({__proto__:null,Any:Ft,BaseBlock:ve,BaseStringBlock:Io,BitString:Lt,BmpString:Wi,Boolean:Fi,CharacterString:tn,Choice:Ho,Constructed:_e,DATE:Ro,DateTime:Mo,Duration:Uo,EndOfContent:Oo,Enumerated:qi,GeneralString:en,GeneralizedTime:rn,GraphicString:Qi,HexBlock:nt,IA5String:Xi,Integer:lr,Null:$t,NumericString:zi,ObjectIdentifier:Ki,OctetString:Ht,Primitive:Lr,PrintableString:Ji,RawData:Df,RelativeObjectIdentifier:Po,Repeated:nn,Sequence:Ye,Set:ot,TIME:$o,TeletexString:Yi,TimeOfDay:Do,UTCTime:Kr,UniversalString:Gi,Utf8String:gt,ValueBlock:Oe,VideotexString:Zi,ViewWriter:Hi,VisibleString:qr,compareSchema:Nt,fromBER:cr,verifySchema:Mf},Symbol.toStringTag,{value:"Module"}));var v;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(v||(v={}));var d;(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"})(d||(d={}));class on{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(C.isBufferSource(e))this.unusedBits=t,this.value=C.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Lt))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 Lt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Lt({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 Q{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):C.isBufferSource(e)?this.buffer=C.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Ht))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new Ht({valueHex:this.buffer})}toSchema(e){return new Ht({name:e})}}const Uf={fromASN:r=>r instanceof $t?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new $t;const e=cr(r);if(e.result.error)throw new Error(e.result.error);return e.result}},$f={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new lr({value:+r})},Hf={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new qi({value:r})},ue={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new lr({valueHex:r})},Lf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Lt({valueHex:r})},Ff={fromASN:r=>r.valueBlock.toString(),toASN:r=>new Ki({value:r})},qf={fromASN:r=>r.valueBlock.value,toASN:r=>new Fi({value:r})},sn={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ht({valueHex:r})},Kf={fromASN:r=>new Q(r.getValue()),toASN:r=>r.toASN()};function We(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Xc=We(gt),Wf=We(Wi),Gf=We(Gi),zf=We(zi),Jf=We(Ji),Yf=We(Yi),Zf=We(Zi),Xf=We(Xi),Qf=We(Qi),ed=We(qr),td=We(en),rd=We(tn),id={fromASN:r=>r.toDate(),toASN:r=>new Kr({valueDate:r})},nd={fromASN:r=>r.toDate(),toASN:r=>new rn({valueDate:r})},od={fromASN:()=>null,toASN:()=>new $t};function Wr(r){switch(r){case d.Any:return Uf;case d.BitString:return Lf;case d.BmpString:return Wf;case d.Boolean:return qf;case d.CharacterString:return rd;case d.Enumerated:return Hf;case d.GeneralString:return td;case d.GeneralizedTime:return nd;case d.GraphicString:return Qf;case d.IA5String:return Xf;case d.Integer:return $f;case d.Null:return od;case d.NumericString:return zf;case d.ObjectIdentifier:return Ff;case d.OctetString:return sn;case d.PrintableString:return Jf;case d.TeletexString:return Yf;case d.UTCTime:return id;case d.UniversalString:return Gf;case d.Utf8String:return Xc;case d.VideotexString:return Zf;case d.VisibleString:return ed;default:return null}}function mt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:mt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function Qc(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:Qc(t)}return!1}function sd(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 ad{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:v.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 m=d[c.type],y=Zc[m];if(!y)throw new Error(`Cannot get ASN1 class by name '${m}'`);f=new y({name:u})}else mt(c.type)?f=new c.type().toSchema(u):c.optional?this.get(c.type).type===v.Choice?f=new Ft({name:u}):(f=this.create(c.type,!1),f.name=u):f=new Ft({name:u});const p=!!c.optional||c.defaultValue!==void 0;if(c.repeated){f.name="";const m=c.repeated==="set"?ot:Ye;f=new m({name:"",value:[new nn({name:u,value:f})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||mt(c.type)){const m=c.repeated?_e:Lr;n.push(new m({name:u,optional:p,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const m=!!c.repeated;let y=m?f:this.get(c.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,n.push(new _e({name:m?"":u,optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:y}))}else n.push(new _e({optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else f.optional=p,n.push(f)}switch(i.type){case v.Sequence:return new Ye({value:n,name:""});case v.Set:return new ot({value:n,name:""});case v.Choice:return new Ho({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 we=new ad,w=r=>e=>{let t;we.has(e)?t=we.get(e):(t=we.createDefault(e),we.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;we.has(e.constructor)?i=we.get(e.constructor):(i=we.createDefault(e.constructor),we.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=Wr(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}n.raw=r.raw,i.items[t]=n};class Gr extends Error{constructor(){super(...arguments),this.schemas=[]}}class cd{static parse(e,t){const i=cr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){try{if(mt(t))return new t().fromASN(e);const i=we.get(t);we.cache(t);let n=i.schema;const s=this.handleChoiceTypes(e,i,t,n);if(s!=null&&s.result)return s.result;s!=null&&s.targetSchema&&(n=s.targetSchema);const c=this.handleSequenceTypes(e,i,t,n),u=new t;return Qc(t)?this.handleArrayTypes(e,i,t):(this.processSchemaItems(i,c,u),u)}catch(i){throw i instanceof Gr&&i.schemas.push(t.name),i}}static handleChoiceTypes(e,t,i,n){if(e.constructor===_e&&t.type===v.Choice&&e.idBlock.tagClass===3)for(const s in t.items){const c=t.items[s];if(c.context===e.idBlock.tagNumber&&c.implicit&&typeof c.type=="function"&&we.has(c.type)){const u=we.get(c.type);if(u&&u.type===v.Sequence){const f=new Ye;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in f.valueBlock){f.valueBlock.value=e.valueBlock.value;const p=this.fromASN(f,c.type),m=new i;return m[s]=p,{result:m}}}}}else if(e.constructor===_e&&t.type!==v.Choice){const s=new _e({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(const c in t.items)delete e[c];return{targetSchema:s}}return null}static handleSequenceTypes(e,t,i,n){if(t.type===v.Sequence){const s=Nt({},e,n);if(!s.verified)throw new Gr(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{const s=Nt({},e,n);if(!s.verified)throw new Gr(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,t,i){let n=e.slice(t);if(n.length===1&&n[0].constructor.name==="Sequence"){const s=n[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(n=s.valueBlock.value)}if(typeof i.type=="number"){const s=Wr(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(c=>c&&c.valueBlock).map(c=>{try{return s.fromASN(c)}catch{return}}).filter(c=>c!==void 0)}else return n.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,i.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,t){const i=Wr(t.type);if(!i)throw new Error(`No converter for ASN.1 type ${t.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&we.has(e.type)&&we.get(e.type).type===v.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(i){if(i instanceof Gr&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,t,i){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 n=t.itemType;if(typeof n=="number"){const s=Wr(n);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,c=>s.fromASN(c))}else return i.from(e.valueBlock.value,s=>this.fromASN(s,n))}static processSchemaItems(e,t,i){for(const n in e.items){const s=t.result[n];if(!s)continue;const c=e.items[n],u=c.type;let f;typeof u=="number"||mt(u)?f=this.processPrimitiveSchemaItem(s,c,u):f=this.processComplexSchemaItem(s,c,u),f&&typeof f=="object"&&"value"in f&&"raw"in f?(i[n]=f.value,i[`${n}Raw`]=f.raw):i[n]=f}}static processPrimitiveSchemaItem(e,t,i){var n;const s=(n=t.converter)!==null&&n!==void 0?n:mt(i)?new i:null;if(!s)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,s):this.processSinglePrimitiveItem(e,t,i,s)}static processRepeatedPrimitiveItem(e,t,i){if(t.implicit){const n=t.repeated==="sequence"?Ye:ot,s=new n;s.valueBlock=e.valueBlock;const c=cr(s.toBER(!1));if(c.offset===-1)throw new Error(`Cannot parse the child item. ${c.result.error}`);if(!("value"in c.result.valueBlock&&Array.isArray(c.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const u=c.result.valueBlock.value;return Array.from(u,f=>i.fromASN(f))}else return Array.from(e,n=>i.fromASN(n))}static processSinglePrimitiveItem(e,t,i,n){let s=e;if(t.implicit){let c;if(mt(i))c=new i().toSchema("");else{const u=d[i],f=Zc[u];if(!f)throw new Error(`Cannot get '${u}' class from asn1js module`);c=new f}c.valueBlock=s.valueBlock,s=cr(c.toBER(!1)).result}return n.fromASN(s)}static processComplexSchemaItem(e,t,i){if(t.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,n=>this.fromASN(n,i))}else{const n=this.handleImplicitTagging(e,t,i);if(this.isOptionalChoiceField(t))try{return this.fromASN(n,i)}catch(s){if(s instanceof Gr&&/Wrong values for Choice type/.test(s.message))return;throw s}else{const s=this.fromASN(n,i);return t.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,t,i){if(t.implicit&&typeof t.context=="number"){const n=we.get(i);if(n.type===v.Sequence){const s=new Ye;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(n.type===v.Set){const s=new ot;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}}class Lo{static serialize(e){return e instanceof ve?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&mt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=we.get(t);we.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=Wr(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"&&sd(this.serialize(u.defaultValue),this.serialize(f)))continue;const p=Lo.toAsnItem(u,c,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||mt(u.type))){const m={};m.valueHex=p instanceof $t?p.valueBeforeDecodeView:p.valueBlock.toBER(),n.push(new Lr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...m}))}else n.push(new _e({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:p.valueBlock.value}));else n.push(new _e({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 v.Sequence:s=new Ye({value:n});break;case v.Set:s=new ot({value:n});break;case v.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 ${d[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"?Ye:ot;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"?Ye:ot;s=new u({value:c})}else s=this.toASN(n);return s}}class re extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class x{static serialize(e){return Lo.serialize(e)}static parse(e,t){return cd.parse(e,t)}static toString(e){const t=C.isBufferSource(e)?C.toArrayBuffer(e):x.serialize(e),i=cr(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}function W(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}function de(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t}typeof SuppressedError=="function"&&SuppressedError;class el{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){const t=e.split(".");if(t.length!==4)throw new Error("Invalid IPv4 address");return t.map(i=>{const n=parseInt(i,10);if(isNaN(n)||n<0||n>255)throw new Error("Invalid IPv4 address part");return n})}static parseIPv6(e){const i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((n,s)=>{const c=parseInt(s,16);if(isNaN(c)||c<0||c>65535)throw new Error("Invalid IPv6 address part");return n.push(c>>8&255),n.push(c&255),n},[])}static expandIPv6(e){if(!e.includes("::"))return e;const t=e.split("::");if(t.length>2)throw new Error("Invalid IPv6 address");const i=t[0]?t[0].split(":"):[],n=t[1]?t[1].split(":"):[],s=8-(i.length+n.length);if(s<0)throw new Error("Invalid IPv6 address");return[...i,...Array(s).fill("0"),...n].join(":")}static formatIPv6(e){const t=[];for(let i=0;i<16;i+=2)t.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){const t=e.split(":");let i=-1,n=0,s=-1,c=0;for(let u=0;u<t.length;u++)t[u]==="0"?(s===-1&&(s=u),c++):(c>n&&(i=s,n=c),s=-1,c=0);if(c>n&&(i=s,n=c),n>1){const u=t.slice(0,i).join(":"),f=t.slice(i+n).join(":");return`${u}::${f}`}return e}static parseCIDR(e){const[t,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(t)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),n]}else{if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),n]}}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){const t=new Uint8Array(e);if(t.length===4)return Array.from(t).join(".");if(t.length===16)return this.formatIPv6(t);if(t.length===8||t.length===32){const i=t.length/2,n=t.slice(0,i),s=t.slice(i);if(t.every(f=>f===0))return t.length===8?"0.0.0.0/0":"::/0";const u=s.reduce((f,p)=>f+(p.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(n).join(".")}/${u}`:`${this.formatIPv6(n)}/${u}`}return this.decodeIP(_.ToHex(e))}static fromString(e){if(e.includes("/")){const[i,n]=this.parseCIDR(e),s=new Uint8Array(i.length);let c=n;for(let f=0;f<s.length;f++)c>=8?(s[f]=255,c-=8):c>0&&(s[f]=255<<8-c,c=0);const u=new Uint8Array(i.length*2);return u.set(i,0),u.set(s,i.length),u.buffer}const t=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(t).buffer}}var Fo,qo,Ko;let Se=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:d.TeletexString})],Se.prototype,"teletexString",void 0),a([l({type:d.PrintableString})],Se.prototype,"printableString",void 0),a([l({type:d.UniversalString})],Se.prototype,"universalString",void 0),a([l({type:d.Utf8String})],Se.prototype,"utf8String",void 0),a([l({type:d.BmpString})],Se.prototype,"bmpString",void 0),Se=a([w({type:v.Choice})],Se);let ur=class extends Se{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?_.ToHex(this.anyValue):super.toString())}};a([l({type:d.IA5String})],ur.prototype,"ia5String",void 0),a([l({type:d.Any})],ur.prototype,"anyValue",void 0),ur=a([w({type:v.Choice})],ur);class an{constructor(e={}){this.type="",this.value=new ur,Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],an.prototype,"type",void 0),a([l({type:ur})],an.prototype,"value",void 0);let fr=Fo=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Fo.prototype)}};fr=Fo=a([w({type:v.Set,itemType:an})],fr);let Wo=qo=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};Wo=qo=a([w({type:v.Sequence,itemType:fr})],Wo);let ge=Ko=class extends Wo{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};ge=Ko=a([w({type:v.Sequence})],ge);const ld={fromASN:r=>el.toString(sn.fromASN(r)),toASN:r=>sn.toASN(el.fromString(r))};class zr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],zr.prototype,"typeId",void 0),a([l({type:d.Any,context:0})],zr.prototype,"value",void 0);class Go{constructor(e={}){this.partyName=new Se,Object.assign(this,e)}}a([l({type:Se,optional:!0,context:0,implicit:!0})],Go.prototype,"nameAssigner",void 0),a([l({type:Se,context:1,implicit:!0})],Go.prototype,"partyName",void 0);let q=class{constructor(e={}){Object.assign(this,e)}};a([l({type:zr,context:0,implicit:!0})],q.prototype,"otherName",void 0),a([l({type:d.IA5String,context:1,implicit:!0})],q.prototype,"rfc822Name",void 0),a([l({type:d.IA5String,context:2,implicit:!0})],q.prototype,"dNSName",void 0),a([l({type:d.Any,context:3,implicit:!0})],q.prototype,"x400Address",void 0),a([l({type:ge,context:4,implicit:!1})],q.prototype,"directoryName",void 0),a([l({type:Go,context:5})],q.prototype,"ediPartyName",void 0),a([l({type:d.IA5String,context:6,implicit:!0})],q.prototype,"uniformResourceIdentifier",void 0),a([l({type:d.OctetString,context:7,implicit:!0,converter:ld})],q.prototype,"iPAddress",void 0),a([l({type:d.ObjectIdentifier,context:8,implicit:!0})],q.prototype,"registeredID",void 0),q=a([w({type:v.Choice})],q);const zo="1.3.6.1.5.5.7",ud=`${zo}.1`,dr=`${zo}.3`,cn=`${zo}.48`,tl=`${cn}.1`,rl=`${cn}.2`,il=`${cn}.3`,nl=`${cn}.5`,bt="2.5.29";var Jo;const Yo=`${ud}.1`;class Jr{constructor(e={}){this.accessMethod="",this.accessLocation=new q,Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Jr.prototype,"accessMethod",void 0),a([l({type:q})],Jr.prototype,"accessLocation",void 0);let pr=Jo=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Jo.prototype)}};pr=Jo=a([w({type:v.Sequence,itemType:Jr})],pr);const Zo=`${bt}.35`;class Xo extends Q{}class qt{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:Xo,context:0,optional:!0,implicit:!0})],qt.prototype,"keyIdentifier",void 0),a([l({type:q,context:1,optional:!0,implicit:!0,repeated:"sequence"})],qt.prototype,"authorityCertIssuer",void 0),a([l({type:d.Integer,context:2,optional:!0,implicit:!0,converter:ue})],qt.prototype,"authorityCertSerialNumber",void 0);const ol=`${bt}.19`;class ln{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:d.Boolean,defaultValue:!1})],ln.prototype,"cA",void 0),a([l({type:d.Integer,optional:!0})],ln.prototype,"pathLenConstraint",void 0);var Qo;let Ee=Qo=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Ee=Qo=a([w({type:v.Sequence,itemType:q})],Ee);var es;let sl=es=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,es.prototype)}};sl=es=a([w({type:v.Sequence})],sl);var ts;const al=`${bt}.32`;let vt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:d.IA5String})],vt.prototype,"ia5String",void 0),a([l({type:d.VisibleString})],vt.prototype,"visibleString",void 0),a([l({type:d.BmpString})],vt.prototype,"bmpString",void 0),a([l({type:d.Utf8String})],vt.prototype,"utf8String",void 0),vt=a([w({type:v.Choice})],vt);class rs{constructor(e={}){this.organization=new vt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:vt})],rs.prototype,"organization",void 0),a([l({type:d.Integer,repeated:"sequence"})],rs.prototype,"noticeNumbers",void 0);class is{constructor(e={}){Object.assign(this,e)}}a([l({type:rs,optional:!0})],is.prototype,"noticeRef",void 0),a([l({type:vt,optional:!0})],is.prototype,"explicitText",void 0);let un=class{constructor(e={}){Object.assign(this,e)}};a([l({type:d.IA5String})],un.prototype,"cPSuri",void 0),a([l({type:is})],un.prototype,"userNotice",void 0),un=a([w({type:v.Choice})],un);class ns{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],ns.prototype,"policyQualifierId",void 0),a([l({type:d.Any})],ns.prototype,"qualifier",void 0);class fn{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],fn.prototype,"policyIdentifier",void 0),a([l({type:ns,repeated:"sequence",optional:!0})],fn.prototype,"policyQualifiers",void 0);let dn=ts=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ts.prototype)}};dn=ts=a([w({type:v.Sequence,itemType:fn})],dn);let pn=class{constructor(e=0){this.value=e}};a([l({type:d.Integer})],pn.prototype,"value",void 0),pn=a([w({type:v.Choice})],pn);let cl=class extends pn{};cl=a([w({type:v.Choice})],cl);var os;const ss=`${bt}.31`;var Ze;(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"})(Ze||(Ze={}));class ll extends on{toJSON(){const e=[],t=this.toNumber();return t&Ze.aACompromise&&e.push("aACompromise"),t&Ze.affiliationChanged&&e.push("affiliationChanged"),t&Ze.cACompromise&&e.push("cACompromise"),t&Ze.certificateHold&&e.push("certificateHold"),t&Ze.cessationOfOperation&&e.push("cessationOfOperation"),t&Ze.keyCompromise&&e.push("keyCompromise"),t&Ze.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Ze.superseded&&e.push("superseded"),t&Ze.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Kt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:q,context:0,repeated:"sequence",implicit:!0})],Kt.prototype,"fullName",void 0),a([l({type:fr,context:1,implicit:!0})],Kt.prototype,"nameRelativeToCRLIssuer",void 0),Kt=a([w({type:v.Choice})],Kt);class hr{constructor(e={}){Object.assign(this,e)}}a([l({type:Kt,context:0,optional:!0})],hr.prototype,"distributionPoint",void 0),a([l({type:ll,context:1,optional:!0,implicit:!0})],hr.prototype,"reasons",void 0),a([l({type:q,context:2,optional:!0,repeated:"sequence",implicit:!0})],hr.prototype,"cRLIssuer",void 0);let yr=os=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,os.prototype)}};yr=os=a([w({type:v.Sequence,itemType:hr})],yr);var as;let ul=as=class extends yr{constructor(e){super(e),Object.setPrototypeOf(this,as.prototype)}};ul=as=a([w({type:v.Sequence,itemType:hr})],ul);class Ne{constructor(e={}){this.onlyContainsUserCerts=Ne.ONLY,this.onlyContainsCACerts=Ne.ONLY,this.indirectCRL=Ne.ONLY,this.onlyContainsAttributeCerts=Ne.ONLY,Object.assign(this,e)}}Ne.ONLY=!1,a([l({type:Kt,context:0,optional:!0})],Ne.prototype,"distributionPoint",void 0),a([l({type:d.Boolean,context:1,defaultValue:Ne.ONLY,implicit:!0})],Ne.prototype,"onlyContainsUserCerts",void 0),a([l({type:d.Boolean,context:2,defaultValue:Ne.ONLY,implicit:!0})],Ne.prototype,"onlyContainsCACerts",void 0),a([l({type:ll,context:3,optional:!0,implicit:!0})],Ne.prototype,"onlySomeReasons",void 0),a([l({type:d.Boolean,context:4,defaultValue:Ne.ONLY,implicit:!0})],Ne.prototype,"indirectCRL",void 0),a([l({type:d.Boolean,context:5,defaultValue:Ne.ONLY,implicit:!0})],Ne.prototype,"onlyContainsAttributeCerts",void 0);var Yr;(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"})(Yr||(Yr={}));let cs=class{constructor(e=Yr.unspecified){this.reason=Yr.unspecified,this.reason=e}toJSON(){return Yr[this.reason]}toString(){return this.toJSON()}};a([l({type:d.Enumerated})],cs.prototype,"reason",void 0),cs=a([w({type:v.Choice})],cs);var ls;const fl=`${bt}.37`;let hn=ls=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};hn=ls=a([w({type:v.Sequence,itemType:d.ObjectIdentifier})],hn);const fd=`${dr}.1`,dd=`${dr}.2`,pd=`${dr}.3`,hd=`${dr}.4`,yd=`${dr}.8`,gd=`${dr}.9`;let us=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:d.Integer,converter:ue})],us.prototype,"value",void 0),us=a([w({type:v.Choice})],us);let fs=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:d.GeneralizedTime})],fs.prototype,"value",void 0),fs=a([w({type:v.Choice})],fs);var ds;const dl=`${bt}.18`;let pl=ds=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,ds.prototype)}};pl=ds=a([w({type:v.Sequence})],pl);const hl=`${bt}.15`;var Xe;(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"})(Xe||(Xe={}));class ps extends on{toJSON(){const e=this.toNumber(),t=[];return e&Xe.cRLSign&&t.push("crlSign"),e&Xe.dataEncipherment&&t.push("dataEncipherment"),e&Xe.decipherOnly&&t.push("decipherOnly"),e&Xe.digitalSignature&&t.push("digitalSignature"),e&Xe.encipherOnly&&t.push("encipherOnly"),e&Xe.keyAgreement&&t.push("keyAgreement"),e&Xe.keyCertSign&&t.push("keyCertSign"),e&Xe.keyEncipherment&&t.push("keyEncipherment"),e&Xe.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var hs;class yn{constructor(e={}){this.base=new q,this.minimum=0,Object.assign(this,e)}}a([l({type:q})],yn.prototype,"base",void 0),a([l({type:d.Integer,context:0,defaultValue:0,implicit:!0})],yn.prototype,"minimum",void 0),a([l({type:d.Integer,context:1,optional:!0,implicit:!0})],yn.prototype,"maximum",void 0);let gn=hs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,hs.prototype)}};gn=hs=a([w({type:v.Sequence,itemType:yn})],gn);class yl{constructor(e={}){Object.assign(this,e)}}a([l({type:gn,context:0,optional:!0,implicit:!0})],yl.prototype,"permittedSubtrees",void 0),a([l({type:gn,context:1,optional:!0,implicit:!0})],yl.prototype,"excludedSubtrees",void 0);class gl{constructor(e={}){Object.assign(this,e)}}a([l({type:d.Integer,context:0,implicit:!0,optional:!0,converter:ue})],gl.prototype,"requireExplicitPolicy",void 0),a([l({type:d.Integer,context:1,implicit:!0,optional:!0,converter:ue})],gl.prototype,"inhibitPolicyMapping",void 0);var ys;class gs{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],gs.prototype,"issuerDomainPolicy",void 0),a([l({type:d.ObjectIdentifier})],gs.prototype,"subjectDomainPolicy",void 0);let ml=ys=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ys.prototype)}};ml=ys=a([w({type:v.Sequence,itemType:gs})],ml);var ms;const bl=`${bt}.17`;let bs=ms=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,ms.prototype)}};bs=ms=a([w({type:v.Sequence})],bs);let wt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:d.ObjectIdentifier})],wt.prototype,"type",void 0),a([l({type:d.Any,repeated:"set"})],wt.prototype,"values",void 0);var vs;let vl=vs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};vl=vs=a([w({type:v.Sequence,itemType:wt})],vl);const wl=`${bt}.14`;class It extends Xo{}class Sl{constructor(e={}){Object.assign(this,e)}}a([l({type:d.GeneralizedTime,context:0,implicit:!0,optional:!0})],Sl.prototype,"notBefore",void 0),a([l({type:d.GeneralizedTime,context:1,implicit:!0,optional:!0})],Sl.prototype,"notAfter",void 0);var Zr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Zr||(Zr={}));class Al extends on{toJSON(){const e=[],t=this.toNumber();return t&Zr.pKIXCertificate&&e.push("pKIXCertificate"),t&Zr.newExtensions&&e.push("newExtensions"),t&Zr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class kl{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Al,Object.assign(this,e)}}a([l({type:d.GeneralString})],kl.prototype,"entrustVers",void 0),a([l({type:Al})],kl.prototype,"entrustInfoFlags",void 0);var ws;let Cl=ws=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};Cl=ws=a([w({type:v.Sequence,itemType:Jr})],Cl);class E{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof E&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Xa(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:d.ObjectIdentifier})],E.prototype,"algorithm",void 0),a([l({type:d.Any,optional:!0})],E.prototype,"parameters",void 0);class st{constructor(e={}){this.algorithm=new E,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:E})],st.prototype,"algorithm",void 0),a([l({type:d.BitString})],st.prototype,"subjectPublicKey",void 0);let Ae=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:d.UTCTime})],Ae.prototype,"utcTime",void 0),a([l({type:d.GeneralizedTime})],Ae.prototype,"generalTime",void 0),Ae=a([w({type:v.Choice})],Ae);class mn{constructor(e){this.notBefore=new Ae(new Date),this.notAfter=new Ae(new Date),e&&(this.notBefore=new Ae(e.notBefore),this.notAfter=new Ae(e.notAfter))}}a([l({type:Ae})],mn.prototype,"notBefore",void 0),a([l({type:Ae})],mn.prototype,"notAfter",void 0);var Ss;let Qe=class mf{constructor(e={}){this.extnID="",this.critical=mf.CRITICAL,this.extnValue=new Q,Object.assign(this,e)}};Qe.CRITICAL=!1,a([l({type:d.ObjectIdentifier})],Qe.prototype,"extnID",void 0),a([l({type:d.Boolean,defaultValue:Qe.CRITICAL})],Qe.prototype,"critical",void 0),a([l({type:Q})],Qe.prototype,"extnValue",void 0);let Wt=Ss=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ss.prototype)}};Wt=Ss=a([w({type:v.Sequence,itemType:Qe})],Wt);var gr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(gr||(gr={}));class Ge{constructor(e={}){this.version=gr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new E,this.issuer=new ge,this.validity=new mn,this.subject=new ge,this.subjectPublicKeyInfo=new st,Object.assign(this,e)}}a([l({type:d.Integer,context:0,defaultValue:gr.v1})],Ge.prototype,"version",void 0),a([l({type:d.Integer,converter:ue})],Ge.prototype,"serialNumber",void 0),a([l({type:E})],Ge.prototype,"signature",void 0),a([l({type:ge})],Ge.prototype,"issuer",void 0),a([l({type:mn})],Ge.prototype,"validity",void 0),a([l({type:ge})],Ge.prototype,"subject",void 0),a([l({type:st})],Ge.prototype,"subjectPublicKeyInfo",void 0),a([l({type:d.BitString,context:1,implicit:!0,optional:!0})],Ge.prototype,"issuerUniqueID",void 0),a([l({type:d.BitString,context:2,implicit:!0,optional:!0})],Ge.prototype,"subjectUniqueID",void 0),a([l({type:Wt,context:3,optional:!0})],Ge.prototype,"extensions",void 0);class mr{constructor(e={}){this.tbsCertificate=new Ge,this.signatureAlgorithm=new E,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ge,raw:!0})],mr.prototype,"tbsCertificate",void 0),a([l({type:E})],mr.prototype,"signatureAlgorithm",void 0),a([l({type:d.BitString})],mr.prototype,"signatureValue",void 0);class bn{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Ae,Object.assign(this,e)}}a([l({type:d.Integer,converter:ue})],bn.prototype,"userCertificate",void 0),a([l({type:Ae})],bn.prototype,"revocationDate",void 0),a([l({type:Qe,optional:!0,repeated:"sequence"})],bn.prototype,"crlEntryExtensions",void 0);class St{constructor(e={}){this.signature=new E,this.issuer=new ge,this.thisUpdate=new Ae,Object.assign(this,e)}}a([l({type:d.Integer,optional:!0})],St.prototype,"version",void 0),a([l({type:E})],St.prototype,"signature",void 0),a([l({type:ge})],St.prototype,"issuer",void 0),a([l({type:Ae})],St.prototype,"thisUpdate",void 0),a([l({type:Ae,optional:!0})],St.prototype,"nextUpdate",void 0),a([l({type:bn,repeated:"sequence",optional:!0})],St.prototype,"revokedCertificates",void 0),a([l({type:Qe,optional:!0,context:0,repeated:"sequence"})],St.prototype,"crlExtensions",void 0);let As=class{constructor(e={}){this.tbsCertList=new St,this.signatureAlgorithm=new E,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:St,raw:!0})],As.prototype,"tbsCertList",void 0),a([l({type:E})],As.prototype,"signatureAlgorithm",void 0),a([l({type:d.BitString})],As.prototype,"signature",void 0);class br{constructor(e={}){this.issuer=new ge,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:ge})],br.prototype,"issuer",void 0),a([l({type:d.Integer,converter:ue})],br.prototype,"serialNumber",void 0);let vr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:It,context:0,implicit:!0})],vr.prototype,"subjectKeyIdentifier",void 0),a([l({type:br})],vr.prototype,"issuerAndSerialNumber",void 0),vr=a([w({type:v.Choice})],vr);var At;(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"})(At||(At={}));let Xr=class extends E{};Xr=a([w({type:v.Sequence})],Xr);let vn=class extends E{};vn=a([w({type:v.Sequence})],vn);let at=class extends E{};at=a([w({type:v.Sequence})],at);let wn=class extends E{};wn=a([w({type:v.Sequence})],wn);let xl=class extends E{};xl=a([w({type:v.Sequence})],xl);let ks=class extends E{};ks=a([w({type:v.Sequence})],ks);let wr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:d.ObjectIdentifier})],wr.prototype,"attrType",void 0),a([l({type:d.Any,repeated:"set"})],wr.prototype,"attrValues",void 0);var Cs;class ct{constructor(e={}){this.version=At.v0,this.sid=new vr,this.digestAlgorithm=new Xr,this.signatureAlgorithm=new vn,this.signature=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],ct.prototype,"version",void 0),a([l({type:vr})],ct.prototype,"sid",void 0),a([l({type:Xr})],ct.prototype,"digestAlgorithm",void 0),a([l({type:wr,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],ct.prototype,"signedAttrs",void 0),a([l({type:vn})],ct.prototype,"signatureAlgorithm",void 0),a([l({type:Q})],ct.prototype,"signature",void 0),a([l({type:wr,repeated:"set",context:1,implicit:!0,optional:!0})],ct.prototype,"unsignedAttrs",void 0);let Sn=Cs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};Sn=Cs=a([w({type:v.Set,itemType:ct})],Sn);let Bl=class extends ct{};Bl=a([w({type:v.Sequence})],Bl);let El=class extends Ae{};El=a([w({type:v.Choice})],El);class xs{constructor(e={}){this.acIssuer=new q,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:q})],xs.prototype,"acIssuer",void 0),a([l({type:d.Integer})],xs.prototype,"acSerial",void 0),a([l({type:wt,repeated:"sequence"})],xs.prototype,"attrs",void 0);var Bs;let An=Bs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Bs.prototype)}};An=Bs=a([w({type:v.Sequence,itemType:d.ObjectIdentifier})],An);class kn{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:d.Integer,optional:!0})],kn.prototype,"pathLenConstraint",void 0),a([l({type:An,implicit:!0,context:0,optional:!0})],kn.prototype,"permittedAttrs",void 0),a([l({type:An,implicit:!0,context:1,optional:!0})],kn.prototype,"excludedAttrs",void 0),a([l({type:d.Boolean,defaultValue:!0})],kn.prototype,"permitUnSpecified",void 0);class Gt{constructor(e={}){this.issuer=new Ee,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ee})],Gt.prototype,"issuer",void 0),a([l({type:d.Integer,converter:ue})],Gt.prototype,"serial",void 0),a([l({type:d.BitString,optional:!0})],Gt.prototype,"issuerUID",void 0);var Es;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(Es||(Es={}));class zt{constructor(e={}){this.digestedObjectType=Es.publicKey,this.digestAlgorithm=new E,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Enumerated})],zt.prototype,"digestedObjectType",void 0),a([l({type:d.ObjectIdentifier,optional:!0})],zt.prototype,"otherObjectTypeID",void 0),a([l({type:E})],zt.prototype,"digestAlgorithm",void 0),a([l({type:d.BitString})],zt.prototype,"objectDigest",void 0);class Cn{constructor(e={}){Object.assign(this,e)}}a([l({type:Ee,optional:!0})],Cn.prototype,"issuerName",void 0),a([l({type:Gt,context:0,implicit:!0,optional:!0})],Cn.prototype,"baseCertificateID",void 0),a([l({type:zt,context:1,implicit:!0,optional:!0})],Cn.prototype,"objectDigestInfo",void 0);let Sr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:q,repeated:"sequence"})],Sr.prototype,"v1Form",void 0),a([l({type:Cn,context:0,implicit:!0})],Sr.prototype,"v2Form",void 0),Sr=a([w({type:v.Choice})],Sr);class xn{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:d.GeneralizedTime})],xn.prototype,"notBeforeTime",void 0),a([l({type:d.GeneralizedTime})],xn.prototype,"notAfterTime",void 0);class Qr{constructor(e={}){Object.assign(this,e)}}a([l({type:Gt,implicit:!0,context:0,optional:!0})],Qr.prototype,"baseCertificateID",void 0),a([l({type:Ee,implicit:!0,context:1,optional:!0})],Qr.prototype,"entityName",void 0),a([l({type:zt,implicit:!0,context:2,optional:!0})],Qr.prototype,"objectDigestInfo",void 0);var Ns;(function(r){r[r.v2=1]="v2"})(Ns||(Ns={}));class et{constructor(e={}){this.version=Ns.v2,this.holder=new Qr,this.issuer=new Sr,this.signature=new E,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new xn,this.attributes=[],Object.assign(this,e)}}a([l({type:d.Integer})],et.prototype,"version",void 0),a([l({type:Qr})],et.prototype,"holder",void 0),a([l({type:Sr})],et.prototype,"issuer",void 0),a([l({type:E})],et.prototype,"signature",void 0),a([l({type:d.Integer,converter:ue})],et.prototype,"serialNumber",void 0),a([l({type:xn})],et.prototype,"attrCertValidityPeriod",void 0),a([l({type:wt,repeated:"sequence"})],et.prototype,"attributes",void 0),a([l({type:d.BitString,optional:!0})],et.prototype,"issuerUniqueID",void 0),a([l({type:Wt,optional:!0})],et.prototype,"extensions",void 0);class Bn{constructor(e={}){this.acinfo=new et,this.signatureAlgorithm=new E,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:et})],Bn.prototype,"acinfo",void 0),a([l({type:E})],Bn.prototype,"signatureAlgorithm",void 0),a([l({type:d.BitString})],Bn.prototype,"signatureValue",void 0);var En;(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"})(En||(En={}));class Is extends on{}class Os{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier,implicit:!0,context:0})],Os.prototype,"type",void 0),a([l({type:d.Any,implicit:!0,context:1})],Os.prototype,"value",void 0);class _s{constructor(e={}){this.policyId="",this.classList=new Is(En.unclassified),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],_s.prototype,"policyId",void 0),a([l({type:Is,defaultValue:new Is(En.unclassified)})],_s.prototype,"classList",void 0),a([l({type:Os,repeated:"set"})],_s.prototype,"securityCategories",void 0);class Nn{constructor(e={}){Object.assign(this,e)}}a([l({type:Q})],Nn.prototype,"cotets",void 0),a([l({type:d.ObjectIdentifier})],Nn.prototype,"oid",void 0),a([l({type:d.Utf8String})],Nn.prototype,"string",void 0);class Nl{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Ee,implicit:!0,context:0,optional:!0})],Nl.prototype,"policyAuthority",void 0),a([l({type:Nn,repeated:"sequence"})],Nl.prototype,"values",void 0);var Ts;class In{constructor(e={}){this.targetCertificate=new Gt,Object.assign(this,e)}}a([l({type:Gt})],In.prototype,"targetCertificate",void 0),a([l({type:q,optional:!0})],In.prototype,"targetName",void 0),a([l({type:zt,optional:!0})],In.prototype,"certDigestInfo",void 0);let Ar=class{constructor(e={}){Object.assign(this,e)}};a([l({type:q,context:0,implicit:!0})],Ar.prototype,"targetName",void 0),a([l({type:q,context:1,implicit:!0})],Ar.prototype,"targetGroup",void 0),a([l({type:In,context:2,implicit:!0})],Ar.prototype,"targetCert",void 0),Ar=a([w({type:v.Choice})],Ar);let Vs=Ts=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ts.prototype)}};Vs=Ts=a([w({type:v.Sequence,itemType:Ar})],Vs);var js;let Il=js=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,js.prototype)}};Il=js=a([w({type:v.Sequence,itemType:Vs})],Il);class Ol{constructor(e={}){Object.assign(this,e)}}a([l({type:Ee,implicit:!0,context:0,optional:!0})],Ol.prototype,"roleAuthority",void 0),a([l({type:q,implicit:!0,context:1})],Ol.prototype,"roleName",void 0);class Ps{constructor(e={}){this.service=new q,this.ident=new q,Object.assign(this,e)}}a([l({type:q})],Ps.prototype,"service",void 0),a([l({type:q})],Ps.prototype,"ident",void 0),a([l({type:Q,optional:!0})],Ps.prototype,"authInfo",void 0);var Rs;class Ds{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Ds.prototype,"otherCertFormat",void 0),a([l({type:d.Any})],Ds.prototype,"otherCert",void 0);let kr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:mr})],kr.prototype,"certificate",void 0),a([l({type:Bn,context:2,implicit:!0})],kr.prototype,"v2AttrCert",void 0),a([l({type:Ds,context:3,implicit:!0})],kr.prototype,"other",void 0),kr=a([w({type:v.Choice})],kr);let On=Rs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Rs.prototype)}};On=Rs=a([w({type:v.Set,itemType:kr})],On);class Cr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Cr.prototype,"contentType",void 0),a([l({type:d.Any,context:0})],Cr.prototype,"content",void 0);let ei=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Q})],ei.prototype,"single",void 0),a([l({type:d.Any})],ei.prototype,"any",void 0),ei=a([w({type:v.Choice})],ei);class _n{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],_n.prototype,"eContentType",void 0),a([l({type:ei,context:0,optional:!0})],_n.prototype,"eContent",void 0);let ti=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Q,context:0,implicit:!0,optional:!0})],ti.prototype,"value",void 0),a([l({type:Q,converter:Kf,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ti.prototype,"constructedValue",void 0),ti=a([w({type:v.Choice})],ti);class ri{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new wn,Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],ri.prototype,"contentType",void 0),a([l({type:wn})],ri.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:ti,optional:!0})],ri.prototype,"encryptedContent",void 0);class Tn{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Tn.prototype,"keyAttrId",void 0),a([l({type:d.Any,optional:!0})],Tn.prototype,"keyAttr",void 0);var Ms;class Vn{constructor(e={}){this.subjectKeyIdentifier=new It,Object.assign(this,e)}}a([l({type:It})],Vn.prototype,"subjectKeyIdentifier",void 0),a([l({type:d.GeneralizedTime,optional:!0})],Vn.prototype,"date",void 0),a([l({type:Tn,optional:!0})],Vn.prototype,"other",void 0);let xr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Vn,context:0,implicit:!0,optional:!0})],xr.prototype,"rKeyId",void 0),a([l({type:br,optional:!0})],xr.prototype,"issuerAndSerialNumber",void 0),xr=a([w({type:v.Choice})],xr);class Us{constructor(e={}){this.rid=new xr,this.encryptedKey=new Q,Object.assign(this,e)}}a([l({type:xr})],Us.prototype,"rid",void 0),a([l({type:Q})],Us.prototype,"encryptedKey",void 0);let jn=Ms=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ms.prototype)}};jn=Ms=a([w({type:v.Sequence,itemType:Us})],jn);class $s{constructor(e={}){this.algorithm=new E,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:E})],$s.prototype,"algorithm",void 0),a([l({type:d.BitString})],$s.prototype,"publicKey",void 0);let Jt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:It,context:0,implicit:!0,optional:!0})],Jt.prototype,"subjectKeyIdentifier",void 0),a([l({type:$s,context:1,implicit:!0,optional:!0})],Jt.prototype,"originatorKey",void 0),a([l({type:br,optional:!0})],Jt.prototype,"issuerAndSerialNumber",void 0),Jt=a([w({type:v.Choice})],Jt);class Br{constructor(e={}){this.version=At.v3,this.originator=new Jt,this.keyEncryptionAlgorithm=new at,this.recipientEncryptedKeys=new jn,Object.assign(this,e)}}a([l({type:d.Integer})],Br.prototype,"version",void 0),a([l({type:Jt,context:0})],Br.prototype,"originator",void 0),a([l({type:Q,context:1,optional:!0})],Br.prototype,"ukm",void 0),a([l({type:at})],Br.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:jn})],Br.prototype,"recipientEncryptedKeys",void 0);let Er=class{constructor(e={}){Object.assign(this,e)}};a([l({type:It,context:0,implicit:!0})],Er.prototype,"subjectKeyIdentifier",void 0),a([l({type:br})],Er.prototype,"issuerAndSerialNumber",void 0),Er=a([w({type:v.Choice})],Er);class ii{constructor(e={}){this.version=At.v0,this.rid=new Er,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],ii.prototype,"version",void 0),a([l({type:Er})],ii.prototype,"rid",void 0),a([l({type:at})],ii.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Q})],ii.prototype,"encryptedKey",void 0);class ni{constructor(e={}){this.keyIdentifier=new Q,Object.assign(this,e)}}a([l({type:Q})],ni.prototype,"keyIdentifier",void 0),a([l({type:d.GeneralizedTime,optional:!0})],ni.prototype,"date",void 0),a([l({type:Tn,optional:!0})],ni.prototype,"other",void 0);class oi{constructor(e={}){this.version=At.v4,this.kekid=new ni,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],oi.prototype,"version",void 0),a([l({type:ni})],oi.prototype,"kekid",void 0),a([l({type:at})],oi.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Q})],oi.prototype,"encryptedKey",void 0);class si{constructor(e={}){this.version=At.v0,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],si.prototype,"version",void 0),a([l({type:ks,context:0,optional:!0})],si.prototype,"keyDerivationAlgorithm",void 0),a([l({type:at})],si.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Q})],si.prototype,"encryptedKey",void 0);class Hs{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Hs.prototype,"oriType",void 0),a([l({type:d.Any})],Hs.prototype,"oriValue",void 0);let Ot=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ii,optional:!0})],Ot.prototype,"ktri",void 0),a([l({type:Br,context:1,implicit:!0,optional:!0})],Ot.prototype,"kari",void 0),a([l({type:oi,context:2,implicit:!0,optional:!0})],Ot.prototype,"kekri",void 0),a([l({type:si,context:3,implicit:!0,optional:!0})],Ot.prototype,"pwri",void 0),a([l({type:Hs,context:4,implicit:!0,optional:!0})],Ot.prototype,"ori",void 0),Ot=a([w({type:v.Choice})],Ot);var Ls;let Pn=Ls=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ls.prototype)}};Pn=Ls=a([w({type:v.Set,itemType:Ot})],Pn);var Fs;class Rn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Rn.prototype,"otherRevInfoFormat",void 0),a([l({type:d.Any})],Rn.prototype,"otherRevInfo",void 0);let Dn=class{constructor(e={}){this.other=new Rn,Object.assign(this,e)}};a([l({type:Rn,context:1,implicit:!0})],Dn.prototype,"other",void 0),Dn=a([w({type:v.Choice})],Dn);let Mn=Fs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Fs.prototype)}};Mn=Fs=a([w({type:v.Set,itemType:Dn})],Mn);class qs{constructor(e={}){Object.assign(this,e)}}a([l({type:On,context:0,implicit:!0,optional:!0})],qs.prototype,"certs",void 0),a([l({type:Mn,context:1,implicit:!0,optional:!0})],qs.prototype,"crls",void 0);var Ks;let Ws=Ks=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ks.prototype)}};Ws=Ks=a([w({type:v.Set,itemType:wr})],Ws);class ai{constructor(e={}){this.version=At.v0,this.recipientInfos=new Pn,this.encryptedContentInfo=new ri,Object.assign(this,e)}}a([l({type:d.Integer})],ai.prototype,"version",void 0),a([l({type:qs,context:0,implicit:!0,optional:!0})],ai.prototype,"originatorInfo",void 0),a([l({type:Pn})],ai.prototype,"recipientInfos",void 0),a([l({type:ri})],ai.prototype,"encryptedContentInfo",void 0),a([l({type:Ws,context:1,implicit:!0,optional:!0})],ai.prototype,"unprotectedAttrs",void 0);const md="1.2.840.113549.1.7.2";var Gs;let Un=Gs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Gs.prototype)}};Un=Gs=a([w({type:v.Set,itemType:Xr})],Un);class Nr{constructor(e={}){this.version=At.v0,this.digestAlgorithms=new Un,this.encapContentInfo=new _n,this.signerInfos=new Sn,Object.assign(this,e)}}a([l({type:d.Integer})],Nr.prototype,"version",void 0),a([l({type:Un})],Nr.prototype,"digestAlgorithms",void 0),a([l({type:_n})],Nr.prototype,"encapContentInfo",void 0),a([l({type:On,context:0,implicit:!0,optional:!0})],Nr.prototype,"certificates",void 0),a([l({type:Mn,context:1,implicit:!0,optional:!0})],Nr.prototype,"crls",void 0),a([l({type:Sn})],Nr.prototype,"signerInfos",void 0);const ci="1.2.840.10045.2.1",zs="1.2.840.10045.4.1",_l="1.2.840.10045.4.3.1",Js="1.2.840.10045.4.3.2",Ys="1.2.840.10045.4.3.3",Zs="1.2.840.10045.4.3.4",Tl="1.2.840.10045.3.1.7",Vl="1.3.132.0.34",jl="1.3.132.0.35";function li(r){return new E({algorithm:r})}const bd=li(zs);li(_l);const vd=li(Js),wd=li(Ys),Sd=li(Zs);let ui=class{constructor(e={}){Object.assign(this,e)}};a([l({type:d.ObjectIdentifier})],ui.prototype,"fieldType",void 0),a([l({type:d.Any})],ui.prototype,"parameters",void 0),ui=a([w({type:v.Sequence})],ui);class Ad extends Q{}let Ir=class{constructor(e={}){Object.assign(this,e)}};a([l({type:d.OctetString})],Ir.prototype,"a",void 0),a([l({type:d.OctetString})],Ir.prototype,"b",void 0),a([l({type:d.BitString,optional:!0})],Ir.prototype,"seed",void 0),Ir=a([w({type:v.Sequence})],Ir);var Xs;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Xs||(Xs={}));let kt=class{constructor(e={}){this.version=Xs.ecpVer1,Object.assign(this,e)}};a([l({type:d.Integer})],kt.prototype,"version",void 0),a([l({type:ui})],kt.prototype,"fieldID",void 0),a([l({type:Ir})],kt.prototype,"curve",void 0),a([l({type:Ad})],kt.prototype,"base",void 0),a([l({type:d.Integer,converter:ue})],kt.prototype,"order",void 0),a([l({type:d.Integer,optional:!0})],kt.prototype,"cofactor",void 0),kt=a([w({type:v.Sequence})],kt);let _t=class{constructor(e={}){Object.assign(this,e)}};a([l({type:d.ObjectIdentifier})],_t.prototype,"namedCurve",void 0),a([l({type:d.Null})],_t.prototype,"implicitCurve",void 0),a([l({type:kt})],_t.prototype,"specifiedCurve",void 0),_t=a([w({type:v.Choice})],_t);class $n{constructor(e={}){this.version=1,this.privateKey=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],$n.prototype,"version",void 0),a([l({type:Q})],$n.prototype,"privateKey",void 0),a([l({type:_t,context:0,optional:!0})],$n.prototype,"parameters",void 0),a([l({type:d.BitString,context:1,optional:!0})],$n.prototype,"publicKey",void 0);class Hn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Integer,converter:ue})],Hn.prototype,"r",void 0),a([l({type:d.Integer,converter:ue})],Hn.prototype,"s",void 0);const Re="1.2.840.113549.1.1",Yt=`${Re}.1`,kd=`${Re}.7`,Cd=`${Re}.9`,fi=`${Re}.10`,xd=`${Re}.2`,Bd=`${Re}.4`,Ln=`${Re}.5`,Ed=`${Re}.14`,Qs=`${Re}.11`,Fn=`${Re}.12`,qn=`${Re}.13`,Pl=`${Re}.15`,Rl=`${Re}.16`,Kn="1.3.14.3.2.26",Dl="2.16.840.1.101.3.4.2.4",Wn="2.16.840.1.101.3.4.2.1",Gn="2.16.840.1.101.3.4.2.2",zn="2.16.840.1.101.3.4.2.3",Nd="2.16.840.1.101.3.4.2.5",Id="2.16.840.1.101.3.4.2.6",Od="1.2.840.113549.2.2",_d="1.2.840.113549.2.5",Jn=`${Re}.8`;function me(r){return new E({algorithm:r,parameters:null})}me(Od),me(_d);const Zt=me(Kn);me(Dl),me(Wn),me(Gn),me(zn),me(Nd),me(Id);const Ml=new E({algorithm:Jn,parameters:x.serialize(Zt)}),Ul=new E({algorithm:Cd,parameters:x.serialize(sn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});me(Yt),me(xd),me(Bd),me(Ln),me(Pl),me(Rl),me(Fn),me(qn),me(Pl),me(Rl);class Yn{constructor(e={}){this.hashAlgorithm=new E(Zt),this.maskGenAlgorithm=new E({algorithm:Jn,parameters:x.serialize(Zt)}),this.pSourceAlgorithm=new E(Ul),Object.assign(this,e)}}a([l({type:E,context:0,defaultValue:Zt})],Yn.prototype,"hashAlgorithm",void 0),a([l({type:E,context:1,defaultValue:Ml})],Yn.prototype,"maskGenAlgorithm",void 0),a([l({type:E,context:2,defaultValue:Ul})],Yn.prototype,"pSourceAlgorithm",void 0),new E({algorithm:kd,parameters:x.serialize(new Yn)});class Xt{constructor(e={}){this.hashAlgorithm=new E(Zt),this.maskGenAlgorithm=new E({algorithm:Jn,parameters:x.serialize(Zt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:E,context:0,defaultValue:Zt})],Xt.prototype,"hashAlgorithm",void 0),a([l({type:E,context:1,defaultValue:Ml})],Xt.prototype,"maskGenAlgorithm",void 0),a([l({type:d.Integer,context:2,defaultValue:20})],Xt.prototype,"saltLength",void 0),a([l({type:d.Integer,context:3,defaultValue:1})],Xt.prototype,"trailerField",void 0),new E({algorithm:fi,parameters:x.serialize(new Xt)});class Zn{constructor(e={}){this.digestAlgorithm=new E,this.digest=new Q,Object.assign(this,e)}}a([l({type:E})],Zn.prototype,"digestAlgorithm",void 0),a([l({type:Q})],Zn.prototype,"digest",void 0);var ea;class Xn{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Integer,converter:ue})],Xn.prototype,"prime",void 0),a([l({type:d.Integer,converter:ue})],Xn.prototype,"exponent",void 0),a([l({type:d.Integer,converter:ue})],Xn.prototype,"coefficient",void 0);let ta=ea=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ea.prototype)}};ta=ea=a([w({type:v.Sequence,itemType:Xn})],ta);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:d.Integer})],lt.prototype,"version",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"modulus",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"publicExponent",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"privateExponent",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"prime1",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"prime2",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"exponent1",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"exponent2",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"coefficient",void 0),a([l({type:ta,optional:!0})],lt.prototype,"otherPrimeInfos",void 0);class ra{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Integer,converter:ue})],ra.prototype,"modulus",void 0),a([l({type:d.Integer,converter:ue})],ra.prototype,"publicExponent",void 0);var ia;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(ia||(ia={}));const De=ia;/*! *****************************************************************************
|
|
76
76
|
Copyright (c) Microsoft Corporation.
|
|
77
77
|
|
|
78
78
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -85,9 +85,9 @@ ${e.join(`
|
|
|
85
85
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
86
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
87
|
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
-
***************************************************************************** */var
|
|
88
|
+
***************************************************************************** */var na=function(r,e){return na=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])},na(r,e)};function oa(r,e){na(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Td(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(m){try{p(i.next(m))}catch(y){c(y)}}function f(m){try{p(i.throw(m))}catch(y){c(y)}}function p(m){m.done?s(m.value):n(m.value).then(u,f)}p((i=i.apply(r,[])).next())})}function Vd(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(m){return f([p,m])}}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(m){p=[6,m],n=0}finally{i=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Qn(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 eo(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(eo(arguments[e]));return r}var jd="injectionTokens";function Pd(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(jd,r)||{};return Object.keys(t).forEach(function(i){e[+i]=t[i]}),e}function $l(r){return!!r.useClass}function sa(r){return!!r.useFactory}var Hl=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 Or(r){return typeof r=="string"||typeof r=="symbol"}function Rd(r){return typeof r=="object"&&"token"in r&&"multiple"in r}function Ll(r){return typeof r=="object"&&"token"in r&&"transform"in r}function Dd(r){return typeof r=="function"||r instanceof Hl}function to(r){return!!r.useToken}function ro(r){return r.useValue!=null}function Md(r){return $l(r)||ro(r)||to(r)||sa(r)}var aa=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}(),Ud=function(r){oa(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(aa),io=function(){function r(){this.scopedResolutions=new Map}return r}();function $d(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}function Hd(r,e,t){return t===void 0&&(t=" "),Qt([r],e.message.split(`
|
|
89
89
|
`).map(function(i){return t+i})).join(`
|
|
90
|
-
`)}function vd(r,e,t){var i=Tn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,a=md(s,e);return bd("Cannot inject the dependency "+a+' of "'+r.name+'" constructor. Reason:',t)}function wd(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var Sd=function(r){Rs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ms),Ad=function(r){Rs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ms),kd=function(){function r(){this.preResolution=new Sd,this.postResolution=new Ad}return r}(),wl=new Map,Cd=function(){function r(e){this.parent=e,this._registry=new gd,this.interceptors=new kd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:Pe.Transient}),this.ensureNotDisposed();var n;if(yd(t)?n=t:n={useClass:t},_n(n))for(var s=[e],a=n;a!=null;){var u=a.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&&_n(f.provider)?a=f.provider:a=null}if((i.lifecycle===Pe.Singleton||i.lifecycle==Pe.ContainerScoped||i.lifecycle==Pe.ResolutionScoped)&&(Vn(n)||Ds(n)))throw new Error('Cannot use lifecycle "'+Pe[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(),Nr(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(),Nr(e)){if(Nr(t))return this.register(e,{useToken:t},{lifecycle:Pe.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Pe.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!Nr(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:Pe.Singleton})},r.prototype.resolve=function(e,t,i){t===void 0&&(t=new jn),i===void 0&&(i=!1),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&Nr(e)){if(i)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),n){var s=this.resolveRegistration(n,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(hd(e)){var s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}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 a=On(this.interceptors.preResolution.getAll(e)),u=a.next();!u.done;u=a.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(d){i={error:d}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}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 a=[];try{for(var u=On(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var d=f.value;d.options.frequency!="Once"&&a.push(d),d.callback(e,t,i)}}catch(g){n={error:g}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,a)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Pe.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===Pe.Singleton,n=e.options.lifecycle===Pe.ContainerScoped,s=i||n,a;return Vn(e.provider)?a=e.provider.useValue:_n(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):ml(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Ds(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,t),e.options.lifecycle===Pe.ResolutionScoped&&t.scopedResolutions.set(e,a),a},r.prototype.resolveAll=function(e,t,i){var n=this;t===void 0&&(t=new jn),i===void 0&&(i=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&Nr(e)){if(i)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var a=s.map(function(f){return n.resolveRegistration(f,t)});return this.executePostResolutionInterceptor(e,a,"All"),a}var u=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,u,"All"),u},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=On(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Tn(n.value,2),a=s[0],u=s[1];this._registry.setAll(a,u.filter(function(f){return!Vn(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=On(this._registry.entries()),s=n.next();!s.done;s=n.next()){var a=Tn(s.value,2),u=a[0],f=a[1];f.some(function(d){var g=d.options;return g.lifecycle===Pe.ContainerScoped})&&i._registry.setAll(u,f.map(function(d){return d.options.lifecycle===Pe.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){e={error:d}}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 ld(this,void 0,void 0,function(){var e;return ud(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 bl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=wl.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var a=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Qt([void 0],a)))}();return wd(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var a,u,f;try{return pd(n)?vl(n)?n.multiple?(a=i.resolve(n.transform)).transform.apply(a,Qt([i.resolveAll(n.token,new jn,n.isOptional)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Qt([i.resolve(n.token,e,n.isOptional)],n.transformArgs)):n.multiple?i.resolveAll(n.token,new jn,n.isOptional):i.resolve(n.token,e,n.isOptional):vl(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Qt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(d){throw new Error(vd(t,s,d))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),Oe=new Cd;function Pn(r){return function(e){wl.set(e,dd(e))}}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 Us;class Rn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}c([l({type:p.ObjectIdentifier})],Rn.prototype,"attrId",void 0),c([l({type:p.Any,repeated:"set"})],Rn.prototype,"attrValues",void 0);let Sl=Us=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Us.prototype)}};Sl=Us=c([w({type:v.Sequence,itemType:Rn})],Sl);var $s;let Al=$s=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,$s.prototype)}};Al=$s=c([w({type:v.Sequence,itemType:Ar})],Al);class kl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],kl.prototype,"certId",void 0),c([l({type:p.Any,context:0})],kl.prototype,"certValue",void 0);class Cl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Cl.prototype,"crlId",void 0),c([l({type:p.Any,context:0})],Cl.prototype,"crltValue",void 0);class xl extends Q{}let Dn=class{constructor(e={}){this.encryptionAlgorithm=new E,this.encryptedData=new xl,Object.assign(this,e)}};c([l({type:E})],Dn.prototype,"encryptionAlgorithm",void 0),c([l({type:xl})],Dn.prototype,"encryptedData",void 0);var Hs,Ls;(function(r){r[r.v1=0]="v1"})(Ls||(Ls={}));class Bl extends Q{}let Fs=Hs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Hs.prototype)}};Fs=Hs=c([w({type:v.Sequence,itemType:bt})],Fs);class ai{constructor(e={}){this.version=Ls.v1,this.privateKeyAlgorithm=new E,this.privateKey=new Bl,Object.assign(this,e)}}c([l({type:p.Integer})],ai.prototype,"version",void 0),c([l({type:E})],ai.prototype,"privateKeyAlgorithm",void 0),c([l({type:Bl})],ai.prototype,"privateKey",void 0),c([l({type:Fs,implicit:!0,context:0,optional:!0})],ai.prototype,"attributes",void 0);let El=class extends ai{};El=c([w({type:v.Sequence})],El);let Nl=class extends Dn{};Nl=c([w({type:v.Sequence})],Nl);class Il{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Il.prototype,"secretTypeId",void 0),c([l({type:p.Any,context:0})],Il.prototype,"secretValue",void 0);class ci{constructor(e={}){this.mac=new Nn,this.macSalt=new Q,this.iterations=1,Object.assign(this,e)}}c([l({type:Nn})],ci.prototype,"mac",void 0),c([l({type:Q})],ci.prototype,"macSalt",void 0),c([l({type:p.Integer,defaultValue:1})],ci.prototype,"iterations",void 0);class Mn{constructor(e={}){this.version=3,this.authSafe=new Ar,this.macData=new ci,Object.assign(this,e)}}c([l({type:p.Integer})],Mn.prototype,"version",void 0),c([l({type:Ar})],Mn.prototype,"authSafe",void 0),c([l({type:ci,optional:!0})],Mn.prototype,"macData",void 0);var qs;class Un{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Un.prototype,"bagId",void 0),c([l({type:p.Any,context:0})],Un.prototype,"bagValue",void 0),c([l({type:Rn,repeated:"set",optional:!0})],Un.prototype,"bagAttributes",void 0);let Ol=qs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,qs.prototype)}};Ol=qs=c([w({type:v.Sequence,itemType:Un})],Ol);var Ks,Ws,Gs;const Tl="1.2.840.113549.1.9",_l=`${Tl}.7`,zs=`${Tl}.14`;let $n=class extends ve{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};c([l({type:p.IA5String})],$n.prototype,"ia5String",void 0),$n=c([w({type:v.Choice})],$n);let Vl=class extends Ar{};Vl=c([w({type:v.Sequence})],Vl);let jl=class extends Mn{};jl=c([w({type:v.Sequence})],jl);let Pl=class extends Dn{};Pl=c([w({type:v.Sequence})],Pl);let Js=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.IA5String})],Js.prototype,"value",void 0),Js=c([w({type:v.Choice})],Js);let Rl=class extends $n{};Rl=c([w({type:v.Choice})],Rl);let Dl=class extends ve{};Dl=c([w({type:v.Choice})],Dl);let Ys=class{constructor(e=new Date){this.value=e}};c([l({type:p.GeneralizedTime})],Ys.prototype,"value",void 0),Ys=c([w({type:v.Choice})],Ys);let Ml=class extends ve{};Ml=c([w({type:v.Choice})],Ml);let Zs=class{constructor(e="M"){this.value=e}toString(){return this.value}};c([l({type:p.PrintableString})],Zs.prototype,"value",void 0),Zs=c([w({type:v.Choice})],Zs);let Hn=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.PrintableString})],Hn.prototype,"value",void 0),Hn=c([w({type:v.Choice})],Hn);let Ul=class extends Hn{};Ul=c([w({type:v.Choice})],Ul);let $l=class extends ve{};$l=c([w({type:v.Choice})],$l);let Qs=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.ObjectIdentifier})],Qs.prototype,"value",void 0),Qs=c([w({type:v.Choice})],Qs);let Hl=class extends we{};Hl=c([w({type:v.Choice})],Hl);let Xs=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};c([l({type:p.Integer})],Xs.prototype,"value",void 0),Xs=c([w({type:v.Choice})],Xs);let Ll=class extends st{};Ll=c([w({type:v.Sequence})],Ll);let Ln=class extends ve{};Ln=c([w({type:v.Choice})],Ln);let Fl=Ks=class extends Kt{constructor(e){super(e),Object.setPrototypeOf(this,Ks.prototype)}};Fl=Ks=c([w({type:v.Sequence})],Fl);let ql=Ws=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ws.prototype)}};ql=Ws=c([w({type:v.Set,itemType:br})],ql);let ea=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.BmpString})],ea.prototype,"value",void 0),ea=c([w({type:v.Choice})],ea);let ta=class extends E{};ta=c([w({type:v.Sequence})],ta);let Kl=Gs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Gs.prototype)}};Kl=Gs=c([w({type:v.Sequence,itemType:ta})],Kl);var ra;let Fn=ra=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ra.prototype)}};Fn=ra=c([w({type:v.Sequence,itemType:bt})],Fn);class Ir{constructor(e={}){this.version=0,this.subject=new ye,this.subjectPKInfo=new nt,this.attributes=new Fn,Object.assign(this,e)}}c([l({type:p.Integer})],Ir.prototype,"version",void 0),c([l({type:ye})],Ir.prototype,"subject",void 0),c([l({type:nt})],Ir.prototype,"subjectPKInfo",void 0),c([l({type:Fn,implicit:!0,context:0})],Ir.prototype,"attributes",void 0);class li{constructor(e={}){this.certificationRequestInfo=new Ir,this.signatureAlgorithm=new E,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Ir})],li.prototype,"certificationRequestInfo",void 0),c([l({type:E})],li.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],li.prototype,"signature",void 0);/*!
|
|
90
|
+
`)}function Ld(r,e,t){var i=eo(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,c=$d(s,e);return Hd("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function Fd(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var qd=function(r){oa(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(aa),Kd=function(r){oa(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(aa),Wd=function(){function r(){this.preResolution=new qd,this.postResolution=new Kd}return r}(),Fl=new Map,Gd=function(){function r(e){this.parent=e,this._registry=new Ud,this.interceptors=new Wd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:De.Transient}),this.ensureNotDisposed();var n;if(Md(t)?n=t:n={useClass:t},to(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&&to(f.provider)?c=f.provider:c=null}if((i.lifecycle===De.Singleton||i.lifecycle==De.ContainerScoped||i.lifecycle==De.ResolutionScoped)&&(ro(n)||sa(n)))throw new Error('Cannot use lifecycle "'+De[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(),Or(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(),Or(e)){if(Or(t))return this.register(e,{useToken:t},{lifecycle:De.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:De.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!Or(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:De.Singleton})},r.prototype.resolve=function(e,t,i){t===void 0&&(t=new io),i===void 0&&(i=!1),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&Or(e)){if(i)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),n){var s=this.resolveRegistration(n,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(Dd(e)){var s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}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=Qn(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=Qn(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(m){n={error:m}}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===De.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===De.Singleton,n=e.options.lifecycle===De.ContainerScoped,s=i||n,c;return ro(e.provider)?c=e.provider.useValue:to(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):$l(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):sa(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===De.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t,i){var n=this;t===void 0&&(t=new io),i===void 0&&(i=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&Or(e)){if(i)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var c=s.map(function(f){return n.resolveRegistration(f,t)});return this.executePostResolutionInterceptor(e,c,"All"),c}var u=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,u,"All"),u},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=Qn(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=eo(n.value,2),c=s[0],u=s[1];this._registry.setAll(c,u.filter(function(f){return!ro(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=Qn(this._registry.entries()),s=n.next();!s.done;s=n.next()){var c=eo(s.value,2),u=c[0],f=c[1];f.some(function(p){var m=p.options;return m.lifecycle===De.ContainerScoped})&&i._registry.setAll(u,f.map(function(p){return p.options.lifecycle===De.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 Td(this,void 0,void 0,function(){var e;return Vd(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 Hl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=Fl.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 Fd(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 Rd(n)?Ll(n)?n.multiple?(c=i.resolve(n.transform)).transform.apply(c,Qt([i.resolveAll(n.token,new io,n.isOptional)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Qt([i.resolve(n.token,e,n.isOptional)],n.transformArgs)):n.multiple?i.resolveAll(n.token,new io,n.isOptional):i.resolve(n.token,e,n.isOptional):Ll(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(Ld(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 Gd;function no(r){return function(e){Fl.set(e,Pd(e))}}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 ca;class oo{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:d.ObjectIdentifier})],oo.prototype,"attrId",void 0),a([l({type:d.Any,repeated:"set"})],oo.prototype,"attrValues",void 0);let ql=ca=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ca.prototype)}};ql=ca=a([w({type:v.Sequence,itemType:oo})],ql);var la;let Kl=la=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,la.prototype)}};Kl=la=a([w({type:v.Sequence,itemType:Cr})],Kl);class Wl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Wl.prototype,"certId",void 0),a([l({type:d.Any,context:0})],Wl.prototype,"certValue",void 0);class Gl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Gl.prototype,"crlId",void 0),a([l({type:d.Any,context:0})],Gl.prototype,"crltValue",void 0);class zl extends Q{}let so=class{constructor(e={}){this.encryptionAlgorithm=new E,this.encryptedData=new zl,Object.assign(this,e)}};a([l({type:E})],so.prototype,"encryptionAlgorithm",void 0),a([l({type:zl})],so.prototype,"encryptedData",void 0);var ua,fa;(function(r){r[r.v1=0]="v1"})(fa||(fa={}));class Jl extends Q{}let da=ua=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ua.prototype)}};da=ua=a([w({type:v.Sequence,itemType:wt})],da);class di{constructor(e={}){this.version=fa.v1,this.privateKeyAlgorithm=new E,this.privateKey=new Jl,Object.assign(this,e)}}a([l({type:d.Integer})],di.prototype,"version",void 0),a([l({type:E})],di.prototype,"privateKeyAlgorithm",void 0),a([l({type:Jl})],di.prototype,"privateKey",void 0),a([l({type:da,implicit:!0,context:0,optional:!0})],di.prototype,"attributes",void 0);let Yl=class extends di{};Yl=a([w({type:v.Sequence})],Yl);let Zl=class extends so{};Zl=a([w({type:v.Sequence})],Zl);class Xl{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Xl.prototype,"secretTypeId",void 0),a([l({type:d.Any,context:0})],Xl.prototype,"secretValue",void 0);class pi{constructor(e={}){this.mac=new Zn,this.macSalt=new Q,this.iterations=1,Object.assign(this,e)}}a([l({type:Zn})],pi.prototype,"mac",void 0),a([l({type:Q})],pi.prototype,"macSalt",void 0),a([l({type:d.Integer,defaultValue:1})],pi.prototype,"iterations",void 0);class ao{constructor(e={}){this.version=3,this.authSafe=new Cr,this.macData=new pi,Object.assign(this,e)}}a([l({type:d.Integer})],ao.prototype,"version",void 0),a([l({type:Cr})],ao.prototype,"authSafe",void 0),a([l({type:pi,optional:!0})],ao.prototype,"macData",void 0);var pa;class co{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],co.prototype,"bagId",void 0),a([l({type:d.Any,context:0})],co.prototype,"bagValue",void 0),a([l({type:oo,repeated:"set",optional:!0})],co.prototype,"bagAttributes",void 0);let Ql=pa=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,pa.prototype)}};Ql=pa=a([w({type:v.Sequence,itemType:co})],Ql);var ha,ya,ga;const eu="1.2.840.113549.1.9",tu=`${eu}.7`,ma=`${eu}.14`;let lo=class extends Se{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:d.IA5String})],lo.prototype,"ia5String",void 0),lo=a([w({type:v.Choice})],lo);let ru=class extends Cr{};ru=a([w({type:v.Sequence})],ru);let iu=class extends ao{};iu=a([w({type:v.Sequence})],iu);let nu=class extends so{};nu=a([w({type:v.Sequence})],nu);let ba=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:d.IA5String})],ba.prototype,"value",void 0),ba=a([w({type:v.Choice})],ba);let ou=class extends lo{};ou=a([w({type:v.Choice})],ou);let su=class extends Se{};su=a([w({type:v.Choice})],su);let va=class{constructor(e=new Date){this.value=e}};a([l({type:d.GeneralizedTime})],va.prototype,"value",void 0),va=a([w({type:v.Choice})],va);let au=class extends Se{};au=a([w({type:v.Choice})],au);let wa=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:d.PrintableString})],wa.prototype,"value",void 0),wa=a([w({type:v.Choice})],wa);let uo=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:d.PrintableString})],uo.prototype,"value",void 0),uo=a([w({type:v.Choice})],uo);let cu=class extends uo{};cu=a([w({type:v.Choice})],cu);let lu=class extends Se{};lu=a([w({type:v.Choice})],lu);let Sa=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:d.ObjectIdentifier})],Sa.prototype,"value",void 0),Sa=a([w({type:v.Choice})],Sa);let uu=class extends Ae{};uu=a([w({type:v.Choice})],uu);let Aa=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:d.Integer})],Aa.prototype,"value",void 0),Aa=a([w({type:v.Choice})],Aa);let fu=class extends ct{};fu=a([w({type:v.Sequence})],fu);let fo=class extends Se{};fo=a([w({type:v.Choice})],fo);let du=ha=class extends Wt{constructor(e){super(e),Object.setPrototypeOf(this,ha.prototype)}};du=ha=a([w({type:v.Sequence})],du);let pu=ya=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ya.prototype)}};pu=ya=a([w({type:v.Set,itemType:wr})],pu);let ka=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:d.BmpString})],ka.prototype,"value",void 0),ka=a([w({type:v.Choice})],ka);let Ca=class extends E{};Ca=a([w({type:v.Sequence})],Ca);let hu=ga=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ga.prototype)}};hu=ga=a([w({type:v.Sequence,itemType:Ca})],hu);var xa;let po=xa=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,xa.prototype)}};po=xa=a([w({type:v.Sequence,itemType:wt})],po);class _r{constructor(e={}){this.version=0,this.subject=new ge,this.subjectPKInfo=new st,this.attributes=new po,Object.assign(this,e)}}a([l({type:d.Integer})],_r.prototype,"version",void 0),a([l({type:ge})],_r.prototype,"subject",void 0),a([l({type:st})],_r.prototype,"subjectPKInfo",void 0),a([l({type:po,implicit:!0,context:0,optional:!0})],_r.prototype,"attributes",void 0);class hi{constructor(e={}){this.certificationRequestInfo=new _r,this.signatureAlgorithm=new E,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:_r,raw:!0})],hi.prototype,"certificationRequestInfo",void 0),a([l({type:E})],hi.prototype,"signatureAlgorithm",void 0),a([l({type:d.BitString})],hi.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
|
|
114
|
-
`)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const i=[];let n=this.pad(t++),s="";const
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return x.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]||
|
|
116
|
-
`)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:C.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
|
|
117
|
-
`)}}Le.CertificateTag="CERTIFICATE",Le.CrlTag="CRL",Le.CertificateRequestTag="CERTIFICATE REQUEST",Le.PublicKeyTag="PUBLIC KEY",Le.PrivateKeyTag="PRIVATE KEY";class At extends Tt{static isAsnEncoded(e){return C.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Le.isPem(e))return Le.decode(e)[0];if(T.isHex(e))return T.FromHex(e);if(T.isBase64(e))return T.FromBase64(e);if(T.isBase64Url(e))return T.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=T.ToBinary(e);return Le.isPem(t)?Le.decode(t)[0]:T.isHex(t)?T.FromHex(t):T.isBase64(t)?T.FromBase64(t):T.isBase64Url(t)?T.FromBase64Url(t):C.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 ct extends At{static async create(e,t=Te.get()){if(e instanceof ct)return e;if(_t.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new ct(i)}else{if(e.publicKey)return e.publicKey;if(C.isBufferSource(e))return new ct(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){At.isAsnEncoded(e)?super(e,nt):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]||Te.get()):t=e[0]||Te.get();let s=this.rawData;const a=x.parse(this.rawData,nt);return a.algorithm.algorithm===si&&(s=Md(a,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=Oe.resolve(Or),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Jt:{const n=x.parse(e.subjectPublicKey,Vs),s=C.toUint8Array(n.modulus);i.publicExponent=C.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]||Te.get()):i=e[0]||Te.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=Te.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Te.get();const n=x.parse(this.rawData,nt);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=x.parse(this.rawData,nt);switch(e.Algorithm=Xt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case ii:e["EC Point"]=t.subjectPublicKey;break;case Jt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function Md(r,e){return r.algorithm=new E({algorithm:Jt,parameters:null}),e=x.serialize(r),e}class hi extends He{static async create(e,t=!1,i=Te.get()){if("name"in e&&"serialNumber"in e)return new hi(e,t);const s=await(await ct.create(e,i)).getKeyIdentifier(i);return new hi(T.ToHex(s),t)}constructor(...e){if(C.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Ft({keyIdentifier:new Io(T.FromHex(e[0]))});super(No,e[1],x.serialize(t))}else{const t=e[0],i=t.name instanceof er?x.parse(t.name.rawData,xe):t.name,n=new Ft({authorityCertIssuer:i,authorityCertSerialNumber:T.FromHex(t.serialNumber)});super(No,e[1],x.serialize(n))}}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,Ft);t.keyIdentifier&&(this.keyId=T.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?T.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,Ft);return t.authorityCertIssuer&&(e["Authority Issuer"]=new er(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}hi.NAME="Authority Key Identifier";class Ou extends He{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,Ui);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Ui({cA:e[0],pathLenConstraint:e[1]});super(Rc,e[2],x.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}}Ou.NAME="Basic Constraints";var Tu;(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"})(Tu||(Tu={}));class _u extends He{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,qi);this.usages=t.map(i=>i)}else{const t=new qi(e[0]);super(Lc,e[1],x.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Ot.toString(t)).join(", "),e}}_u.NAME="Extended Key Usages";var ua;(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"})(ua||(ua={}));class fa extends He{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,qo);this.usages=t.toNumber()}else{const t=new qo(e[0]);super(Kc,e[1],x.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,qo);return e[""]=t.toJSON().join(", "),e}}fa.NAME="Key Usages";class Wn extends He{static async create(e,t=!1,i=Te.get()){const s=await(await ct.create(e,i)).getKeyIdentifier(i);return new Wn(T.ToHex(s),t)}constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,Et);this.keyId=T.ToHex(t)}else{const t=typeof e[0]=="string"?T.FromHex(e[0]):e[0],i=new Et(t);super(Zc,e[1],x.serialize(i)),this.keyId=T.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,Et);return e[""]=t,e}}Wn.NAME="Subject Key Identifier";class da extends He{constructor(...e){C.isBufferSource(e[0])?super(e[0]):super(Jc,e[1],new er(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,Jo);this.names=new er(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}da.NAME="Subject Alternative Name";class Fe{static register(e,t){this.items.set(e,t)}static create(e){const t=new He(e),i=this.items.get(t.type);return i?new i(e):t}}Fe.items=new Map;class Vu extends He{constructor(...e){var t;if(C.isBufferSource(e[0])){super(e[0]);const i=x.parse(this.value,Li);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new Li(i.map(a=>new Hi({policyIdentifier:a})));super(Mc,n,x.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new ee("",{},Ot.toString(t))),e}}Vu.NAME="Certificate Policies",Fe.register(Mc,Vu);class ju extends He{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(a=>new dr({distributionPoint:new qt({fullName:[new q({uniformResourceIdentifier:a})]})})),s=new pr(n);super(Do,e[1],x.serialize(s))}else{const i=new pr(e[0]);super(Do,e[1],x.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,pr);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 jt(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}ju.NAME="CRL Distribution Points";class Pu extends He{constructor(...e){var t,i,n,s;if(C.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof fr){const a=new fr(e[0]);super(Eo,e[1],x.serialize(a))}else{const a=e[0],u=new fr;zn(u,a,_c,"ocsp"),zn(u,a,Vc,"caIssuers"),zn(u,a,jc,"timeStamping"),zn(u,a,Pc,"caRepository"),super(Eo,e[1],x.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=[],x.parse(e.extnValue,fr).forEach(i=>{switch(i.accessMethod){case _c:this.ocsp.push(new jt(i.accessLocation));break;case Vc:this.caIssuers.push(new jt(i.accessLocation));break;case jc:this.timeStamping.push(new jt(i.accessLocation));break;case Pc:this.caRepository.push(new jt(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&Gn(e,"OCSP",this.ocsp),this.caIssuers.length&&Gn(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&Gn(e,"Time Stamping",this.timeStamping),this.caRepository.length&&Gn(e,"CA Repository",this.caRepository),e}}Pu.NAME="Authority Info Access";function Gn(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new ee("");t.forEach((n,s)=>{const a=n.toTextObject(),u=`${a[ee.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(a)}),r[e]=i}}function zn(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(a=>{typeof a=="string"&&(a=new jt("url",a)),r.push(new qr({accessMethod:t,accessLocation:x.parse(a.rawData,q)}))})}class Ru extends He{constructor(...e){C.isBufferSource(e[0])?super(e[0]):super(Fc,e[1],new er(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,xe);this.names=new er(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}Ru.NAME="Issuer Alternative Name";class _r extends Tt{constructor(...e){let t;if(C.isBufferSource(e[0]))t=C.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>C.toArrayBuffer(s)):[];t=x.serialize(new bt({type:i,values:n}))}super(t,bt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new ee("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[ee.NAME]===_r.NAME&&(e[ee.NAME]=Ot.toString(this.type)),e}}_r.NAME="Attribute";class Du extends _r{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else{const i=new Ln({printableString:e[0]});super(_l,[x.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=x.parse(this.values[0],Ln);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[ee.VALUE]=this.password,e}}Du.NAME="Challenge Password";class pa extends _r{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new Kt;for(const s of i)n.push(x.parse(s.rawData,Ze));super(zs,[x.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=x.parse(this.values[0],Kt);this.items=t.map(i=>Fe.create(x.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[ee.NAME]]=i;return e}}pa.NAME="Extensions";class Jn{static register(e,t){this.items.set(e,t)}static create(e){const t=new _r(e),i=this.items.get(t.type);return i?new i(e):t}}Jn.items=new Map;const Yn="crypto.signatureFormatter";class Ud{toAsnSignature(e,t){return C.toArrayBuffer(t)}toWebSignature(e,t){return C.toArrayBuffer(t)}}var Zn;let ha=Zn=class{static createPssParams(e,t){const i=Zn.getHashAlgorithm(e);return i?new Zt({hashAlgorithm:i,maskGenAlgorithm:new E({algorithm:Bn,parameters:x.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=Oe.resolve(Or);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 E({algorithm:vn,parameters:null});case"sha-256":return new E({algorithm:Os,parameters:null});case"sha-384":return new E({algorithm:wn,parameters:null});case"sha-512":return new E({algorithm:Sn,parameters:null})}}else return new E({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=Zn.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new E({algorithm:si,parameters:x.serialize(t)})}else return new E({algorithm:si,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Jt:return{name:"RSASSA-PKCS1-v1_5"};case vn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Os:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case wn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Sn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case si:if(e.parameters){const t=x.parse(e.parameters,Zt);return{name:"RSA-PSS",hash:Oe.resolve(Or).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};ha=Zn=c([Pn()],ha),Oe.registerSingleton(ui,ha);let ya=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new E({algorithm:An});case"sha-256":return new E({algorithm:kn});case"sha-384":return new E({algorithm:Cn});case"sha-512":return new E({algorithm:xn})}return null}toWebAlgorithm(e){switch(e.algorithm){case An:return{name:"SHA-1"};case kn:return{name:"SHA-256"};case Cn:return{name:"SHA-384"};case xn:return{name:"SHA-512"}}return null}};ya=c([Pn()],ya),Oe.registerSingleton(ui,ya);class We{addPadding(e,t){const i=C.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}removePadding(e,t=!1){let i=C.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=We.namedCurveSize.get(i)||We.defaultNamedCurveSize,s=new bn,a=C.toUint8Array(t);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),x.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=x.parse(t,bn),n=e.namedCurve,s=We.namedCurveSize.get(n)||We.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return Qu(a,u)}return null}}We.namedCurveSize=new Map,We.defaultNamedCurveSize=32;const ga="1.3.101.110",Mu="1.3.101.111",ma="1.3.101.112",Uu="1.3.101.113";let ba=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=ma;break;case"x25519":t=ga;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=ma;break;case"ed448":t=Uu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=ga;break;case"x448":t=Mu;break}}return t?new E({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case ma:return{name:"Ed25519"};case Uu:return{name:"EdDSA",namedCurve:"Ed448"};case ga:return{name:"X25519"};case Mu:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};ba=c([Pn()],ba),Oe.registerSingleton(ui,ba);class $d extends At{constructor(e){At.isAsnEncoded(e)?super(e,li):super(e),this.tag=Le.CertificateRequestTag}onInit(e){this.tbs=x.serialize(e.certificationRequestInfo),this.publicKey=new ct(e.certificationRequestInfo.subjectPKInfo);const t=Oe.resolve(Or);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>Jn.create(x.serialize(n)));const i=this.getAttribute(zs);this.extensions=[],i instanceof pa&&(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=Te.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=Oe.resolveAll(Yn).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=x.parse(this.rawData,li),i=t.certificationRequestInfo,n=new ee("",{Version:`${hr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ee("");for(const a of this.attributes){const u=a.toTextObject();s[u[ee.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new ee("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}$d.NAME="PKCS#10 Certificate Request";class $u extends At{constructor(e){At.isAsnEncoded(e)?super(e,yr):super(e),this.tag=Le.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=x.serialize(t);let i=new Uint8Array(t.serialNumber);i.length>1&&i[0]===0&&i[1]>127&&(i=i.slice(1)),this.serialNumber=T.ToHex(i),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 n=Oe.resolve(Or);this.signatureAlgorithm=n.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const s=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!s)throw new Error("Cannot get 'notBefore' value");this.notBefore=s;const a=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!a)throw new Error("Cannot get 'notAfter' value");this.notAfter=a,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(u=>Fe.create(x.serialize(u)))),this.publicKey=new ct(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=Te.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 ct)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(C.isBufferSource(s)){const d=new ct(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=Oe.resolveAll(Yn).reverse();let u=null;for(const d of a)if(u=d.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 g=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<g&&g<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=Te.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Te.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=x.parse(this.rawData,yr),i=t.tbsCertificate,n=new ee("",{Version:`${hr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Xt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ee("",{"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 ee("");for(const a of this.extensions){const u=a.toTextObject();s[u[ee.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new ee("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}$u.NAME="Certificate";var Hu;(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"})(Hu||(Hu={})),Fe.register(Rc,Ou),Fe.register(Lc,_u),Fe.register(Kc,fa),Fe.register(Zc,Wn),Fe.register(No,hi),Fe.register(Jc,da),Fe.register(Do,ju),Fe.register(Eo,Pu),Fe.register(Fc,Ru),Jn.register(_l,Du),Jn.register(zs,pa),Oe.registerSingleton(Yn,Ud),Oe.registerSingleton(Yn,We),We.namedCurveSize.set("P-256",32),We.namedCurveSize.set("K-256",32),We.namedCurveSize.set("P-384",48),We.namedCurveSize.set("P-521",66);function Lu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new $u(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof da){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,d)=>{const g=d.type,h=f[g]??[];return{...f,[g]:[...h,d.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof fa){const s=Object.values(ua),a=Array(s.length/2).fill(null).reduce((u,f,d)=>{const g=s[s.length/2+d];if(n.usages&g){const h=s[d];u.push(h)}return u},[]);i.keyUsage=a}return i}}}function Hd(){const r=Lu(),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 Ld={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."},empty_state_v2:{create:"New certificate",title:"Configure your first certificate",group:"Certificates created in gateways within this group will automatically appear here.",description:"Certificates manage SSL/TLS encryption, ensuring secure communication between clients and your API services.",learn_more:"Learn more"}},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."},empty_state_v2:{create:"New CA certificate",title:"Configure your first CA certificate",group:"CA Certificates created in gateways within this group will automatically appear here.",description:"CA Certificates validate the authenticity of client and server certificates, reinforcing the trust and security of your API communications.",learn_more:"Learn more"}},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 Fd(){const r=xa.createI18n("en-us",Ld);return{i18n:r,i18nT:xa.i18nTComponent(r)}}const Xe={useCertificate:Hd,useI18n:Fd,useX509:Lu},va="/v2/control-planes/{controlPlaneId}/core-entities",wa="/{workspace}",Qn={list:{konnect:`${va}/certificates`,kongManager:`${wa}/certificates`},form:{konnect:{create:`${va}/certificates`,edit:`${va}/certificates/{id}`},kongManager:{create:`${wa}/certificates`,edit:`${wa}/certificates/{id}`}}},qd={class:"kong-ui-entities-certificates-list"},Kd={class:"button-row"},Wd={key:0},Gd={key:1},zd={key:0},Jd={key:1},Yd={key:0},Zd={key:1},Qd={key:1},Xd=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},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var W;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=Xe.useI18n(),u=gi.useRouter(),{axiosInstance:f}=A.useAxios((W=i.config)==null?void 0:W.axiosRequestConfig),{handleStateChange:d,hasRecords:g}=A.useTableState(()=>ie.value),h=o.computed(()=>g.value&&i.config.app==="konnect"),L=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),re={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}},X=o.computed(()=>{var H,G;let O=`${i.config.apiBaseUrl}${Qn.list[i.config.app]}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((H=i.config)==null?void 0:H.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(G=i.config)!=null&&G.workspace?`/${i.config.workspace}`:"")),O}),ie=o.ref(""),Me=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:Se,fetcherState:P,fetcherCacheKey:M}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),X),oe=()=>{ie.value=""},R=()=>{M.value++},j=o.ref(null),S=async(O,H)=>{const G=O.id;if(!await H(G)){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:G})})},F=async(O,H)=>{const G=JSON.stringify(O);if(!await H(G)){t("copy:error",{entity:O,message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,message:n("certificates.copy.success_brief")})},Z=async O=>{var G;await((G=i.canRetrieve)==null?void 0:G.call(i,O))&&u.push(i.config.getViewRoute(O.id))},lt=O=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(O)}),ut=O=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(O)}),se=O=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(O)}},ce=o.ref(void 0),z=o.ref(!1),ft=o.ref(!1),rr=o.ref(""),Vr=A.useDeleteUrlBuilder(i.config,X.value),{certificateDataCache:Pt,getCertificateData:kt}=Xe.useCertificate(),jr=O=>{ce.value=O,z.value=!0},U=()=>{z.value=!1},dt=async()=>{var O,H,G;if((O=ce.value)!=null&&O.id){ft.value=!0;try{await f.delete(Vr(ce.value.id)),ft.value=!1,z.value=!1,M.value++,t("delete:success",ce.value)}catch(Ae){rr.value=((G=(H=Ae.response)==null?void 0:H.data)==null?void 0:G.message)||Ae.message||n("certificates.errors.delete"),t("error",Ae)}finally{ft.value=!1}}},ir=()=>{u.push(i.config.createRoute)};o.watch(P,O=>{var H,G,Ae;if(O.status===A.FetcherStatus.Error){j.value={title:n("certificates.errors.general")},(Ae=(G=(H=O.error)==null?void 0:H.response)==null?void 0:G.data)!=null&&Ae.message&&(j.value.message=O.error.response.data.message),t("error",O.error);return}Pt.value={},j.value=null});const ae=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")}),Rt=o.ref(!1);return o.onBeforeMount(async()=>{Rt.value=await i.canCreate(),Rt.value&&(ae.value.title=n("certificates.list.empty_state.title"),ae.value.ctaText=n("certificates.actions.create"))}),(O,H)=>{const G=o.resolveComponent("KButton"),Ae=o.resolveComponent("KEmptyState"),Ct=o.resolveComponent("KCopy"),K=o.resolveComponent("KDropdownItem"),Ee=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",qd,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":L.value,"empty-state-options":ae.value,"enable-entity-actions":"","error-message":j.value,fetcher:o.unref(Se),"fetcher-cache-key":o.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:ie.value,"table-headers":o.unref(re),onClearSearchInput:oe,"onClick:row":H[3]||(H[3]=D=>Z(D)),onSort:R,onState:o.unref(d)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:ie.value,"onUpdate:modelValue":H[0]||(H[0]=D=>ie.value=D),config:Me.value},null,8,["modelValue","config"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":r.canCreate},{default:o.withCtx(()=>[r.useToolbarCreationButton?(o.openBlock(),o.createBlock(G,{key:0,appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])):o.createCommentVNode("",!0)]),_:1},8,["auth-function"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",Kd,[h.value?(o.openBlock(),o.createBlock(G,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"certificates-learn-more-button",icon:"",onClick:H[1]||(H[1]=D=>O.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(G,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"]))])],8,["disabled"]))]),subject:o.withCtx(({row:D})=>{var ke;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Wd,o.toDisplayString((ke=D==null?void 0:D.metadata)!=null&&ke.subject?D.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",Gd,o.toDisplayString(o.unref(kt)(D).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:D})=>{var ke;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",zd,o.toDisplayString((ke=D==null?void 0:D.metadata)!=null&&ke.expiry?o.unref(s)(D.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Jd,o.toDisplayString(o.unref(kt)(D).schemaExpiry?o.unref(s)(o.unref(kt)(D).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:D})=>{var ke;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Yd,o.toDisplayString((ke=D==null?void 0:D.metadata)!=null&&ke.dns_names?`dns=${D.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",Zd,o.toDisplayString(o.unref(kt)(D).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:D})=>[D!=null&&D.cert?(o.openBlock(),o.createBlock(Ct,{key:0,"data-testid":"copy-certificate-cert",text:D.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Qd,"-"))]),tags:o.withCtx(({row:D})=>[o.createVNode(o.unref(A.TableTags),{tags:D==null?void 0:D.tags},null,8,["tags"])]),actions:o.withCtx(({row:D})=>[o.createVNode(Ee,null,{default:o.withCtx(({copyToClipboard:ke})=>[o.createVNode(K,{"data-testid":"action-entity-copy-id",onClick:eo=>S(D,ke)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(Ee,null,{default:o.withCtx(({copyToClipboard:ke})=>[o.createVNode(K,{"data-testid":"action-entity-copy-json",onClick:eo=>F(D,ke)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(D)},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-view","has-divider":"",item:lt(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canEdit(D)},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-edit",item:ut(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-add-sni",item:se(D.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canDelete(D)},{default:o.withCtx(()=>[o.createVNode(K,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ke=>jr(D)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!ie.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var D;return[o.createVNode(Ae,{"data-testid":"certificates-entity-empty-state","icon-background":"",message:o.unref(n)("certificates.list.empty_state_v2.description"),title:o.unref(n)("certificates.list.empty_state_v2.title")},o.createSlots({icon:o.withCtx(()=>[o.createVNode(o.unref(_e.ServiceDocumentIcon),{decoration:""})]),action:o.withCtx(()=>[Rt.value?(o.openBlock(),o.createBlock(G,{key:0,"data-testid":"entity-create-button",onClick:ir},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(G,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:H[2]||(H[2]=ke=>O.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.BookIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(D=r.config)!=null&&D.isControlPlaneGroup?{name:"default",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","title"])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),o.createVNode(o.unref(A.EntityDeleteModal),{"action-pending":ft.value,"entity-type":o.unref(A.EntityTypes).Certificate,error:rr.value,title:o.unref(n)("certificates.delete.title"),visible:z.value,onCancel:U,onProceed:dt},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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"])])}}}),tr=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},ep=tr(Xd,[["__scopeId","data-v-198dc311"]]),tp="#d60027",rp={class:"sni-field-container"},ip={key:1,class:"sni-field-controls-container"},np={key:0},op=tr(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}}=Xe.useI18n(),a=o.ref([]);return o.watch(t.modelValue,u=>{a.value=[...u]},{immediate:!0,deep:!0}),o.watch(a,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const d=o.resolveComponent("KLabel"),g=o.resolveComponent("KInput"),h=o.resolveComponent("KButton"),L=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",rp,[o.createVNode(d,{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(a.value,(ne,re)=>(o.openBlock(),o.createElementBlock("div",{key:re,class:"sni-field-input"},[!r.isEditing||a.value[re]?(o.openBlock(),o.createBlock(g,{key:0,modelValue:a.value[re],"onUpdate:modelValue":X=>a.value[re]=X,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${re+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",ip,[o.createVNode(h,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:X=>u.$emit("remove",re)},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.TrashIcon),{color:o.unref(tp)},null,8,["color"])]),_:1},8,["onClick"]),o.createVNode(h,{appearance:"tertiary","data-testid":"add-sni",disabled:re!==a.value.length-1,icon:"",onClick:f[0]||(f[0]=X=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon))]),_:1},8,["disabled"])]))]))),128)),a.value.length===0?(o.openBlock(),o.createElementBlock("div",np,[o.createVNode(h,{onClick:f[1]||(f[1]=ne=>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(L,{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-a5577ce8"]]),sp={class:"kong-ui-entities-certificates-form"},ap=tr(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 oe;const t=e,i=r,n=gi.useRouter(),{i18nT:s,i18n:{t:a}}=Xe.useI18n(),{getMessageFromError:u}=A.useErrors(),{axiosInstance:f}=A.useAxios((oe=i.config)==null?void 0:oe.axiosRequestConfig),d=o.computed(()=>Qn.form[i.config.app].edit),g=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),h=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),L=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),ne=o.computed(()=>(g.value===A.EntityBaseFormType.Create||JSON.stringify(h.fields)!==JSON.stringify(L))&&!!h.fields.cert&&!!h.fields.key),re=R=>{var j,S;h.fields.cert=(R==null?void 0:R.cert)||"",h.fields.key=(R==null?void 0:R.key)||"",h.fields.certAlt=(R==null?void 0:R.cert_alt)||"",h.fields.keyAlt=(R==null?void 0:R.key_alt)||"",h.fields.snis=(j=R==null?void 0:R.snis)!=null&&j.length?R.snis:[""],h.fields.tags=((S=R==null?void 0:R.tags)==null?void 0:S.join(", "))||"",Object.assign(L,h.fields)},X=()=>{n.push(i.config.cancelRoute)},ie=()=>{h.fields.snis.push("")},Me=R=>{h.fields.snis.splice(R,1)},Se=o.computed(()=>{var j,S;let R=`${i.config.apiBaseUrl}${Qn.form[i.config.app][g.value]}`;return i.config.app==="konnect"?R=R.replace(/{controlPlaneId}/gi,((j=i.config)==null?void 0:j.controlPlaneId)||""):i.config.app==="kongManager"&&(R=R.replace(/\/{workspace}/gi,(S=i.config)!=null&&S.workspace?`/${i.config.workspace}`:"")),R=R.replace(/{id}/gi,i.certificateId),R}),P=o.computed(()=>{var R,j;return{cert:h.fields.cert,key:h.fields.key,cert_alt:h.fields.certAlt||null,key_alt:h.fields.keyAlt||null,...i.showSnisField?{snis:h.fields.snis.filter(Boolean)}:{},tags:(j=(R=h.fields.tags.split(","))==null?void 0:R.map(S=>String(S||"").trim()))==null?void 0:j.filter(S=>S!=="")}}),M=async()=>{var R,j,S,F,Z,lt,ut,se,ce;try{h.isReadonly=!0;let z;g.value==="create"?z=await f.post(Se.value,P.value):g.value==="edit"&&(z=((R=i.config)==null?void 0:R.app)==="konnect"?await f.put(Se.value,P.value):await f.patch(Se.value,P.value)),h.fields.cert=((j=z==null?void 0:z.data)==null?void 0:j.cert)||"",h.fields.key=((S=z==null?void 0:z.data)==null?void 0:S.key)||"",h.fields.certAlt=((F=z==null?void 0:z.data)==null?void 0:F.cert_alt)||"",h.fields.keyAlt=((Z=z==null?void 0:z.data)==null?void 0:Z.key_alt)||"",h.fields.snis=(ut=(lt=z==null?void 0:z.data)==null?void 0:lt.snis)!=null&&ut.length?z.data.snis:[""],h.fields.tags=((ce=(se=z==null?void 0:z.data)==null?void 0:se.tags)==null?void 0:ce.join(", "))||"",Object.assign(L,h.fields),t("update",z==null?void 0:z.data)}catch(z){h.errorMessage=u(z),t("error",z)}finally{h.isReadonly=!1}};return(R,j)=>{const S=o.resolveComponent("KTextArea"),F=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",sp,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":ne.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).Certificate,"error-message":h.errorMessage,"fetch-url":d.value,"form-fields":P.value,"is-readonly":h.isReadonly,onCancel:X,"onFetch:error":j[7]||(j[7]=Z=>R.$emit("error",Z)),"onFetch:success":re,onLoading:j[8]||(j[8]=Z=>R.$emit("loading",Z)),onSubmit:M},{default:o.withCtx(()=>[o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(a)("certificates.form.sections.ssl.description"),title:o.unref(a)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(S,{modelValue:h.fields.cert,"onUpdate:modelValue":j[0]||(j[0]=Z=>h.fields.cert=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(a)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:h.fields.key,"onUpdate:modelValue":j[1]||(j[1]=Z=>h.fields.key=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(a)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:h.fields.certAlt,"onUpdate:modelValue":j[2]||(j[2]=Z=>h.fields.certAlt=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(a)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:h.fields.keyAlt,"onUpdate:modelValue":j[3]||(j[3]=Z=>h.fields.keyAlt=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(a)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(op,{key:0,modelValue:h.fields.snis,"onUpdate:modelValue":j[4]||(j[4]=Z=>h.fields.snis=Z),"is-editing":g.value===o.unref(A.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:ie,onRemove:j[5]||(j[5]=Z=>Me(Z))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(a)("certificates.form.sections.general.description"),title:o.unref(a)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(F,{modelValue:h.fields.tags,"onUpdate:modelValue":j[6]||(j[6]=Z=>h.fields.tags=Z),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(a)("certificates.form.fields.tags.help"),label:o.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(a)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(a)("certificates.form.fields.tags.placeholder"),readonly:h.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-8efa723a"]]),Sa="/v2/control-planes/{controlPlaneId}/core-entities",Aa="/{workspace}",Xn={list:{konnect:`${Sa}/ca_certificates`,kongManager:`${Aa}/ca_certificates`},form:{konnect:{create:`${Sa}/ca_certificates`,edit:`${Sa}/ca_certificates/{id}`},kongManager:{create:`${Aa}/ca_certificates`,edit:`${Aa}/ca_certificates/{id}`}}},cp={class:"kong-ui-ca-certificate-entity-config-card"},lp={key:0},up=tr(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:a}}=Xe.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:d}=Xe.useCertificate(),g=o.computed(()=>Xn.form[n.config.app].edit),h=o.ref(),L=o.computed(()=>{if(h.value)return d(h.value)}),ne=o.computed(()=>{var P;return((P=L.value)==null?void 0:P.schemaIssuer)||""}),re=o.computed(()=>{var P,M;return(P=L.value)!=null&&P.schemaExpiry?a((M=L.value)==null?void 0:M.schemaExpiry):""}),X=o.computed(()=>{var P;return((P=L.value)==null?void 0:P.schemaKeyUsages)||[]}),ie=(P,M)=>{const oe=f("rowValue",M);if(P==="expiry")return re.value;if(P==="key_usages")return X.value;if(oe)return oe[P]},Me=P=>{h.value=P,i("fetch:success",P)},Se=o.ref({id:{},updated_at:{},created_at:{},cert:{section:A.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:A.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:A.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:A.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:A.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(P,M)=>{const oe=o.resolveComponent("KCodeBlock"),R=o.resolveComponent("KLabel"),j=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",cp,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":Se.value,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"fetch-url":g.value,"hide-title":r.hideTitle,"onFetch:error":M[0]||(M[0]=S=>P.$emit("fetch:error",S)),"onFetch:success":Me,onLoading:M[1]||(M[1]=S=>P.$emit("loading",S))},{cert:o.withCtx(S=>[o.unref(f)("rowValue",S)?(o.openBlock(),o.createBlock(oe,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",S),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(R,{class:"metadata-label"},{default:o.withCtx(()=>[...M[2]||(M[2]=[o.createTextVNode(" Metadata ",-1)])]),_:1})]),metadata:o.withCtx(S=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",S)).filter(F=>!t.includes(F)),F=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:F,"data-testid":`ca-cert-metadata-${F}`,item:{key:F,label:o.unref(u)(F),value:ie(F,S),type:F==="key_usages"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(re.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ne.value||"–"),1)]),key_usages:o.withCtx(()=>[X.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",lp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(X.value,(S,F)=>(o.openBlock(),o.createBlock(j,{key:`key_usages-badge-tag-${F}`,class:"config-badge","data-testid":`key_usages-badge-tag-${F}`,tooltip:S,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-83648433"]]),fp={class:"kong-ui-entities-ca-certificates-list"},dp={class:"button-row"},pp={key:0},hp={key:1},yp={key:0},gp={key:1},mp=tr(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},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var Rt;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=Xe.useI18n(),u=gi.useRouter(),{axiosInstance:f}=A.useAxios((Rt=i.config)==null?void 0:Rt.axiosRequestConfig),{hasRecords:d,handleStateChange:g}=A.useTableState(()=>ie.value),h=o.computed(()=>d.value&&i.config.app==="konnect"),L=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),re={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}},X=o.computed(()=>{var O,H;let W=`${i.config.apiBaseUrl}${Xn.list[i.config.app]}`;return i.config.app==="konnect"?W=W.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(W=W.replace(/\/{workspace}/gi,(H=i.config)!=null&&H.workspace?`/${i.config.workspace}`:"")),W}),ie=o.ref(""),Me=o.computed(()=>{const W=i.config.app==="konnect"||i.config.isExactMatch;return W?{isExactMatch:W,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:W,schema:i.config.filterSchema}}),{fetcher:Se,fetcherState:P,fetcherCacheKey:M}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),X),oe=()=>{ie.value=""},R=()=>{M.value++},j=o.ref(null),S=async(W,O)=>{const H=W.id;if(!await O(H)){t("copy:error",{entity:W,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:W,field:"id",message:n("ca-certificates.copy.success",{val:H})})},F=async(W,O)=>{const H=JSON.stringify(W);if(!await O(H)){t("copy:error",{entity:W,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:W,message:n("ca-certificates.copy.success_brief")})},Z=async W=>{var H;await((H=i.canRetrieve)==null?void 0:H.call(i,W))&&u.push(i.config.getViewRoute(W.id))},lt=W=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(W)}),ut=W=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(W)}),se=o.ref(void 0),ce=o.ref(!1),z=o.ref(!1),ft=o.ref(""),rr=A.useDeleteUrlBuilder(i.config,X.value),{certificateDataCache:Vr,getCertificateData:Pt}=Xe.useCertificate(),kt=W=>{se.value=W,ce.value=!0},jr=()=>{ce.value=!1},U=async()=>{var W,O,H;if((W=se.value)!=null&&W.id){z.value=!0;try{await f.delete(rr(se.value.id)),z.value=!1,ce.value=!1,M.value++,t("delete:success",se.value)}catch(G){ft.value=((H=(O=G.response)==null?void 0:O.data)==null?void 0:H.message)||G.message||n("ca-certificates.errors.delete"),t("error",G)}finally{z.value=!1}}},dt=()=>{u.push(i.config.createRoute)};o.watch(P,W=>{var O,H,G;if(W.status===A.FetcherStatus.Error){j.value={title:n("ca-certificates.errors.general")},(G=(H=(O=W.error)==null?void 0:O.response)==null?void 0:H.data)!=null&&G.message&&(j.value.message=W.error.response.data.message),t("error",W.error);return}Vr.value={},j.value=null});const ir=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")}),ae=o.ref(!1);return o.onBeforeMount(async()=>{ae.value=await i.canCreate(),ae.value&&(ir.value.title=n("ca-certificates.list.empty_state.title"),ir.value.ctaText=n("ca-certificates.actions.create"))}),(W,O)=>{const H=o.resolveComponent("KButton"),G=o.resolveComponent("KEmptyState"),Ae=o.resolveComponent("KDropdownItem"),Ct=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",fp,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":L.value,"empty-state-options":ir.value,"enable-entity-actions":"","error-message":j.value,fetcher:o.unref(Se),"fetcher-cache-key":o.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:ie.value,"table-headers":o.unref(re),onClearSearchInput:oe,"onClick:row":O[3]||(O[3]=K=>Z(K)),onSort:R,onState:o.unref(g)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:ie.value,"onUpdate:modelValue":O[0]||(O[0]=K=>ie.value=K),config:Me.value},null,8,["modelValue","config"]),r.useToolbarCreationButton?(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:0,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(H,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])):o.createCommentVNode("",!0)]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",dp,[h.value?(o.openBlock(),o.createBlock(H,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"ca-certificates-learn-more-button",icon:"",onClick:O[1]||(O[1]=K=>W.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(H,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"]))])],8,["disabled"]))]),issuer:o.withCtx(({row:K})=>{var Ee;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",pp,o.toDisplayString((Ee=K==null?void 0:K.metadata)!=null&&Ee.issuer?K.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",hp,o.toDisplayString(o.unref(Pt)(K).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:K})=>{var Ee;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",yp,o.toDisplayString((Ee=K==null?void 0:K.metadata)!=null&&Ee.expiry?o.unref(s)(K.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",gp,o.toDisplayString(o.unref(Pt)(K).schemaExpiry?o.unref(s)(o.unref(Pt)(K).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:K})=>[o.createVNode(o.unref(A.TableTags),{tags:K==null?void 0:K.tags},null,8,["tags"])]),actions:o.withCtx(({row:K})=>[o.createVNode(Ct,null,{default:o.withCtx(({copyToClipboard:Ee})=>[o.createVNode(Ae,{"data-testid":"action-entity-copy-id",onClick:D=>S(K,Ee)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(Ct,null,{default:o.withCtx(({copyToClipboard:Ee})=>[o.createVNode(Ae,{"data-testid":"action-entity-copy-json",onClick:D=>F(K,Ee)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(K)},{default:o.withCtx(()=>[o.createVNode(Ae,{"data-testid":"action-entity-view","has-divider":"",item:lt(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canEdit(K)},{default:o.withCtx(()=>[o.createVNode(Ae,{"data-testid":"action-entity-edit",item:ut(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canDelete(K)},{default:o.withCtx(()=>[o.createVNode(Ae,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ee=>kt(K)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!ie.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var K;return[o.createVNode(G,{"data-testid":"ca-certificates-entity-empty-state","icon-background":"",message:o.unref(n)("ca-certificates.list.empty_state_v2.description"),title:o.unref(n)("ca-certificates.list.empty_state_v2.title")},o.createSlots({icon:o.withCtx(()=>[o.createVNode(o.unref(_e.ServiceDocumentIcon),{decorative:""})]),action:o.withCtx(()=>[ae.value?(o.openBlock(),o.createBlock(H,{key:0,"data-testid":"entity-create-button",onClick:dt},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(H,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:O[2]||(O[2]=Ee=>W.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.BookIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(K=r.config)!=null&&K.isControlPlaneGroup?{name:"default",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","title"])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),o.createVNode(o.unref(A.EntityDeleteModal),{"action-pending":z.value,"entity-type":o.unref(A.EntityTypes).CACertificate,error:ft.value,title:o.unref(n)("ca-certificates.delete.title"),visible:ce.value,onCancel:jr,onProceed:U},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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-c4525d48"]]),bp={class:"kong-ui-entities-ca-certificates-form"},vp=tr(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 Se;const t=e,i=r,n=gi.useRouter(),{i18n:{t:s}}=Xe.useI18n(),{getMessageFromError:a}=A.useErrors(),{axiosInstance:u}=A.useAxios((Se=i.config)==null?void 0:Se.axiosRequestConfig),f=o.computed(()=>Xn.form[i.config.app].edit),d=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),g=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),h=o.reactive({cert:"",certDigest:"",tags:""}),L=o.computed(()=>(d.value===A.EntityBaseFormType.Create||JSON.stringify(g.fields)!==JSON.stringify(h))&&!!g.fields.cert),ne=P=>{var M;g.fields.cert=(P==null?void 0:P.cert)||"",g.fields.certDigest=(P==null?void 0:P.cert_digest)||"",g.fields.tags=((M=P==null?void 0:P.tags)==null?void 0:M.join(", "))||"",Object.assign(h,g.fields)},re=()=>{n.push(i.config.cancelRoute)},X=o.computed(()=>{var M,oe;let P=`${i.config.apiBaseUrl}${Xn.form[i.config.app][d.value]}`;return i.config.app==="konnect"?P=P.replace(/{controlPlaneId}/gi,((M=i.config)==null?void 0:M.controlPlaneId)||""):i.config.app==="kongManager"&&(P=P.replace(/\/{workspace}/gi,(oe=i.config)!=null&&oe.workspace?`/${i.config.workspace}`:"")),P=P.replace(/{id}/gi,i.certificateId),P}),ie=o.computed(()=>{var P,M;return{cert:g.fields.cert,cert_digest:g.fields.certDigest||null,tags:(M=(P=g.fields.tags.split(","))==null?void 0:P.map(oe=>String(oe||"").trim()))==null?void 0:M.filter(oe=>oe!=="")}}),Me=async()=>{var P,M,oe,R,j;try{g.isReadonly=!0;let S;d.value==="create"?S=await u.post(X.value,ie.value):d.value==="edit"&&(S=((P=i.config)==null?void 0:P.app)==="konnect"?await u.put(X.value,ie.value):await u.patch(X.value,ie.value)),g.fields.cert=((M=S==null?void 0:S.data)==null?void 0:M.cert)||"",g.fields.certDigest=((oe=S==null?void 0:S.data)==null?void 0:oe.cert_digest)||"",g.fields.tags=((j=(R=S==null?void 0:S.data)==null?void 0:R.tags)==null?void 0:j.join(", "))||"",Object.assign(h,g.fields),t("update",S==null?void 0:S.data)}catch(S){g.errorMessage=a(S),t("error",S)}finally{g.isReadonly=!1}};return(P,M)=>{const oe=o.resolveComponent("KTextArea"),R=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",bp,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":L.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"error-message":g.errorMessage,"fetch-url":f.value,"form-fields":ie.value,"is-readonly":g.isReadonly,onCancel:re,"onFetch:error":M[3]||(M[3]=j=>P.$emit("error",j)),"onFetch:success":ne,onLoading:M[4]||(M[4]=j=>P.$emit("loading",j)),onSubmit:Me},{default:o.withCtx(()=>[o.createVNode(o.unref(A.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(oe,{modelValue:g.fields.cert,"onUpdate:modelValue":M[0]||(M[0]=j=>g.fields.cert=j),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:g.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(R,{modelValue:g.fields.certDigest,"onUpdate:modelValue":M[1]||(M[1]=j=>g.fields.certDigest=j),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:g.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(A.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(R,{modelValue:g.fields.tags,"onUpdate:modelValue":M[2]||(M[2]=j=>g.fields.tags=j),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:g.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-65a16c52"]]),wp={class:"kong-ui-certificate-entity-config-card"},Sp={key:0},Ap=tr(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:a}=Xe.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:d}=Xe.useCertificate(),g=o.computed(()=>Qn.form[i.config.app].edit),h=o.ref(),L=o.ref({id:{},cert:{section:A.ConfigurationSchemaSection.Basic},key:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Redacted},metadata:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Json},snis:{section:A.ConfigurationSchemaSection.Basic,type:A.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:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:A.ConfigurationSchemaSection.Advanced},key_alt:{section:A.ConfigurationSchemaSection.Advanced,type:A.ConfigurationSchemaType.Redacted}}),ne=S=>{h.value=S,t("fetch:success",S)},re=(S,F)=>{const Z=f("rowValue",F);if(S==="expiry")return ie.value;if(S==="key_usages")return M.value;if(S==="san_names")return Se.value;if(Z)return Z[S]},X=o.computed(()=>{if(h.value)return d(h.value)}),ie=o.computed(()=>{var S,F;return(S=X.value)!=null&&S.schemaExpiry?s((F=X.value)==null?void 0:F.schemaExpiry):""}),Me=o.computed(()=>{var S;return((S=X.value)==null?void 0:S.schemaIssuer)||""}),Se=o.computed(()=>{var S;return((S=X.value)==null?void 0:S.schemaSanNames)||""}),P=o.computed(()=>{var S;return((S=X.value)==null?void 0:S.schemaSubject)||""}),M=o.computed(()=>{var S;return((S=X.value)==null?void 0:S.schemaKeyUsages)||[]}),oe=o.computed(()=>{var S,F;return((F=(S=h==null?void 0:h.value)==null?void 0:S.snis)==null?void 0:F.length)>0}),R=o.computed(()=>{var S;return!!((S=h==null?void 0:h.value)!=null&&S.cert_alt)}),j=S=>{var F,Z;return S==="san_names"?n("certificates.list.table_headers.san"):((Z=(F=L.value)==null?void 0:F[S])==null?void 0:Z.label)||u(S)};return(S,F)=>{const Z=o.resolveComponent("KCodeBlock"),lt=o.resolveComponent("KLabel"),ut=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",wp,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":L.value,"entity-type":o.unref(A.SupportedEntityType).Certificate,"fetch-url":g.value,"hide-title":r.hideTitle,"onFetch:error":F[0]||(F[0]=se=>S.$emit("fetch:error",se)),"onFetch:success":ne,onLoading:F[1]||(F[1]=se=>S.$emit("loading",se))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(se=>[o.unref(f)("rowValue",se)?(o.openBlock(),o.createBlock(Z,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",se),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(lt,{class:"metadata-label"},{default:o.withCtx(()=>[...F[2]||(F[2]=[o.createTextVNode(" Metadata ",-1)])]),_:1})]),metadata:o.withCtx(se=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",se)),ce=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:ce,item:{key:ce,value:re(ce,se),label:j(ce),type:ce==="key_usages"||ce==="snis"||ce==="dns_names"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ie.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Me.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Se.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(P.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(a),{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(()=>[M.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Sp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(M.value,(se,ce)=>(o.openBlock(),o.createBlock(ut,{key:`key_usages-badge-tag-${ce}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ce}`,tooltip:se,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(se),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[oe.value?void 0:{name:"snis",fn:o.withCtx(()=>[F[3]||(F[3]=o.createTextVNode(" – ",-1))]),key:"0"},R.value?{name:"cert_alt",fn:o.withCtx(se=>[F[4]||(F[4]=o.createTextVNode(" > ",-1)),o.unref(f)("rowValue",se)?(o.openBlock(),o.createBlock(Z,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",se),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-de8f90ef"]]);Ce.CACertificateConfigCard=up,Ce.CACertificateForm=vp,Ce.CACertificateList=mp,Ce.CertificateConfigCard=Ap,Ce.CertificateForm=ap,Ce.CertificateList=ep,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})});
|
|
113
|
+
*/const yi="crypto.algorithm";class zd{getAlgorithms(){return Te.resolveAll(yi)}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 E({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 Tr="crypto.algorithmProvider";Te.registerSingleton(Tr,zd);var ho;const Me="1.3.36.3.3.2.8.1.1",yu=`${Me}.1`,gu=`${Me}.2`,mu=`${Me}.3`,bu=`${Me}.4`,vu=`${Me}.5`,wu=`${Me}.6`,Su=`${Me}.7`,Au=`${Me}.8`,ku=`${Me}.9`,Cu=`${Me}.10`,xu=`${Me}.11`,Bu=`${Me}.12`,Eu=`${Me}.13`,Nu=`${Me}.14`,Iu="brainpoolP160r1",Ou="brainpoolP160t1",_u="brainpoolP192r1",Tu="brainpoolP192t1",Vu="brainpoolP224r1",ju="brainpoolP224t1",Pu="brainpoolP256r1",Ru="brainpoolP256t1",Du="brainpoolP320r1",Mu="brainpoolP320t1",Uu="brainpoolP384r1",$u="brainpoolP384t1",Hu="brainpoolP512r1",Lu="brainpoolP512t1",pe="ECDSA";let gi=ho=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case pe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return bd;case"sha-256":return vd;case"sha-384":return wd;case"sha-512":return Sd}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=Tl;break;case"K-256":t=ho.SECP256K1;break;case"P-384":t=Vl;break;case"P-521":t=jl;break;case Iu:t=yu;break;case Ou:t=gu;break;case _u:t=mu;break;case Tu:t=bu;break;case Vu:t=vu;break;case ju:t=wu;break;case Pu:t=Su;break;case Ru:t=Au;break;case Du:t=ku;break;case Mu:t=Cu;break;case Uu:t=xu;break;case $u:t=Bu;break;case Hu:t=Eu;break;case Lu:t=Nu;break}if(t)return new E({algorithm:ci,parameters:x.serialize(new _t({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case zs:return{name:pe,hash:{name:"SHA-1"}};case Js:return{name:pe,hash:{name:"SHA-256"}};case Ys:return{name:pe,hash:{name:"SHA-384"}};case Zs:return{name:pe,hash:{name:"SHA-512"}};case ci:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(x.parse(e.parameters,_t).namedCurve){case Tl:return{name:pe,namedCurve:"P-256"};case ho.SECP256K1:return{name:pe,namedCurve:"K-256"};case Vl:return{name:pe,namedCurve:"P-384"};case jl:return{name:pe,namedCurve:"P-521"};case yu:return{name:pe,namedCurve:Iu};case gu:return{name:pe,namedCurve:Ou};case mu:return{name:pe,namedCurve:_u};case bu:return{name:pe,namedCurve:Tu};case vu:return{name:pe,namedCurve:Vu};case wu:return{name:pe,namedCurve:ju};case Su:return{name:pe,namedCurve:Pu};case Au:return{name:pe,namedCurve:Ru};case ku:return{name:pe,namedCurve:Du};case Cu:return{name:pe,namedCurve:Mu};case xu:return{name:pe,namedCurve:Uu};case Bu:return{name:pe,namedCurve:$u};case Eu:return{name:pe,namedCurve:Hu};case Nu:return{name:pe,namedCurve:Lu}}}}return null}};gi.SECP256K1="1.3.132.0.10",gi=ho=a([no()],gi),Te.registerSingleton(yi,gi);const Fu=Symbol("name"),qu=Symbol("value");class te{constructor(e,t={},i=""){this[Fu]=e,this[qu]=i;for(const n in t)this[n]=t[n]}}te.NAME=Fu,te.VALUE=qu;class Jd{static toTextObject(e){const t=new te("Algorithm Identifier",{},Tt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case ci:{const i=new gi().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class Tt{static toString(e){const t=this.items[e];return t||e}}Tt.items={[Kn]:"sha1",[Dl]:"sha224",[Wn]:"sha256",[Gn]:"sha384",[zn]:"sha512",[Yt]:"rsaEncryption",[Ln]:"sha1WithRSAEncryption",[Ed]:"sha224WithRSAEncryption",[Qs]:"sha256WithRSAEncryption",[Fn]:"sha384WithRSAEncryption",[qn]:"sha512WithRSAEncryption",[ci]:"ecPublicKey",[zs]:"ecdsaWithSHA1",[_l]:"ecdsaWithSHA224",[Js]:"ecdsaWithSHA256",[Ys]:"ecdsaWithSHA384",[Zs]:"ecdsaWithSHA512",[fd]:"TLS WWW server authentication",[dd]:"TLS WWW client authentication",[pd]:"Code Signing",[hd]:"E-mail Protection",[yd]:"Time Stamping",[gd]:"OCSP Signing",[md]:"Signed Data"};class er{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[te.VALUE];c&&(s=` ${c}`),i.push(`${n}${e[te.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 m of f)m[te.NAME]=u,i.push(...this.serializeObj(m,t));else if(f instanceof te)f[te.NAME]=u,i.push(...this.serializeObj(f,t));else if(C.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 m=f.toTextObject();m[te.NAME]=u,i.push(...this.serializeObj(m,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=C.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)}}er.oidSerializer=Tt,er.algorithmSerializer=Jd;var Vr;class Vt{get rawData(){return W(this,Vr,"f")||de(this,Vr,x.serialize(this.asn),"f"),W(this,Vr,"f")}constructor(...e){Vr.set(this,void 0),C.isBufferSource(e[0])?(this.asn=x.parse(e[0],e[1]),de(this,Vr,C.toArrayBuffer(e[0]),"f"),this.onInit(this.asn)):(this.asn=e[0],this.onInit(this.asn))}equal(e){return e instanceof Vt?Xa(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return x.toString(this.rawData);case"text":return er.serialize(this.toTextObject());case"hex":return _.ToHex(this.rawData);case"base64":return _.ToBase64(this.rawData);case"base64url":return _.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 te(this.getTextName(),{},e)}}Vr=new WeakMap,Vt.NAME="ASN";class Fe extends Vt{constructor(...e){let t;C.isBufferSource(e[0])?t=C.toArrayBuffer(e[0]):t=x.serialize(new Qe({extnID:e[0],critical:e[1],extnValue:new Q(C.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[te.NAME]===Fe.NAME&&(e[te.NAME]=Tt.toString(this.type)),e}}var Ku;class jt{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[Ku]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(jt.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(jt.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=jt.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(jt.DEFAULT,e);return this}}Ku=Symbol.toStringTag,jt.DEFAULT="default";const Ve=new jt,Yd=/^[0-2](?:\.[1-9][0-9]*)+$/;function Zd(r){return new RegExp(Yd).test(r)}class Wu{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Zd(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Ue=new Wu;Ue.register("CN","2.5.4.3"),Ue.register("L","2.5.4.7"),Ue.register("ST","2.5.4.8"),Ue.register("O","2.5.4.10"),Ue.register("OU","2.5.4.11"),Ue.register("C","2.5.4.6"),Ue.register("DC","0.9.2342.19200300.100.1.25"),Ue.register("E","1.2.840.113549.1.9.1"),Ue.register("G","2.5.4.42"),Ue.register("I","2.5.4.43"),Ue.register("SN","2.5.4.4"),Ue.register("T","2.5.4.12");function Xd(r,e){return`\\${_.ToHex(_.FromUtf8String(e)).toUpperCase()}`}function Qd(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Xd)}class tr{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 Wu,this.asn=new ge;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 ge?this.asn=e:C.isBufferSource(e)?this.asn=x.parse(e,ge):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Ue.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)||Ue.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${_.ToHex(t.value.anyValue)}`:Qd(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?`#${_.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(n)}return t}fromString(e){const t=new ge,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 m=this.createAttribute(c,u);s==="+"?t[t.length-1].push(m):t.push(new fr([m])),s=p}return t}fromJSON(e){const t=new ge;for(const i of e){const n=new fr;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 an({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=_.FromHex(t.slice(1));else{const n=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:tr.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 x.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 Gu="Cannot initialize GeneralName from ASN.1 data.",zu=`${Gu} Unsupported string format in use.`,ep=`${Gu} Value doesn't match to GUID regular expression.`,Ju=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Yu="1.3.6.1.4.1.311.25.1",Zu="1.3.6.1.4.1.311.20.2.3",Ba="dns",Ea="dn",Na="email",Ia="ip",Oa="url",_a="guid",Ta="upn",yo="id";class Pt extends Vt{constructor(...e){let t;if(e.length===2)switch(e[0]){case Ea:{const i=new tr(e[1]).toArrayBuffer(),n=x.parse(i,ge);t=new q({directoryName:n});break}case Ba:t=new q({dNSName:e[1]});break;case Na:t=new q({rfc822Name:e[1]});break;case _a:{const i=new RegExp(Ju,"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?_.ToHex(new Uint8Array(_.FromHex(s)).reverse()):s).join("");t=new q({otherName:new zr({typeId:Yu,value:x.serialize(new Q(_.FromHex(n)))})});break}case Ia:t=new q({iPAddress:e[1]});break;case yo:t=new q({registeredID:e[1]});break;case Ta:{t=new q({otherName:new zr({typeId:Zu,value:x.serialize(Xc.toASN(e[1]))})});break}case Oa:t=new q({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else C.isBufferSource(e[0])?t=x.parse(e[0],q):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=Ba,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=Na,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=Ia,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=Oa,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=yo,this.value=e.registeredID;else if(e.directoryName!=null)this.type=Ea,this.value=new tr(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===Yu){this.type=_a;const t=x.parse(e.otherName.value,Q),i=new RegExp(Ju,"i").exec(_.ToHex(t));if(!i)throw new Error(ep);this.value=i.slice(1).map((n,s)=>s<3?_.ToHex(new Uint8Array(_.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===Zu)this.type=Ta,this.value=x.parse(e.otherName.value,Se).toString();else throw new Error(zu);else throw new Error(zu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case Ea:case Ba:case _a:case Ia:case yo:case Ta:case Oa:e=this.type.toUpperCase();break;case Na:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===yo&&(t=Tt.toString(t)),new te(e,void 0,t)}}class rr extends Vt{constructor(e){let t;if(e instanceof Ee)t=e;else if(Array.isArray(e)){const i=[];for(const n of e)if(n instanceof q)i.push(n);else{const s=x.parse(new Pt(n.type,n.value).rawData,q);i.push(s)}t=new Ee(i)}else if(C.isBufferSource(e))t=x.parse(e,Ee);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 Pt(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[te.NAME]];Array.isArray(n)||(n=[],e[i[te.NAME]]=n),n.push(i)}return e}}rr.NAME="GeneralNames";const mi="-{5}",bi="\\n",tp=`[^${bi}]+`,rp=`${mi}BEGIN (${tp}(?=${mi}))${mi}`,ip=`${mi}END \\1${mi}`,jr="\\n",np=`[^:${bi}]+`,op=`(?:[^${bi}]+${jr}(?: +[^${bi}]+${jr})*)`,sp=`(?:[a-zA-Z0-9=+/]+${jr})+`,Xu=`${rp}${jr}(?:((?:${np}: ${op})+))?${jr}?(${sp})${ip}`;class qe{static isPem(e){return typeof e=="string"&&new RegExp(Xu,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(Xu,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${bi}]+`,"g"),""),c={type:n[1],headers:[],rawData:_.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(jr,"g"));let p=null;for(const m of f){const[y,L]=m.split(/:(.*)/);if(L===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:L.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(!C.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:C.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:C.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=_.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
|
+
`)}}qe.CertificateTag="CERTIFICATE",qe.CrlTag="CRL",qe.CertificateRequestTag="CERTIFICATE REQUEST",qe.PublicKeyTag="PUBLIC KEY",qe.PrivateKeyTag="PRIVATE KEY";class Ct extends Vt{static isAsnEncoded(e){return C.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(qe.isPem(e))return qe.decode(e)[0];if(_.isHex(e))return _.FromHex(e);if(_.isBase64(e))return _.FromBase64(e);if(_.isBase64Url(e))return _.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=C.toUint8Array(e);if(t.length>0&&t[0]===48)return C.toArrayBuffer(e);const i=_.ToBinary(e);if(qe.isPem(i))return qe.decode(i)[0];if(_.isHex(i))return _.FromHex(i);if(_.isBase64(i))return _.FromBase64(i);if(_.isBase64Url(i))return _.FromBase64Url(i);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){Ct.isAsnEncoded(e[0])?super(Ct.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return qe.encode(this.rawData,this.tag);default:return super.toString(e)}}}class ut extends Ct{static async create(e,t=Ve.get()){if(e instanceof ut)return e;if(jt.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(C.isBufferSource(e))return new ut(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){Ct.isAsnEncoded(e)?super(e,st):super(e),this.tag=qe.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=x.parse(this.rawData,st);return c.algorithm.algorithm===fi&&(s=ap(c,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=Te.resolve(Tr),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Yt:{const n=x.parse(e.subjectPublicKey,ra),s=C.toUint8Array(n.modulus);i.publicExponent=C.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=x.parse(this.rawData,st);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=x.parse(this.rawData,st);switch(e.Algorithm=er.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case ci:e["EC Point"]=t.subjectPublicKey;break;case Yt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function ap(r,e){return r.algorithm=new E({algorithm:Yt,parameters:null}),e=x.serialize(r),e}class vi extends Fe{static async create(e,t=!1,i=Ve.get()){if("name"in e&&"serialNumber"in e)return new vi(e,t);const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new vi(_.ToHex(s),t)}constructor(...e){if(C.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new qt({keyIdentifier:new Xo(_.FromHex(e[0]))});super(Zo,e[1],x.serialize(t))}else{const t=e[0],i=t.name instanceof rr?x.parse(t.name.rawData,Ee):t.name,n=new qt({authorityCertIssuer:i,authorityCertSerialNumber:_.FromHex(t.serialNumber)});super(Zo,e[1],x.serialize(n))}}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,qt);t.keyIdentifier&&(this.keyId=_.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?_.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,qt);return t.authorityCertIssuer&&(e["Authority Issuer"]=new rr(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}vi.NAME="Authority Key Identifier";class Qu extends Fe{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,ln);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new ln({cA:e[0],pathLenConstraint:e[1]});super(ol,e[2],x.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}}Qu.NAME="Basic Constraints";var ef;(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"})(ef||(ef={}));class tf extends Fe{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,hn);this.usages=t.map(i=>i)}else{const t=new hn(e[0]);super(fl,e[1],x.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Tt.toString(t)).join(", "),e}}tf.NAME="Extended Key Usages";var Va;(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"})(Va||(Va={}));class ja extends Fe{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,ps);this.usages=t.toNumber()}else{const t=new ps(e[0]);super(hl,e[1],x.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,ps);return e[""]=t.toJSON().join(", "),e}}ja.NAME="Key Usages";class go extends Fe{static async create(e,t=!1,i=Ve.get()){const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new go(_.ToHex(s),t)}constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,It);this.keyId=_.ToHex(t)}else{const t=typeof e[0]=="string"?_.FromHex(e[0]):e[0],i=new It(t);super(wl,e[1],x.serialize(i)),this.keyId=_.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,It);return e[""]=t,e}}go.NAME="Subject Key Identifier";class Pa extends Fe{constructor(...e){C.isBufferSource(e[0])?super(e[0]):super(bl,e[1],new rr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,bs);this.names=new rr(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}Pa.NAME="Subject Alternative Name";class Ke{static register(e,t){this.items.set(e,t)}static create(e){const t=new Fe(e),i=this.items.get(t.type);return i?new i(e):t}}Ke.items=new Map;class rf extends Fe{constructor(...e){var t;if(C.isBufferSource(e[0])){super(e[0]);const i=x.parse(this.value,dn);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new dn(i.map(c=>new fn({policyIdentifier:c})));super(al,n,x.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new te("",{},Tt.toString(t))),e}}rf.NAME="Certificate Policies",Ke.register(al,rf);class nf extends Fe{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(c=>new hr({distributionPoint:new Kt({fullName:[new q({uniformResourceIdentifier:c})]})})),s=new yr(n);super(ss,e[1],x.serialize(s))}else{const i=new yr(e[0]);super(ss,e[1],x.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,yr);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 Pt(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}nf.NAME="CRL Distribution Points";class of extends Fe{constructor(...e){var t,i,n,s;if(C.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof pr){const c=new pr(e[0]);super(Yo,e[1],x.serialize(c))}else{const c=e[0],u=new pr;bo(u,c,tl,"ocsp"),bo(u,c,rl,"caIssuers"),bo(u,c,il,"timeStamping"),bo(u,c,nl,"caRepository"),super(Yo,e[1],x.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=[],x.parse(e.extnValue,pr).forEach(i=>{switch(i.accessMethod){case tl:this.ocsp.push(new Pt(i.accessLocation));break;case rl:this.caIssuers.push(new Pt(i.accessLocation));break;case il:this.timeStamping.push(new Pt(i.accessLocation));break;case nl:this.caRepository.push(new Pt(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&mo(e,"OCSP",this.ocsp),this.caIssuers.length&&mo(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&mo(e,"Time Stamping",this.timeStamping),this.caRepository.length&&mo(e,"CA Repository",this.caRepository),e}}of.NAME="Authority Info Access";function mo(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new te("");t.forEach((n,s)=>{const c=n.toTextObject(),u=`${c[te.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(c)}),r[e]=i}}function bo(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(c=>{typeof c=="string"&&(c=new Pt("url",c)),r.push(new Jr({accessMethod:t,accessLocation:x.parse(c.rawData,q)}))})}class sf extends Fe{constructor(...e){C.isBufferSource(e[0])?super(e[0]):super(dl,e[1],new rr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,Ee);this.names=new rr(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}sf.NAME="Issuer Alternative Name";class Pr extends Vt{constructor(...e){let t;if(C.isBufferSource(e[0]))t=C.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>C.toArrayBuffer(s)):[];t=x.serialize(new wt({type:i,values:n}))}super(t,wt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new te("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[te.NAME]===Pr.NAME&&(e[te.NAME]=Tt.toString(this.type)),e}}Pr.NAME="Attribute";class af extends Pr{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else{const i=new fo({printableString:e[0]});super(tu,[x.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=x.parse(this.values[0],fo);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[te.VALUE]=this.password,e}}af.NAME="Challenge Password";class Ra extends Pr{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new Wt;for(const s of i)n.push(x.parse(s.rawData,Qe));super(ma,[x.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=x.parse(this.values[0],Wt);this.items=t.map(i=>Ke.create(x.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[te.NAME]]=i;return e}}Ra.NAME="Extensions";class vo{static register(e,t){this.items.set(e,t)}static create(e){const t=new Pr(e),i=this.items.get(t.type);return i?new i(e):t}}vo.items=new Map;const wo="crypto.signatureFormatter";class cp{toAsnSignature(e,t){return C.toArrayBuffer(t)}toWebSignature(e,t){return C.toArrayBuffer(t)}}var So;let Da=So=class{static createPssParams(e,t){const i=So.getHashAlgorithm(e);return i?new Xt({hashAlgorithm:i,maskGenAlgorithm:new E({algorithm:Jn,parameters:x.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=Te.resolve(Tr);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 E({algorithm:Ln,parameters:null});case"sha-256":return new E({algorithm:Qs,parameters:null});case"sha-384":return new E({algorithm:Fn,parameters:null});case"sha-512":return new E({algorithm:qn,parameters:null})}}else return new E({algorithm:Yt,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=So.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new E({algorithm:fi,parameters:x.serialize(t)})}else return new E({algorithm:fi,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Yt:return{name:"RSASSA-PKCS1-v1_5"};case Ln:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Qs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Fn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case qn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case fi:if(e.parameters){const t=x.parse(e.parameters,Xt);return{name:"RSA-PSS",hash:Te.resolve(Tr).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};Da=So=a([no()],Da),Te.registerSingleton(yi,Da);let Ma=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new E({algorithm:Kn});case"sha-256":return new E({algorithm:Wn});case"sha-384":return new E({algorithm:Gn});case"sha-512":return new E({algorithm:zn})}return null}toWebAlgorithm(e){switch(e.algorithm){case Kn:return{name:"SHA-1"};case Wn:return{name:"SHA-256"};case Gn:return{name:"SHA-384"};case zn:return{name:"SHA-512"}}return null}};Ma=a([no()],Ma),Te.registerSingleton(yi,Ma);class ze{addPadding(e,t){const i=C.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n.buffer}removePadding(e,t=!1){let i=C.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=ze.namedCurveSize.get(i)||ze.defaultNamedCurveSize,s=new Hn,c=C.toUint8Array(t);return s.r=this.removePadding(c.slice(0,n),!0),s.s=this.removePadding(c.slice(n,n+n),!0),x.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=x.parse(t,Hn),n=e.namedCurve,s=ze.namedCurveSize.get(n)||ze.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return Af(c,u)}return null}}ze.namedCurveSize=new Map,ze.defaultNamedCurveSize=32;const Ua="1.3.101.110",cf="1.3.101.111",$a="1.3.101.112",lf="1.3.101.113";let Ha=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=$a;break;case"x25519":t=Ua;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=$a;break;case"ed448":t=lf;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=Ua;break;case"x448":t=cf;break}}return t?new E({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case $a:return{name:"Ed25519"};case lf:return{name:"EdDSA",namedCurve:"Ed448"};case Ua:return{name:"X25519"};case cf:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ha=a([no()],Ha),Te.registerSingleton(yi,Ha);var wi,Si,Ai,ki,Ci,xi,Bi,Rr;class lp extends Ct{get subjectName(){return W(this,Si,"f")||de(this,Si,new tr(this.asn.certificationRequestInfo.subject),"f"),W(this,Si,"f")}get subject(){return W(this,Ai,"f")||de(this,Ai,this.subjectName.toString(),"f"),W(this,Ai,"f")}get signatureAlgorithm(){if(!W(this,ki,"f")){const e=Te.resolve(Tr);de(this,ki,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return W(this,ki,"f")}get signature(){return W(this,Ci,"f")||de(this,Ci,this.asn.signature,"f"),W(this,Ci,"f")}get publicKey(){return W(this,xi,"f")||de(this,xi,new ut(this.asn.certificationRequestInfo.subjectPKInfo),"f"),W(this,xi,"f")}get attributes(){return W(this,Bi,"f")||de(this,Bi,this.asn.certificationRequestInfo.attributes.map(e=>vo.create(x.serialize(e))),"f"),W(this,Bi,"f")}get extensions(){if(!W(this,Rr,"f")){de(this,Rr,[],"f");const e=this.getAttribute(ma);e instanceof Ra&&de(this,Rr,e.items,"f")}return W(this,Rr,"f")}get tbs(){return W(this,wi,"f")||de(this,wi,this.asn.certificationRequestInfoRaw||x.serialize(this.asn.certificationRequestInfo),"f"),W(this,wi,"f")}constructor(e){const t=Ct.isAsnEncoded(e)?[e,hi]:[e];super(t[0],t[1]),wi.set(this,void 0),Si.set(this,void 0),Ai.set(this,void 0),ki.set(this,void 0),Ci.set(this,void 0),xi.set(this,void 0),Bi.set(this,void 0),Rr.set(this,void 0),this.tag=qe.CertificateRequestTag}onInit(e){}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(wo).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=x.parse(this.rawData,hi),i=t.certificationRequestInfo,n=new te("",{Version:`${gr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new te("");for(const c of this.attributes){const u=c.toTextObject();s[u[te.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new te("",{Algorithm:er.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}wi=new WeakMap,Si=new WeakMap,Ai=new WeakMap,ki=new WeakMap,Ci=new WeakMap,xi=new WeakMap,Bi=new WeakMap,Rr=new WeakMap,lp.NAME="PKCS#10 Certificate Request";var Ei,Ni,Ii,Oi,_i,Ti,Vi,ji,Pi,Ri,Dr,Di;class uf extends Ct{get publicKey(){return W(this,Di,"f")||de(this,Di,new ut(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),W(this,Di,"f")}get serialNumber(){if(!W(this,Ni,"f")){const e=this.asn.tbsCertificate;let t=new Uint8Array(e.serialNumber);t.length>1&&t[0]===0&&t[1]>127&&(t=t.slice(1)),de(this,Ni,_.ToHex(t),"f")}return W(this,Ni,"f")}get subjectName(){return W(this,Ii,"f")||de(this,Ii,new tr(this.asn.tbsCertificate.subject),"f"),W(this,Ii,"f")}get subject(){return W(this,Oi,"f")||de(this,Oi,this.subjectName.toString(),"f"),W(this,Oi,"f")}get issuerName(){return W(this,_i,"f")||de(this,_i,new tr(this.asn.tbsCertificate.issuer),"f"),W(this,_i,"f")}get issuer(){return W(this,Ti,"f")||de(this,Ti,this.issuerName.toString(),"f"),W(this,Ti,"f")}get notBefore(){if(!W(this,Vi,"f")){const e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");de(this,Vi,e,"f")}return W(this,Vi,"f")}get notAfter(){if(!W(this,ji,"f")){const e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");de(this,ji,e,"f")}return W(this,ji,"f")}get signatureAlgorithm(){if(!W(this,Pi,"f")){const e=Te.resolve(Tr);de(this,Pi,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return W(this,Pi,"f")}get signature(){return W(this,Ri,"f")||de(this,Ri,this.asn.signatureValue,"f"),W(this,Ri,"f")}get extensions(){return W(this,Dr,"f")||(de(this,Dr,[],"f"),this.asn.tbsCertificate.extensions&&de(this,Dr,this.asn.tbsCertificate.extensions.map(e=>Ke.create(x.serialize(e))),"f")),W(this,Dr,"f")}get tbs(){return W(this,Ei,"f")||de(this,Ei,this.asn.tbsCertificateRaw||x.serialize(this.asn.tbsCertificate),"f"),W(this,Ei,"f")}constructor(e){const t=Ct.isAsnEncoded(e)?[e,mr]:[e];super(t[0],t[1]),Ei.set(this,void 0),Ni.set(this,void 0),Ii.set(this,void 0),Oi.set(this,void 0),_i.set(this,void 0),Ti.set(this,void 0),Vi.set(this,void 0),ji.set(this,void 0),Pi.set(this,void 0),Ri.set(this,void 0),Dr.set(this,void 0),Di.set(this,void 0),this.tag=qe.CertificateTag}onInit(e){}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(C.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(wo).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 m=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<m&&m<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=x.parse(this.rawData,mr),i=t.tbsCertificate,n=new te("",{Version:`${gr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":er.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new te("",{"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 te("");for(const c of this.extensions){const u=c.toTextObject();s[u[te.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new te("",{Algorithm:er.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}Ei=new WeakMap,Ni=new WeakMap,Ii=new WeakMap,Oi=new WeakMap,_i=new WeakMap,Ti=new WeakMap,Vi=new WeakMap,ji=new WeakMap,Pi=new WeakMap,Ri=new WeakMap,Dr=new WeakMap,Di=new WeakMap,uf.NAME="Certificate";var ff;(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"})(ff||(ff={})),Ke.register(ol,Qu),Ke.register(fl,tf),Ke.register(hl,ja),Ke.register(wl,go),Ke.register(Zo,vi),Ke.register(bl,Pa),Ke.register(ss,nf),Ke.register(Yo,of),Ke.register(dl,sf),vo.register(tu,af),vo.register(ma,Ra),Te.registerSingleton(wo,cp),Te.registerSingleton(wo,ze),ze.namedCurveSize.set("P-256",32),ze.namedCurveSize.set("K-256",32),ze.namedCurveSize.set("P-384",48),ze.namedCurveSize.set("P-521",66);function df(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new uf(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof Pa){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,p)=>{const m=p.type,y=f[m]??[];return{...f,[m]:[...y,p.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof ja){const s=Object.values(Va),c=Array(s.length/2).fill(null).reduce((u,f,p)=>{const m=s[s.length/2+p];if(n.usages&m){const y=s[p];u.push(y)}return u},[]);i.keyUsage=c}return i}}}function up(){const r=df(),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 fp={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."},empty_state_v2:{create:"New certificate",title:"Configure your first certificate",group:"Certificates created in gateways within this group will automatically appear here.",description:"Certificates manage SSL/TLS encryption, ensuring secure communication between clients and your API services.",learn_more:"Learn more"}},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."},empty_state_v2:{create:"New CA certificate",title:"Configure your first CA certificate",group:"CA Certificates created in gateways within this group will automatically appear here.",description:"CA Certificates validate the authenticity of client and server certificates, reinforcing the trust and security of your API communications.",learn_more:"Learn more"}},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 dp(){const r=za.createI18n("en-us",fp);return{i18n:r,i18nT:za.i18nTComponent(r)}}const tt={useCertificate:up,useI18n:dp,useX509:df},La="/v2/control-planes/{controlPlaneId}/core-entities",Fa="/{workspace}",Ao={list:{konnect:`${La}/certificates`,kongManager:`${Fa}/certificates`},form:{konnect:{create:`${La}/certificates`,edit:`${La}/certificates/{id}`},kongManager:{create:`${Fa}/certificates`,edit:`${Fa}/certificates/{id}`}}},pp={class:"kong-ui-entities-certificates-list"},hp={class:"button-row"},yp={key:0},gp={key:1},mp={key:0},bp={key:1},vp={key:0},wp={key:1},Sp={key:1},Ap=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},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var G;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=tt.useI18n(),u=Ui.useRouter(),{axiosInstance:f}=A.useAxios((G=i.config)==null?void 0:G.axiosRequestConfig),{handleStateChange:p,hasRecords:m}=A.useTableState(()=>ne.value),y=o.computed(()=>m.value&&i.config.app==="konnect"),L=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),ie={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}},ee=o.computed(()=>{var H,z;let O=`${i.config.apiBaseUrl}${Ao.list[i.config.app]}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((H=i.config)==null?void 0:H.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(z=i.config)!=null&&z.workspace?`/${i.config.workspace}`:"")),O}),ne=o.ref(""),$e=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:ke,fetcherState:P,fetcherCacheKey:M}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),ee),se=()=>{ne.value=""},R=()=>{M.value++},j=o.ref(null),S=async(O,H)=>{const z=O.id;if(!await H(z)){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:z})})},F=async(O,H)=>{const z=JSON.stringify(O);if(!await H(z)){t("copy:error",{entity:O,message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,message:n("certificates.copy.success_brief")})},X=async O=>{var z;await((z=i.canRetrieve)==null?void 0:z.call(i,O))&&u.push(i.config.getViewRoute(O.id))},ft=O=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(O)}),dt=O=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(O)}),ae=O=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(O)}},le=o.ref(void 0),J=o.ref(!1),pt=o.ref(!1),nr=o.ref(""),Mr=A.useDeleteUrlBuilder(i.config,ee.value),{certificateDataCache:Rt,getCertificateData:xt}=tt.useCertificate(),Ur=O=>{le.value=O,J.value=!0},U=()=>{J.value=!1},ht=async()=>{var O,H,z;if((O=le.value)!=null&&O.id){pt.value=!0;try{await f.delete(Mr(le.value.id)),pt.value=!1,J.value=!1,M.value++,t("delete:success",le.value)}catch(Ce){nr.value=((z=(H=Ce.response)==null?void 0:H.data)==null?void 0:z.message)||Ce.message||n("certificates.errors.delete"),t("error",Ce)}finally{pt.value=!1}}},or=()=>{u.push(i.config.createRoute)};o.watch(P,O=>{var H,z,Ce;if(O.status===A.FetcherStatus.Error){j.value={title:n("certificates.errors.general")},(Ce=(z=(H=O.error)==null?void 0:H.response)==null?void 0:z.data)!=null&&Ce.message&&(j.value.message=O.error.response.data.message),t("error",O.error);return}Rt.value={},j.value=null});const ce=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")}),Dt=o.ref(!1);return o.onBeforeMount(async()=>{Dt.value=await i.canCreate(),Dt.value&&(ce.value.title=n("certificates.list.empty_state.title"),ce.value.ctaText=n("certificates.actions.create"))}),(O,H)=>{const z=o.resolveComponent("KButton"),Ce=o.resolveComponent("KEmptyState"),Bt=o.resolveComponent("KCopy"),K=o.resolveComponent("KDropdownItem"),Ie=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",pp,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":L.value,"empty-state-options":ce.value,"enable-entity-actions":"","error-message":j.value,fetcher:o.unref(ke),"fetcher-cache-key":o.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:ne.value,"table-headers":o.unref(ie),onClearSearchInput:se,"onClick:row":H[3]||(H[3]=D=>X(D)),onSort:R,onState:o.unref(p)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:ne.value,"onUpdate:modelValue":H[0]||(H[0]=D=>ne.value=D),config:$e.value},null,8,["modelValue","config"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":r.canCreate},{default:o.withCtx(()=>[r.useToolbarCreationButton?(o.openBlock(),o.createBlock(z,{key:0,appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])):o.createCommentVNode("",!0)]),_:1},8,["auth-function"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",hp,[y.value?(o.openBlock(),o.createBlock(z,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"certificates-learn-more-button",icon:"",onClick:H[1]||(H[1]=D=>O.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(z,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"]))])],8,["disabled"]))]),subject:o.withCtx(({row:D})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",yp,o.toDisplayString((xe=D==null?void 0:D.metadata)!=null&&xe.subject?D.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",gp,o.toDisplayString(o.unref(xt)(D).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:D})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",mp,o.toDisplayString((xe=D==null?void 0:D.metadata)!=null&&xe.expiry?o.unref(s)(D.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",bp,o.toDisplayString(o.unref(xt)(D).schemaExpiry?o.unref(s)(o.unref(xt)(D).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:D})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",vp,o.toDisplayString((xe=D==null?void 0:D.metadata)!=null&&xe.dns_names?`dns=${D.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",wp,o.toDisplayString(o.unref(xt)(D).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:D})=>[D!=null&&D.cert?(o.openBlock(),o.createBlock(Bt,{key:0,"data-testid":"copy-certificate-cert",text:D.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Sp,"-"))]),tags:o.withCtx(({row:D})=>[o.createVNode(o.unref(A.TableTags),{tags:D==null?void 0:D.tags},null,8,["tags"])]),actions:o.withCtx(({row:D})=>[o.createVNode(Ie,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(K,{"data-testid":"action-entity-copy-id",onClick:Co=>S(D,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(Ie,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(K,{"data-testid":"action-entity-copy-json",onClick:Co=>F(D,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(D)},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-view","has-divider":"",item:ft(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canEdit(D)},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-edit",item:dt(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-add-sni",item:ae(D.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canDelete(D)},{default:o.withCtx(()=>[o.createVNode(K,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Ur(D)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!ne.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var D;return[o.createVNode(Ce,{"data-testid":"certificates-entity-empty-state","icon-background":"",message:o.unref(n)("certificates.list.empty_state_v2.description"),title:o.unref(n)("certificates.list.empty_state_v2.title")},o.createSlots({icon:o.withCtx(()=>[o.createVNode(o.unref(je.ServiceDocumentIcon),{decoration:""})]),action:o.withCtx(()=>[Dt.value?(o.openBlock(),o.createBlock(z,{key:0,"data-testid":"entity-create-button",onClick:or},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(z,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:H[2]||(H[2]=xe=>O.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(D=r.config)!=null&&D.isControlPlaneGroup?{name:"default",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","title"])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),o.createVNode(o.unref(A.EntityDeleteModal),{"action-pending":pt.value,"entity-type":o.unref(A.EntityTypes).Certificate,error:nr.value,title:o.unref(n)("certificates.delete.title"),visible:J.value,onCancel:U,onProceed:ht},{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"])])}}}),ir=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},kp=ir(Ap,[["__scopeId","data-v-198dc311"]]),Cp="#d60027",xp={class:"sni-field-container"},Bp={key:1,class:"sni-field-controls-container"},Ep={key:0},Np=ir(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}}=tt.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"),m=o.resolveComponent("KInput"),y=o.resolveComponent("KButton"),L=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",xp,[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,(oe,ie)=>(o.openBlock(),o.createElementBlock("div",{key:ie,class:"sni-field-input"},[!r.isEditing||c.value[ie]?(o.openBlock(),o.createBlock(m,{key:0,modelValue:c.value[ie],"onUpdate:modelValue":ee=>c.value[ie]=ee,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${ie+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",Bp,[o.createVNode(y,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:ee=>u.$emit("remove",ie)},{default:o.withCtx(()=>[o.createVNode(o.unref(je.TrashIcon),{color:o.unref(Cp)},null,8,["color"])]),_:1},8,["onClick"]),o.createVNode(y,{appearance:"tertiary","data-testid":"add-sni",disabled:ie!==c.value.length-1,icon:"",onClick:f[0]||(f[0]=ee=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon))]),_:1},8,["disabled"])]))]))),128)),c.value.length===0?(o.openBlock(),o.createElementBlock("div",Ep,[o.createVNode(y,{onClick:f[1]||(f[1]=oe=>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(L,{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-a5577ce8"]]),Ip={class:"kong-ui-entities-certificates-form"},Op=ir(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=Ui.useRouter(),{i18nT:s,i18n:{t:c}}=tt.useI18n(),{getMessageFromError:u}=A.useErrors(),{axiosInstance:f}=A.useAxios((se=i.config)==null?void 0:se.axiosRequestConfig),p=o.computed(()=>Ao.form[i.config.app].edit),m=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),y=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),L=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),oe=o.computed(()=>(m.value===A.EntityBaseFormType.Create||JSON.stringify(y.fields)!==JSON.stringify(L))&&!!y.fields.cert&&!!y.fields.key),ie=R=>{var j,S;y.fields.cert=(R==null?void 0:R.cert)||"",y.fields.key=(R==null?void 0:R.key)||"",y.fields.certAlt=(R==null?void 0:R.cert_alt)||"",y.fields.keyAlt=(R==null?void 0:R.key_alt)||"",y.fields.snis=(j=R==null?void 0:R.snis)!=null&&j.length?R.snis:[""],y.fields.tags=((S=R==null?void 0:R.tags)==null?void 0:S.join(", "))||"",Object.assign(L,y.fields)},ee=()=>{n.push(i.config.cancelRoute)},ne=()=>{y.fields.snis.push("")},$e=R=>{y.fields.snis.splice(R,1)},ke=o.computed(()=>{var j,S;let R=`${i.config.apiBaseUrl}${Ao.form[i.config.app][m.value]}`;return i.config.app==="konnect"?R=R.replace(/{controlPlaneId}/gi,((j=i.config)==null?void 0:j.controlPlaneId)||""):i.config.app==="kongManager"&&(R=R.replace(/\/{workspace}/gi,(S=i.config)!=null&&S.workspace?`/${i.config.workspace}`:"")),R=R.replace(/{id}/gi,i.certificateId),R}),P=o.computed(()=>{var R,j;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:(j=(R=y.fields.tags.split(","))==null?void 0:R.map(S=>String(S||"").trim()))==null?void 0:j.filter(S=>S!=="")}}),M=async()=>{var R,j,S,F,X,ft,dt,ae,le;try{y.isReadonly=!0;let J;m.value==="create"?J=await f.post(ke.value,P.value):m.value==="edit"&&(J=((R=i.config)==null?void 0:R.app)==="konnect"?await f.put(ke.value,P.value):await f.patch(ke.value,P.value)),y.fields.cert=((j=J==null?void 0:J.data)==null?void 0:j.cert)||"",y.fields.key=((S=J==null?void 0:J.data)==null?void 0:S.key)||"",y.fields.certAlt=((F=J==null?void 0:J.data)==null?void 0:F.cert_alt)||"",y.fields.keyAlt=((X=J==null?void 0:J.data)==null?void 0:X.key_alt)||"",y.fields.snis=(dt=(ft=J==null?void 0:J.data)==null?void 0:ft.snis)!=null&&dt.length?J.data.snis:[""],y.fields.tags=((le=(ae=J==null?void 0:J.data)==null?void 0:ae.tags)==null?void 0:le.join(", "))||"",Object.assign(L,y.fields),t("update",J==null?void 0:J.data)}catch(J){y.errorMessage=u(J),t("error",J)}finally{y.isReadonly=!1}};return(R,j)=>{const S=o.resolveComponent("KTextArea"),F=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",Ip,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":oe.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).Certificate,"error-message":y.errorMessage,"fetch-url":p.value,"form-fields":P.value,"is-readonly":y.isReadonly,onCancel:ee,"onFetch:error":j[7]||(j[7]=X=>R.$emit("error",X)),"onFetch:success":ie,onLoading:j[8]||(j[8]=X=>R.$emit("loading",X)),onSubmit:M},{default:o.withCtx(()=>[o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(c)("certificates.form.sections.ssl.description"),title:o.unref(c)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(S,{modelValue:y.fields.cert,"onUpdate:modelValue":j[0]||(j[0]=X=>y.fields.cert=X),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(S,{modelValue:y.fields.key,"onUpdate:modelValue":j[1]||(j[1]=X=>y.fields.key=X),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(S,{modelValue:y.fields.certAlt,"onUpdate:modelValue":j[2]||(j[2]=X=>y.fields.certAlt=X),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(S,{modelValue:y.fields.keyAlt,"onUpdate:modelValue":j[3]||(j[3]=X=>y.fields.keyAlt=X),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(Np,{key:0,modelValue:y.fields.snis,"onUpdate:modelValue":j[4]||(j[4]=X=>y.fields.snis=X),"is-editing":m.value===o.unref(A.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:ne,onRemove:j[5]||(j[5]=X=>$e(X))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(c)("certificates.form.sections.general.description"),title:o.unref(c)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(F,{modelValue:y.fields.tags,"onUpdate:modelValue":j[6]||(j[6]=X=>y.fields.tags=X),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-8efa723a"]]),qa="/v2/control-planes/{controlPlaneId}/core-entities",Ka="/{workspace}",ko={list:{konnect:`${qa}/ca_certificates`,kongManager:`${Ka}/ca_certificates`},form:{konnect:{create:`${qa}/ca_certificates`,edit:`${qa}/ca_certificates/{id}`},kongManager:{create:`${Ka}/ca_certificates`,edit:`${Ka}/ca_certificates/{id}`}}},_p={class:"kong-ui-ca-certificate-entity-config-card"},Tp={key:0},Vp=ir(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}}=tt.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:p}=tt.useCertificate(),m=o.computed(()=>ko.form[n.config.app].edit),y=o.ref(),L=o.computed(()=>{if(y.value)return p(y.value)}),oe=o.computed(()=>{var P;return((P=L.value)==null?void 0:P.schemaIssuer)||""}),ie=o.computed(()=>{var P,M;return(P=L.value)!=null&&P.schemaExpiry?c((M=L.value)==null?void 0:M.schemaExpiry):""}),ee=o.computed(()=>{var P;return((P=L.value)==null?void 0:P.schemaKeyUsages)||[]}),ne=(P,M)=>{const se=f("rowValue",M);if(P==="expiry")return ie.value;if(P==="key_usages")return ee.value;if(se)return se[P]},$e=P=>{y.value=P,i("fetch:success",P)},ke=o.ref({id:{},updated_at:{},created_at:{},cert:{section:A.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:A.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:A.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:A.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:A.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(P,M)=>{const se=o.resolveComponent("KCodeBlock"),R=o.resolveComponent("KLabel"),j=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",_p,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":ke.value,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"fetch-url":m.value,"hide-title":r.hideTitle,"onFetch:error":M[0]||(M[0]=S=>P.$emit("fetch:error",S)),"onFetch:success":$e,onLoading:M[1]||(M[1]=S=>P.$emit("loading",S))},{cert:o.withCtx(S=>[o.unref(f)("rowValue",S)?(o.openBlock(),o.createBlock(se,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",S),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(R,{class:"metadata-label"},{default:o.withCtx(()=>[...M[2]||(M[2]=[o.createTextVNode(" Metadata ",-1)])]),_:1})]),metadata:o.withCtx(S=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",S)).filter(F=>!t.includes(F)),F=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:F,"data-testid":`ca-cert-metadata-${F}`,item:{key:F,label:o.unref(u)(F),value:ne(F,S),type:F==="key_usages"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ie.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(oe.value||"–"),1)]),key_usages:o.withCtx(()=>[ee.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Tp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ee.value,(S,F)=>(o.openBlock(),o.createBlock(j,{key:`key_usages-badge-tag-${F}`,class:"config-badge","data-testid":`key_usages-badge-tag-${F}`,tooltip:S,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-83648433"]]),jp={class:"kong-ui-entities-ca-certificates-list"},Pp={class:"button-row"},Rp={key:0},Dp={key:1},Mp={key:0},Up={key:1},$p=ir(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},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var Dt;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=tt.useI18n(),u=Ui.useRouter(),{axiosInstance:f}=A.useAxios((Dt=i.config)==null?void 0:Dt.axiosRequestConfig),{hasRecords:p,handleStateChange:m}=A.useTableState(()=>ne.value),y=o.computed(()=>p.value&&i.config.app==="konnect"),L=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),ie={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}},ee=o.computed(()=>{var O,H;let G=`${i.config.apiBaseUrl}${ko.list[i.config.app]}`;return i.config.app==="konnect"?G=G.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(G=G.replace(/\/{workspace}/gi,(H=i.config)!=null&&H.workspace?`/${i.config.workspace}`:"")),G}),ne=o.ref(""),$e=o.computed(()=>{const G=i.config.app==="konnect"||i.config.isExactMatch;return G?{isExactMatch:G,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:G,schema:i.config.filterSchema}}),{fetcher:ke,fetcherState:P,fetcherCacheKey:M}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),ee),se=()=>{ne.value=""},R=()=>{M.value++},j=o.ref(null),S=async(G,O)=>{const H=G.id;if(!await O(H)){t("copy:error",{entity:G,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:G,field:"id",message:n("ca-certificates.copy.success",{val:H})})},F=async(G,O)=>{const H=JSON.stringify(G);if(!await O(H)){t("copy:error",{entity:G,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:G,message:n("ca-certificates.copy.success_brief")})},X=async G=>{var H;await((H=i.canRetrieve)==null?void 0:H.call(i,G))&&u.push(i.config.getViewRoute(G.id))},ft=G=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(G)}),dt=G=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(G)}),ae=o.ref(void 0),le=o.ref(!1),J=o.ref(!1),pt=o.ref(""),nr=A.useDeleteUrlBuilder(i.config,ee.value),{certificateDataCache:Mr,getCertificateData:Rt}=tt.useCertificate(),xt=G=>{ae.value=G,le.value=!0},Ur=()=>{le.value=!1},U=async()=>{var G,O,H;if((G=ae.value)!=null&&G.id){J.value=!0;try{await f.delete(nr(ae.value.id)),J.value=!1,le.value=!1,M.value++,t("delete:success",ae.value)}catch(z){pt.value=((H=(O=z.response)==null?void 0:O.data)==null?void 0:H.message)||z.message||n("ca-certificates.errors.delete"),t("error",z)}finally{J.value=!1}}},ht=()=>{u.push(i.config.createRoute)};o.watch(P,G=>{var O,H,z;if(G.status===A.FetcherStatus.Error){j.value={title:n("ca-certificates.errors.general")},(z=(H=(O=G.error)==null?void 0:O.response)==null?void 0:H.data)!=null&&z.message&&(j.value.message=G.error.response.data.message),t("error",G.error);return}Mr.value={},j.value=null});const or=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")}),ce=o.ref(!1);return o.onBeforeMount(async()=>{ce.value=await i.canCreate(),ce.value&&(or.value.title=n("ca-certificates.list.empty_state.title"),or.value.ctaText=n("ca-certificates.actions.create"))}),(G,O)=>{const H=o.resolveComponent("KButton"),z=o.resolveComponent("KEmptyState"),Ce=o.resolveComponent("KDropdownItem"),Bt=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",jp,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":L.value,"empty-state-options":or.value,"enable-entity-actions":"","error-message":j.value,fetcher:o.unref(ke),"fetcher-cache-key":o.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:ne.value,"table-headers":o.unref(ie),onClearSearchInput:se,"onClick:row":O[3]||(O[3]=K=>X(K)),onSort:R,onState:o.unref(m)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:ne.value,"onUpdate:modelValue":O[0]||(O[0]=K=>ne.value=K),config:$e.value},null,8,["modelValue","config"]),r.useToolbarCreationButton?(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:0,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(H,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])):o.createCommentVNode("",!0)]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",Pp,[y.value?(o.openBlock(),o.createBlock(H,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"ca-certificates-learn-more-button",icon:"",onClick:O[1]||(O[1]=K=>G.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(H,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"]))])],8,["disabled"]))]),issuer:o.withCtx(({row:K})=>{var Ie;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Rp,o.toDisplayString((Ie=K==null?void 0:K.metadata)!=null&&Ie.issuer?K.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",Dp,o.toDisplayString(o.unref(Rt)(K).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:K})=>{var Ie;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Mp,o.toDisplayString((Ie=K==null?void 0:K.metadata)!=null&&Ie.expiry?o.unref(s)(K.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Up,o.toDisplayString(o.unref(Rt)(K).schemaExpiry?o.unref(s)(o.unref(Rt)(K).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:K})=>[o.createVNode(o.unref(A.TableTags),{tags:K==null?void 0:K.tags},null,8,["tags"])]),actions:o.withCtx(({row:K})=>[o.createVNode(Bt,null,{default:o.withCtx(({copyToClipboard:Ie})=>[o.createVNode(Ce,{"data-testid":"action-entity-copy-id",onClick:D=>S(K,Ie)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(Bt,null,{default:o.withCtx(({copyToClipboard:Ie})=>[o.createVNode(Ce,{"data-testid":"action-entity-copy-json",onClick:D=>F(K,Ie)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(K)},{default:o.withCtx(()=>[o.createVNode(Ce,{"data-testid":"action-entity-view","has-divider":"",item:ft(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canEdit(K)},{default:o.withCtx(()=>[o.createVNode(Ce,{"data-testid":"action-entity-edit",item:dt(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canDelete(K)},{default:o.withCtx(()=>[o.createVNode(Ce,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ie=>xt(K)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!ne.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var K;return[o.createVNode(z,{"data-testid":"ca-certificates-entity-empty-state","icon-background":"",message:o.unref(n)("ca-certificates.list.empty_state_v2.description"),title:o.unref(n)("ca-certificates.list.empty_state_v2.title")},o.createSlots({icon:o.withCtx(()=>[o.createVNode(o.unref(je.ServiceDocumentIcon),{decorative:""})]),action:o.withCtx(()=>[ce.value?(o.openBlock(),o.createBlock(H,{key:0,"data-testid":"entity-create-button",onClick:ht},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(H,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:O[2]||(O[2]=Ie=>G.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(K=r.config)!=null&&K.isControlPlaneGroup?{name:"default",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","title"])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),o.createVNode(o.unref(A.EntityDeleteModal),{"action-pending":J.value,"entity-type":o.unref(A.EntityTypes).CACertificate,error:pt.value,title:o.unref(n)("ca-certificates.delete.title"),visible:le.value,onCancel:Ur,onProceed:U},{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-c4525d48"]]),Hp={class:"kong-ui-entities-ca-certificates-form"},Lp=ir(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 ke;const t=e,i=r,n=Ui.useRouter(),{i18n:{t:s}}=tt.useI18n(),{getMessageFromError:c}=A.useErrors(),{axiosInstance:u}=A.useAxios((ke=i.config)==null?void 0:ke.axiosRequestConfig),f=o.computed(()=>ko.form[i.config.app].edit),p=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),m=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),y=o.reactive({cert:"",certDigest:"",tags:""}),L=o.computed(()=>(p.value===A.EntityBaseFormType.Create||JSON.stringify(m.fields)!==JSON.stringify(y))&&!!m.fields.cert),oe=P=>{var M;m.fields.cert=(P==null?void 0:P.cert)||"",m.fields.certDigest=(P==null?void 0:P.cert_digest)||"",m.fields.tags=((M=P==null?void 0:P.tags)==null?void 0:M.join(", "))||"",Object.assign(y,m.fields)},ie=()=>{n.push(i.config.cancelRoute)},ee=o.computed(()=>{var M,se;let P=`${i.config.apiBaseUrl}${ko.form[i.config.app][p.value]}`;return i.config.app==="konnect"?P=P.replace(/{controlPlaneId}/gi,((M=i.config)==null?void 0:M.controlPlaneId)||""):i.config.app==="kongManager"&&(P=P.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),P=P.replace(/{id}/gi,i.certificateId),P}),ne=o.computed(()=>{var P,M;return{cert:m.fields.cert,cert_digest:m.fields.certDigest||null,tags:(M=(P=m.fields.tags.split(","))==null?void 0:P.map(se=>String(se||"").trim()))==null?void 0:M.filter(se=>se!=="")}}),$e=async()=>{var P,M,se,R,j;try{m.isReadonly=!0;let S;p.value==="create"?S=await u.post(ee.value,ne.value):p.value==="edit"&&(S=((P=i.config)==null?void 0:P.app)==="konnect"?await u.put(ee.value,ne.value):await u.patch(ee.value,ne.value)),m.fields.cert=((M=S==null?void 0:S.data)==null?void 0:M.cert)||"",m.fields.certDigest=((se=S==null?void 0:S.data)==null?void 0:se.cert_digest)||"",m.fields.tags=((j=(R=S==null?void 0:S.data)==null?void 0:R.tags)==null?void 0:j.join(", "))||"",Object.assign(y,m.fields),t("update",S==null?void 0:S.data)}catch(S){m.errorMessage=c(S),t("error",S)}finally{m.isReadonly=!1}};return(P,M)=>{const se=o.resolveComponent("KTextArea"),R=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",Hp,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":L.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"error-message":m.errorMessage,"fetch-url":f.value,"form-fields":ne.value,"is-readonly":m.isReadonly,onCancel:ie,"onFetch:error":M[3]||(M[3]=j=>P.$emit("error",j)),"onFetch:success":oe,onLoading:M[4]||(M[4]=j=>P.$emit("loading",j)),onSubmit:$e},{default:o.withCtx(()=>[o.createVNode(o.unref(A.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:m.fields.cert,"onUpdate:modelValue":M[0]||(M[0]=j=>m.fields.cert=j),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:m.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(R,{modelValue:m.fields.certDigest,"onUpdate:modelValue":M[1]||(M[1]=j=>m.fields.certDigest=j),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:m.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(A.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(R,{modelValue:m.fields.tags,"onUpdate:modelValue":M[2]||(M[2]=j=>m.fields.tags=j),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:m.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-65a16c52"]]),Fp={class:"kong-ui-certificate-entity-config-card"},qp={key:0},Kp=ir(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}=tt.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:p}=tt.useCertificate(),m=o.computed(()=>Ao.form[i.config.app].edit),y=o.ref(),L=o.ref({id:{},cert:{section:A.ConfigurationSchemaSection.Basic},key:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Redacted},metadata:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Json},snis:{section:A.ConfigurationSchemaSection.Basic,type:A.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:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:A.ConfigurationSchemaSection.Advanced},key_alt:{section:A.ConfigurationSchemaSection.Advanced,type:A.ConfigurationSchemaType.Redacted}}),oe=S=>{y.value=S,t("fetch:success",S)},ie=(S,F)=>{const X=f("rowValue",F);if(S==="expiry")return ne.value;if(S==="key_usages")return M.value;if(S==="san_names")return ke.value;if(X)return X[S]},ee=o.computed(()=>{if(y.value)return p(y.value)}),ne=o.computed(()=>{var S,F;return(S=ee.value)!=null&&S.schemaExpiry?s((F=ee.value)==null?void 0:F.schemaExpiry):""}),$e=o.computed(()=>{var S;return((S=ee.value)==null?void 0:S.schemaIssuer)||""}),ke=o.computed(()=>{var S;return((S=ee.value)==null?void 0:S.schemaSanNames)||""}),P=o.computed(()=>{var S;return((S=ee.value)==null?void 0:S.schemaSubject)||""}),M=o.computed(()=>{var S;return((S=ee.value)==null?void 0:S.schemaKeyUsages)||[]}),se=o.computed(()=>{var S,F;return((F=(S=y==null?void 0:y.value)==null?void 0:S.snis)==null?void 0:F.length)>0}),R=o.computed(()=>{var S;return!!((S=y==null?void 0:y.value)!=null&&S.cert_alt)}),j=S=>{var F,X;return S==="san_names"?n("certificates.list.table_headers.san"):((X=(F=L.value)==null?void 0:F[S])==null?void 0:X.label)||u(S)};return(S,F)=>{const X=o.resolveComponent("KCodeBlock"),ft=o.resolveComponent("KLabel"),dt=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",Fp,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":L.value,"entity-type":o.unref(A.SupportedEntityType).Certificate,"fetch-url":m.value,"hide-title":r.hideTitle,"onFetch:error":F[0]||(F[0]=ae=>S.$emit("fetch:error",ae)),"onFetch:success":oe,onLoading:F[1]||(F[1]=ae=>S.$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(X,{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(ft,{class:"metadata-label"},{default:o.withCtx(()=>[...F[2]||(F[2]=[o.createTextVNode(" Metadata ",-1)])]),_:1})]),metadata:o.withCtx(ae=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",ae)),le=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:le,item:{key:le,value:ie(le,ae),label:j(le),type:le==="key_usages"||le==="snis"||le==="dns_names"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ne.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString($e.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ke.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(P.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(()=>[M.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",qp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(M.value,(ae,le)=>(o.openBlock(),o.createBlock(dt,{key:`key_usages-badge-tag-${le}`,class:"config-badge","data-testid":`key_usages-badge-tag-${le}`,tooltip:ae,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ae),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[se.value?void 0:{name:"snis",fn:o.withCtx(()=>[F[3]||(F[3]=o.createTextVNode(" – ",-1))]),key:"0"},R.value?{name:"cert_alt",fn:o.withCtx(ae=>[F[4]||(F[4]=o.createTextVNode(" > ",-1)),o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(X,{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-de8f90ef"]]);Be.CACertificateConfigCard=Vp,Be.CACertificateForm=Lp,Be.CACertificateList=$p,Be.CertificateConfigCard=Kp,Be.CertificateForm=Op,Be.CertificateList=kp,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})});
|