@kong-ui-public/entities-certificates 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@
11
11
 
12
12
  See the Apache Version 2.0 License for specific language governing permissions
13
13
  and limitations under the License.
14
- ***************************************************************************** */var Za;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof yo=="object"?yo:typeof self=="object"?self:typeof this=="object"?this:c(),i=o(e);typeof r.Reflect<"u"&&(i=o(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(l,d){return function(y,p){Object.defineProperty(l,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function c(){return s()||a()}})(function(t,r){var i=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",s=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,d=!c&&!l,y={create:c?function(){return Ya(Object.create(null))}:l?function(){return Ya({__proto__:null})}:function(){return Ya({})},has:d?function(S,A){return i.call(S,A)}:function(S,A){return A in S},get:d?function(S,A){return i.call(S,A)?S[A]:void 0}:function(S,A){return S[A]}},p=Object.getPrototypeOf(Function),B=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Bb(),v=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Ib(),h=typeof WeakMap=="function"?WeakMap:Eb(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,k=Sb(),m=xb(k);function x(S,A,I,j){if(X(I)){if(!Oe(S))throw new TypeError;if(!Ce(A))throw new TypeError;return J(S,A)}else{if(!Oe(S))throw new TypeError;if(!V(A))throw new TypeError;if(!V(j)&&!X(j)&&!ee(j))throw new TypeError;return ee(j)&&(j=void 0),I=te(I),H(S,A,I,j)}}t("decorate",x);function C(S,A){function I(j,Q){if(!V(j))throw new TypeError;if(!X(Q)&&!zr(Q))throw new TypeError;he(S,A,j,Q)}return I}t("metadata",C);function w(S,A,I,j){if(!V(I))throw new TypeError;return X(j)||(j=te(j)),he(S,A,I,j)}t("defineMetadata",w);function O(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),R(S,A,I)}t("hasMetadata",O);function $(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),se(S,A,I)}t("hasOwnMetadata",$);function re(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),fe(S,A,I)}t("getMetadata",re);function E(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),ke(S,A,I)}t("getOwnMetadata",E);function N(S,A){if(!V(S))throw new TypeError;return X(A)||(A=te(A)),ye(S,A)}t("getMetadataKeys",N);function q(S,A){if(!V(S))throw new TypeError;return X(A)||(A=te(A)),Be(S,A)}t("getOwnMetadataKeys",q);function P(S,A,I){if(!V(A))throw new TypeError;if(X(I)||(I=te(I)),!V(A))throw new TypeError;X(I)||(I=te(I));var j=ji(A,I,!1);return X(j)?!1:j.OrdinaryDeleteMetadata(S,A,I)}t("deleteMetadata",P);function J(S,A){for(var I=S.length-1;I>=0;--I){var j=S[I],Q=j(A);if(!X(Q)&&!ee(Q)){if(!Ce(Q))throw new TypeError;A=Q}}return A}function H(S,A,I,j){for(var Q=S.length-1;Q>=0;--Q){var Se=S[Q],_e=Se(A,I,j);if(!X(_e)&&!ee(_e)){if(!V(_e))throw new TypeError;j=_e}}return j}function R(S,A,I){var j=se(S,A,I);if(j)return!0;var Q=Ja(A);return ee(Q)?!1:R(S,Q,I)}function se(S,A,I){var j=ji(A,I,!1);return X(j)?!1:Pe(j.OrdinaryHasOwnMetadata(S,A,I))}function fe(S,A,I){var j=se(S,A,I);if(j)return ke(S,A,I);var Q=Ja(A);if(!ee(Q))return fe(S,Q,I)}function ke(S,A,I){var j=ji(A,I,!1);if(!X(j))return j.OrdinaryGetOwnMetadata(S,A,I)}function he(S,A,I,j){var Q=ji(I,j,!0);Q.OrdinaryDefineOwnMetadata(S,A,I,j)}function ye(S,A){var I=Be(S,A),j=Ja(S);if(j===null)return I;var Q=ye(j,A);if(Q.length<=0)return I;if(I.length<=0)return Q;for(var Se=new v,_e=[],ne=0,D=I;ne<D.length;ne++){var z=D[ne],F=Se.has(z);F||(Se.add(z),_e.push(z))}for(var W=0,oe=Q;W<oe.length;W++){var z=oe[W],F=Se.has(z);F||(Se.add(z),_e.push(z))}return _e}function Be(S,A){var I=ji(S,A,!1);return I?I.OrdinaryOwnMetadataKeys(S,A):[]}function zt(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function X(S){return S===void 0}function ee(S){return S===null}function ge(S){return typeof S=="symbol"}function V(S){return typeof S=="object"?S!==null:typeof S=="function"}function ae(S,A){switch(zt(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var I=A===3?"string":A===5?"number":"default",j=Zf(S,s);if(j!==void 0){var Q=j.call(S,I);if(V(Q))throw new TypeError;return Q}return me(S,I==="default"?"number":I)}function me(S,A){if(A==="string"){var I=S.toString;if(Y(I)){var j=I.call(S);if(!V(j))return j}var Q=S.valueOf;if(Y(Q)){var j=Q.call(S);if(!V(j))return j}}else{var Q=S.valueOf;if(Y(Q)){var j=Q.call(S);if(!V(j))return j}var Se=S.toString;if(Y(Se)){var j=Se.call(S);if(!V(j))return j}}throw new TypeError}function Pe(S){return!!S}function Mt(S){return""+S}function te(S){var A=ae(S,3);return ge(A)?A:Mt(A)}function Oe(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function Y(S){return typeof S=="function"}function Ce(S){return typeof S=="function"}function zr(S){switch(zt(S)){case 3:return!0;case 4:return!0;default:return!1}}function Wa(S,A){return S===A||S!==S&&A!==A}function Zf(S,A){var I=S[A];if(I!=null){if(!Y(I))throw new TypeError;return I}}function Qf(S){var A=Zf(S,a);if(!Y(A))throw new TypeError;var I=A.call(S);if(!V(I))throw new TypeError;return I}function Xf(S){return S.value}function ep(S){var A=S.next();return A.done?!1:A}function tp(S){var A=S.return;A&&A.call(S)}function Ja(S){var A=Object.getPrototypeOf(S);if(typeof S!="function"||S===p||A!==p)return A;var I=S.prototype,j=I&&Object.getPrototypeOf(I);if(j==null||j===Object.prototype)return A;var Q=j.constructor;return typeof Q!="function"||Q===S?A:Q}function Cb(){var S;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(S=Ab(r.Reflect));var A,I,j,Q=new h,Se={registerProvider:_e,getProvider:D,setProvider:F};return Se;function _e(W){if(!Object.isExtensible(Se))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case S===W:break;case X(A):A=W;break;case A===W:break;case X(I):I=W;break;case I===W:break;default:j===void 0&&(j=new v),j.add(W);break}}function ne(W,oe){if(!X(A)){if(A.isProviderFor(W,oe))return A;if(!X(I)){if(I.isProviderFor(W,oe))return A;if(!X(j))for(var be=Qf(j);;){var xe=ep(be);if(!xe)return;var ft=Xf(xe);if(ft.isProviderFor(W,oe))return tp(be),ft}}}if(!X(S)&&S.isProviderFor(W,oe))return S}function D(W,oe){var be=Q.get(W),xe;return X(be)||(xe=be.get(oe)),X(xe)&&(xe=ne(W,oe),X(xe)||(X(be)&&(be=new B,Q.set(W,be)),be.set(oe,xe))),xe}function z(W){if(X(W))throw new TypeError;return A===W||I===W||!X(j)&&j.has(W)}function F(W,oe,be){if(!z(be))throw new Error("Metadata provider not registered.");var xe=D(W,oe);if(xe!==be){if(!X(xe))return!1;var ft=Q.get(W);X(ft)&&(ft=new B,Q.set(W,ft)),ft.set(oe,be)}return!0}}function Sb(){var S;return!X(g)&&V(r.Reflect)&&Object.isExtensible(r.Reflect)&&(S=r.Reflect[g]),X(S)&&(S=Cb()),!X(g)&&V(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:S}),S}function xb(S){var A=new h,I={isProviderFor:function(z,F){var W=A.get(z);return X(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:_e,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:Se,OrdinaryOwnMetadataKeys:ne,OrdinaryDeleteMetadata:D};return k.registerProvider(I),I;function j(z,F,W){var oe=A.get(z),be=!1;if(X(oe)){if(!W)return;oe=new B,A.set(z,oe),be=!0}var xe=oe.get(F);if(X(xe)){if(!W)return;if(xe=new B,oe.set(F,xe),!S.setProvider(z,F,I))throw oe.delete(F),be&&A.delete(z),new Error("Wrong provider for target.")}return xe}function Q(z,F,W){var oe=j(F,W,!1);return X(oe)?!1:Pe(oe.has(z))}function Se(z,F,W){var oe=j(F,W,!1);if(!X(oe))return oe.get(z)}function _e(z,F,W,oe){var be=j(W,oe,!0);be.set(z,F)}function ne(z,F){var W=[],oe=j(z,F,!1);if(X(oe))return W;for(var be=oe.keys(),xe=Qf(be),ft=0;;){var rp=ep(xe);if(!rp)return W.length=ft,W;var Nb=Xf(rp);try{W[ft]=Nb}catch(Ob){try{tp(xe)}finally{throw Ob}}ft++}}function D(z,F,W){var oe=j(F,W,!1);if(X(oe)||!oe.delete(z))return!1;if(oe.size===0){var be=A.get(F);X(be)||(be.delete(W),be.size===0&&A.delete(be))}return!0}}function Ab(S){var A=S.defineMetadata,I=S.hasOwnMetadata,j=S.getOwnMetadata,Q=S.getOwnMetadataKeys,Se=S.deleteMetadata,_e=new h,ne={isProviderFor:function(D,z){var F=_e.get(D);return X(F)?Q(D,z).length?(X(F)&&(F=new v,_e.set(D,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:I,OrdinaryGetOwnMetadata:j,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:Se};return ne}function ji(S,A,I){var j=k.getProvider(S,A);if(!X(j))return j;if(I){if(k.setProvider(S,A,m))return m;throw new Error("Illegal state.")}}function Bb(){var S={},A=[],I=function(){function ne(D,z,F){this._index=0,this._keys=D,this._values=z,this._selector=F}return ne.prototype["@@iterator"]=function(){return this},ne.prototype[a]=function(){return this},ne.prototype.next=function(){var D=this._index;if(D>=0&&D<this._keys.length){var z=this._selector(this._keys[D],this._values[D]);return D+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},ne.prototype.throw=function(D){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),D},ne.prototype.return=function(D){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:D,done:!0}},ne}(),j=function(){function ne(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(ne.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ne.prototype.has=function(D){return this._find(D,!1)>=0},ne.prototype.get=function(D){var z=this._find(D,!1);return z>=0?this._values[z]:void 0},ne.prototype.set=function(D,z){var F=this._find(D,!0);return this._values[F]=z,this},ne.prototype.delete=function(D){var z=this._find(D,!1);if(z>=0){for(var F=this._keys.length,W=z+1;W<F;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,Wa(D,this._cacheKey)&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},ne.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},ne.prototype.keys=function(){return new I(this._keys,this._values,Q)},ne.prototype.values=function(){return new I(this._keys,this._values,Se)},ne.prototype.entries=function(){return new I(this._keys,this._values,_e)},ne.prototype["@@iterator"]=function(){return this.entries()},ne.prototype[a]=function(){return this.entries()},ne.prototype._find=function(D,z){if(!Wa(this._cacheKey,D)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(Wa(this._keys[F],D)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(D),this._values.push(void 0)),this._cacheIndex},ne}();return j;function Q(ne,D){return ne}function Se(ne,D){return D}function _e(ne,D){return[ne,D]}}function Ib(){var S=function(){function A(){this._map=new B}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(I){return this._map.has(I)},A.prototype.add=function(I){return this._map.set(I,I),this},A.prototype.delete=function(I){return this._map.delete(I)},A.prototype.clear=function(){this._map.clear()},A.prototype.keys=function(){return this._map.keys()},A.prototype.values=function(){return this._map.keys()},A.prototype.entries=function(){return this._map.entries()},A.prototype["@@iterator"]=function(){return this.keys()},A.prototype[a]=function(){return this.keys()},A}();return S}function Eb(){var S=16,A=y.create(),I=j();return function(){function D(){this._key=j()}return D.prototype.has=function(z){var F=Q(z,!1);return F!==void 0?y.has(F,this._key):!1},D.prototype.get=function(z){var F=Q(z,!1);return F!==void 0?y.get(F,this._key):void 0},D.prototype.set=function(z,F){var W=Q(z,!0);return W[this._key]=F,this},D.prototype.delete=function(z){var F=Q(z,!1);return F!==void 0?delete F[this._key]:!1},D.prototype.clear=function(){this._key=j()},D}();function j(){var D;do D="@@WeakMap@@"+ne();while(y.has(A,D));return A[D]=!0,D}function Q(D,z){if(!i.call(D,I)){if(!z)return;Object.defineProperty(D,I,{value:y.create()})}return D[I]}function Se(D,z){for(var F=0;F<z;++F)D[F]=Math.random()*255|0;return D}function _e(D){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(D)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(D)):Se(new Uint8Array(D),D):Se(new Array(D),D)}function ne(){var D=_e(S);D[6]=D[6]&79|64,D[8]=D[8]&191|128;for(var z="",F=0;F<S;++F){var W=D[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function Ya(S){return S.__=void 0,delete S.__,S}})})(Za||(Za={}));/*!
14
+ ***************************************************************************** */var Za;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof yo=="object"?yo:typeof self=="object"?self:typeof this=="object"?this:c(),i=o(e);typeof r.Reflect<"u"&&(i=o(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(l,d){return function(y,p){Object.defineProperty(l,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function c(){return s()||a()}})(function(t,r){var i=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",s=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,d=!c&&!l,y={create:c?function(){return Ya(Object.create(null))}:l?function(){return Ya({__proto__:null})}:function(){return Ya({})},has:d?function(S,A){return i.call(S,A)}:function(S,A){return A in S},get:d?function(S,A){return i.call(S,A)?S[A]:void 0}:function(S,A){return S[A]}},p=Object.getPrototypeOf(Function),B=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Bb(),v=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Ib(),h=typeof WeakMap=="function"?WeakMap:Eb(),m=o?Symbol.for("@reflect-metadata:registry"):void 0,k=Sb(),g=xb(k);function x(S,A,I,j){if(X(I)){if(!Oe(S))throw new TypeError;if(!Ce(A))throw new TypeError;return J(S,A)}else{if(!Oe(S))throw new TypeError;if(!V(A))throw new TypeError;if(!V(j)&&!X(j)&&!ee(j))throw new TypeError;return ee(j)&&(j=void 0),I=te(I),H(S,A,I,j)}}t("decorate",x);function C(S,A){function I(j,Q){if(!V(j))throw new TypeError;if(!X(Q)&&!zr(Q))throw new TypeError;he(S,A,j,Q)}return I}t("metadata",C);function w(S,A,I,j){if(!V(I))throw new TypeError;return X(j)||(j=te(j)),he(S,A,I,j)}t("defineMetadata",w);function O(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),R(S,A,I)}t("hasMetadata",O);function $(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),se(S,A,I)}t("hasOwnMetadata",$);function re(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),fe(S,A,I)}t("getMetadata",re);function E(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),ke(S,A,I)}t("getOwnMetadata",E);function N(S,A){if(!V(S))throw new TypeError;return X(A)||(A=te(A)),ye(S,A)}t("getMetadataKeys",N);function q(S,A){if(!V(S))throw new TypeError;return X(A)||(A=te(A)),Be(S,A)}t("getOwnMetadataKeys",q);function P(S,A,I){if(!V(A))throw new TypeError;if(X(I)||(I=te(I)),!V(A))throw new TypeError;X(I)||(I=te(I));var j=ji(A,I,!1);return X(j)?!1:j.OrdinaryDeleteMetadata(S,A,I)}t("deleteMetadata",P);function J(S,A){for(var I=S.length-1;I>=0;--I){var j=S[I],Q=j(A);if(!X(Q)&&!ee(Q)){if(!Ce(Q))throw new TypeError;A=Q}}return A}function H(S,A,I,j){for(var Q=S.length-1;Q>=0;--Q){var Se=S[Q],_e=Se(A,I,j);if(!X(_e)&&!ee(_e)){if(!V(_e))throw new TypeError;j=_e}}return j}function R(S,A,I){var j=se(S,A,I);if(j)return!0;var Q=Ja(A);return ee(Q)?!1:R(S,Q,I)}function se(S,A,I){var j=ji(A,I,!1);return X(j)?!1:Pe(j.OrdinaryHasOwnMetadata(S,A,I))}function fe(S,A,I){var j=se(S,A,I);if(j)return ke(S,A,I);var Q=Ja(A);if(!ee(Q))return fe(S,Q,I)}function ke(S,A,I){var j=ji(A,I,!1);if(!X(j))return j.OrdinaryGetOwnMetadata(S,A,I)}function he(S,A,I,j){var Q=ji(I,j,!0);Q.OrdinaryDefineOwnMetadata(S,A,I,j)}function ye(S,A){var I=Be(S,A),j=Ja(S);if(j===null)return I;var Q=ye(j,A);if(Q.length<=0)return I;if(I.length<=0)return Q;for(var Se=new v,_e=[],ne=0,D=I;ne<D.length;ne++){var z=D[ne],F=Se.has(z);F||(Se.add(z),_e.push(z))}for(var W=0,oe=Q;W<oe.length;W++){var z=oe[W],F=Se.has(z);F||(Se.add(z),_e.push(z))}return _e}function Be(S,A){var I=ji(S,A,!1);return I?I.OrdinaryOwnMetadataKeys(S,A):[]}function zt(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function X(S){return S===void 0}function ee(S){return S===null}function me(S){return typeof S=="symbol"}function V(S){return typeof S=="object"?S!==null:typeof S=="function"}function ae(S,A){switch(zt(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var I=A===3?"string":A===5?"number":"default",j=Zf(S,s);if(j!==void 0){var Q=j.call(S,I);if(V(Q))throw new TypeError;return Q}return ge(S,I==="default"?"number":I)}function ge(S,A){if(A==="string"){var I=S.toString;if(Y(I)){var j=I.call(S);if(!V(j))return j}var Q=S.valueOf;if(Y(Q)){var j=Q.call(S);if(!V(j))return j}}else{var Q=S.valueOf;if(Y(Q)){var j=Q.call(S);if(!V(j))return j}var Se=S.toString;if(Y(Se)){var j=Se.call(S);if(!V(j))return j}}throw new TypeError}function Pe(S){return!!S}function Mt(S){return""+S}function te(S){var A=ae(S,3);return me(A)?A:Mt(A)}function Oe(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function Y(S){return typeof S=="function"}function Ce(S){return typeof S=="function"}function zr(S){switch(zt(S)){case 3:return!0;case 4:return!0;default:return!1}}function Wa(S,A){return S===A||S!==S&&A!==A}function Zf(S,A){var I=S[A];if(I!=null){if(!Y(I))throw new TypeError;return I}}function Qf(S){var A=Zf(S,a);if(!Y(A))throw new TypeError;var I=A.call(S);if(!V(I))throw new TypeError;return I}function Xf(S){return S.value}function ep(S){var A=S.next();return A.done?!1:A}function tp(S){var A=S.return;A&&A.call(S)}function Ja(S){var A=Object.getPrototypeOf(S);if(typeof S!="function"||S===p||A!==p)return A;var I=S.prototype,j=I&&Object.getPrototypeOf(I);if(j==null||j===Object.prototype)return A;var Q=j.constructor;return typeof Q!="function"||Q===S?A:Q}function Cb(){var S;!X(m)&&typeof r.Reflect<"u"&&!(m in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(S=Ab(r.Reflect));var A,I,j,Q=new h,Se={registerProvider:_e,getProvider:D,setProvider:F};return Se;function _e(W){if(!Object.isExtensible(Se))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case S===W:break;case X(A):A=W;break;case A===W:break;case X(I):I=W;break;case I===W:break;default:j===void 0&&(j=new v),j.add(W);break}}function ne(W,oe){if(!X(A)){if(A.isProviderFor(W,oe))return A;if(!X(I)){if(I.isProviderFor(W,oe))return A;if(!X(j))for(var be=Qf(j);;){var xe=ep(be);if(!xe)return;var ft=Xf(xe);if(ft.isProviderFor(W,oe))return tp(be),ft}}}if(!X(S)&&S.isProviderFor(W,oe))return S}function D(W,oe){var be=Q.get(W),xe;return X(be)||(xe=be.get(oe)),X(xe)&&(xe=ne(W,oe),X(xe)||(X(be)&&(be=new B,Q.set(W,be)),be.set(oe,xe))),xe}function z(W){if(X(W))throw new TypeError;return A===W||I===W||!X(j)&&j.has(W)}function F(W,oe,be){if(!z(be))throw new Error("Metadata provider not registered.");var xe=D(W,oe);if(xe!==be){if(!X(xe))return!1;var ft=Q.get(W);X(ft)&&(ft=new B,Q.set(W,ft)),ft.set(oe,be)}return!0}}function Sb(){var S;return!X(m)&&V(r.Reflect)&&Object.isExtensible(r.Reflect)&&(S=r.Reflect[m]),X(S)&&(S=Cb()),!X(m)&&V(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,m,{enumerable:!1,configurable:!1,writable:!1,value:S}),S}function xb(S){var A=new h,I={isProviderFor:function(z,F){var W=A.get(z);return X(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:_e,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:Se,OrdinaryOwnMetadataKeys:ne,OrdinaryDeleteMetadata:D};return k.registerProvider(I),I;function j(z,F,W){var oe=A.get(z),be=!1;if(X(oe)){if(!W)return;oe=new B,A.set(z,oe),be=!0}var xe=oe.get(F);if(X(xe)){if(!W)return;if(xe=new B,oe.set(F,xe),!S.setProvider(z,F,I))throw oe.delete(F),be&&A.delete(z),new Error("Wrong provider for target.")}return xe}function Q(z,F,W){var oe=j(F,W,!1);return X(oe)?!1:Pe(oe.has(z))}function Se(z,F,W){var oe=j(F,W,!1);if(!X(oe))return oe.get(z)}function _e(z,F,W,oe){var be=j(W,oe,!0);be.set(z,F)}function ne(z,F){var W=[],oe=j(z,F,!1);if(X(oe))return W;for(var be=oe.keys(),xe=Qf(be),ft=0;;){var rp=ep(xe);if(!rp)return W.length=ft,W;var Nb=Xf(rp);try{W[ft]=Nb}catch(Ob){try{tp(xe)}finally{throw Ob}}ft++}}function D(z,F,W){var oe=j(F,W,!1);if(X(oe)||!oe.delete(z))return!1;if(oe.size===0){var be=A.get(F);X(be)||(be.delete(W),be.size===0&&A.delete(be))}return!0}}function Ab(S){var A=S.defineMetadata,I=S.hasOwnMetadata,j=S.getOwnMetadata,Q=S.getOwnMetadataKeys,Se=S.deleteMetadata,_e=new h,ne={isProviderFor:function(D,z){var F=_e.get(D);return X(F)?Q(D,z).length?(X(F)&&(F=new v,_e.set(D,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:I,OrdinaryGetOwnMetadata:j,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:Se};return ne}function ji(S,A,I){var j=k.getProvider(S,A);if(!X(j))return j;if(I){if(k.setProvider(S,A,g))return g;throw new Error("Illegal state.")}}function Bb(){var S={},A=[],I=function(){function ne(D,z,F){this._index=0,this._keys=D,this._values=z,this._selector=F}return ne.prototype["@@iterator"]=function(){return this},ne.prototype[a]=function(){return this},ne.prototype.next=function(){var D=this._index;if(D>=0&&D<this._keys.length){var z=this._selector(this._keys[D],this._values[D]);return D+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},ne.prototype.throw=function(D){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),D},ne.prototype.return=function(D){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:D,done:!0}},ne}(),j=function(){function ne(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(ne.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ne.prototype.has=function(D){return this._find(D,!1)>=0},ne.prototype.get=function(D){var z=this._find(D,!1);return z>=0?this._values[z]:void 0},ne.prototype.set=function(D,z){var F=this._find(D,!0);return this._values[F]=z,this},ne.prototype.delete=function(D){var z=this._find(D,!1);if(z>=0){for(var F=this._keys.length,W=z+1;W<F;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,Wa(D,this._cacheKey)&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},ne.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},ne.prototype.keys=function(){return new I(this._keys,this._values,Q)},ne.prototype.values=function(){return new I(this._keys,this._values,Se)},ne.prototype.entries=function(){return new I(this._keys,this._values,_e)},ne.prototype["@@iterator"]=function(){return this.entries()},ne.prototype[a]=function(){return this.entries()},ne.prototype._find=function(D,z){if(!Wa(this._cacheKey,D)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(Wa(this._keys[F],D)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(D),this._values.push(void 0)),this._cacheIndex},ne}();return j;function Q(ne,D){return ne}function Se(ne,D){return D}function _e(ne,D){return[ne,D]}}function Ib(){var S=function(){function A(){this._map=new B}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(I){return this._map.has(I)},A.prototype.add=function(I){return this._map.set(I,I),this},A.prototype.delete=function(I){return this._map.delete(I)},A.prototype.clear=function(){this._map.clear()},A.prototype.keys=function(){return this._map.keys()},A.prototype.values=function(){return this._map.keys()},A.prototype.entries=function(){return this._map.entries()},A.prototype["@@iterator"]=function(){return this.keys()},A.prototype[a]=function(){return this.keys()},A}();return S}function Eb(){var S=16,A=y.create(),I=j();return function(){function D(){this._key=j()}return D.prototype.has=function(z){var F=Q(z,!1);return F!==void 0?y.has(F,this._key):!1},D.prototype.get=function(z){var F=Q(z,!1);return F!==void 0?y.get(F,this._key):void 0},D.prototype.set=function(z,F){var W=Q(z,!0);return W[this._key]=F,this},D.prototype.delete=function(z){var F=Q(z,!1);return F!==void 0?delete F[this._key]:!1},D.prototype.clear=function(){this._key=j()},D}();function j(){var D;do D="@@WeakMap@@"+ne();while(y.has(A,D));return A[D]=!0,D}function Q(D,z){if(!i.call(D,I)){if(!z)return;Object.defineProperty(D,I,{value:y.create()})}return D[I]}function Se(D,z){for(var F=0;F<z;++F)D[F]=Math.random()*255|0;return D}function _e(D){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(D)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(D)):Se(new Uint8Array(D),D):Se(new Array(D),D)}function ne(){var D=_e(S);D[6]=D[6]&79|64,D[8]=D[8]&191|128;for(var z="",F=0;F<S;++F){var W=D[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function Ya(S){return S.__=void 0,delete S.__,S}})})(Za||(Za={}));/*!
15
15
  * MIT License
16
16
  *
17
17
  * Copyright (c) 2017-2022 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 ap="[object ArrayBuffer]";class M{static isArrayBuffer(t){return Object.prototype.toString.call(t)===ap}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength||t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t.buffer).slice(t.byteOffset,t.byteOffset+t.byteLength).buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const i=M.toUint8Array(t),o=M.toUint8Array(r);if(i.length!==o.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==o[s])return!1;return!0}static concat(...t){let r;Array.isArray(t[0])&&!(t[1]instanceof Function)||Array.isArray(t[0])&&t[1]instanceof Function?r=t[0]:t[t.length-1]instanceof Function?r=t.slice(0,t.length-1):r=t;let i=0;for(const a of r)i+=a.byteLength;const o=new Uint8Array(i);let s=0;for(const a of r){const c=this.toUint8Array(a);o.set(c,s),s+=c.length}return t[t.length-1]instanceof Function?this.toView(o,t[t.length-1]):o.buffer}}const go="string",cp=/^[0-9a-f]+$/i,lp=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,up=/^[a-zA-Z0-9-_]+$/;class Qa{static fromString(t){const r=unescape(encodeURIComponent(t)),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i.buffer}static toString(t){const r=M.toUint8Array(t);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class pt{static toString(t,r=!1){const i=M.toArrayBuffer(t),o=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const c=o.getUint16(a,r);s+=String.fromCharCode(c)}return s}static fromString(t,r=!1){const i=new ArrayBuffer(t.length*2),o=new DataView(i);for(let s=0;s<t.length;s++)o.setUint16(s*2,t.charCodeAt(s),r);return i}}class L{static isHex(t){return typeof t===go&&cp.test(t)}static isBase64(t){return typeof t===go&&lp.test(t)}static isBase64Url(t){return typeof t===go&&up.test(t)}static ToString(t,r="utf8"){const i=M.toUint8Array(t);switch(r.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 pt.toString(i,!0);case"utf16":case"utf16be":return pt.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(t,r="utf8"){if(!t)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(t);case"binary":return this.FromBinary(t);case"hex":return this.FromHex(t);case"base64":return this.FromBase64(t);case"base64url":return this.FromBase64Url(t);case"utf16le":return pt.fromString(t,!0);case"utf16":case"utf16be":return pt.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=M.toUint8Array(t);if(typeof btoa<"u"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return Qa.fromString(t);case"utf16":case"utf16be":return pt.fromString(t);case"utf16le":case"usc2":return pt.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return Qa.toString(t);case"utf16":case"utf16be":return pt.toString(t);case"utf16le":case"usc2":return pt.toString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(t){const r=t.length,i=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);return i.buffer}static ToBinary(t){const r=M.toUint8Array(t);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(t){const r=M.toUint8Array(t);let i="";const o=r.length;for(let s=0;s<o;s++){const a=r[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const s=r.slice(o,o+2);i[o/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(t,r=!1){return pt.toString(t,r)}static FromUtf16String(t,r=!1){return pt.fromString(t,r)}static Base64Padding(t){const r=4-t.length%4;if(r<4)for(let i=0;i<r;i++)t+="=";return t}static formatString(t){return(t==null?void 0:t.replace(/[\n\r\t ]/g,""))||""}}L.DEFAULT_UTF8_ENCODING="utf8";function dp(...e){const t=e.map(o=>o.byteLength).reduce((o,s)=>o+s),r=new Uint8Array(t);let i=0;return e.map(o=>new Uint8Array(o)).forEach(o=>{for(const s of o)r[i++]=s}),r.buffer}function Xa(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}/*!
37
+ */const ap="[object ArrayBuffer]";class M{static isArrayBuffer(t){return Object.prototype.toString.call(t)===ap}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength||t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t.buffer).slice(t.byteOffset,t.byteOffset+t.byteLength).buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const i=M.toUint8Array(t),o=M.toUint8Array(r);if(i.length!==o.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==o[s])return!1;return!0}static concat(...t){let r;Array.isArray(t[0])&&!(t[1]instanceof Function)||Array.isArray(t[0])&&t[1]instanceof Function?r=t[0]:t[t.length-1]instanceof Function?r=t.slice(0,t.length-1):r=t;let i=0;for(const a of r)i+=a.byteLength;const o=new Uint8Array(i);let s=0;for(const a of r){const c=this.toUint8Array(a);o.set(c,s),s+=c.length}return t[t.length-1]instanceof Function?this.toView(o,t[t.length-1]):o.buffer}}const mo="string",cp=/^[0-9a-f]+$/i,lp=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,up=/^[a-zA-Z0-9-_]+$/;class Qa{static fromString(t){const r=unescape(encodeURIComponent(t)),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i.buffer}static toString(t){const r=M.toUint8Array(t);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class pt{static toString(t,r=!1){const i=M.toArrayBuffer(t),o=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const c=o.getUint16(a,r);s+=String.fromCharCode(c)}return s}static fromString(t,r=!1){const i=new ArrayBuffer(t.length*2),o=new DataView(i);for(let s=0;s<t.length;s++)o.setUint16(s*2,t.charCodeAt(s),r);return i}}class L{static isHex(t){return typeof t===mo&&cp.test(t)}static isBase64(t){return typeof t===mo&&lp.test(t)}static isBase64Url(t){return typeof t===mo&&up.test(t)}static ToString(t,r="utf8"){const i=M.toUint8Array(t);switch(r.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 pt.toString(i,!0);case"utf16":case"utf16be":return pt.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(t,r="utf8"){if(!t)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(t);case"binary":return this.FromBinary(t);case"hex":return this.FromHex(t);case"base64":return this.FromBase64(t);case"base64url":return this.FromBase64Url(t);case"utf16le":return pt.fromString(t,!0);case"utf16":case"utf16be":return pt.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=M.toUint8Array(t);if(typeof btoa<"u"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return Qa.fromString(t);case"utf16":case"utf16be":return pt.fromString(t);case"utf16le":case"usc2":return pt.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return Qa.toString(t);case"utf16":case"utf16be":return pt.toString(t);case"utf16le":case"usc2":return pt.toString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(t){const r=t.length,i=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);return i.buffer}static ToBinary(t){const r=M.toUint8Array(t);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(t){const r=M.toUint8Array(t);let i="";const o=r.length;for(let s=0;s<o;s++){const a=r[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const s=r.slice(o,o+2);i[o/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(t,r=!1){return pt.toString(t,r)}static FromUtf16String(t,r=!1){return pt.fromString(t,r)}static Base64Padding(t){const r=4-t.length%4;if(r<4)for(let i=0;i<r;i++)t+="=";return t}static formatString(t){return(t==null?void 0:t.replace(/[\n\r\t ]/g,""))||""}}L.DEFAULT_UTF8_ENCODING="utf8";function dp(...e){const t=e.map(o=>o.byteLength).reduce((o,s)=>o+s),r=new Uint8Array(t);let i=0;return e.map(o=>new Uint8Array(o)).forEach(o=>{for(const s of o)r[i++]=s}),r.buffer}function Xa(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}/*!
38
38
  Copyright (c) Peculiar Ventures, LLC
39
- */function hr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function Gt(e,t,r=-1){const i=r;let o=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(i<0)l=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);l=new ArrayBuffer(i),s=i}const d=new Uint8Array(l);for(let y=c-1;y>=0;y--){const p=Math.pow(2,y*t);d[s-y-1]=Math.floor(o/p),o-=d[s-y-1]*p}return l}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function mo(...e){let t=0,r=0;for(const s of e)t+=s.length;const i=new ArrayBuffer(t),o=new Uint8Array(i);for(const s of e)o.set(s,r),r+=s.length;return o}function ec(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=e[0]===255&&e[1]&128,l=e[0]===0&&(e[1]&128)===0;(c||l)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let c=0;c<this.valueHex.byteLength;c++)r[c]=0;r[0]=e[0]&128;const i=hr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=e[c];return s[0]&=127,hr(s,8)-i}function fp(e){const t=e<0?e*-1:e;let r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){const a=r-t,c=Gt(a,8,i),l=new Uint8Array(c);return l[0]|=128,c}let o=Gt(t,8,i),s=new Uint8Array(o);if(s[0]&128){const a=o.slice(0),c=new Uint8Array(a);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let l=0;l<a.byteLength;l++)s[l+1]=c[l];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function pp(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function Ze(e,t){const r=e.toString(10);if(t<r.length)return"";const i=t-r.length,o=new Array(i);for(let a=0;a<i;a++)o[a]="0";return o.join("").concat(r)}/*!
39
+ */function hr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function Gt(e,t,r=-1){const i=r;let o=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(i<0)l=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);l=new ArrayBuffer(i),s=i}const d=new Uint8Array(l);for(let y=c-1;y>=0;y--){const p=Math.pow(2,y*t);d[s-y-1]=Math.floor(o/p),o-=d[s-y-1]*p}return l}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function go(...e){let t=0,r=0;for(const s of e)t+=s.length;const i=new ArrayBuffer(t),o=new Uint8Array(i);for(const s of e)o.set(s,r),r+=s.length;return o}function ec(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=e[0]===255&&e[1]&128,l=e[0]===0&&(e[1]&128)===0;(c||l)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let c=0;c<this.valueHex.byteLength;c++)r[c]=0;r[0]=e[0]&128;const i=hr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=e[c];return s[0]&=127,hr(s,8)-i}function fp(e){const t=e<0?e*-1:e;let r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){const a=r-t,c=Gt(a,8,i),l=new Uint8Array(c);return l[0]|=128,c}let o=Gt(t,8,i),s=new Uint8Array(o);if(s[0]&128){const a=o.slice(0),c=new Uint8Array(a);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let l=0;l<a.byteLength;l++)s[l+1]=c[l];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function pp(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function Ze(e,t){const r=e.toString(10);if(t<r.length)return"";const i=t-r.length,o=new Array(i);for(let a=0;a<i;a++)o[a]="0";return o.join("").concat(r)}/*!
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 Di(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function bo(e){let t=0,r=0;for(let o=0;o<e.length;o++){const s=e[o];t+=s.byteLength}const i=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function St(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class Mi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return bo(this.items)}}const Wr=[new Uint8Array([1])],tc="0123456789",wo="name",rc="valueHexView",hp="isHexOnly",yp="idBlock",gp="tagClass",mp="tagNumber",bp="isConstructed",wp="fromBER",vp="toBER",kp="local",qe="",st=new ArrayBuffer(0),Pi=new Uint8Array(0),Jr="EndOfContent",ic="OCTET STRING",nc="BIT STRING";function ht(e){var t;return t=class extends e{constructor(...i){var o;super(...i);const s=i[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?M.toUint8Array(s.valueHex):Pi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,o,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!St(this,a,o,s))return-1;const c=o+s;return this.valueHexView=a.subarray(o,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),o)}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",st)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Wt{constructor({blockLength:t=0,error:r=qe,warnings:i=[],valueBeforeDecode:o=Pi}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=M.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:L.ToHex(this.valueBeforeDecodeView)}}}Wt.NAME="baseBlock";class Le extends Wt{fromBER(t,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}Le.NAME="valueBlock";class oc extends ht(Wt){constructor({idBlock:t={}}={}){var r,i,o,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?M.toUint8Array(t.valueHex):Pi,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=t.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",st}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,o[0]=r}return o.buffer}if(!this.isHexOnly){const o=Gt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)i[s+1]=o[s]|128;i[this.valueHexView.byteLength]=o[o.length-1]}return i.buffer}fromBER(t,r,i){const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+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 c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===y){y+=255;const B=new Uint8Array(y);for(let v=0;v<d.length;v++)B[v]=d[v];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let B=0;B<l;B++)p[B]=d[B];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=hr(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 r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}oc.NAME="identificationBlock";class sc extends Wt{constructor({lenBlock:t={}}={}){var r,i,o;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(o=t.length)!==null&&o!==void 0?o:0}fromBER(t,r,i){const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+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,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+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 c=r+1,l=o.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=hr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const o=Gt(this.length,8);if(o.byteLength>127)return this.error="Too big length",st;if(r=new ArrayBuffer(o.byteLength+1),t)return r;const s=new Uint8Array(o);i=new Uint8Array(r),i[0]=o.byteLength|128;for(let a=0;a<o.byteLength;a++)i[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}sc.NAME="lengthBlock";const U={};class Ve extends Wt{constructor({name:t=qe,optional:r=!1,primitiveSchema:i,...o}={},s){super(o),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new oc(o),this.lenBlock=new sc(o),this.valueBlock=s?new s(o):new Le(o)}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}toBER(t,r){const i=r||new Mi;r||ac(this);const o=this.idBlock.toBER(t);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?st:i.final()}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(t.primitiveSchema=this.primitiveSchema.toJSON()),t}toString(t="ascii"){return t==="ascii"?this.onAsciiEncoding():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),i=t.toBER();return pp(r,i)}}Ve.NAME="BaseBlock";function ac(e){if(e instanceof U.Constructed)for(const t of e.valueBlock.value)ac(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class vo extends Ve{constructor({value:t=qe,...r}={},i){super(r,i),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}vo.NAME="BaseStringBlock";class cc extends ht(Le){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}cc.NAME="PrimitiveValueBlock";var lc;class Yr extends Ve{constructor(t={}){super(t,cc),this.idBlock.isConstructed=!1}}lc=Yr,U.Primitive=lc,Yr.NAME="PRIMITIVE";function Cp(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function yr(e,t=0,r=e.length){const i=t;let o=new Ve({},Le);const s=new Wt;if(!St(s,e,t,r))return o.error=s.error,{offset:-1,result:o};if(!e.subarray(t,t+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let c=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),c===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=c,r-=o.idBlock.blockLength,c=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),c===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=c,r-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let l=Ve;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};l=U.EndOfContent;break;case 1:l=U.Boolean;break;case 2:l=U.Integer;break;case 3:l=U.BitString;break;case 4:l=U.OctetString;break;case 5:l=U.Null;break;case 6:l=U.ObjectIdentifier;break;case 10:l=U.Enumerated;break;case 12:l=U.Utf8String;break;case 13:l=U.RelativeObjectIdentifier;break;case 14:l=U.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=U.Sequence;break;case 17:l=U.Set;break;case 18:l=U.NumericString;break;case 19:l=U.PrintableString;break;case 20:l=U.TeletexString;break;case 21:l=U.VideotexString;break;case 22:l=U.IA5String;break;case 23:l=U.UTCTime;break;case 24:l=U.GeneralizedTime;break;case 25:l=U.GraphicString;break;case 26:l=U.VisibleString;break;case 27:l=U.GeneralString;break;case 28:l=U.UniversalString;break;case 29:l=U.CharacterString;break;case 30:l=U.BmpString;break;case 31:l=U.DATE;break;case 32:l=U.TimeOfDay;break;case 33:l=U.DateTime;break;case 34:l=U.Duration;break;default:{const d=o.idBlock.isConstructed?new U.Constructed:new U.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:l=o.idBlock.isConstructed?U.Constructed:U.Primitive}return o=Cp(o,l),c=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(i,i+o.blockLength),{offset:c,result:o}}function gr(e){if(!e.byteLength){const t=new Ve({},Le);return t.error="Input buffer has zero length",{offset:-1,result:t}}return yr(M.toUint8Array(e).slice(),0,e.byteLength)}function Sp(e,t){return e?1:t}class Pt extends Le{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;Sp(this.isIndefiniteForm,i)>0;){const a=yr(o,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===Jr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Jr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Mi;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?st:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Pt.NAME="ConstructedValueBlock";var uc;class Ke extends Ve{constructor(t={}){super(t,Pt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}onAsciiEncoding(){const t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
71
+ */function Di(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function bo(e){let t=0,r=0;for(let o=0;o<e.length;o++){const s=e[o];t+=s.byteLength}const i=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function St(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class Mi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return bo(this.items)}}const Wr=[new Uint8Array([1])],tc="0123456789",wo="name",rc="valueHexView",hp="isHexOnly",yp="idBlock",mp="tagClass",gp="tagNumber",bp="isConstructed",wp="fromBER",vp="toBER",kp="local",qe="",st=new ArrayBuffer(0),Pi=new Uint8Array(0),Jr="EndOfContent",ic="OCTET STRING",nc="BIT STRING";function ht(e){var t;return t=class extends e{constructor(...i){var o;super(...i);const s=i[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?M.toUint8Array(s.valueHex):Pi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,o,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!St(this,a,o,s))return-1;const c=o+s;return this.valueHexView=a.subarray(o,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),o)}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",st)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Wt{constructor({blockLength:t=0,error:r=qe,warnings:i=[],valueBeforeDecode:o=Pi}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=M.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:L.ToHex(this.valueBeforeDecodeView)}}}Wt.NAME="baseBlock";class Le extends Wt{fromBER(t,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}Le.NAME="valueBlock";class oc extends ht(Wt){constructor({idBlock:t={}}={}){var r,i,o,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?M.toUint8Array(t.valueHex):Pi,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=t.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",st}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,o[0]=r}return o.buffer}if(!this.isHexOnly){const o=Gt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)i[s+1]=o[s]|128;i[this.valueHexView.byteLength]=o[o.length-1]}return i.buffer}fromBER(t,r,i){const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+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 c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===y){y+=255;const B=new Uint8Array(y);for(let v=0;v<d.length;v++)B[v]=d[v];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let B=0;B<l;B++)p[B]=d[B];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=hr(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 r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}oc.NAME="identificationBlock";class sc extends Wt{constructor({lenBlock:t={}}={}){var r,i,o;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(o=t.length)!==null&&o!==void 0?o:0}fromBER(t,r,i){const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+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,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+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 c=r+1,l=o.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=hr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const o=Gt(this.length,8);if(o.byteLength>127)return this.error="Too big length",st;if(r=new ArrayBuffer(o.byteLength+1),t)return r;const s=new Uint8Array(o);i=new Uint8Array(r),i[0]=o.byteLength|128;for(let a=0;a<o.byteLength;a++)i[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}sc.NAME="lengthBlock";const U={};class Ve extends Wt{constructor({name:t=qe,optional:r=!1,primitiveSchema:i,...o}={},s){super(o),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new oc(o),this.lenBlock=new sc(o),this.valueBlock=s?new s(o):new Le(o)}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}toBER(t,r){const i=r||new Mi;r||ac(this);const o=this.idBlock.toBER(t);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?st:i.final()}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(t.primitiveSchema=this.primitiveSchema.toJSON()),t}toString(t="ascii"){return t==="ascii"?this.onAsciiEncoding():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),i=t.toBER();return pp(r,i)}}Ve.NAME="BaseBlock";function ac(e){if(e instanceof U.Constructed)for(const t of e.valueBlock.value)ac(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class vo extends Ve{constructor({value:t=qe,...r}={},i){super(r,i),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}vo.NAME="BaseStringBlock";class cc extends ht(Le){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}cc.NAME="PrimitiveValueBlock";var lc;class Yr extends Ve{constructor(t={}){super(t,cc),this.idBlock.isConstructed=!1}}lc=Yr,U.Primitive=lc,Yr.NAME="PRIMITIVE";function Cp(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function yr(e,t=0,r=e.length){const i=t;let o=new Ve({},Le);const s=new Wt;if(!St(s,e,t,r))return o.error=s.error,{offset:-1,result:o};if(!e.subarray(t,t+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let c=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),c===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=c,r-=o.idBlock.blockLength,c=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),c===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=c,r-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let l=Ve;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};l=U.EndOfContent;break;case 1:l=U.Boolean;break;case 2:l=U.Integer;break;case 3:l=U.BitString;break;case 4:l=U.OctetString;break;case 5:l=U.Null;break;case 6:l=U.ObjectIdentifier;break;case 10:l=U.Enumerated;break;case 12:l=U.Utf8String;break;case 13:l=U.RelativeObjectIdentifier;break;case 14:l=U.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=U.Sequence;break;case 17:l=U.Set;break;case 18:l=U.NumericString;break;case 19:l=U.PrintableString;break;case 20:l=U.TeletexString;break;case 21:l=U.VideotexString;break;case 22:l=U.IA5String;break;case 23:l=U.UTCTime;break;case 24:l=U.GeneralizedTime;break;case 25:l=U.GraphicString;break;case 26:l=U.VisibleString;break;case 27:l=U.GeneralString;break;case 28:l=U.UniversalString;break;case 29:l=U.CharacterString;break;case 30:l=U.BmpString;break;case 31:l=U.DATE;break;case 32:l=U.TimeOfDay;break;case 33:l=U.DateTime;break;case 34:l=U.Duration;break;default:{const d=o.idBlock.isConstructed?new U.Constructed:new U.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:l=o.idBlock.isConstructed?U.Constructed:U.Primitive}return o=Cp(o,l),c=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(i,i+o.blockLength),{offset:c,result:o}}function mr(e){if(!e.byteLength){const t=new Ve({},Le);return t.error="Input buffer has zero length",{offset:-1,result:t}}return yr(M.toUint8Array(e).slice(),0,e.byteLength)}function Sp(e,t){return e?1:t}class Pt extends Le{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;Sp(this.isIndefiniteForm,i)>0;){const a=yr(o,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===Jr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Jr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Mi;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?st:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Pt.NAME="ConstructedValueBlock";var uc;class Ke extends Ve{constructor(t={}){super(t,Pt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}onAsciiEncoding(){const t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
72
72
  `).map(o=>` ${o}`).join(`
73
73
  `));const r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${r} :
74
74
  ${t.join(`
75
- `)}`:`${r} :`}}uc=Ke,U.Constructed=uc,Ke.NAME="CONSTRUCTED";class dc extends Le{fromBER(t,r,i){return r}toBER(t){return st}}dc.override="EndOfContentValueBlock";var fc;class ko extends Ve{constructor(t={}){super(t,dc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}fc=ko,U.EndOfContent=fc,ko.NAME=Jr;var pc;class Jt extends Ve{constructor(t={}){super(t,Le),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,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,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}pc=Jt,U.Null=pc,Jt.NAME="NULL";class hc extends ht(Le){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=M.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,i){const o=M.toUint8Array(t);return St(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ec.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}hc.NAME="BooleanValueBlock";var yc;let $i=class extends Ve{constructor(t={}){super(t,hc),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};yc=$i,U.Boolean=yc,$i.NAME="BOOLEAN";class gc extends ht(Pt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=Pt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==ic)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,i),this.blockLength=i;return o}toBER(t,r){return this.isConstructed?Pt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}gc.NAME="OctetStringValueBlock";var mc;let Yt=class ip extends Ve{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},gc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,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),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=yr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Ke.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof ip&&t.push(r.valueBlock.valueHexView);return M.concat(t)}};mc=Yt,U.OctetString=mc,Yt.NAME=ic;class bc extends ht(Pt){constructor({unusedBits:t=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,i){if(!i)return r;let o=-1;if(this.isConstructed){if(o=Pt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const c of this.value){const l=c.constructor.NAME;if(l===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==nc)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.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 o}const s=M.toUint8Array(t);if(!St(this,s,r,i))return-1;const a=s.subarray(r,r+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 c=a.subarray(1);try{if(c.byteLength){const l=yr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return Pt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return st;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}}}bc.NAME="BitStringValueBlock";var wc;let Zt=class extends Ve{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ke.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};wc=Zt,U.BitString=wc,Zt.NAME=nc;var vc;function xp(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),o=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=o.slice(0),l=c.length-1;let d=0;const y=l<a?a:l;let p=0;for(let B=y;B>=0;B--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=mo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=mo(r,s)),s}function kc(e){if(e>=Wr.length)for(let t=Wr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Wr[t-1].slice(0);for(let o=i.length-1;o>=0;o--){const s=new Uint8Array([(i[o]<<1)+r[0]]);r[0]=s[0]/10,i[o]=s[0]%10}r[0]>0&&(i=mo(r,i)),Wr.push(i)}return Wr[e]}function Ap(e,t){let r=0;const i=new Uint8Array(e),o=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=o.slice(0),l=c.length-1;let d,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class Co extends ht(Le){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}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=ec.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(fp(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,o=0){const s=this.fromBER(t,r,i);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):o!==0&&a.length<o&&(o-a.length>1&&(o=a.length+1),this.valueHexView=a.subarray(o-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,i){const o=super.fromBER(t,r,i);return o===-1||this.setValueHex(),o}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),i=0,o;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){o=s[l];for(let d=0;d<8;d++){if((o&1)===1)switch(i){case t:r=Ap(kc(i),r),a="-";break;default:r=xp(r,kc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=tc.charAt(r[l]));return c===!1&&(a+=tc.charAt(0)),a}}vc=Co,Co.NAME="IntegerValueBlock",Object.defineProperty(vc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Cc;class yt extends Ve{constructor(t={}){super(t,Co),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Di(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Di();const r=BigInt(t),i=new Mi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${L.ToHex(c)}`)+r,y=M.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new yt({valueHex:i.final()})}convertToDER(){const t=new yt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new yt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Cc=yt,U.Integer=Cc,yt.NAME="INTEGER";var Sc;class Ri extends yt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Sc=Ri,U.Enumerated=Sc,Ri.NAME="ENUMERATED";class So extends ht(Le){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];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=hr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Di();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let o=0;o<i.length;o++)i[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Gt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",st;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i}toString(){let t="";if(this.isHexOnly)t=L.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}So.NAME="sidBlock";class xc extends Le{constructor({value:t=qe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new So;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(t);if(o.byteLength===0)return this.error=this.value[i].error,st;r.push(o)}return bo(r)}fromString(t){this.value=[];let r=0,i=0,o="",s=!1;do if(i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(o,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new So;if(o>Number.MAX_SAFE_INTEGER){Di();const c=BigInt(o);a.valueBigInt=c}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[i].isFirstSid?t=`2.{${o} - 80}`:t+=o):t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}xc.NAME="ObjectIdentifierValueBlock";var Ac;class Ui extends Ve{constructor(t={}){super(t,xc),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ac=Ui,U.ObjectIdentifier=Ac,Ui.NAME="OBJECT IDENTIFIER";class xo extends ht(Wt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];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=hr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Gt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",st;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i.buffer}toString(){let t="";return this.isHexOnly?t=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}xo.NAME="relativeSidBlock";class Bc extends Le{constructor({value:t=qe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new xo;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const i=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(t);if(s.byteLength===0)return this.error=this.value[o].error,st;i.push(s)}return bo(i)}fromString(t){this.value=[];let r=0,i=0,o="";do{i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1;const s=new xo;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(o=`{${o}}`),t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Bc.NAME="RelativeObjectIdentifierValueBlock";var Ic;class Ao extends Ve{constructor(t={}){super(t,Bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ic=Ao,U.RelativeObjectIdentifier=Ic,Ao.NAME="RelativeObjectIdentifier";var Ec;class xt extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ec=xt,U.Sequence=Ec,xt.NAME="SEQUENCE";var Nc;let At=class extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Nc=At,U.Set=Nc,At.NAME="SET";class Oc extends ht(Le){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=qe}toJSON(){return{...super.toJSON(),value:this.value}}}Oc.NAME="StringValueBlock";class _c extends Oc{}_c.NAME="SimpleStringValueBlock";class Qe extends vo{constructor({...t}={}){super(t,_c)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,M.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);this.valueBlock.value=t}}Qe.NAME="SIMPLE STRING";class Tc extends Qe{fromBuffer(t){this.valueBlock.valueHexView=M.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}Tc.NAME="Utf8StringValueBlock";var Vc;class Bt extends Tc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Vc=Bt,U.Utf8String=Vc,Bt.NAME="UTF8String";class jc extends Qe{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=M.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}jc.NAME="BmpStringValueBlock";var Dc;class Li extends jc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Dc=Li,U.BmpString=Dc,Li.NAME="BMPString";class Mc extends Qe{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);for(let o=0;o<i.length;o+=4)i[o]=i[o+3],i[o+1]=i[o+2],i[o+2]=0,i[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=Gt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[o*4+l+c]=a[l]}this.valueBlock.value=t}}Mc.NAME="UniversalStringValueBlock";var Pc;class Hi extends Mc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Pc=Hi,U.UniversalString=Pc,Hi.NAME="UniversalString";var $c;class Fi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}$c=Fi,U.NumericString=$c,Fi.NAME="NumericString";var Rc;class qi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Rc=qi,U.PrintableString=Rc,qi.NAME="PrintableString";var Uc;class Ki extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Uc=Ki,U.TeletexString=Uc,Ki.NAME="TeletexString";var Lc;class zi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Lc=zi,U.VideotexString=Lc,zi.NAME="VideotexString";var Hc;class Gi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Hc=Gi,U.IA5String=Hc,Gi.NAME="IA5String";var Fc;class Wi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Fc=Wi,U.GraphicString=Fc,Wi.NAME="GraphicString";var qc;class Zr extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}qc=Zr,U.VisibleString=qc,Zr.NAME="VisibleString";var Kc;class Ji extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Kc=Ji,U.GeneralString=Kc,Ji.NAME="GeneralString";var zc;class Yi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}zc=Yi,U.CharacterString=zc,Yi.NAME="CharacterString";var Gc;class Qr extends Zr{constructor({value:t,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let o=0;o<t.length;o++)this.valueBlock.valueHexView[o]=t.charCodeAt(o)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,M.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const o=parseInt(i[1],10);o>=50?this.year=1900+o:this.year=2e3+o,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(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=Ze(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Ze(this.month,2),r[2]=Ze(this.day,2),r[3]=Ze(this.hour,2),r[4]=Ze(this.minute,2),r[5]=Ze(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}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}}}Gc=Qr,U.UTCTime=Gc,Qr.NAME="UTCTime";var Wc;class Zi extends Qr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,i="",o="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){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 p=1,B=i.indexOf("+"),v="";if(B===-1&&(B=i.indexOf("-"),p=-1),B!==-1){if(v=i.substring(B+1),i=i.substring(0,B),v.length!==2&&v.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(v.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,v.length===4){if(h=parseInt(v.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),o=i.substring(0,d)}else o=i;switch(!0){case o.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(o);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Ze(this.year,4)),r.push(Ze(this.month,2)),r.push(Ze(this.day,2)),r.push(Ze(this.hour,2)),r.push(Ze(this.minute,2)),r.push(Ze(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Ze(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Wc=Zi,U.GeneralizedTime=Wc,Zi.NAME="GeneralizedTime";var Jc;class Bo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Jc=Bo,U.DATE=Jc,Bo.NAME="DATE";var Yc;class Io extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Yc=Io,U.TimeOfDay=Yc,Io.NAME="TimeOfDay";var Zc;class Eo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Zc=Eo,U.DateTime=Zc,Eo.NAME="DateTime";var Qc;class No extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Qc=No,U.Duration=Qc,No.NAME="Duration";var Xc;class Oo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Xc=Oo,U.TIME=Xc,Oo.NAME="TIME";class Qt{constructor({name:t=qe,optional:r=!1}={}){this.name=t,this.optional=r}}class _o extends Qt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Qi extends Qt{constructor({value:t=new Qt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class Bp{constructor({data:t=Pi}={}){this.dataView=M.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=M.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=M.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Xt(e,t,r){if(r instanceof _o){for(let s=0;s<r.value.length;s++)if(Xt(e,t,r.value[s]).verified)return{verified:!0,result:e};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(wo)&&(s.name=r.name),s}}if(r instanceof Qt)return r.hasOwnProperty(wo)&&(e[r.name]=t),{verified:!0,result:e};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(yp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(wp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(vp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(gp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(mp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(bp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(hp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly)return{verified:!1,result:e};if(r.idBlock.isHexOnly){if(!(rc in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(e[r.name]=t)),r instanceof U.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Qi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Qi){if(a=Xt(e,t.valueBlock.value[l],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),a;if(wo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};kp in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[l])}}else if(a=Xt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&rc in t.valueBlock){const s=yr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],a.name=r.name)),a}return Xt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Ip(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=yr(M.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Xt(r.result,r.result,t)}const el=Object.freeze(Object.defineProperty({__proto__:null,Any:Qt,BaseBlock:Ve,BaseStringBlock:vo,BitString:Zt,BmpString:Li,Boolean:$i,CharacterString:Yi,Choice:_o,Constructed:Ke,DATE:Bo,DateTime:Eo,Duration:No,EndOfContent:ko,Enumerated:Ri,GeneralString:Ji,GeneralizedTime:Zi,GraphicString:Wi,HexBlock:ht,IA5String:Gi,Integer:yt,Null:Jt,NumericString:Fi,ObjectIdentifier:Ui,OctetString:Yt,Primitive:Yr,PrintableString:qi,RawData:Bp,RelativeObjectIdentifier:Ao,Repeated:Qi,Sequence:xt,Set:At,TIME:Oo,TeletexString:Ki,TimeOfDay:Io,UTCTime:Qr,UniversalString:Hi,Utf8String:Bt,ValueBlock:Le,VideotexString:zi,ViewWriter:Mi,VisibleString:Zr,compareSchema:Xt,fromBER:gr,verifySchema:Ip},Symbol.toStringTag,{value:"Module"}));var _;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(_||(_={}));var b;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(b||(b={}));class Xi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(M.isBufferSource(t))this.unusedBits=r,this.value=M.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Zt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new Zt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Zt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class ce{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):M.isBufferSource(t)?this.buffer=M.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Yt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Yt({valueHex:this.buffer})}toSchema(t){return new Yt({name:t})}}const Ep={fromASN:e=>e instanceof Jt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Jt;const t=gr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Np={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new yt({value:+e})},Op={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ri({value:e})},we={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new yt({valueHex:e})},_p={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Zt({valueHex:e})},Tp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Ui({value:e})},Vp={fromASN:e=>e.valueBlock.value,toASN:e=>new $i({value:e})},en={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},jp={fromASN:e=>new ce(e.getValue()),toASN:e=>e.toASN()};function tt(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const tl=tt(Bt),Dp=tt(Li),Mp=tt(Hi),Pp=tt(Fi),$p=tt(qi),Rp=tt(Ki),Up=tt(zi),Lp=tt(Gi),Hp=tt(Wi),Fp=tt(Zr),qp=tt(Ji),Kp=tt(Yi),zp={fromASN:e=>e.toDate(),toASN:e=>new Qr({valueDate:e})},Gp={fromASN:e=>e.toDate(),toASN:e=>new Zi({valueDate:e})},Wp={fromASN:()=>null,toASN:()=>new Jt};function To(e){switch(e){case b.Any:return Ep;case b.BitString:return _p;case b.BmpString:return Dp;case b.Boolean:return Vp;case b.CharacterString:return Kp;case b.Enumerated:return Op;case b.GeneralString:return qp;case b.GeneralizedTime:return Gp;case b.GraphicString:return Hp;case b.IA5String:return Lp;case b.Integer:return Np;case b.Null:return Wp;case b.NumericString:return Pp;case b.ObjectIdentifier:return Tp;case b.OctetString:return en;case b.PrintableString:return $p;case b.TeletexString:return Rp;case b.UTCTime:return zp;case b.UniversalString:return Mp;case b.Utf8String:return tl;case b.VideotexString:return Up;case b.VisibleString:return Fp;default:return null}}function It(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:It(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function rl(e){var t;if(e){const r=Object.getPrototypeOf(e);return((t=r==null?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array?!0:rl(r)}return!1}function Jp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}class Yp{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const i=this.items.get(t);if(!i)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:_.Sequence,items:{}},i=this.findParentSchema(t);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(t,r){const i=this.items.get(t)||this.createDefault(t),o=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const y=b[a.type],p=el[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else It(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===_.Choice?l=new Qt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Qt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?At:xt;l=new y({name:"",value:[new Qi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||It(a.type)){const y=a.repeated?Ke:Yr;o.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new Ke({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new Ke({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,o.push(l)}switch(i.type){case _.Sequence:return new xt({value:o,name:""});case _.Set:return new At({value:o,name:""});case _.Choice:return new _o({value:o,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const rt=new Yp,T=e=>t=>{let r;rt.has(t)?r=rt.get(t):(r=rt.createDefault(t),rt.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;rt.has(t.constructor)?i=rt.get(t.constructor):(i=rt.createDefault(t.constructor),rt.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=To(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}i.items[r]=o};class il extends Error{constructor(){super(...arguments),this.schemas=[]}}class Zp{static parse(t,r){const i=gr(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(It(r))return new r().fromASN(t);const o=rt.get(r);rt.cache(r);let s=o.schema;if(t.constructor===Ke&&o.type!==_.Choice){s=new Ke({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=Xt({},t,s);if(!a.verified)throw new il(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(rl(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const l=o.itemType;if(typeof l=="number"){const d=To(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const y=o.items[l],p=y.type;if(typeof p=="number"||It(p)){const B=(i=y.converter)!==null&&i!==void 0?i:It(p)?new p:null;if(!B)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const v=y.repeated==="sequence"?xt:At,h=new v;h.valueBlock=d.valueBlock;const g=gr(h.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const k=g.result.valueBlock.value;c[l]=Array.from(k,m=>B.fromASN(m))}else c[l]=Array.from(d,v=>B.fromASN(v));else{let v=d;if(y.implicit){let h;if(It(p))h=new p().toSchema("");else{const g=b[p],k=el[g];if(!k)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new k}h.valueBlock=v.valueBlock,v=gr(h.toBER(!1)).result}c[l]=B.fromASN(v)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");c[l]=Array.from(d,B=>this.fromASN(B,p))}else c[l]=this.fromASN(d,p)}return c}catch(o){throw o instanceof il&&o.schemas.push(r.name),o}}}class Vo{static serialize(t){return t instanceof Ve?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&It(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=rt.get(r);rt.cache(r);let o=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=To(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(c=>a.toASN(c))}else o=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&Jp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Vo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||It(c.type))){const y={};y.valueHex=d instanceof Jt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Yr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else o.push(new Ke({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new Ke({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case _.Sequence:s=new xt({value:o});break;case _.Set:s=new At({value:o});break;case _.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(t,r,i,o){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${b[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,d=>a.toASN(d)),l=t.repeated==="sequence"?xt:At;s=new l({value:c})}else s=a.toASN(o)}else if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(o,l=>this.toASN(l)),c=t.repeated==="sequence"?xt:At;s=new c({value:a})}else s=this.toASN(o);return s}}class ue extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class G{static serialize(t){return Vo.serialize(t)}static parse(t,r){return Zp.parse(t,r)}static toString(t){const r=M.isBufferSource(t)?M.toArrayBuffer(t):G.serialize(t),i=gr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(o<3?a(s):o>3?a(t,r,s):a(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var nl={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let k=0,m=-1,x=(h.match(l.zoneIndex)||[])[0],C,w;for(x&&(x=x.substring(1),h=h.replace(/%.+$/,""));(m=h.indexOf(":",m+1))>=0;)k++;if(h.substr(0,2)==="::"&&k--,h.substr(-2,2)==="::"&&k--,k>g)return null;for(w=g-k,C=":";w--;)C+="0:";return h=h.replace("::",C),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const O=h.split(":"),$=[];for(let re=0;re<O.length;re++)$.push(parseInt(O[re],16));return $}(),{parts:g,zoneId:x}}function y(h,g,k,m){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,C;for(;m>0;){if(C=k-m,C<0&&(C=0),h[x]>>C!==g[x]>>C)return!1;m-=k,x+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function B(h,g){for(;h.length<g;)h=`0${h}`;return h}const v={};v.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let k,m;for(k=0;k<g.length;k++)if(m=g[k],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(g,k){let m;if(k===void 0&&(m=g,g=m[0],k=m[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,k)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,k=!1;const m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let x,C,w;for(x=3;x>=0;x-=1)if(C=this.octets[x],C in m){if(w=m[C],k&&w!==0)return null;w!==8&&(k=!0),g+=w}else return null;return 32-g},h.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return v.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),v.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),k=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let C=0;for(;C<4;)x.push(parseInt(k[C],10)|parseInt(m[C],10)^255),C++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.isIPv4=function(h){return this.parser(h)!==null},v.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},v.IPv4.isValidFourPartDecimal=function(h){return!!(v.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},v.IPv4.networkAddressFromCIDR=function(h){let g,k,m,x,C;try{for(g=this.parseCIDR(h),m=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],k=0;k<4;)x.push(parseInt(m[k],10)&parseInt(C[k],10)),k++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.parse=function(h){const g=this.parser(h);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},v.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const k=parseInt(g[2]);if(k>=0&&k<=32){const m=[this.parse(g[1]),k];return Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},v.IPv4.parser=function(h){let g,k,m;if(g=h.match(i.fourOctet))return function(){const x=g.slice(1,6),C=[];for(let w=0;w<x.length;w++)k=x[w],C.push(p(k));return C}();if(g=h.match(i.longValue)){if(m=p(g[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){const x=[];let C;for(C=0;C<=24;C+=8)x.push(m>>C&255);return x}().reverse()}else return(g=h.match(i.twoOctet))?function(){const x=g.slice(1,4),C=[];if(m=p(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return C.push(p(x[0])),C.push(m>>16&255),C.push(m>>8&255),C.push(m&255),C}():(g=h.match(i.threeOctet))?function(){const x=g.slice(1,5),C=[];if(m=p(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return C.push(p(x[0])),C.push(p(x[1])),C.push(m>>8&255),C.push(m&255),C}():null},v.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let k=0;const m=Math.floor(h/8);for(;k<m;)g[k]=255,k++;return m<4&&(g[m]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},v.IPv6=function(){function h(g,k){let m,x;if(g.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(g[m]<<8|g[m+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");k&&(this.zoneId=k)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(g,k){let m;if(k===void 0&&(m=g,g=m[0],k=m[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,k)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,k=!1;const m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let x,C;for(let w=7;w>=0;w-=1)if(x=this.parts[w],x in m){if(C=m[x],k&&C!==0)return null;C!==16&&(k=!0),g+=C}else return null;return 128-g},h.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const k=[],m=this.parts;for(let x=0;x<m.length;x++)g=m[x],k.push(g>>8),k.push(g&255);return k},h.prototype.toFixedLengthString=function(){const g=(function(){const m=[];for(let x=0;x<this.parts.length;x++)m.push(B(this.parts[x].toString(16),4));return m}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),g+k},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),k=g[0],m=g[1];return new v.IPv4([k>>8,k&255,m>>8,m&255])},h.prototype.toNormalizedString=function(){const g=(function(){const m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),g+k},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,k=this.toNormalizedString();let m=0,x=-1,C;for(;C=g.exec(k);)C[0].length>x&&(m=C.index,x=C[0].length);return x<0?k:`${k.substring(0,m)}::${k.substring(m+x)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),v.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),k=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let C=0;for(;C<16;)x.push(parseInt(k[C],10)|parseInt(m[C],10)^255),C++;return new this(x)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},v.IPv6.isIPv6=function(h){return this.parser(h)!==null},v.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const g=this.parser(h);return new this(g.parts,g.zoneId),!0}catch{return!1}},v.IPv6.networkAddressFromCIDR=function(h){let g,k,m,x,C;try{for(g=this.parseCIDR(h),m=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],k=0;k<16;)x.push(parseInt(m[k],10)&parseInt(C[k],10)),k++;return new this(x)}catch(w){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${w})`)}},v.IPv6.parse=function(h){const g=this.parser(h);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},v.IPv6.parseCIDR=function(h){let g,k,m;if((k=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(k[2]),g>=0&&g<=128))return m=[this.parse(k[1]),g],Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},v.IPv6.parser=function(h){let g,k,m,x,C,w;if(m=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(h))return d(h,8);if((m=h.match(l.transitional))&&(w=m[6]||"",g=d(m[1].slice(0,-1)+w,6),g.parts)){for(C=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],k=0;k<C.length;k++)if(x=C[k],!(0<=x&&x<=255))return null;return g.parts.push(C[0]<<8|C[1]),g.parts.push(C[2]<<8|C[3]),{parts:g.parts,zoneId:g.zoneId}}return null},v.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let k=0;const m=Math.floor(h/8);for(;k<m;)g[k]=255,k++;return m<16&&(g[m]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},v.fromByteArray=function(h){const g=h.length;if(g===4)return new v.IPv4(h);if(g===16)return new v.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},v.isValid=function(h){return v.IPv6.isValid(h)||v.IPv4.isValid(h)},v.parse=function(h){if(v.IPv6.isValid(h))return v.IPv6.parse(h);if(v.IPv4.isValid(h))return v.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},v.parseCIDR=function(h){try{return v.IPv6.parseCIDR(h)}catch{try{return v.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},v.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},v.subnetMatch=function(h,g,k){let m,x,C,w;k==null&&(k="unicast");for(x in g)if(Object.prototype.hasOwnProperty.call(g,x)){for(C=g[x],C[0]&&!(C[0]instanceof Array)&&(C=[C]),m=0;m<C.length;m++)if(w=C[m],h.kind()===w[0].kind()&&h.match.apply(h,w))return x}return k},e.exports?e.exports=v:t.ipaddr=v})(yo)})(nl);var ol=nl.exports;class sl{static decodeIP(t){if(t.length===64&&parseInt(t,16)===0)return"::/0";if(t.length!==16)return t;const r=parseInt(t.slice(8),16).toString(2).split("").reduce((o,s)=>o+ +s,0);let i=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return ol.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=ol.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var jo,Do,Mo;let je=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:b.TeletexString})],je.prototype,"teletexString",void 0),u([f({type:b.PrintableString})],je.prototype,"printableString",void 0),u([f({type:b.UniversalString})],je.prototype,"universalString",void 0),u([f({type:b.Utf8String})],je.prototype,"utf8String",void 0),u([f({type:b.BmpString})],je.prototype,"bmpString",void 0),je=u([T({type:_.Choice})],je);let mr=class extends je{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:b.IA5String})],mr.prototype,"ia5String",void 0),u([f({type:b.Any})],mr.prototype,"anyValue",void 0),mr=u([T({type:_.Choice})],mr);class Xr{constructor(t={}){this.type="",this.value=new mr,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Xr.prototype,"type",void 0),u([f({type:mr})],Xr.prototype,"value",void 0);let br=jo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,jo.prototype)}};br=jo=u([T({type:_.Set,itemType:Xr})],br);let Po=Do=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};Po=Do=u([T({type:_.Sequence,itemType:br})],Po);let Ie=Mo=class extends Po{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};Ie=Mo=u([T({type:_.Sequence})],Ie);const Qp={fromASN:e=>sl.toString(en.fromASN(e)),toASN:e=>en.toASN(sl.fromString(e))};class ei{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ei.prototype,"typeId",void 0),u([f({type:b.Any,context:0})],ei.prototype,"value",void 0);class $o{constructor(t={}){this.partyName=new je,Object.assign(this,t)}}u([f({type:je,optional:!0,context:0,implicit:!0})],$o.prototype,"nameAssigner",void 0),u([f({type:je,context:1,implicit:!0})],$o.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ei,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type:b.IA5String,context:1,implicit:!0})],ie.prototype,"rfc822Name",void 0),u([f({type:b.IA5String,context:2,implicit:!0})],ie.prototype,"dNSName",void 0),u([f({type:b.Any,context:3,implicit:!0})],ie.prototype,"x400Address",void 0),u([f({type:Ie,context:4,implicit:!1})],ie.prototype,"directoryName",void 0),u([f({type:$o,context:5})],ie.prototype,"ediPartyName",void 0),u([f({type:b.IA5String,context:6,implicit:!0})],ie.prototype,"uniformResourceIdentifier",void 0),u([f({type:b.OctetString,context:7,implicit:!0,converter:Qp})],ie.prototype,"iPAddress",void 0),u([f({type:b.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([T({type:_.Choice})],ie);const wr="1.3.6.1.5.5.7.3",er="2.5.29";var Ro;class tn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],tn.prototype,"accessMethod",void 0),u([f({type:ie})],tn.prototype,"accessLocation",void 0);let al=Ro=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};al=Ro=u([T({type:_.Sequence,itemType:tn})],al);const Uo=`${er}.35`;class Lo extends ce{}class tr{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Lo,context:0,optional:!0,implicit:!0})],tr.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],tr.prototype,"authorityCertIssuer",void 0),u([f({type:b.Integer,context:2,optional:!0,implicit:!0,converter:we})],tr.prototype,"authorityCertSerialNumber",void 0);const cl=`${er}.19`;class rn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:b.Boolean,defaultValue:!1})],rn.prototype,"cA",void 0),u([f({type:b.Integer,optional:!0})],rn.prototype,"pathLenConstraint",void 0);var Ho;let He=Ho=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};He=Ho=u([T({type:_.Sequence,itemType:ie})],He);var Fo;let ll=Fo=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};ll=Fo=u([T({type:_.Sequence})],ll);var qo;const ul=`${er}.32`;let Et=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:b.IA5String})],Et.prototype,"ia5String",void 0),u([f({type:b.VisibleString})],Et.prototype,"visibleString",void 0),u([f({type:b.BmpString})],Et.prototype,"bmpString",void 0),u([f({type:b.Utf8String})],Et.prototype,"utf8String",void 0),Et=u([T({type:_.Choice})],Et);class Ko{constructor(t={}){this.organization=new Et,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:Et})],Ko.prototype,"organization",void 0),u([f({type:b.Integer,repeated:"sequence"})],Ko.prototype,"noticeNumbers",void 0);class zo{constructor(t={}){Object.assign(this,t)}}u([f({type:Ko,optional:!0})],zo.prototype,"noticeRef",void 0),u([f({type:Et,optional:!0})],zo.prototype,"explicitText",void 0);let nn=class{constructor(t={}){Object.assign(this,t)}};u([f({type:b.IA5String})],nn.prototype,"cPSuri",void 0),u([f({type:zo})],nn.prototype,"userNotice",void 0),nn=u([T({type:_.Choice})],nn);class Go{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Go.prototype,"policyQualifierId",void 0),u([f({type:b.Any})],Go.prototype,"qualifier",void 0);class on{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],on.prototype,"policyIdentifier",void 0),u([f({type:Go,repeated:"sequence",optional:!0})],on.prototype,"policyQualifiers",void 0);let sn=qo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};sn=qo=u([T({type:_.Sequence,itemType:on})],sn);let an=class{constructor(t=0){this.value=t}};u([f({type:b.Integer})],an.prototype,"value",void 0),an=u([T({type:_.Choice})],an);let dl=class extends an{};dl=u([T({type:_.Choice})],dl);var Wo,at;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(at||(at={}));class fl extends Xi{toJSON(){const t=[],r=this.toNumber();return r&at.aACompromise&&t.push("aACompromise"),r&at.affiliationChanged&&t.push("affiliationChanged"),r&at.cACompromise&&t.push("cACompromise"),r&at.certificateHold&&t.push("certificateHold"),r&at.cessationOfOperation&&t.push("cessationOfOperation"),r&at.keyCompromise&&t.push("keyCompromise"),r&at.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&at.superseded&&t.push("superseded"),r&at.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let vr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],vr.prototype,"fullName",void 0),u([f({type:br,context:1,implicit:!0})],vr.prototype,"nameRelativeToCRLIssuer",void 0),vr=u([T({type:_.Choice})],vr);class ti{constructor(t={}){Object.assign(this,t)}}u([f({type:vr,context:0,optional:!0})],ti.prototype,"distributionPoint",void 0),u([f({type:fl,context:1,optional:!0,implicit:!0})],ti.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ti.prototype,"cRLIssuer",void 0);let Jo=Wo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};Jo=Wo=u([T({type:_.Sequence,itemType:ti})],Jo);var Yo;let pl=Yo=class extends Jo{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};pl=Yo=u([T({type:_.Sequence,itemType:ti})],pl);class Re{constructor(t={}){this.onlyContainsUserCerts=Re.ONLY,this.onlyContainsCACerts=Re.ONLY,this.indirectCRL=Re.ONLY,this.onlyContainsAttributeCerts=Re.ONLY,Object.assign(this,t)}}Re.ONLY=!1,u([f({type:vr,context:0,optional:!0})],Re.prototype,"distributionPoint",void 0),u([f({type:b.Boolean,context:1,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsUserCerts",void 0),u([f({type:b.Boolean,context:2,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsCACerts",void 0),u([f({type:fl,context:3,optional:!0,implicit:!0})],Re.prototype,"onlySomeReasons",void 0),u([f({type:b.Boolean,context:4,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"indirectCRL",void 0),u([f({type:b.Boolean,context:5,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsAttributeCerts",void 0);var ri;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ri||(ri={}));let Zo=class{constructor(t=ri.unspecified){this.reason=ri.unspecified,this.reason=t}toJSON(){return ri[this.reason]}toString(){return this.toJSON()}};u([f({type:b.Enumerated})],Zo.prototype,"reason",void 0),Zo=u([T({type:_.Choice})],Zo);var Qo;const hl=`${er}.37`;let cn=Qo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};cn=Qo=u([T({type:_.Sequence,itemType:b.ObjectIdentifier})],cn);const Xp=`${wr}.1`,eh=`${wr}.2`,th=`${wr}.3`,rh=`${wr}.4`,ih=`${wr}.8`,nh=`${wr}.9`;let Xo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:b.Integer,converter:we})],Xo.prototype,"value",void 0),Xo=u([T({type:_.Choice})],Xo);let es=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:b.GeneralizedTime})],es.prototype,"value",void 0),es=u([T({type:_.Choice})],es);var ts;let yl=ts=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};yl=ts=u([T({type:_.Sequence})],yl);const gl=`${er}.15`;var ct;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(ct||(ct={}));class rs extends Xi{toJSON(){const t=this.toNumber(),r=[];return t&ct.cRLSign&&r.push("crlSign"),t&ct.dataEncipherment&&r.push("dataEncipherment"),t&ct.decipherOnly&&r.push("decipherOnly"),t&ct.digitalSignature&&r.push("digitalSignature"),t&ct.encipherOnly&&r.push("encipherOnly"),t&ct.keyAgreement&&r.push("keyAgreement"),t&ct.keyCertSign&&r.push("keyCertSign"),t&ct.keyEncipherment&&r.push("keyEncipherment"),t&ct.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var is;class ln{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],ln.prototype,"base",void 0),u([f({type:b.Integer,context:0,defaultValue:0,implicit:!0})],ln.prototype,"minimum",void 0),u([f({type:b.Integer,context:1,optional:!0,implicit:!0})],ln.prototype,"maximum",void 0);let un=is=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};un=is=u([T({type:_.Sequence,itemType:ln})],un);class ml{constructor(t={}){Object.assign(this,t)}}u([f({type:un,context:0,optional:!0,implicit:!0})],ml.prototype,"permittedSubtrees",void 0),u([f({type:un,context:1,optional:!0,implicit:!0})],ml.prototype,"excludedSubtrees",void 0);class bl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.Integer,context:0,implicit:!0,optional:!0,converter:we})],bl.prototype,"requireExplicitPolicy",void 0),u([f({type:b.Integer,context:1,implicit:!0,optional:!0,converter:we})],bl.prototype,"inhibitPolicyMapping",void 0);var ns;class os{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],os.prototype,"issuerDomainPolicy",void 0),u([f({type:b.ObjectIdentifier})],os.prototype,"subjectDomainPolicy",void 0);let wl=ns=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};wl=ns=u([T({type:_.Sequence,itemType:os})],wl);var ss;const vl=`${er}.17`;let as=ss=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};as=ss=u([T({type:_.Sequence})],as);let Nt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],Nt.prototype,"type",void 0),u([f({type:b.Any,repeated:"set"})],Nt.prototype,"values",void 0);var cs;let kl=cs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};kl=cs=u([T({type:_.Sequence,itemType:Nt})],kl);const Cl=`${er}.14`;class $t extends Lo{}class Sl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.GeneralizedTime,context:0,implicit:!0,optional:!0})],Sl.prototype,"notBefore",void 0),u([f({type:b.GeneralizedTime,context:1,implicit:!0,optional:!0})],Sl.prototype,"notAfter",void 0);var ii;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ii||(ii={}));class xl extends Xi{toJSON(){const t=[],r=this.toNumber();return r&ii.pKIXCertificate&&t.push("pKIXCertificate"),r&ii.newExtensions&&t.push("newExtensions"),r&ii.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Al{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new xl,Object.assign(this,t)}}u([f({type:b.GeneralString})],Al.prototype,"entrustVers",void 0),u([f({type:xl})],Al.prototype,"entrustInfoFlags",void 0);var ls;let Bl=ls=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};Bl=ls=u([T({type:_.Sequence,itemType:tn})],Bl);class K{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof K&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&Xa(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:b.ObjectIdentifier})],K.prototype,"algorithm",void 0),u([f({type:b.Any,optional:!0})],K.prototype,"parameters",void 0);class Ot{constructor(t={}){this.algorithm=new K,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:K})],Ot.prototype,"algorithm",void 0),u([f({type:b.BitString})],Ot.prototype,"subjectPublicKey",void 0);let De=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:b.UTCTime})],De.prototype,"utcTime",void 0),u([f({type:b.GeneralizedTime})],De.prototype,"generalTime",void 0),De=u([T({type:_.Choice})],De);class dn{constructor(t){this.notBefore=new De(new Date),this.notAfter=new De(new Date),t&&(this.notBefore=new De(t.notBefore),this.notAfter=new De(t.notAfter))}}u([f({type:De})],dn.prototype,"notBefore",void 0),u([f({type:De})],dn.prototype,"notAfter",void 0);var us;let lt=class np{constructor(t={}){this.extnID="",this.critical=np.CRITICAL,this.extnValue=new ce,Object.assign(this,t)}};lt.CRITICAL=!1,u([f({type:b.ObjectIdentifier})],lt.prototype,"extnID",void 0),u([f({type:b.Boolean,defaultValue:lt.CRITICAL})],lt.prototype,"critical",void 0),u([f({type:ce})],lt.prototype,"extnValue",void 0);let rr=us=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};rr=us=u([T({type:_.Sequence,itemType:lt})],rr);var kr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(kr||(kr={}));class it{constructor(t={}){this.version=kr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new K,this.issuer=new Ie,this.validity=new dn,this.subject=new Ie,this.subjectPublicKeyInfo=new Ot,Object.assign(this,t)}}u([f({type:b.Integer,context:0,defaultValue:kr.v1})],it.prototype,"version",void 0),u([f({type:b.Integer,converter:we})],it.prototype,"serialNumber",void 0),u([f({type:K})],it.prototype,"signature",void 0),u([f({type:Ie})],it.prototype,"issuer",void 0),u([f({type:dn})],it.prototype,"validity",void 0),u([f({type:Ie})],it.prototype,"subject",void 0),u([f({type:Ot})],it.prototype,"subjectPublicKeyInfo",void 0),u([f({type:b.BitString,context:1,implicit:!0,optional:!0})],it.prototype,"issuerUniqueID",void 0),u([f({type:b.BitString,context:2,implicit:!0,optional:!0})],it.prototype,"subjectUniqueID",void 0),u([f({type:rr,context:3,optional:!0})],it.prototype,"extensions",void 0);class Cr{constructor(t={}){this.tbsCertificate=new it,this.signatureAlgorithm=new K,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:it})],Cr.prototype,"tbsCertificate",void 0),u([f({type:K})],Cr.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],Cr.prototype,"signatureValue",void 0);class fn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new De,Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],fn.prototype,"userCertificate",void 0),u([f({type:De})],fn.prototype,"revocationDate",void 0),u([f({type:lt,optional:!0,repeated:"sequence"})],fn.prototype,"crlEntryExtensions",void 0);class _t{constructor(t={}){this.signature=new K,this.issuer=new Ie,this.thisUpdate=new De,Object.assign(this,t)}}u([f({type:b.Integer,optional:!0})],_t.prototype,"version",void 0),u([f({type:K})],_t.prototype,"signature",void 0),u([f({type:Ie})],_t.prototype,"issuer",void 0),u([f({type:De})],_t.prototype,"thisUpdate",void 0),u([f({type:De,optional:!0})],_t.prototype,"nextUpdate",void 0),u([f({type:fn,repeated:"sequence",optional:!0})],_t.prototype,"revokedCertificates",void 0),u([f({type:lt,optional:!0,context:0,repeated:"sequence"})],_t.prototype,"crlExtensions",void 0);let ds=class{constructor(t={}){this.tbsCertList=new _t,this.signatureAlgorithm=new K,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:_t})],ds.prototype,"tbsCertList",void 0),u([f({type:K})],ds.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],ds.prototype,"signature",void 0);class Sr{constructor(t={}){this.issuer=new Ie,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Ie})],Sr.prototype,"issuer",void 0),u([f({type:b.Integer,converter:we})],Sr.prototype,"serialNumber",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0})],xr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],xr.prototype,"issuerAndSerialNumber",void 0),xr=u([T({type:_.Choice})],xr);var Tt;(function(e){e[e.v0=0]="v0",e[e.v1=1]="v1",e[e.v2=2]="v2",e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v5=5]="v5"})(Tt||(Tt={}));let ni=class extends K{};ni=u([T({type:_.Sequence})],ni);let pn=class extends K{};pn=u([T({type:_.Sequence})],pn);let gt=class extends K{};gt=u([T({type:_.Sequence})],gt);let hn=class extends K{};hn=u([T({type:_.Sequence})],hn);let Il=class extends K{};Il=u([T({type:_.Sequence})],Il);let fs=class extends K{};fs=u([T({type:_.Sequence})],fs);let Ar=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],Ar.prototype,"attrType",void 0),u([f({type:b.Any,repeated:"set"})],Ar.prototype,"attrValues",void 0);var ps;class mt{constructor(t={}){this.version=Tt.v0,this.sid=new xr,this.digestAlgorithm=new ni,this.signatureAlgorithm=new pn,this.signature=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],mt.prototype,"version",void 0),u([f({type:xr})],mt.prototype,"sid",void 0),u([f({type:ni})],mt.prototype,"digestAlgorithm",void 0),u([f({type:Ar,repeated:"set",context:0,implicit:!0,optional:!0})],mt.prototype,"signedAttrs",void 0),u([f({type:pn})],mt.prototype,"signatureAlgorithm",void 0),u([f({type:ce})],mt.prototype,"signature",void 0),u([f({type:Ar,repeated:"set",context:1,implicit:!0,optional:!0})],mt.prototype,"unsignedAttrs",void 0);let yn=ps=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};yn=ps=u([T({type:_.Set,itemType:mt})],yn);let El=class extends De{};El=u([T({type:_.Choice})],El);let Nl=class extends mt{};Nl=u([T({type:_.Sequence})],Nl);class hs{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],hs.prototype,"acIssuer",void 0),u([f({type:b.Integer})],hs.prototype,"acSerial",void 0),u([f({type:Nt,repeated:"sequence"})],hs.prototype,"attrs",void 0);var ys;let gn=ys=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};gn=ys=u([T({type:_.Sequence,itemType:b.ObjectIdentifier})],gn);class mn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:b.Integer,optional:!0})],mn.prototype,"pathLenConstraint",void 0),u([f({type:gn,implicit:!0,context:0,optional:!0})],mn.prototype,"permittedAttrs",void 0),u([f({type:gn,implicit:!0,context:1,optional:!0})],mn.prototype,"excludedAttrs",void 0),u([f({type:b.Boolean,defaultValue:!0})],mn.prototype,"permitUnSpecified",void 0);class ir{constructor(t={}){this.issuer=new He,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:He})],ir.prototype,"issuer",void 0),u([f({type:b.Integer,converter:we})],ir.prototype,"serial",void 0),u([f({type:b.BitString,optional:!0})],ir.prototype,"issuerUID",void 0);var gs;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(gs||(gs={}));class nr{constructor(t={}){this.digestedObjectType=gs.publicKey,this.digestAlgorithm=new K,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Enumerated})],nr.prototype,"digestedObjectType",void 0),u([f({type:b.ObjectIdentifier,optional:!0})],nr.prototype,"otherObjectTypeID",void 0),u([f({type:K})],nr.prototype,"digestAlgorithm",void 0),u([f({type:b.BitString})],nr.prototype,"objectDigest",void 0);class bn{constructor(t={}){Object.assign(this,t)}}u([f({type:He,optional:!0})],bn.prototype,"issuerName",void 0),u([f({type:ir,context:0,implicit:!0,optional:!0})],bn.prototype,"baseCertificateID",void 0),u([f({type:nr,context:1,implicit:!0,optional:!0})],bn.prototype,"objectDigestInfo",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],Br.prototype,"v1Form",void 0),u([f({type:bn,context:0,implicit:!0})],Br.prototype,"v2Form",void 0),Br=u([T({type:_.Choice})],Br);class wn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:b.GeneralizedTime})],wn.prototype,"notBeforeTime",void 0),u([f({type:b.GeneralizedTime})],wn.prototype,"notAfterTime",void 0);class oi{constructor(t={}){Object.assign(this,t)}}u([f({type:ir,implicit:!0,context:0,optional:!0})],oi.prototype,"baseCertificateID",void 0),u([f({type:He,implicit:!0,context:1,optional:!0})],oi.prototype,"entityName",void 0),u([f({type:nr,implicit:!0,context:2,optional:!0})],oi.prototype,"objectDigestInfo",void 0);var ms;(function(e){e[e.v2=1]="v2"})(ms||(ms={}));class ut{constructor(t={}){this.version=ms.v2,this.holder=new oi,this.issuer=new Br,this.signature=new K,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new wn,this.attributes=[],Object.assign(this,t)}}u([f({type:b.Integer})],ut.prototype,"version",void 0),u([f({type:oi})],ut.prototype,"holder",void 0),u([f({type:Br})],ut.prototype,"issuer",void 0),u([f({type:K})],ut.prototype,"signature",void 0),u([f({type:b.Integer,converter:we})],ut.prototype,"serialNumber",void 0),u([f({type:wn})],ut.prototype,"attrCertValidityPeriod",void 0),u([f({type:Nt,repeated:"sequence"})],ut.prototype,"attributes",void 0),u([f({type:b.BitString,optional:!0})],ut.prototype,"issuerUniqueID",void 0),u([f({type:rr,optional:!0})],ut.prototype,"extensions",void 0);class vn{constructor(t={}){this.acinfo=new ut,this.signatureAlgorithm=new K,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ut})],vn.prototype,"acinfo",void 0),u([f({type:K})],vn.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],vn.prototype,"signatureValue",void 0);var kn;(function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"})(kn||(kn={}));class bs extends Xi{}class ws{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier,implicit:!0,context:0})],ws.prototype,"type",void 0),u([f({type:b.Any,implicit:!0,context:1})],ws.prototype,"value",void 0);class vs{constructor(t={}){this.policyId="",this.classList=new bs(kn.unclassified),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],vs.prototype,"policyId",void 0),u([f({type:bs,defaultValue:new bs(kn.unclassified)})],vs.prototype,"classList",void 0),u([f({type:ws,repeated:"set"})],vs.prototype,"securityCategories",void 0);class Cn{constructor(t={}){Object.assign(this,t)}}u([f({type:ce})],Cn.prototype,"cotets",void 0),u([f({type:b.ObjectIdentifier})],Cn.prototype,"oid",void 0),u([f({type:b.Utf8String})],Cn.prototype,"string",void 0);class Ol{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Ol.prototype,"policyAuthority",void 0),u([f({type:Cn,repeated:"sequence"})],Ol.prototype,"values",void 0);var ks;class Sn{constructor(t={}){this.targetCertificate=new ir,Object.assign(this,t)}}u([f({type:ir})],Sn.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],Sn.prototype,"targetName",void 0),u([f({type:nr,optional:!0})],Sn.prototype,"certDigestInfo",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],Ir.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],Ir.prototype,"targetGroup",void 0),u([f({type:Sn,context:2,implicit:!0})],Ir.prototype,"targetCert",void 0),Ir=u([T({type:_.Choice})],Ir);let Cs=ks=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};Cs=ks=u([T({type:_.Sequence,itemType:Ir})],Cs);var Ss;let _l=Ss=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};_l=Ss=u([T({type:_.Sequence,itemType:Cs})],_l);class Tl{constructor(t={}){Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Tl.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Tl.prototype,"roleName",void 0);class xs{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],xs.prototype,"service",void 0),u([f({type:ie})],xs.prototype,"ident",void 0),u([f({type:ce,optional:!0})],xs.prototype,"authInfo",void 0);var As;class Bs{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Bs.prototype,"otherCertFormat",void 0),u([f({type:b.Any})],Bs.prototype,"otherCert",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Cr})],Er.prototype,"certificate",void 0),u([f({type:vn,context:2,implicit:!0})],Er.prototype,"v2AttrCert",void 0),u([f({type:Bs,context:3,implicit:!0})],Er.prototype,"other",void 0),Er=u([T({type:_.Choice})],Er);let xn=As=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};xn=As=u([T({type:_.Set,itemType:Er})],xn);class Nr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Nr.prototype,"contentType",void 0),u([f({type:b.Any,context:0})],Nr.prototype,"content",void 0);let si=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ce})],si.prototype,"single",void 0),u([f({type:b.Any})],si.prototype,"any",void 0),si=u([T({type:_.Choice})],si);class An{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],An.prototype,"eContentType",void 0),u([f({type:si,context:0,optional:!0})],An.prototype,"eContent",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ce,context:0,implicit:!0,optional:!0})],ai.prototype,"value",void 0),u([f({type:ce,converter:jp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ai.prototype,"constructedValue",void 0),ai=u([T({type:_.Choice})],ai);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new hn,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:hn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ai,optional:!0})],ci.prototype,"encryptedContent",void 0);class Bn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Bn.prototype,"keyAttrId",void 0),u([f({type:b.Any,optional:!0})],Bn.prototype,"keyAttr",void 0);var Is;class In{constructor(t={}){this.subjectKeyIdentifier=new $t,Object.assign(this,t)}}u([f({type:$t})],In.prototype,"subjectKeyIdentifier",void 0),u([f({type:b.GeneralizedTime,optional:!0})],In.prototype,"date",void 0),u([f({type:Bn,optional:!0})],In.prototype,"other",void 0);let Or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:In,context:0,implicit:!0,optional:!0})],Or.prototype,"rKeyId",void 0),u([f({type:Sr,optional:!0})],Or.prototype,"issuerAndSerialNumber",void 0),Or=u([T({type:_.Choice})],Or);class Es{constructor(t={}){this.rid=new Or,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:Or})],Es.prototype,"rid",void 0),u([f({type:ce})],Es.prototype,"encryptedKey",void 0);let En=Is=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};En=Is=u([T({type:_.Sequence,itemType:Es})],En);class Ns{constructor(t={}){this.algorithm=new K,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:K})],Ns.prototype,"algorithm",void 0),u([f({type:b.BitString})],Ns.prototype,"publicKey",void 0);let or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0,optional:!0})],or.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ns,context:1,implicit:!0,optional:!0})],or.prototype,"originatorKey",void 0),u([f({type:Sr,optional:!0})],or.prototype,"issuerAndSerialNumber",void 0),or=u([T({type:_.Choice})],or);class _r{constructor(t={}){this.version=Tt.v3,this.originator=new or,this.keyEncryptionAlgorithm=new gt,this.recipientEncryptedKeys=new En,Object.assign(this,t)}}u([f({type:b.Integer})],_r.prototype,"version",void 0),u([f({type:or,context:0})],_r.prototype,"originator",void 0),u([f({type:ce,context:1,optional:!0})],_r.prototype,"ukm",void 0),u([f({type:gt})],_r.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:En})],_r.prototype,"recipientEncryptedKeys",void 0);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0})],Tr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],Tr.prototype,"issuerAndSerialNumber",void 0),Tr=u([T({type:_.Choice})],Tr);class li{constructor(t={}){this.version=Tt.v0,this.rid=new Tr,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],li.prototype,"version",void 0),u([f({type:Tr})],li.prototype,"rid",void 0),u([f({type:gt})],li.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],li.prototype,"encryptedKey",void 0);class ui{constructor(t={}){this.keyIdentifier=new ce,Object.assign(this,t)}}u([f({type:ce})],ui.prototype,"keyIdentifier",void 0),u([f({type:b.GeneralizedTime,optional:!0})],ui.prototype,"date",void 0),u([f({type:Bn,optional:!0})],ui.prototype,"other",void 0);class di{constructor(t={}){this.version=Tt.v4,this.kekid=new ui,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],di.prototype,"version",void 0),u([f({type:ui})],di.prototype,"kekid",void 0),u([f({type:gt})],di.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],di.prototype,"encryptedKey",void 0);class fi{constructor(t={}){this.version=Tt.v0,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],fi.prototype,"version",void 0),u([f({type:fs,context:0,optional:!0})],fi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:gt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],fi.prototype,"encryptedKey",void 0);class Os{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Os.prototype,"oriType",void 0),u([f({type:b.Any})],Os.prototype,"oriValue",void 0);let Rt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:li,optional:!0})],Rt.prototype,"ktri",void 0),u([f({type:_r,context:1,implicit:!0,optional:!0})],Rt.prototype,"kari",void 0),u([f({type:di,context:2,implicit:!0,optional:!0})],Rt.prototype,"kekri",void 0),u([f({type:fi,context:3,implicit:!0,optional:!0})],Rt.prototype,"pwri",void 0),u([f({type:Os,context:4,implicit:!0,optional:!0})],Rt.prototype,"ori",void 0),Rt=u([T({type:_.Choice})],Rt);var _s;let Nn=_s=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};Nn=_s=u([T({type:_.Set,itemType:Rt})],Nn);var Ts;class On{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],On.prototype,"otherRevInfoFormat",void 0),u([f({type:b.Any})],On.prototype,"otherRevInfo",void 0);let pi=class{constructor(t={}){this.other=new On,Object.assign(this,t)}};u([f({type:On,context:1,implicit:!0})],pi.prototype,"other",void 0),pi=u([T({type:_.Choice})],pi);let Vs=Ts=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Vs=Ts=u([T({type:_.Set,itemType:pi})],Vs);class js{constructor(t={}){Object.assign(this,t)}}u([f({type:xn,context:0,implicit:!0,optional:!0})],js.prototype,"certs",void 0),u([f({type:Vs,context:1,implicit:!0,optional:!0})],js.prototype,"crls",void 0);var Ds;let Ms=Ds=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ds.prototype)}};Ms=Ds=u([T({type:_.Set,itemType:Ar})],Ms);class hi{constructor(t={}){this.version=Tt.v0,this.recipientInfos=new Nn,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:b.Integer})],hi.prototype,"version",void 0),u([f({type:js,context:0,implicit:!0,optional:!0})],hi.prototype,"originatorInfo",void 0),u([f({type:Nn})],hi.prototype,"recipientInfos",void 0),u([f({type:ci})],hi.prototype,"encryptedContentInfo",void 0),u([f({type:Ms,context:1,implicit:!0,optional:!0})],hi.prototype,"unprotectedAttrs",void 0);const oh="1.2.840.113549.1.7.2";var Ps;let _n=Ps=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};_n=Ps=u([T({type:_.Set,itemType:ni})],_n);class Vr{constructor(t={}){this.version=Tt.v0,this.digestAlgorithms=new _n,this.encapContentInfo=new An,this.signerInfos=new yn,Object.assign(this,t)}}u([f({type:b.Integer})],Vr.prototype,"version",void 0),u([f({type:_n})],Vr.prototype,"digestAlgorithms",void 0),u([f({type:An})],Vr.prototype,"encapContentInfo",void 0),u([f({type:xn,context:0,implicit:!0,optional:!0})],Vr.prototype,"certificates",void 0),u([f({type:pi,context:1,implicit:!0,optional:!0})],Vr.prototype,"crls",void 0),u([f({type:yn})],Vr.prototype,"signerInfos",void 0);const yi="1.2.840.10045.2.1",$s="1.2.840.10045.4.1",Vl="1.2.840.10045.4.3.1",Rs="1.2.840.10045.4.3.2",Us="1.2.840.10045.4.3.3",Ls="1.2.840.10045.4.3.4",jl="1.2.840.10045.3.1.7",Dl="1.3.132.0.34",Ml="1.3.132.0.35";function gi(e){return new K({algorithm:e})}const sh=gi($s);gi(Vl);const ah=gi(Rs),ch=gi(Us),lh=gi(Ls);let jr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],jr.prototype,"namedCurve",void 0),jr=u([T({type:_.Choice})],jr);class Tn{constructor(t={}){this.version=1,this.privateKey=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],Tn.prototype,"version",void 0),u([f({type:ce})],Tn.prototype,"privateKey",void 0),u([f({type:jr,context:0,optional:!0})],Tn.prototype,"parameters",void 0),u([f({type:b.BitString,context:1,optional:!0})],Tn.prototype,"publicKey",void 0);class Vn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],Vn.prototype,"r",void 0),u([f({type:b.Integer,converter:we})],Vn.prototype,"s",void 0);const ze="1.2.840.113549.1.1",Dr=`${ze}.1`,uh=`${ze}.7`,dh=`${ze}.9`,fh=`${ze}.10`,ph=`${ze}.2`,hh=`${ze}.4`,jn=`${ze}.5`,yh=`${ze}.14`,Hs=`${ze}.11`,Dn=`${ze}.12`,Mn=`${ze}.13`,Pl=`${ze}.15`,$l=`${ze}.16`,Rl="1.3.14.3.2.26",Ul="2.16.840.1.101.3.4.2.4",Ll="2.16.840.1.101.3.4.2.1",Hl="2.16.840.1.101.3.4.2.2",Fl="2.16.840.1.101.3.4.2.3",gh="2.16.840.1.101.3.4.2.5",mh="2.16.840.1.101.3.4.2.6",bh="1.2.840.113549.2.2",wh="1.2.840.113549.2.5",Fs=`${ze}.8`;function Ee(e){return new K({algorithm:e,parameters:null})}Ee(bh),Ee(wh);const sr=Ee(Rl);Ee(Ul),Ee(Ll),Ee(Hl),Ee(Fl),Ee(gh),Ee(mh);const ql=new K({algorithm:Fs,parameters:G.serialize(sr)}),Kl=new K({algorithm:dh,parameters:G.serialize(en.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ee(Dr),Ee(ph),Ee(hh),Ee(jn),Ee(Pl),Ee($l),Ee(Dn),Ee(Mn),Ee(Pl),Ee($l);class Pn{constructor(t={}){this.hashAlgorithm=new K(sr),this.maskGenAlgorithm=new K({algorithm:Fs,parameters:G.serialize(sr)}),this.pSourceAlgorithm=new K(Kl),Object.assign(this,t)}}u([f({type:K,context:0,defaultValue:sr})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:K,context:1,defaultValue:ql})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:K,context:2,defaultValue:Kl})],Pn.prototype,"pSourceAlgorithm",void 0),new K({algorithm:uh,parameters:G.serialize(new Pn)});class mi{constructor(t={}){this.hashAlgorithm=new K(sr),this.maskGenAlgorithm=new K({algorithm:Fs,parameters:G.serialize(sr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:K,context:0,defaultValue:sr})],mi.prototype,"hashAlgorithm",void 0),u([f({type:K,context:1,defaultValue:ql})],mi.prototype,"maskGenAlgorithm",void 0),u([f({type:b.Integer,context:2,defaultValue:20})],mi.prototype,"saltLength",void 0),u([f({type:b.Integer,context:3,defaultValue:1})],mi.prototype,"trailerField",void 0),new K({algorithm:fh,parameters:G.serialize(new mi)});class $n{constructor(t={}){this.digestAlgorithm=new K,this.digest=new ce,Object.assign(this,t)}}u([f({type:K})],$n.prototype,"digestAlgorithm",void 0),u([f({type:ce})],$n.prototype,"digest",void 0);var qs;class Rn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],Rn.prototype,"prime",void 0),u([f({type:b.Integer,converter:we})],Rn.prototype,"exponent",void 0),u([f({type:b.Integer,converter:we})],Rn.prototype,"coefficient",void 0);let Ks=qs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([T({type:_.Sequence,itemType:Rn})],Ks);class bt{constructor(t={}){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,t)}}u([f({type:b.Integer})],bt.prototype,"version",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"modulus",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"publicExponent",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"privateExponent",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"prime1",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"prime2",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"exponent1",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"exponent2",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"coefficient",void 0),u([f({type:Ks,optional:!0})],bt.prototype,"otherPrimeInfos",void 0);class zs{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],zs.prototype,"modulus",void 0),u([f({type:b.Integer,converter:we})],zs.prototype,"publicExponent",void 0);var Gs;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Gs||(Gs={}));const Ge=Gs;/*! *****************************************************************************
75
+ `)}`:`${r} :`}}uc=Ke,U.Constructed=uc,Ke.NAME="CONSTRUCTED";class dc extends Le{fromBER(t,r,i){return r}toBER(t){return st}}dc.override="EndOfContentValueBlock";var fc;class ko extends Ve{constructor(t={}){super(t,dc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}fc=ko,U.EndOfContent=fc,ko.NAME=Jr;var pc;class Jt extends Ve{constructor(t={}){super(t,Le),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,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,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}pc=Jt,U.Null=pc,Jt.NAME="NULL";class hc extends ht(Le){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=M.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,i){const o=M.toUint8Array(t);return St(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ec.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}hc.NAME="BooleanValueBlock";var yc;let $i=class extends Ve{constructor(t={}){super(t,hc),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};yc=$i,U.Boolean=yc,$i.NAME="BOOLEAN";class mc extends ht(Pt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=Pt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==ic)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,i),this.blockLength=i;return o}toBER(t,r){return this.isConstructed?Pt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}mc.NAME="OctetStringValueBlock";var gc;let Yt=class ip extends Ve{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},mc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,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),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=yr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Ke.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof ip&&t.push(r.valueBlock.valueHexView);return M.concat(t)}};gc=Yt,U.OctetString=gc,Yt.NAME=ic;class bc extends ht(Pt){constructor({unusedBits:t=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,i){if(!i)return r;let o=-1;if(this.isConstructed){if(o=Pt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const c of this.value){const l=c.constructor.NAME;if(l===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==nc)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.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 o}const s=M.toUint8Array(t);if(!St(this,s,r,i))return-1;const a=s.subarray(r,r+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 c=a.subarray(1);try{if(c.byteLength){const l=yr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return Pt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return st;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}}}bc.NAME="BitStringValueBlock";var wc;let Zt=class extends Ve{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ke.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};wc=Zt,U.BitString=wc,Zt.NAME=nc;var vc;function xp(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),o=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=o.slice(0),l=c.length-1;let d=0;const y=l<a?a:l;let p=0;for(let B=y;B>=0;B--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=go(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=go(r,s)),s}function kc(e){if(e>=Wr.length)for(let t=Wr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Wr[t-1].slice(0);for(let o=i.length-1;o>=0;o--){const s=new Uint8Array([(i[o]<<1)+r[0]]);r[0]=s[0]/10,i[o]=s[0]%10}r[0]>0&&(i=go(r,i)),Wr.push(i)}return Wr[e]}function Ap(e,t){let r=0;const i=new Uint8Array(e),o=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=o.slice(0),l=c.length-1;let d,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class Co extends ht(Le){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}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=ec.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(fp(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,o=0){const s=this.fromBER(t,r,i);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):o!==0&&a.length<o&&(o-a.length>1&&(o=a.length+1),this.valueHexView=a.subarray(o-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,i){const o=super.fromBER(t,r,i);return o===-1||this.setValueHex(),o}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),i=0,o;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){o=s[l];for(let d=0;d<8;d++){if((o&1)===1)switch(i){case t:r=Ap(kc(i),r),a="-";break;default:r=xp(r,kc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=tc.charAt(r[l]));return c===!1&&(a+=tc.charAt(0)),a}}vc=Co,Co.NAME="IntegerValueBlock",Object.defineProperty(vc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Cc;class yt extends Ve{constructor(t={}){super(t,Co),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Di(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Di();const r=BigInt(t),i=new Mi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${L.ToHex(c)}`)+r,y=M.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new yt({valueHex:i.final()})}convertToDER(){const t=new yt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new yt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Cc=yt,U.Integer=Cc,yt.NAME="INTEGER";var Sc;class Ri extends yt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Sc=Ri,U.Enumerated=Sc,Ri.NAME="ENUMERATED";class So extends ht(Le){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];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=hr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Di();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let o=0;o<i.length;o++)i[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Gt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",st;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i}toString(){let t="";if(this.isHexOnly)t=L.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}So.NAME="sidBlock";class xc extends Le{constructor({value:t=qe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new So;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(t);if(o.byteLength===0)return this.error=this.value[i].error,st;r.push(o)}return bo(r)}fromString(t){this.value=[];let r=0,i=0,o="",s=!1;do if(i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(o,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new So;if(o>Number.MAX_SAFE_INTEGER){Di();const c=BigInt(o);a.valueBigInt=c}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[i].isFirstSid?t=`2.{${o} - 80}`:t+=o):t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}xc.NAME="ObjectIdentifierValueBlock";var Ac;class Ui extends Ve{constructor(t={}){super(t,xc),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ac=Ui,U.ObjectIdentifier=Ac,Ui.NAME="OBJECT IDENTIFIER";class xo extends ht(Wt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=M.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];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=hr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Gt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",st;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i.buffer}toString(){let t="";return this.isHexOnly?t=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}xo.NAME="relativeSidBlock";class Bc extends Le{constructor({value:t=qe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new xo;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const i=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(t);if(s.byteLength===0)return this.error=this.value[o].error,st;i.push(s)}return bo(i)}fromString(t){this.value=[];let r=0,i=0,o="";do{i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1;const s=new xo;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(o=`{${o}}`),t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Bc.NAME="RelativeObjectIdentifierValueBlock";var Ic;class Ao extends Ve{constructor(t={}){super(t,Bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ic=Ao,U.RelativeObjectIdentifier=Ic,Ao.NAME="RelativeObjectIdentifier";var Ec;class xt extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ec=xt,U.Sequence=Ec,xt.NAME="SEQUENCE";var Nc;let At=class extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Nc=At,U.Set=Nc,At.NAME="SET";class Oc extends ht(Le){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=qe}toJSON(){return{...super.toJSON(),value:this.value}}}Oc.NAME="StringValueBlock";class _c extends Oc{}_c.NAME="SimpleStringValueBlock";class Qe extends vo{constructor({...t}={}){super(t,_c)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,M.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);this.valueBlock.value=t}}Qe.NAME="SIMPLE STRING";class Tc extends Qe{fromBuffer(t){this.valueBlock.valueHexView=M.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}Tc.NAME="Utf8StringValueBlock";var Vc;class Bt extends Tc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Vc=Bt,U.Utf8String=Vc,Bt.NAME="UTF8String";class jc extends Qe{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=M.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}jc.NAME="BmpStringValueBlock";var Dc;class Li extends jc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Dc=Li,U.BmpString=Dc,Li.NAME="BMPString";class Mc extends Qe{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);for(let o=0;o<i.length;o+=4)i[o]=i[o+3],i[o+1]=i[o+2],i[o+2]=0,i[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=Gt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[o*4+l+c]=a[l]}this.valueBlock.value=t}}Mc.NAME="UniversalStringValueBlock";var Pc;class Hi extends Mc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Pc=Hi,U.UniversalString=Pc,Hi.NAME="UniversalString";var $c;class Fi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}$c=Fi,U.NumericString=$c,Fi.NAME="NumericString";var Rc;class qi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Rc=qi,U.PrintableString=Rc,qi.NAME="PrintableString";var Uc;class Ki extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Uc=Ki,U.TeletexString=Uc,Ki.NAME="TeletexString";var Lc;class zi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Lc=zi,U.VideotexString=Lc,zi.NAME="VideotexString";var Hc;class Gi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Hc=Gi,U.IA5String=Hc,Gi.NAME="IA5String";var Fc;class Wi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Fc=Wi,U.GraphicString=Fc,Wi.NAME="GraphicString";var qc;class Zr extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}qc=Zr,U.VisibleString=qc,Zr.NAME="VisibleString";var Kc;class Ji extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Kc=Ji,U.GeneralString=Kc,Ji.NAME="GeneralString";var zc;class Yi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}zc=Yi,U.CharacterString=zc,Yi.NAME="CharacterString";var Gc;class Qr extends Zr{constructor({value:t,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let o=0;o<t.length;o++)this.valueBlock.valueHexView[o]=t.charCodeAt(o)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,M.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const o=parseInt(i[1],10);o>=50?this.year=1900+o:this.year=2e3+o,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(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=Ze(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Ze(this.month,2),r[2]=Ze(this.day,2),r[3]=Ze(this.hour,2),r[4]=Ze(this.minute,2),r[5]=Ze(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}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}}}Gc=Qr,U.UTCTime=Gc,Qr.NAME="UTCTime";var Wc;class Zi extends Qr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,i="",o="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){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 p=1,B=i.indexOf("+"),v="";if(B===-1&&(B=i.indexOf("-"),p=-1),B!==-1){if(v=i.substring(B+1),i=i.substring(0,B),v.length!==2&&v.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(v.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,v.length===4){if(h=parseInt(v.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),o=i.substring(0,d)}else o=i;switch(!0){case o.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(o);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Ze(this.year,4)),r.push(Ze(this.month,2)),r.push(Ze(this.day,2)),r.push(Ze(this.hour,2)),r.push(Ze(this.minute,2)),r.push(Ze(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Ze(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Wc=Zi,U.GeneralizedTime=Wc,Zi.NAME="GeneralizedTime";var Jc;class Bo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Jc=Bo,U.DATE=Jc,Bo.NAME="DATE";var Yc;class Io extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Yc=Io,U.TimeOfDay=Yc,Io.NAME="TimeOfDay";var Zc;class Eo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Zc=Eo,U.DateTime=Zc,Eo.NAME="DateTime";var Qc;class No extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Qc=No,U.Duration=Qc,No.NAME="Duration";var Xc;class Oo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Xc=Oo,U.TIME=Xc,Oo.NAME="TIME";class Qt{constructor({name:t=qe,optional:r=!1}={}){this.name=t,this.optional=r}}class _o extends Qt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Qi extends Qt{constructor({value:t=new Qt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class Bp{constructor({data:t=Pi}={}){this.dataView=M.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=M.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=M.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Xt(e,t,r){if(r instanceof _o){for(let s=0;s<r.value.length;s++)if(Xt(e,t,r.value[s]).verified)return{verified:!0,result:e};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(wo)&&(s.name=r.name),s}}if(r instanceof Qt)return r.hasOwnProperty(wo)&&(e[r.name]=t),{verified:!0,result:e};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(yp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(wp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(vp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(mp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(gp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(bp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(hp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly)return{verified:!1,result:e};if(r.idBlock.isHexOnly){if(!(rc in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(e[r.name]=t)),r instanceof U.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Qi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Qi){if(a=Xt(e,t.valueBlock.value[l],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),a;if(wo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};kp in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[l])}}else if(a=Xt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&rc in t.valueBlock){const s=yr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],a.name=r.name)),a}return Xt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Ip(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=yr(M.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Xt(r.result,r.result,t)}const el=Object.freeze(Object.defineProperty({__proto__:null,Any:Qt,BaseBlock:Ve,BaseStringBlock:vo,BitString:Zt,BmpString:Li,Boolean:$i,CharacterString:Yi,Choice:_o,Constructed:Ke,DATE:Bo,DateTime:Eo,Duration:No,EndOfContent:ko,Enumerated:Ri,GeneralString:Ji,GeneralizedTime:Zi,GraphicString:Wi,HexBlock:ht,IA5String:Gi,Integer:yt,Null:Jt,NumericString:Fi,ObjectIdentifier:Ui,OctetString:Yt,Primitive:Yr,PrintableString:qi,RawData:Bp,RelativeObjectIdentifier:Ao,Repeated:Qi,Sequence:xt,Set:At,TIME:Oo,TeletexString:Ki,TimeOfDay:Io,UTCTime:Qr,UniversalString:Hi,Utf8String:Bt,ValueBlock:Le,VideotexString:zi,ViewWriter:Mi,VisibleString:Zr,compareSchema:Xt,fromBER:mr,verifySchema:Ip},Symbol.toStringTag,{value:"Module"}));var _;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(_||(_={}));var b;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(b||(b={}));class Xi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(M.isBufferSource(t))this.unusedBits=r,this.value=M.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Zt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new Zt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Zt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class ce{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):M.isBufferSource(t)?this.buffer=M.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Yt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Yt({valueHex:this.buffer})}toSchema(t){return new Yt({name:t})}}const Ep={fromASN:e=>e instanceof Jt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Jt;const t=mr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Np={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new yt({value:+e})},Op={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ri({value:e})},we={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new yt({valueHex:e})},_p={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Zt({valueHex:e})},Tp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Ui({value:e})},Vp={fromASN:e=>e.valueBlock.value,toASN:e=>new $i({value:e})},en={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},jp={fromASN:e=>new ce(e.getValue()),toASN:e=>e.toASN()};function tt(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const tl=tt(Bt),Dp=tt(Li),Mp=tt(Hi),Pp=tt(Fi),$p=tt(qi),Rp=tt(Ki),Up=tt(zi),Lp=tt(Gi),Hp=tt(Wi),Fp=tt(Zr),qp=tt(Ji),Kp=tt(Yi),zp={fromASN:e=>e.toDate(),toASN:e=>new Qr({valueDate:e})},Gp={fromASN:e=>e.toDate(),toASN:e=>new Zi({valueDate:e})},Wp={fromASN:()=>null,toASN:()=>new Jt};function To(e){switch(e){case b.Any:return Ep;case b.BitString:return _p;case b.BmpString:return Dp;case b.Boolean:return Vp;case b.CharacterString:return Kp;case b.Enumerated:return Op;case b.GeneralString:return qp;case b.GeneralizedTime:return Gp;case b.GraphicString:return Hp;case b.IA5String:return Lp;case b.Integer:return Np;case b.Null:return Wp;case b.NumericString:return Pp;case b.ObjectIdentifier:return Tp;case b.OctetString:return en;case b.PrintableString:return $p;case b.TeletexString:return Rp;case b.UTCTime:return zp;case b.UniversalString:return Mp;case b.Utf8String:return tl;case b.VideotexString:return Up;case b.VisibleString:return Fp;default:return null}}function It(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:It(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function rl(e){var t;if(e){const r=Object.getPrototypeOf(e);return((t=r==null?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array?!0:rl(r)}return!1}function Jp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}class Yp{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const i=this.items.get(t);if(!i)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:_.Sequence,items:{}},i=this.findParentSchema(t);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(t,r){const i=this.items.get(t)||this.createDefault(t),o=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const y=b[a.type],p=el[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else It(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===_.Choice?l=new Qt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Qt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?At:xt;l=new y({name:"",value:[new Qi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||It(a.type)){const y=a.repeated?Ke:Yr;o.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new Ke({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new Ke({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,o.push(l)}switch(i.type){case _.Sequence:return new xt({value:o,name:""});case _.Set:return new At({value:o,name:""});case _.Choice:return new _o({value:o,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const rt=new Yp,T=e=>t=>{let r;rt.has(t)?r=rt.get(t):(r=rt.createDefault(t),rt.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;rt.has(t.constructor)?i=rt.get(t.constructor):(i=rt.createDefault(t.constructor),rt.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=To(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}i.items[r]=o};class il extends Error{constructor(){super(...arguments),this.schemas=[]}}class Zp{static parse(t,r){const i=mr(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(It(r))return new r().fromASN(t);const o=rt.get(r);rt.cache(r);let s=o.schema;if(t.constructor===Ke&&o.type!==_.Choice){s=new Ke({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=Xt({},t,s);if(!a.verified)throw new il(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(rl(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const l=o.itemType;if(typeof l=="number"){const d=To(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const y=o.items[l],p=y.type;if(typeof p=="number"||It(p)){const B=(i=y.converter)!==null&&i!==void 0?i:It(p)?new p:null;if(!B)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const v=y.repeated==="sequence"?xt:At,h=new v;h.valueBlock=d.valueBlock;const m=mr(h.toBER(!1));if(m.offset===-1)throw new Error(`Cannot parse the child item. ${m.result.error}`);if(!("value"in m.result.valueBlock&&Array.isArray(m.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const k=m.result.valueBlock.value;c[l]=Array.from(k,g=>B.fromASN(g))}else c[l]=Array.from(d,v=>B.fromASN(v));else{let v=d;if(y.implicit){let h;if(It(p))h=new p().toSchema("");else{const m=b[p],k=el[m];if(!k)throw new Error(`Cannot get '${m}' class from asn1js module`);h=new k}h.valueBlock=v.valueBlock,v=mr(h.toBER(!1)).result}c[l]=B.fromASN(v)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");c[l]=Array.from(d,B=>this.fromASN(B,p))}else c[l]=this.fromASN(d,p)}return c}catch(o){throw o instanceof il&&o.schemas.push(r.name),o}}}class Vo{static serialize(t){return t instanceof Ve?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&It(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=rt.get(r);rt.cache(r);let o=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=To(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(c=>a.toASN(c))}else o=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&Jp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Vo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||It(c.type))){const y={};y.valueHex=d instanceof Jt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Yr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else o.push(new Ke({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new Ke({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case _.Sequence:s=new xt({value:o});break;case _.Set:s=new At({value:o});break;case _.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(t,r,i,o){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${b[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,d=>a.toASN(d)),l=t.repeated==="sequence"?xt:At;s=new l({value:c})}else s=a.toASN(o)}else if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(o,l=>this.toASN(l)),c=t.repeated==="sequence"?xt:At;s=new c({value:a})}else s=this.toASN(o);return s}}class ue extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class G{static serialize(t){return Vo.serialize(t)}static parse(t,r){return Zp.parse(t,r)}static toString(t){const r=M.isBufferSource(t)?M.toArrayBuffer(t):G.serialize(t),i=mr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(o<3?a(s):o>3?a(t,r,s):a(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var nl={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,m){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let k=0,g=-1,x=(h.match(l.zoneIndex)||[])[0],C,w;for(x&&(x=x.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)k++;if(h.substr(0,2)==="::"&&k--,h.substr(-2,2)==="::"&&k--,k>m)return null;for(w=m-k,C=":";w--;)C+="0:";return h=h.replace("::",C),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),m=function(){const O=h.split(":"),$=[];for(let re=0;re<O.length;re++)$.push(parseInt(O[re],16));return $}(),{parts:m,zoneId:x}}function y(h,m,k,g){if(h.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,C;for(;g>0;){if(C=k-g,C<0&&(C=0),h[x]>>C!==m[x]>>C)return!1;g-=k,x+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function B(h,m){for(;h.length<m;)h=`0${h}`;return h}const v={};v.IPv4=function(){function h(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let k,g;for(k=0;k<m.length;k++)if(g=m[k],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(m,k){let g;if(k===void 0&&(g=m,m=g[0],k=g[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,m.octets,8,k)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,k=!1;const g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let x,C,w;for(x=3;x>=0;x-=1)if(C=this.octets[x],C in g){if(w=g[C],k&&w!==0)return null;w!==8&&(k=!0),m+=w}else return null;return 32-m},h.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return v.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),v.IPv4.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),k=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[];let C=0;for(;C<4;)x.push(parseInt(k[C],10)|parseInt(g[C],10)^255),C++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.isIPv4=function(h){return this.parser(h)!==null},v.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},v.IPv4.isValidFourPartDecimal=function(h){return!!(v.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},v.IPv4.networkAddressFromCIDR=function(h){let m,k,g,x,C;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),C=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],k=0;k<4;)x.push(parseInt(g[k],10)&parseInt(C[k],10)),k++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.parse=function(h){const m=this.parser(h);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},v.IPv4.parseCIDR=function(h){let m;if(m=h.match(/^(.+)\/(\d+)$/)){const k=parseInt(m[2]);if(k>=0&&k<=32){const g=[this.parse(m[1]),k];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},v.IPv4.parser=function(h){let m,k,g;if(m=h.match(i.fourOctet))return function(){const x=m.slice(1,6),C=[];for(let w=0;w<x.length;w++)k=x[w],C.push(p(k));return C}();if(m=h.match(i.longValue)){if(g=p(m[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){const x=[];let C;for(C=0;C<=24;C+=8)x.push(g>>C&255);return x}().reverse()}else return(m=h.match(i.twoOctet))?function(){const x=m.slice(1,4),C=[];if(g=p(x[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return C.push(p(x[0])),C.push(g>>16&255),C.push(g>>8&255),C.push(g&255),C}():(m=h.match(i.threeOctet))?function(){const x=m.slice(1,5),C=[];if(g=p(x[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return C.push(p(x[0])),C.push(p(x[1])),C.push(g>>8&255),C.push(g&255),C}():null},v.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const m=[0,0,0,0];let k=0;const g=Math.floor(h/8);for(;k<g;)m[k]=255,k++;return g<4&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},v.IPv6=function(){function h(m,k){let g,x;if(m.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(m[g]<<8|m[g+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(x=this.parts[g],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");k&&(this.zoneId=k)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(m,k){let g;if(k===void 0&&(g=m,m=g[0],k=g[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,m.parts,16,k)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,k=!1;const g={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let x,C;for(let w=7;w>=0;w-=1)if(x=this.parts[w],x in g){if(C=g[x],k&&C!==0)return null;C!==16&&(k=!0),m+=C}else return null;return 128-m},h.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let m;const k=[],g=this.parts;for(let x=0;x<g.length;x++)m=g[x],k.push(m>>8),k.push(m&255);return k},h.prototype.toFixedLengthString=function(){const m=(function(){const g=[];for(let x=0;x<this.parts.length;x++)g.push(B(this.parts[x].toString(16),4));return g}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),m+k},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const m=this.parts.slice(-2),k=m[0],g=m[1];return new v.IPv4([k>>8,k&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){const m=(function(){const g=[];for(let x=0;x<this.parts.length;x++)g.push(this.parts[x].toString(16));return g}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),m+k},h.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,k=this.toNormalizedString();let g=0,x=-1,C;for(;C=m.exec(k);)C[0].length>x&&(g=C.index,x=C[0].length);return x<0?k:`${k.substring(0,g)}::${k.substring(g+x)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),v.IPv6.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),k=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[];let C=0;for(;C<16;)x.push(parseInt(k[C],10)|parseInt(g[C],10)^255),C++;return new this(x)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},v.IPv6.isIPv6=function(h){return this.parser(h)!==null},v.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const m=this.parser(h);return new this(m.parts,m.zoneId),!0}catch{return!1}},v.IPv6.networkAddressFromCIDR=function(h){let m,k,g,x,C;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),C=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],k=0;k<16;)x.push(parseInt(g[k],10)&parseInt(C[k],10)),k++;return new this(x)}catch(w){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${w})`)}},v.IPv6.parse=function(h){const m=this.parser(h);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},v.IPv6.parseCIDR=function(h){let m,k,g;if((k=h.match(/^(.+)\/(\d+)$/))&&(m=parseInt(k[2]),m>=0&&m<=128))return g=[this.parse(k[1]),m],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},v.IPv6.parser=function(h){let m,k,g,x,C,w;if(g=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(l.native.test(h))return d(h,8);if((g=h.match(l.transitional))&&(w=g[6]||"",m=d(g[1].slice(0,-1)+w,6),m.parts)){for(C=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],k=0;k<C.length;k++)if(x=C[k],!(0<=x&&x<=255))return null;return m.parts.push(C[0]<<8|C[1]),m.parts.push(C[2]<<8|C[3]),{parts:m.parts,zoneId:m.zoneId}}return null},v.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let k=0;const g=Math.floor(h/8);for(;k<g;)m[k]=255,k++;return g<16&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},v.fromByteArray=function(h){const m=h.length;if(m===4)return new v.IPv4(h);if(m===16)return new v.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},v.isValid=function(h){return v.IPv6.isValid(h)||v.IPv4.isValid(h)},v.parse=function(h){if(v.IPv6.isValid(h))return v.IPv6.parse(h);if(v.IPv4.isValid(h))return v.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},v.parseCIDR=function(h){try{return v.IPv6.parseCIDR(h)}catch{try{return v.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},v.process=function(h){const m=this.parse(h);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},v.subnetMatch=function(h,m,k){let g,x,C,w;k==null&&(k="unicast");for(x in m)if(Object.prototype.hasOwnProperty.call(m,x)){for(C=m[x],C[0]&&!(C[0]instanceof Array)&&(C=[C]),g=0;g<C.length;g++)if(w=C[g],h.kind()===w[0].kind()&&h.match.apply(h,w))return x}return k},e.exports?e.exports=v:t.ipaddr=v})(yo)})(nl);var ol=nl.exports;class sl{static decodeIP(t){if(t.length===64&&parseInt(t,16)===0)return"::/0";if(t.length!==16)return t;const r=parseInt(t.slice(8),16).toString(2).split("").reduce((o,s)=>o+ +s,0);let i=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return ol.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=ol.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var jo,Do,Mo;let je=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:b.TeletexString})],je.prototype,"teletexString",void 0),u([f({type:b.PrintableString})],je.prototype,"printableString",void 0),u([f({type:b.UniversalString})],je.prototype,"universalString",void 0),u([f({type:b.Utf8String})],je.prototype,"utf8String",void 0),u([f({type:b.BmpString})],je.prototype,"bmpString",void 0),je=u([T({type:_.Choice})],je);let gr=class extends je{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:b.IA5String})],gr.prototype,"ia5String",void 0),u([f({type:b.Any})],gr.prototype,"anyValue",void 0),gr=u([T({type:_.Choice})],gr);class Xr{constructor(t={}){this.type="",this.value=new gr,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Xr.prototype,"type",void 0),u([f({type:gr})],Xr.prototype,"value",void 0);let br=jo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,jo.prototype)}};br=jo=u([T({type:_.Set,itemType:Xr})],br);let Po=Do=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};Po=Do=u([T({type:_.Sequence,itemType:br})],Po);let Ie=Mo=class extends Po{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};Ie=Mo=u([T({type:_.Sequence})],Ie);const Qp={fromASN:e=>sl.toString(en.fromASN(e)),toASN:e=>en.toASN(sl.fromString(e))};class ei{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ei.prototype,"typeId",void 0),u([f({type:b.Any,context:0})],ei.prototype,"value",void 0);class $o{constructor(t={}){this.partyName=new je,Object.assign(this,t)}}u([f({type:je,optional:!0,context:0,implicit:!0})],$o.prototype,"nameAssigner",void 0),u([f({type:je,context:1,implicit:!0})],$o.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ei,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type:b.IA5String,context:1,implicit:!0})],ie.prototype,"rfc822Name",void 0),u([f({type:b.IA5String,context:2,implicit:!0})],ie.prototype,"dNSName",void 0),u([f({type:b.Any,context:3,implicit:!0})],ie.prototype,"x400Address",void 0),u([f({type:Ie,context:4,implicit:!1})],ie.prototype,"directoryName",void 0),u([f({type:$o,context:5})],ie.prototype,"ediPartyName",void 0),u([f({type:b.IA5String,context:6,implicit:!0})],ie.prototype,"uniformResourceIdentifier",void 0),u([f({type:b.OctetString,context:7,implicit:!0,converter:Qp})],ie.prototype,"iPAddress",void 0),u([f({type:b.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([T({type:_.Choice})],ie);const wr="1.3.6.1.5.5.7.3",er="2.5.29";var Ro;class tn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],tn.prototype,"accessMethod",void 0),u([f({type:ie})],tn.prototype,"accessLocation",void 0);let al=Ro=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};al=Ro=u([T({type:_.Sequence,itemType:tn})],al);const Uo=`${er}.35`;class Lo extends ce{}class tr{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Lo,context:0,optional:!0,implicit:!0})],tr.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],tr.prototype,"authorityCertIssuer",void 0),u([f({type:b.Integer,context:2,optional:!0,implicit:!0,converter:we})],tr.prototype,"authorityCertSerialNumber",void 0);const cl=`${er}.19`;class rn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:b.Boolean,defaultValue:!1})],rn.prototype,"cA",void 0),u([f({type:b.Integer,optional:!0})],rn.prototype,"pathLenConstraint",void 0);var Ho;let He=Ho=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};He=Ho=u([T({type:_.Sequence,itemType:ie})],He);var Fo;let ll=Fo=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};ll=Fo=u([T({type:_.Sequence})],ll);var qo;const ul=`${er}.32`;let Et=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:b.IA5String})],Et.prototype,"ia5String",void 0),u([f({type:b.VisibleString})],Et.prototype,"visibleString",void 0),u([f({type:b.BmpString})],Et.prototype,"bmpString",void 0),u([f({type:b.Utf8String})],Et.prototype,"utf8String",void 0),Et=u([T({type:_.Choice})],Et);class Ko{constructor(t={}){this.organization=new Et,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:Et})],Ko.prototype,"organization",void 0),u([f({type:b.Integer,repeated:"sequence"})],Ko.prototype,"noticeNumbers",void 0);class zo{constructor(t={}){Object.assign(this,t)}}u([f({type:Ko,optional:!0})],zo.prototype,"noticeRef",void 0),u([f({type:Et,optional:!0})],zo.prototype,"explicitText",void 0);let nn=class{constructor(t={}){Object.assign(this,t)}};u([f({type:b.IA5String})],nn.prototype,"cPSuri",void 0),u([f({type:zo})],nn.prototype,"userNotice",void 0),nn=u([T({type:_.Choice})],nn);class Go{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Go.prototype,"policyQualifierId",void 0),u([f({type:b.Any})],Go.prototype,"qualifier",void 0);class on{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],on.prototype,"policyIdentifier",void 0),u([f({type:Go,repeated:"sequence",optional:!0})],on.prototype,"policyQualifiers",void 0);let sn=qo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};sn=qo=u([T({type:_.Sequence,itemType:on})],sn);let an=class{constructor(t=0){this.value=t}};u([f({type:b.Integer})],an.prototype,"value",void 0),an=u([T({type:_.Choice})],an);let dl=class extends an{};dl=u([T({type:_.Choice})],dl);var Wo,at;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(at||(at={}));class fl extends Xi{toJSON(){const t=[],r=this.toNumber();return r&at.aACompromise&&t.push("aACompromise"),r&at.affiliationChanged&&t.push("affiliationChanged"),r&at.cACompromise&&t.push("cACompromise"),r&at.certificateHold&&t.push("certificateHold"),r&at.cessationOfOperation&&t.push("cessationOfOperation"),r&at.keyCompromise&&t.push("keyCompromise"),r&at.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&at.superseded&&t.push("superseded"),r&at.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let vr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],vr.prototype,"fullName",void 0),u([f({type:br,context:1,implicit:!0})],vr.prototype,"nameRelativeToCRLIssuer",void 0),vr=u([T({type:_.Choice})],vr);class ti{constructor(t={}){Object.assign(this,t)}}u([f({type:vr,context:0,optional:!0})],ti.prototype,"distributionPoint",void 0),u([f({type:fl,context:1,optional:!0,implicit:!0})],ti.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ti.prototype,"cRLIssuer",void 0);let Jo=Wo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};Jo=Wo=u([T({type:_.Sequence,itemType:ti})],Jo);var Yo;let pl=Yo=class extends Jo{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};pl=Yo=u([T({type:_.Sequence,itemType:ti})],pl);class Re{constructor(t={}){this.onlyContainsUserCerts=Re.ONLY,this.onlyContainsCACerts=Re.ONLY,this.indirectCRL=Re.ONLY,this.onlyContainsAttributeCerts=Re.ONLY,Object.assign(this,t)}}Re.ONLY=!1,u([f({type:vr,context:0,optional:!0})],Re.prototype,"distributionPoint",void 0),u([f({type:b.Boolean,context:1,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsUserCerts",void 0),u([f({type:b.Boolean,context:2,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsCACerts",void 0),u([f({type:fl,context:3,optional:!0,implicit:!0})],Re.prototype,"onlySomeReasons",void 0),u([f({type:b.Boolean,context:4,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"indirectCRL",void 0),u([f({type:b.Boolean,context:5,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsAttributeCerts",void 0);var ri;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ri||(ri={}));let Zo=class{constructor(t=ri.unspecified){this.reason=ri.unspecified,this.reason=t}toJSON(){return ri[this.reason]}toString(){return this.toJSON()}};u([f({type:b.Enumerated})],Zo.prototype,"reason",void 0),Zo=u([T({type:_.Choice})],Zo);var Qo;const hl=`${er}.37`;let cn=Qo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};cn=Qo=u([T({type:_.Sequence,itemType:b.ObjectIdentifier})],cn);const Xp=`${wr}.1`,eh=`${wr}.2`,th=`${wr}.3`,rh=`${wr}.4`,ih=`${wr}.8`,nh=`${wr}.9`;let Xo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:b.Integer,converter:we})],Xo.prototype,"value",void 0),Xo=u([T({type:_.Choice})],Xo);let es=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:b.GeneralizedTime})],es.prototype,"value",void 0),es=u([T({type:_.Choice})],es);var ts;let yl=ts=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};yl=ts=u([T({type:_.Sequence})],yl);const ml=`${er}.15`;var ct;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(ct||(ct={}));class rs extends Xi{toJSON(){const t=this.toNumber(),r=[];return t&ct.cRLSign&&r.push("crlSign"),t&ct.dataEncipherment&&r.push("dataEncipherment"),t&ct.decipherOnly&&r.push("decipherOnly"),t&ct.digitalSignature&&r.push("digitalSignature"),t&ct.encipherOnly&&r.push("encipherOnly"),t&ct.keyAgreement&&r.push("keyAgreement"),t&ct.keyCertSign&&r.push("keyCertSign"),t&ct.keyEncipherment&&r.push("keyEncipherment"),t&ct.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var is;class ln{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],ln.prototype,"base",void 0),u([f({type:b.Integer,context:0,defaultValue:0,implicit:!0})],ln.prototype,"minimum",void 0),u([f({type:b.Integer,context:1,optional:!0,implicit:!0})],ln.prototype,"maximum",void 0);let un=is=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};un=is=u([T({type:_.Sequence,itemType:ln})],un);class gl{constructor(t={}){Object.assign(this,t)}}u([f({type:un,context:0,optional:!0,implicit:!0})],gl.prototype,"permittedSubtrees",void 0),u([f({type:un,context:1,optional:!0,implicit:!0})],gl.prototype,"excludedSubtrees",void 0);class bl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.Integer,context:0,implicit:!0,optional:!0,converter:we})],bl.prototype,"requireExplicitPolicy",void 0),u([f({type:b.Integer,context:1,implicit:!0,optional:!0,converter:we})],bl.prototype,"inhibitPolicyMapping",void 0);var ns;class os{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],os.prototype,"issuerDomainPolicy",void 0),u([f({type:b.ObjectIdentifier})],os.prototype,"subjectDomainPolicy",void 0);let wl=ns=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};wl=ns=u([T({type:_.Sequence,itemType:os})],wl);var ss;const vl=`${er}.17`;let as=ss=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};as=ss=u([T({type:_.Sequence})],as);let Nt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],Nt.prototype,"type",void 0),u([f({type:b.Any,repeated:"set"})],Nt.prototype,"values",void 0);var cs;let kl=cs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};kl=cs=u([T({type:_.Sequence,itemType:Nt})],kl);const Cl=`${er}.14`;class $t extends Lo{}class Sl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.GeneralizedTime,context:0,implicit:!0,optional:!0})],Sl.prototype,"notBefore",void 0),u([f({type:b.GeneralizedTime,context:1,implicit:!0,optional:!0})],Sl.prototype,"notAfter",void 0);var ii;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ii||(ii={}));class xl extends Xi{toJSON(){const t=[],r=this.toNumber();return r&ii.pKIXCertificate&&t.push("pKIXCertificate"),r&ii.newExtensions&&t.push("newExtensions"),r&ii.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Al{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new xl,Object.assign(this,t)}}u([f({type:b.GeneralString})],Al.prototype,"entrustVers",void 0),u([f({type:xl})],Al.prototype,"entrustInfoFlags",void 0);var ls;let Bl=ls=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};Bl=ls=u([T({type:_.Sequence,itemType:tn})],Bl);class K{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof K&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&Xa(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:b.ObjectIdentifier})],K.prototype,"algorithm",void 0),u([f({type:b.Any,optional:!0})],K.prototype,"parameters",void 0);class Ot{constructor(t={}){this.algorithm=new K,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:K})],Ot.prototype,"algorithm",void 0),u([f({type:b.BitString})],Ot.prototype,"subjectPublicKey",void 0);let De=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:b.UTCTime})],De.prototype,"utcTime",void 0),u([f({type:b.GeneralizedTime})],De.prototype,"generalTime",void 0),De=u([T({type:_.Choice})],De);class dn{constructor(t){this.notBefore=new De(new Date),this.notAfter=new De(new Date),t&&(this.notBefore=new De(t.notBefore),this.notAfter=new De(t.notAfter))}}u([f({type:De})],dn.prototype,"notBefore",void 0),u([f({type:De})],dn.prototype,"notAfter",void 0);var us;let lt=class np{constructor(t={}){this.extnID="",this.critical=np.CRITICAL,this.extnValue=new ce,Object.assign(this,t)}};lt.CRITICAL=!1,u([f({type:b.ObjectIdentifier})],lt.prototype,"extnID",void 0),u([f({type:b.Boolean,defaultValue:lt.CRITICAL})],lt.prototype,"critical",void 0),u([f({type:ce})],lt.prototype,"extnValue",void 0);let rr=us=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};rr=us=u([T({type:_.Sequence,itemType:lt})],rr);var kr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(kr||(kr={}));class it{constructor(t={}){this.version=kr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new K,this.issuer=new Ie,this.validity=new dn,this.subject=new Ie,this.subjectPublicKeyInfo=new Ot,Object.assign(this,t)}}u([f({type:b.Integer,context:0,defaultValue:kr.v1})],it.prototype,"version",void 0),u([f({type:b.Integer,converter:we})],it.prototype,"serialNumber",void 0),u([f({type:K})],it.prototype,"signature",void 0),u([f({type:Ie})],it.prototype,"issuer",void 0),u([f({type:dn})],it.prototype,"validity",void 0),u([f({type:Ie})],it.prototype,"subject",void 0),u([f({type:Ot})],it.prototype,"subjectPublicKeyInfo",void 0),u([f({type:b.BitString,context:1,implicit:!0,optional:!0})],it.prototype,"issuerUniqueID",void 0),u([f({type:b.BitString,context:2,implicit:!0,optional:!0})],it.prototype,"subjectUniqueID",void 0),u([f({type:rr,context:3,optional:!0})],it.prototype,"extensions",void 0);class Cr{constructor(t={}){this.tbsCertificate=new it,this.signatureAlgorithm=new K,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:it})],Cr.prototype,"tbsCertificate",void 0),u([f({type:K})],Cr.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],Cr.prototype,"signatureValue",void 0);class fn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new De,Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],fn.prototype,"userCertificate",void 0),u([f({type:De})],fn.prototype,"revocationDate",void 0),u([f({type:lt,optional:!0,repeated:"sequence"})],fn.prototype,"crlEntryExtensions",void 0);class _t{constructor(t={}){this.signature=new K,this.issuer=new Ie,this.thisUpdate=new De,Object.assign(this,t)}}u([f({type:b.Integer,optional:!0})],_t.prototype,"version",void 0),u([f({type:K})],_t.prototype,"signature",void 0),u([f({type:Ie})],_t.prototype,"issuer",void 0),u([f({type:De})],_t.prototype,"thisUpdate",void 0),u([f({type:De,optional:!0})],_t.prototype,"nextUpdate",void 0),u([f({type:fn,repeated:"sequence",optional:!0})],_t.prototype,"revokedCertificates",void 0),u([f({type:lt,optional:!0,context:0,repeated:"sequence"})],_t.prototype,"crlExtensions",void 0);let ds=class{constructor(t={}){this.tbsCertList=new _t,this.signatureAlgorithm=new K,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:_t})],ds.prototype,"tbsCertList",void 0),u([f({type:K})],ds.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],ds.prototype,"signature",void 0);class Sr{constructor(t={}){this.issuer=new Ie,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Ie})],Sr.prototype,"issuer",void 0),u([f({type:b.Integer,converter:we})],Sr.prototype,"serialNumber",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0})],xr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],xr.prototype,"issuerAndSerialNumber",void 0),xr=u([T({type:_.Choice})],xr);var Tt;(function(e){e[e.v0=0]="v0",e[e.v1=1]="v1",e[e.v2=2]="v2",e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v5=5]="v5"})(Tt||(Tt={}));let ni=class extends K{};ni=u([T({type:_.Sequence})],ni);let pn=class extends K{};pn=u([T({type:_.Sequence})],pn);let mt=class extends K{};mt=u([T({type:_.Sequence})],mt);let hn=class extends K{};hn=u([T({type:_.Sequence})],hn);let Il=class extends K{};Il=u([T({type:_.Sequence})],Il);let fs=class extends K{};fs=u([T({type:_.Sequence})],fs);let Ar=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],Ar.prototype,"attrType",void 0),u([f({type:b.Any,repeated:"set"})],Ar.prototype,"attrValues",void 0);var ps;class gt{constructor(t={}){this.version=Tt.v0,this.sid=new xr,this.digestAlgorithm=new ni,this.signatureAlgorithm=new pn,this.signature=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],gt.prototype,"version",void 0),u([f({type:xr})],gt.prototype,"sid",void 0),u([f({type:ni})],gt.prototype,"digestAlgorithm",void 0),u([f({type:Ar,repeated:"set",context:0,implicit:!0,optional:!0})],gt.prototype,"signedAttrs",void 0),u([f({type:pn})],gt.prototype,"signatureAlgorithm",void 0),u([f({type:ce})],gt.prototype,"signature",void 0),u([f({type:Ar,repeated:"set",context:1,implicit:!0,optional:!0})],gt.prototype,"unsignedAttrs",void 0);let yn=ps=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};yn=ps=u([T({type:_.Set,itemType:gt})],yn);let El=class extends De{};El=u([T({type:_.Choice})],El);let Nl=class extends gt{};Nl=u([T({type:_.Sequence})],Nl);class hs{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],hs.prototype,"acIssuer",void 0),u([f({type:b.Integer})],hs.prototype,"acSerial",void 0),u([f({type:Nt,repeated:"sequence"})],hs.prototype,"attrs",void 0);var ys;let mn=ys=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};mn=ys=u([T({type:_.Sequence,itemType:b.ObjectIdentifier})],mn);class gn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:b.Integer,optional:!0})],gn.prototype,"pathLenConstraint",void 0),u([f({type:mn,implicit:!0,context:0,optional:!0})],gn.prototype,"permittedAttrs",void 0),u([f({type:mn,implicit:!0,context:1,optional:!0})],gn.prototype,"excludedAttrs",void 0),u([f({type:b.Boolean,defaultValue:!0})],gn.prototype,"permitUnSpecified",void 0);class ir{constructor(t={}){this.issuer=new He,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:He})],ir.prototype,"issuer",void 0),u([f({type:b.Integer,converter:we})],ir.prototype,"serial",void 0),u([f({type:b.BitString,optional:!0})],ir.prototype,"issuerUID",void 0);var ms;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(ms||(ms={}));class nr{constructor(t={}){this.digestedObjectType=ms.publicKey,this.digestAlgorithm=new K,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Enumerated})],nr.prototype,"digestedObjectType",void 0),u([f({type:b.ObjectIdentifier,optional:!0})],nr.prototype,"otherObjectTypeID",void 0),u([f({type:K})],nr.prototype,"digestAlgorithm",void 0),u([f({type:b.BitString})],nr.prototype,"objectDigest",void 0);class bn{constructor(t={}){Object.assign(this,t)}}u([f({type:He,optional:!0})],bn.prototype,"issuerName",void 0),u([f({type:ir,context:0,implicit:!0,optional:!0})],bn.prototype,"baseCertificateID",void 0),u([f({type:nr,context:1,implicit:!0,optional:!0})],bn.prototype,"objectDigestInfo",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],Br.prototype,"v1Form",void 0),u([f({type:bn,context:0,implicit:!0})],Br.prototype,"v2Form",void 0),Br=u([T({type:_.Choice})],Br);class wn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:b.GeneralizedTime})],wn.prototype,"notBeforeTime",void 0),u([f({type:b.GeneralizedTime})],wn.prototype,"notAfterTime",void 0);class oi{constructor(t={}){Object.assign(this,t)}}u([f({type:ir,implicit:!0,context:0,optional:!0})],oi.prototype,"baseCertificateID",void 0),u([f({type:He,implicit:!0,context:1,optional:!0})],oi.prototype,"entityName",void 0),u([f({type:nr,implicit:!0,context:2,optional:!0})],oi.prototype,"objectDigestInfo",void 0);var gs;(function(e){e[e.v2=1]="v2"})(gs||(gs={}));class ut{constructor(t={}){this.version=gs.v2,this.holder=new oi,this.issuer=new Br,this.signature=new K,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new wn,this.attributes=[],Object.assign(this,t)}}u([f({type:b.Integer})],ut.prototype,"version",void 0),u([f({type:oi})],ut.prototype,"holder",void 0),u([f({type:Br})],ut.prototype,"issuer",void 0),u([f({type:K})],ut.prototype,"signature",void 0),u([f({type:b.Integer,converter:we})],ut.prototype,"serialNumber",void 0),u([f({type:wn})],ut.prototype,"attrCertValidityPeriod",void 0),u([f({type:Nt,repeated:"sequence"})],ut.prototype,"attributes",void 0),u([f({type:b.BitString,optional:!0})],ut.prototype,"issuerUniqueID",void 0),u([f({type:rr,optional:!0})],ut.prototype,"extensions",void 0);class vn{constructor(t={}){this.acinfo=new ut,this.signatureAlgorithm=new K,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ut})],vn.prototype,"acinfo",void 0),u([f({type:K})],vn.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],vn.prototype,"signatureValue",void 0);var kn;(function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"})(kn||(kn={}));class bs extends Xi{}class ws{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier,implicit:!0,context:0})],ws.prototype,"type",void 0),u([f({type:b.Any,implicit:!0,context:1})],ws.prototype,"value",void 0);class vs{constructor(t={}){this.policyId="",this.classList=new bs(kn.unclassified),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],vs.prototype,"policyId",void 0),u([f({type:bs,defaultValue:new bs(kn.unclassified)})],vs.prototype,"classList",void 0),u([f({type:ws,repeated:"set"})],vs.prototype,"securityCategories",void 0);class Cn{constructor(t={}){Object.assign(this,t)}}u([f({type:ce})],Cn.prototype,"cotets",void 0),u([f({type:b.ObjectIdentifier})],Cn.prototype,"oid",void 0),u([f({type:b.Utf8String})],Cn.prototype,"string",void 0);class Ol{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Ol.prototype,"policyAuthority",void 0),u([f({type:Cn,repeated:"sequence"})],Ol.prototype,"values",void 0);var ks;class Sn{constructor(t={}){this.targetCertificate=new ir,Object.assign(this,t)}}u([f({type:ir})],Sn.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],Sn.prototype,"targetName",void 0),u([f({type:nr,optional:!0})],Sn.prototype,"certDigestInfo",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],Ir.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],Ir.prototype,"targetGroup",void 0),u([f({type:Sn,context:2,implicit:!0})],Ir.prototype,"targetCert",void 0),Ir=u([T({type:_.Choice})],Ir);let Cs=ks=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};Cs=ks=u([T({type:_.Sequence,itemType:Ir})],Cs);var Ss;let _l=Ss=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};_l=Ss=u([T({type:_.Sequence,itemType:Cs})],_l);class Tl{constructor(t={}){Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Tl.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Tl.prototype,"roleName",void 0);class xs{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],xs.prototype,"service",void 0),u([f({type:ie})],xs.prototype,"ident",void 0),u([f({type:ce,optional:!0})],xs.prototype,"authInfo",void 0);var As;class Bs{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Bs.prototype,"otherCertFormat",void 0),u([f({type:b.Any})],Bs.prototype,"otherCert",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Cr})],Er.prototype,"certificate",void 0),u([f({type:vn,context:2,implicit:!0})],Er.prototype,"v2AttrCert",void 0),u([f({type:Bs,context:3,implicit:!0})],Er.prototype,"other",void 0),Er=u([T({type:_.Choice})],Er);let xn=As=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};xn=As=u([T({type:_.Set,itemType:Er})],xn);class Nr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Nr.prototype,"contentType",void 0),u([f({type:b.Any,context:0})],Nr.prototype,"content",void 0);let si=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ce})],si.prototype,"single",void 0),u([f({type:b.Any})],si.prototype,"any",void 0),si=u([T({type:_.Choice})],si);class An{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],An.prototype,"eContentType",void 0),u([f({type:si,context:0,optional:!0})],An.prototype,"eContent",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ce,context:0,implicit:!0,optional:!0})],ai.prototype,"value",void 0),u([f({type:ce,converter:jp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ai.prototype,"constructedValue",void 0),ai=u([T({type:_.Choice})],ai);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new hn,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:hn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ai,optional:!0})],ci.prototype,"encryptedContent",void 0);class Bn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Bn.prototype,"keyAttrId",void 0),u([f({type:b.Any,optional:!0})],Bn.prototype,"keyAttr",void 0);var Is;class In{constructor(t={}){this.subjectKeyIdentifier=new $t,Object.assign(this,t)}}u([f({type:$t})],In.prototype,"subjectKeyIdentifier",void 0),u([f({type:b.GeneralizedTime,optional:!0})],In.prototype,"date",void 0),u([f({type:Bn,optional:!0})],In.prototype,"other",void 0);let Or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:In,context:0,implicit:!0,optional:!0})],Or.prototype,"rKeyId",void 0),u([f({type:Sr,optional:!0})],Or.prototype,"issuerAndSerialNumber",void 0),Or=u([T({type:_.Choice})],Or);class Es{constructor(t={}){this.rid=new Or,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:Or})],Es.prototype,"rid",void 0),u([f({type:ce})],Es.prototype,"encryptedKey",void 0);let En=Is=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};En=Is=u([T({type:_.Sequence,itemType:Es})],En);class Ns{constructor(t={}){this.algorithm=new K,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:K})],Ns.prototype,"algorithm",void 0),u([f({type:b.BitString})],Ns.prototype,"publicKey",void 0);let or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0,optional:!0})],or.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ns,context:1,implicit:!0,optional:!0})],or.prototype,"originatorKey",void 0),u([f({type:Sr,optional:!0})],or.prototype,"issuerAndSerialNumber",void 0),or=u([T({type:_.Choice})],or);class _r{constructor(t={}){this.version=Tt.v3,this.originator=new or,this.keyEncryptionAlgorithm=new mt,this.recipientEncryptedKeys=new En,Object.assign(this,t)}}u([f({type:b.Integer})],_r.prototype,"version",void 0),u([f({type:or,context:0})],_r.prototype,"originator",void 0),u([f({type:ce,context:1,optional:!0})],_r.prototype,"ukm",void 0),u([f({type:mt})],_r.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:En})],_r.prototype,"recipientEncryptedKeys",void 0);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0})],Tr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],Tr.prototype,"issuerAndSerialNumber",void 0),Tr=u([T({type:_.Choice})],Tr);class li{constructor(t={}){this.version=Tt.v0,this.rid=new Tr,this.keyEncryptionAlgorithm=new mt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],li.prototype,"version",void 0),u([f({type:Tr})],li.prototype,"rid",void 0),u([f({type:mt})],li.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],li.prototype,"encryptedKey",void 0);class ui{constructor(t={}){this.keyIdentifier=new ce,Object.assign(this,t)}}u([f({type:ce})],ui.prototype,"keyIdentifier",void 0),u([f({type:b.GeneralizedTime,optional:!0})],ui.prototype,"date",void 0),u([f({type:Bn,optional:!0})],ui.prototype,"other",void 0);class di{constructor(t={}){this.version=Tt.v4,this.kekid=new ui,this.keyEncryptionAlgorithm=new mt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],di.prototype,"version",void 0),u([f({type:ui})],di.prototype,"kekid",void 0),u([f({type:mt})],di.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],di.prototype,"encryptedKey",void 0);class fi{constructor(t={}){this.version=Tt.v0,this.keyEncryptionAlgorithm=new mt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],fi.prototype,"version",void 0),u([f({type:fs,context:0,optional:!0})],fi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:mt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],fi.prototype,"encryptedKey",void 0);class Os{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Os.prototype,"oriType",void 0),u([f({type:b.Any})],Os.prototype,"oriValue",void 0);let Rt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:li,optional:!0})],Rt.prototype,"ktri",void 0),u([f({type:_r,context:1,implicit:!0,optional:!0})],Rt.prototype,"kari",void 0),u([f({type:di,context:2,implicit:!0,optional:!0})],Rt.prototype,"kekri",void 0),u([f({type:fi,context:3,implicit:!0,optional:!0})],Rt.prototype,"pwri",void 0),u([f({type:Os,context:4,implicit:!0,optional:!0})],Rt.prototype,"ori",void 0),Rt=u([T({type:_.Choice})],Rt);var _s;let Nn=_s=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};Nn=_s=u([T({type:_.Set,itemType:Rt})],Nn);var Ts;class On{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],On.prototype,"otherRevInfoFormat",void 0),u([f({type:b.Any})],On.prototype,"otherRevInfo",void 0);let pi=class{constructor(t={}){this.other=new On,Object.assign(this,t)}};u([f({type:On,context:1,implicit:!0})],pi.prototype,"other",void 0),pi=u([T({type:_.Choice})],pi);let Vs=Ts=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Vs=Ts=u([T({type:_.Set,itemType:pi})],Vs);class js{constructor(t={}){Object.assign(this,t)}}u([f({type:xn,context:0,implicit:!0,optional:!0})],js.prototype,"certs",void 0),u([f({type:Vs,context:1,implicit:!0,optional:!0})],js.prototype,"crls",void 0);var Ds;let Ms=Ds=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ds.prototype)}};Ms=Ds=u([T({type:_.Set,itemType:Ar})],Ms);class hi{constructor(t={}){this.version=Tt.v0,this.recipientInfos=new Nn,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:b.Integer})],hi.prototype,"version",void 0),u([f({type:js,context:0,implicit:!0,optional:!0})],hi.prototype,"originatorInfo",void 0),u([f({type:Nn})],hi.prototype,"recipientInfos",void 0),u([f({type:ci})],hi.prototype,"encryptedContentInfo",void 0),u([f({type:Ms,context:1,implicit:!0,optional:!0})],hi.prototype,"unprotectedAttrs",void 0);const oh="1.2.840.113549.1.7.2";var Ps;let _n=Ps=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};_n=Ps=u([T({type:_.Set,itemType:ni})],_n);class Vr{constructor(t={}){this.version=Tt.v0,this.digestAlgorithms=new _n,this.encapContentInfo=new An,this.signerInfos=new yn,Object.assign(this,t)}}u([f({type:b.Integer})],Vr.prototype,"version",void 0),u([f({type:_n})],Vr.prototype,"digestAlgorithms",void 0),u([f({type:An})],Vr.prototype,"encapContentInfo",void 0),u([f({type:xn,context:0,implicit:!0,optional:!0})],Vr.prototype,"certificates",void 0),u([f({type:pi,context:1,implicit:!0,optional:!0})],Vr.prototype,"crls",void 0),u([f({type:yn})],Vr.prototype,"signerInfos",void 0);const yi="1.2.840.10045.2.1",$s="1.2.840.10045.4.1",Vl="1.2.840.10045.4.3.1",Rs="1.2.840.10045.4.3.2",Us="1.2.840.10045.4.3.3",Ls="1.2.840.10045.4.3.4",jl="1.2.840.10045.3.1.7",Dl="1.3.132.0.34",Ml="1.3.132.0.35";function mi(e){return new K({algorithm:e})}const sh=mi($s);mi(Vl);const ah=mi(Rs),ch=mi(Us),lh=mi(Ls);let jr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],jr.prototype,"namedCurve",void 0),jr=u([T({type:_.Choice})],jr);class Tn{constructor(t={}){this.version=1,this.privateKey=new ce,Object.assign(this,t)}}u([f({type:b.Integer})],Tn.prototype,"version",void 0),u([f({type:ce})],Tn.prototype,"privateKey",void 0),u([f({type:jr,context:0,optional:!0})],Tn.prototype,"parameters",void 0),u([f({type:b.BitString,context:1,optional:!0})],Tn.prototype,"publicKey",void 0);class Vn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],Vn.prototype,"r",void 0),u([f({type:b.Integer,converter:we})],Vn.prototype,"s",void 0);const ze="1.2.840.113549.1.1",Dr=`${ze}.1`,uh=`${ze}.7`,dh=`${ze}.9`,fh=`${ze}.10`,ph=`${ze}.2`,hh=`${ze}.4`,jn=`${ze}.5`,yh=`${ze}.14`,Hs=`${ze}.11`,Dn=`${ze}.12`,Mn=`${ze}.13`,Pl=`${ze}.15`,$l=`${ze}.16`,Rl="1.3.14.3.2.26",Ul="2.16.840.1.101.3.4.2.4",Ll="2.16.840.1.101.3.4.2.1",Hl="2.16.840.1.101.3.4.2.2",Fl="2.16.840.1.101.3.4.2.3",mh="2.16.840.1.101.3.4.2.5",gh="2.16.840.1.101.3.4.2.6",bh="1.2.840.113549.2.2",wh="1.2.840.113549.2.5",Fs=`${ze}.8`;function Ee(e){return new K({algorithm:e,parameters:null})}Ee(bh),Ee(wh);const sr=Ee(Rl);Ee(Ul),Ee(Ll),Ee(Hl),Ee(Fl),Ee(mh),Ee(gh);const ql=new K({algorithm:Fs,parameters:G.serialize(sr)}),Kl=new K({algorithm:dh,parameters:G.serialize(en.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ee(Dr),Ee(ph),Ee(hh),Ee(jn),Ee(Pl),Ee($l),Ee(Dn),Ee(Mn),Ee(Pl),Ee($l);class Pn{constructor(t={}){this.hashAlgorithm=new K(sr),this.maskGenAlgorithm=new K({algorithm:Fs,parameters:G.serialize(sr)}),this.pSourceAlgorithm=new K(Kl),Object.assign(this,t)}}u([f({type:K,context:0,defaultValue:sr})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:K,context:1,defaultValue:ql})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:K,context:2,defaultValue:Kl})],Pn.prototype,"pSourceAlgorithm",void 0),new K({algorithm:uh,parameters:G.serialize(new Pn)});class gi{constructor(t={}){this.hashAlgorithm=new K(sr),this.maskGenAlgorithm=new K({algorithm:Fs,parameters:G.serialize(sr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:K,context:0,defaultValue:sr})],gi.prototype,"hashAlgorithm",void 0),u([f({type:K,context:1,defaultValue:ql})],gi.prototype,"maskGenAlgorithm",void 0),u([f({type:b.Integer,context:2,defaultValue:20})],gi.prototype,"saltLength",void 0),u([f({type:b.Integer,context:3,defaultValue:1})],gi.prototype,"trailerField",void 0),new K({algorithm:fh,parameters:G.serialize(new gi)});class $n{constructor(t={}){this.digestAlgorithm=new K,this.digest=new ce,Object.assign(this,t)}}u([f({type:K})],$n.prototype,"digestAlgorithm",void 0),u([f({type:ce})],$n.prototype,"digest",void 0);var qs;class Rn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],Rn.prototype,"prime",void 0),u([f({type:b.Integer,converter:we})],Rn.prototype,"exponent",void 0),u([f({type:b.Integer,converter:we})],Rn.prototype,"coefficient",void 0);let Ks=qs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([T({type:_.Sequence,itemType:Rn})],Ks);class bt{constructor(t={}){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,t)}}u([f({type:b.Integer})],bt.prototype,"version",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"modulus",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"publicExponent",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"privateExponent",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"prime1",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"prime2",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"exponent1",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"exponent2",void 0),u([f({type:b.Integer,converter:we})],bt.prototype,"coefficient",void 0),u([f({type:Ks,optional:!0})],bt.prototype,"otherPrimeInfos",void 0);class zs{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],zs.prototype,"modulus",void 0),u([f({type:b.Integer,converter:we})],zs.prototype,"publicExponent",void 0);var Gs;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Gs||(Gs={}));const Ge=Gs;/*! *****************************************************************************
76
76
  Copyright (c) Microsoft Corporation.
77
77
 
78
78
  Permission to use, copy, modify, and/or distribute this software for any
@@ -87,7 +87,7 @@ ${t.join(`
87
87
  PERFORMANCE OF THIS SOFTWARE.
88
88
  ***************************************************************************** */var Ws=function(e,t){return Ws=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},Ws(e,t)};function Js(e,t){Ws(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function vh(e,t,r,i){function o(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function c(y){try{d(i.next(y))}catch(p){a(p)}}function l(y){try{d(i.throw(y))}catch(p){a(p)}}function d(y){y.done?s(y.value):o(y.value).then(c,l)}d((i=i.apply(e,t||[])).next())})}function kh(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,o,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(d){return function(y){return l([d,y])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(y){d=[6,y],o=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Un(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ln(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(c){a={error:c}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function ar(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ln(arguments[t]));return e}var Ch="injectionTokens";function Sh(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(Ch,e)||{};return Object.keys(r).forEach(function(i){t[+i]=r[i]}),t}function zl(e){return!!e.useClass}function Ys(e){return!!e.useFactory}var Gl=function(){function e(t){this.wrap=t,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return e.prototype.createProxy=function(t){var r=this,i={},o=!1,s,a=function(){return o||(s=t(r.wrap()),o=!0),s};return new Proxy(i,this.createHandler(a))},e.prototype.createHandler=function(t){var r={},i=function(o){r[o]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=t();var c=Reflect[o];return c.apply(void 0,ar(s))}};return this.reflectMethods.forEach(i),r},e}();function Mr(e){return typeof e=="string"||typeof e=="symbol"}function xh(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function Wl(e){return typeof e=="object"&&"token"in e&&"transform"in e}function Ah(e){return typeof e=="function"||e instanceof Gl}function Hn(e){return!!e.useToken}function Fn(e){return e.useValue!=null}function Bh(e){return zl(e)||Fn(e)||Hn(e)||Ys(e)}var Zs=function(){function e(){this._registryMap=new Map}return e.prototype.entries=function(){return this._registryMap.entries()},e.prototype.getAll=function(t){return this.ensure(t),this._registryMap.get(t)},e.prototype.get=function(t){this.ensure(t);var r=this._registryMap.get(t);return r[r.length-1]||null},e.prototype.set=function(t,r){this.ensure(t),this._registryMap.get(t).push(r)},e.prototype.setAll=function(t,r){this._registryMap.set(t,r)},e.prototype.has=function(t){return this.ensure(t),this._registryMap.get(t).length>0},e.prototype.clear=function(){this._registryMap.clear()},e.prototype.ensure=function(t){this._registryMap.has(t)||this._registryMap.set(t,[])},e}(),Ih=function(e){Js(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zs),Jl=function(){function e(){this.scopedResolutions=new Map}return e}();function Eh(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function Nh(e,t,r){return r===void 0&&(r=" "),ar([e],t.message.split(`
89
89
  `).map(function(i){return r+i})).join(`
90
- `)}function Oh(e,t,r){var i=Ln(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=Eh(s,t);return Nh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function _h(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Th=function(e){Js(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zs),Vh=function(e){Js(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zs),jh=function(){function e(){this.preResolution=new Th,this.postResolution=new Vh}return e}(),Yl=new Map,Dh=function(){function e(t){this.parent=t,this._registry=new Ih,this.interceptors=new jh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:Ge.Transient}),this.ensureNotDisposed();var o;if(Bh(r)?o=r:o={useClass:r},Hn(o))for(var s=[t],a=o;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+ar(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Hn(l.provider)?a=l.provider:a=null}if((i.lifecycle===Ge.Singleton||i.lifecycle==Ge.ContainerScoped||i.lifecycle==Ge.ResolutionScoped)&&(Fn(o)||Ys(o)))throw new Error('Cannot use lifecycle "'+Ge[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),Mr(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),Mr(t)){if(Mr(r))return this.register(t,{useToken:r},{lifecycle:Ge.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:Ge.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!Mr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:Ge.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Jl),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&Mr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var o=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}if(Ah(t)){var o=this.construct(t,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(t,r){var i,o;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Un(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var o,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Un(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){o={error:y}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===Ge.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===Ge.Singleton,o=t.options.lifecycle===Ge.ContainerScoped,s=i||o,a;return Fn(t.provider)?a=t.provider.useValue:Hn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):zl(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Ys(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===Ge.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Jl),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&Mr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Un(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=Ln(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Fn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var o=Un(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=Ln(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===Ge.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===Ge.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:i})},e.prototype.afterResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:i})},e.prototype.dispose=function(){return vh(this,void 0,void 0,function(){var t;return kh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var o=i.dispose();o&&t.push(o)}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},e.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},e.prototype.construct=function(t,r){var i=this;if(t instanceof Gl)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=Yl.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,ar([void 0],a)))}();return _h(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var i=this;return function(o,s){var a,c,l;try{return xh(o)?Wl(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,ar([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,ar([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Wl(o)?(l=i.resolve(o.transform,t)).transform.apply(l,ar([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(Oh(r,s,d))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},e}(),nt=new Dh;function Qs(){return function(e){Yl.set(e,Sh(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 Xs;class qn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:b.ObjectIdentifier})],qn.prototype,"attrId",void 0),u([f({type:b.Any,repeated:"set"})],qn.prototype,"attrValues",void 0);let Zl=Xs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};Zl=Xs=u([T({type:_.Sequence,itemType:qn})],Zl);var ea;let Ql=ea=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};Ql=ea=u([T({type:_.Sequence,itemType:Nr})],Ql);class Xl{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Xl.prototype,"certId",void 0),u([f({type:b.Any,context:0})],Xl.prototype,"certValue",void 0);class eu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],eu.prototype,"crlId",void 0),u([f({type:b.Any,context:0})],eu.prototype,"crltValue",void 0);class tu extends ce{}let Kn=class{constructor(t={}){this.encryptionAlgorithm=new K,this.encryptedData=new tu,Object.assign(this,t)}};u([f({type:K})],Kn.prototype,"encryptionAlgorithm",void 0),u([f({type:tu})],Kn.prototype,"encryptedData",void 0);var ta,ra;(function(e){e[e.v1=0]="v1"})(ra||(ra={}));class ru extends ce{}let ia=ta=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};ia=ta=u([T({type:_.Sequence,itemType:Nt})],ia);class bi{constructor(t={}){this.version=ra.v1,this.privateKeyAlgorithm=new K,this.privateKey=new ru,Object.assign(this,t)}}u([f({type:b.Integer})],bi.prototype,"version",void 0),u([f({type:K})],bi.prototype,"privateKeyAlgorithm",void 0),u([f({type:ru})],bi.prototype,"privateKey",void 0),u([f({type:ia,implicit:!0,context:0,optional:!0})],bi.prototype,"attributes",void 0);let iu=class extends bi{};iu=u([T({type:_.Sequence})],iu);let nu=class extends Kn{};nu=u([T({type:_.Sequence})],nu);class ou{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ou.prototype,"secretTypeId",void 0),u([f({type:b.Any,context:0})],ou.prototype,"secretValue",void 0);class wi{constructor(t={}){this.mac=new $n,this.macSalt=new ce,this.iterations=1,Object.assign(this,t)}}u([f({type:$n})],wi.prototype,"mac",void 0),u([f({type:ce})],wi.prototype,"macSalt",void 0),u([f({type:b.Integer,defaultValue:1})],wi.prototype,"iterations",void 0);class zn{constructor(t={}){this.version=3,this.authSafe=new Nr,this.macData=new wi,Object.assign(this,t)}}u([f({type:b.Integer})],zn.prototype,"version",void 0),u([f({type:Nr})],zn.prototype,"authSafe",void 0),u([f({type:wi,optional:!0})],zn.prototype,"macData",void 0);var na;class Gn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Gn.prototype,"bagId",void 0),u([f({type:b.Any,context:0})],Gn.prototype,"bagValue",void 0),u([f({type:qn,repeated:"set",optional:!0})],Gn.prototype,"bagAttributes",void 0);let su=na=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,na.prototype)}};su=na=u([T({type:_.Sequence,itemType:Gn})],su);var oa,sa,aa;const au="1.2.840.113549.1.9",cu=`${au}.7`,ca=`${au}.14`;let Wn=class extends je{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:b.IA5String})],Wn.prototype,"ia5String",void 0),Wn=u([T({type:_.Choice})],Wn);let lu=class extends Nr{};lu=u([T({type:_.Sequence})],lu);let uu=class extends zn{};uu=u([T({type:_.Sequence})],uu);let du=class extends Kn{};du=u([T({type:_.Sequence})],du);let la=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.IA5String})],la.prototype,"value",void 0),la=u([T({type:_.Choice})],la);let fu=class extends Wn{};fu=u([T({type:_.Choice})],fu);let pu=class extends je{};pu=u([T({type:_.Choice})],pu);let ua=class{constructor(t=new Date){this.value=t}};u([f({type:b.GeneralizedTime})],ua.prototype,"value",void 0),ua=u([T({type:_.Choice})],ua);let hu=class extends je{};hu=u([T({type:_.Choice})],hu);let da=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:b.PrintableString})],da.prototype,"value",void 0),da=u([T({type:_.Choice})],da);let Jn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.PrintableString})],Jn.prototype,"value",void 0),Jn=u([T({type:_.Choice})],Jn);let yu=class extends Jn{};yu=u([T({type:_.Choice})],yu);let gu=class extends je{};gu=u([T({type:_.Choice})],gu);let fa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.ObjectIdentifier})],fa.prototype,"value",void 0),fa=u([T({type:_.Choice})],fa);let mu=class extends De{};mu=u([T({type:_.Choice})],mu);let pa=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:b.Integer})],pa.prototype,"value",void 0),pa=u([T({type:_.Choice})],pa);let bu=class extends mt{};bu=u([T({type:_.Sequence})],bu);let Yn=class extends je{};Yn=u([T({type:_.Choice})],Yn);let wu=oa=class extends rr{constructor(t){super(t),Object.setPrototypeOf(this,oa.prototype)}};wu=oa=u([T({type:_.Sequence})],wu);let vu=sa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,sa.prototype)}};vu=sa=u([T({type:_.Set,itemType:Ar})],vu);let ha=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.BmpString})],ha.prototype,"value",void 0),ha=u([T({type:_.Choice})],ha);let ya=class extends K{};ya=u([T({type:_.Sequence})],ya);let ku=aa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}};ku=aa=u([T({type:_.Sequence,itemType:ya})],ku);var ga;let Zn=ga=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Zn=ga=u([T({type:_.Sequence,itemType:Nt})],Zn);class Pr{constructor(t={}){this.version=0,this.subject=new Ie,this.subjectPKInfo=new Ot,this.attributes=new Zn,Object.assign(this,t)}}u([f({type:b.Integer})],Pr.prototype,"version",void 0),u([f({type:Ie})],Pr.prototype,"subject",void 0),u([f({type:Ot})],Pr.prototype,"subjectPKInfo",void 0),u([f({type:Zn,implicit:!0,context:0})],Pr.prototype,"attributes",void 0);class vi{constructor(t={}){this.certificationRequestInfo=new Pr,this.signatureAlgorithm=new K,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pr})],vi.prototype,"certificationRequestInfo",void 0),u([f({type:K})],vi.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],vi.prototype,"signature",void 0);/*!
90
+ `)}function Oh(e,t,r){var i=Ln(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=Eh(s,t);return Nh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function _h(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Th=function(e){Js(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zs),Vh=function(e){Js(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zs),jh=function(){function e(){this.preResolution=new Th,this.postResolution=new Vh}return e}(),Yl=new Map,Dh=function(){function e(t){this.parent=t,this._registry=new Ih,this.interceptors=new jh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:Ge.Transient}),this.ensureNotDisposed();var o;if(Bh(r)?o=r:o={useClass:r},Hn(o))for(var s=[t],a=o;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+ar(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Hn(l.provider)?a=l.provider:a=null}if((i.lifecycle===Ge.Singleton||i.lifecycle==Ge.ContainerScoped||i.lifecycle==Ge.ResolutionScoped)&&(Fn(o)||Ys(o)))throw new Error('Cannot use lifecycle "'+Ge[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),Mr(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),Mr(t)){if(Mr(r))return this.register(t,{useToken:r},{lifecycle:Ge.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:Ge.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!Mr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:Ge.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Jl),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&Mr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var o=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}if(Ah(t)){var o=this.construct(t,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(t,r){var i,o;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Un(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var o,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Un(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){o={error:y}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===Ge.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===Ge.Singleton,o=t.options.lifecycle===Ge.ContainerScoped,s=i||o,a;return Fn(t.provider)?a=t.provider.useValue:Hn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):zl(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Ys(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===Ge.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Jl),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&Mr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Un(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=Ln(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Fn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var o=Un(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=Ln(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===Ge.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===Ge.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:i})},e.prototype.afterResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:i})},e.prototype.dispose=function(){return vh(this,void 0,void 0,function(){var t;return kh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var o=i.dispose();o&&t.push(o)}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},e.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},e.prototype.construct=function(t,r){var i=this;if(t instanceof Gl)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=Yl.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,ar([void 0],a)))}();return _h(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var i=this;return function(o,s){var a,c,l;try{return xh(o)?Wl(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,ar([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,ar([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Wl(o)?(l=i.resolve(o.transform,t)).transform.apply(l,ar([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(Oh(r,s,d))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},e}(),nt=new Dh;function Qs(){return function(e){Yl.set(e,Sh(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 Xs;class qn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:b.ObjectIdentifier})],qn.prototype,"attrId",void 0),u([f({type:b.Any,repeated:"set"})],qn.prototype,"attrValues",void 0);let Zl=Xs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};Zl=Xs=u([T({type:_.Sequence,itemType:qn})],Zl);var ea;let Ql=ea=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};Ql=ea=u([T({type:_.Sequence,itemType:Nr})],Ql);class Xl{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Xl.prototype,"certId",void 0),u([f({type:b.Any,context:0})],Xl.prototype,"certValue",void 0);class eu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],eu.prototype,"crlId",void 0),u([f({type:b.Any,context:0})],eu.prototype,"crltValue",void 0);class tu extends ce{}let Kn=class{constructor(t={}){this.encryptionAlgorithm=new K,this.encryptedData=new tu,Object.assign(this,t)}};u([f({type:K})],Kn.prototype,"encryptionAlgorithm",void 0),u([f({type:tu})],Kn.prototype,"encryptedData",void 0);var ta,ra;(function(e){e[e.v1=0]="v1"})(ra||(ra={}));class ru extends ce{}let ia=ta=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};ia=ta=u([T({type:_.Sequence,itemType:Nt})],ia);class bi{constructor(t={}){this.version=ra.v1,this.privateKeyAlgorithm=new K,this.privateKey=new ru,Object.assign(this,t)}}u([f({type:b.Integer})],bi.prototype,"version",void 0),u([f({type:K})],bi.prototype,"privateKeyAlgorithm",void 0),u([f({type:ru})],bi.prototype,"privateKey",void 0),u([f({type:ia,implicit:!0,context:0,optional:!0})],bi.prototype,"attributes",void 0);let iu=class extends bi{};iu=u([T({type:_.Sequence})],iu);let nu=class extends Kn{};nu=u([T({type:_.Sequence})],nu);class ou{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ou.prototype,"secretTypeId",void 0),u([f({type:b.Any,context:0})],ou.prototype,"secretValue",void 0);class wi{constructor(t={}){this.mac=new $n,this.macSalt=new ce,this.iterations=1,Object.assign(this,t)}}u([f({type:$n})],wi.prototype,"mac",void 0),u([f({type:ce})],wi.prototype,"macSalt",void 0),u([f({type:b.Integer,defaultValue:1})],wi.prototype,"iterations",void 0);class zn{constructor(t={}){this.version=3,this.authSafe=new Nr,this.macData=new wi,Object.assign(this,t)}}u([f({type:b.Integer})],zn.prototype,"version",void 0),u([f({type:Nr})],zn.prototype,"authSafe",void 0),u([f({type:wi,optional:!0})],zn.prototype,"macData",void 0);var na;class Gn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Gn.prototype,"bagId",void 0),u([f({type:b.Any,context:0})],Gn.prototype,"bagValue",void 0),u([f({type:qn,repeated:"set",optional:!0})],Gn.prototype,"bagAttributes",void 0);let su=na=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,na.prototype)}};su=na=u([T({type:_.Sequence,itemType:Gn})],su);var oa,sa,aa;const au="1.2.840.113549.1.9",cu=`${au}.7`,ca=`${au}.14`;let Wn=class extends je{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:b.IA5String})],Wn.prototype,"ia5String",void 0),Wn=u([T({type:_.Choice})],Wn);let lu=class extends Nr{};lu=u([T({type:_.Sequence})],lu);let uu=class extends zn{};uu=u([T({type:_.Sequence})],uu);let du=class extends Kn{};du=u([T({type:_.Sequence})],du);let la=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.IA5String})],la.prototype,"value",void 0),la=u([T({type:_.Choice})],la);let fu=class extends Wn{};fu=u([T({type:_.Choice})],fu);let pu=class extends je{};pu=u([T({type:_.Choice})],pu);let ua=class{constructor(t=new Date){this.value=t}};u([f({type:b.GeneralizedTime})],ua.prototype,"value",void 0),ua=u([T({type:_.Choice})],ua);let hu=class extends je{};hu=u([T({type:_.Choice})],hu);let da=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:b.PrintableString})],da.prototype,"value",void 0),da=u([T({type:_.Choice})],da);let Jn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.PrintableString})],Jn.prototype,"value",void 0),Jn=u([T({type:_.Choice})],Jn);let yu=class extends Jn{};yu=u([T({type:_.Choice})],yu);let mu=class extends je{};mu=u([T({type:_.Choice})],mu);let fa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.ObjectIdentifier})],fa.prototype,"value",void 0),fa=u([T({type:_.Choice})],fa);let gu=class extends De{};gu=u([T({type:_.Choice})],gu);let pa=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:b.Integer})],pa.prototype,"value",void 0),pa=u([T({type:_.Choice})],pa);let bu=class extends gt{};bu=u([T({type:_.Sequence})],bu);let Yn=class extends je{};Yn=u([T({type:_.Choice})],Yn);let wu=oa=class extends rr{constructor(t){super(t),Object.setPrototypeOf(this,oa.prototype)}};wu=oa=u([T({type:_.Sequence})],wu);let vu=sa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,sa.prototype)}};vu=sa=u([T({type:_.Set,itemType:Ar})],vu);let ha=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.BmpString})],ha.prototype,"value",void 0),ha=u([T({type:_.Choice})],ha);let ya=class extends K{};ya=u([T({type:_.Sequence})],ya);let ku=aa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}};ku=aa=u([T({type:_.Sequence,itemType:ya})],ku);var ma;let Zn=ma=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ma.prototype)}};Zn=ma=u([T({type:_.Sequence,itemType:Nt})],Zn);class Pr{constructor(t={}){this.version=0,this.subject=new Ie,this.subjectPKInfo=new Ot,this.attributes=new Zn,Object.assign(this,t)}}u([f({type:b.Integer})],Pr.prototype,"version",void 0),u([f({type:Ie})],Pr.prototype,"subject",void 0),u([f({type:Ot})],Pr.prototype,"subjectPKInfo",void 0),u([f({type:Zn,implicit:!0,context:0})],Pr.prototype,"attributes",void 0);class vi{constructor(t={}){this.certificationRequestInfo=new Pr,this.signatureAlgorithm=new K,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pr})],vi.prototype,"certificationRequestInfo",void 0),u([f({type:K})],vi.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],vi.prototype,"signature",void 0);/*!
91
91
  * MIT License
92
92
  *
93
93
  * Copyright (c) Peculiar Ventures. All rights reserved.
@@ -112,28 +112,28 @@ ${t.join(`
112
112
  *
113
113
  */const Qn="crypto.algorithm";class Mh{getAlgorithms(){return nt.resolveAll(Qn)}toAsnAlgorithm(t){({...t});for(const r of this.getAlgorithms()){const i=r.toAsnAlgorithm(t);if(i)return i}if(/^[0-9.]+$/.test(t.name)){const r=new K({algorithm:t.name});if("parameters"in t){const i=t;r.parameters=i.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const i of this.getAlgorithms()){const o=i.toWebAlgorithm(t);if(o)return o}return{name:t.algorithm,parameters:t.parameters}}}const Xn="crypto.algorithmProvider";nt.registerSingleton(Xn,Mh);var eo;const We="1.3.36.3.3.2.8.1.1",Cu=`${We}.1`,Su=`${We}.2`,xu=`${We}.3`,Au=`${We}.4`,Bu=`${We}.5`,Iu=`${We}.6`,Eu=`${We}.7`,Nu=`${We}.8`,Ou=`${We}.9`,_u=`${We}.10`,Tu=`${We}.11`,Vu=`${We}.12`,ju=`${We}.13`,Du=`${We}.14`,Mu="brainpoolP160r1",Pu="brainpoolP160t1",$u="brainpoolP192r1",Ru="brainpoolP192t1",Uu="brainpoolP224r1",Lu="brainpoolP224t1",Hu="brainpoolP256r1",Fu="brainpoolP256t1",qu="brainpoolP320r1",Ku="brainpoolP320t1",zu="brainpoolP384r1",Gu="brainpoolP384t1",Wu="brainpoolP512r1",Ju="brainpoolP512t1",ve="ECDSA";let ki=eo=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case ve.toLowerCase():if("hash"in t)switch((typeof t.hash=="string"?t.hash:t.hash.name).toLowerCase()){case"sha-1":return sh;case"sha-256":return ah;case"sha-384":return ch;case"sha-512":return lh}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=jl;break;case"K-256":r=eo.SECP256K1;break;case"P-384":r=Dl;break;case"P-521":r=Ml;break;case Mu:r=Cu;break;case Pu:r=Su;break;case $u:r=xu;break;case Ru:r=Au;break;case Uu:r=Bu;break;case Lu:r=Iu;break;case Hu:r=Eu;break;case Fu:r=Nu;break;case qu:r=Ou;break;case Ku:r=_u;break;case zu:r=Tu;break;case Gu:r=Vu;break;case Wu:r=ju;break;case Ju:r=Du;break}if(r)return new K({algorithm:yi,parameters:G.serialize(new jr({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case $s:return{name:ve,hash:{name:"SHA-1"}};case Rs:return{name:ve,hash:{name:"SHA-256"}};case Us:return{name:ve,hash:{name:"SHA-384"}};case Ls:return{name:ve,hash:{name:"SHA-512"}};case yi:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(G.parse(t.parameters,jr).namedCurve){case jl:return{name:ve,namedCurve:"P-256"};case eo.SECP256K1:return{name:ve,namedCurve:"K-256"};case Dl:return{name:ve,namedCurve:"P-384"};case Ml:return{name:ve,namedCurve:"P-521"};case Cu:return{name:ve,namedCurve:Mu};case Su:return{name:ve,namedCurve:Pu};case xu:return{name:ve,namedCurve:$u};case Au:return{name:ve,namedCurve:Ru};case Bu:return{name:ve,namedCurve:Uu};case Iu:return{name:ve,namedCurve:Lu};case Eu:return{name:ve,namedCurve:Hu};case Nu:return{name:ve,namedCurve:Fu};case Ou:return{name:ve,namedCurve:qu};case _u:return{name:ve,namedCurve:Ku};case Tu:return{name:ve,namedCurve:zu};case Vu:return{name:ve,namedCurve:Gu};case ju:return{name:ve,namedCurve:Wu};case Du:return{name:ve,namedCurve:Ju}}}}return null}};ki.SECP256K1="1.3.132.0.10",ki=eo=u([Qs()],ki),nt.registerSingleton(Qn,ki);const Yu=Symbol("name"),Zu=Symbol("value");class de{constructor(t,r={},i=""){this[Yu]=t,this[Zu]=i;for(const o in r)this[o]=r[o]}}de.NAME=Yu,de.VALUE=Zu;class Ph{static toTextObject(t){const r=new de("Algorithm Identifier",{},Ut.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case yi:{const i=new ki().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class Ut{static toString(t){const r=this.items[t];return r||t}}Ut.items={[Rl]:"sha1",[Ul]:"sha224",[Ll]:"sha256",[Hl]:"sha384",[Fl]:"sha512",[Dr]:"rsaEncryption",[jn]:"sha1WithRSAEncryption",[yh]:"sha224WithRSAEncryption",[Hs]:"sha256WithRSAEncryption",[Dn]:"sha384WithRSAEncryption",[Mn]:"sha512WithRSAEncryption",[yi]:"ecPublicKey",[$s]:"ecdsaWithSHA1",[Vl]:"ecdsaWithSHA224",[Rs]:"ecdsaWithSHA256",[Us]:"ecdsaWithSHA384",[Ls]:"ecdsaWithSHA512",[Xp]:"TLS WWW server authentication",[eh]:"TLS WWW client authentication",[th]:"Code Signing",[rh]:"E-mail Protection",[ih]:"Time Stamping",[nh]:"OCSP Signing",[oh]:"Signed Data"};class cr{static serialize(t){return this.serializeObj(t).join(`
114
114
  `)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[de.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[de.NAME]}:${s}`),o=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${o}${d}${l}`);else if(l instanceof Date)i.push(`${o}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const y of l)y[de.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof de)l[de.NAME]=c,i.push(...this.serializeObj(l,r));else if(M.isBufferSource(l))c?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const y=l.toTextObject();y[de.NAME]=c,i.push(...this.serializeObj(y,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(t,r=0){const i=this.pad(r),o=M.toUint8Array(t),s=[];for(let a=0;a<o.length;){const c=[];for(let l=0;l<16&&a<o.length;l++){l===8&&c.push("");const d=o[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${i}${c.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}cr.oidSerializer=Ut,cr.algorithmSerializer=Ph;class Lt{constructor(...t){if(t.length===1){const r=t[0];this.rawData=G.serialize(r),this.onInit(r)}else{const r=G.parse(t[0],t[1]);this.rawData=M.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Lt?Xa(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return G.toString(this.rawData);case"text":return cr.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const t=this.toTextObjectEmpty();return t[""]=this.rawData,t}toTextObjectEmpty(t){return new de(this.getTextName(),{},t)}}Lt.NAME="ASN";class wt extends Lt{constructor(...t){let r;M.isBufferSource(t[0])?r=M.toArrayBuffer(t[0]):r=G.serialize(new lt({extnID:t[0],critical:t[1],extnValue:new ce(M.toArrayBuffer(t[2]))})),super(r,lt)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[de.NAME]===wt.NAME&&(t[de.NAME]=Ut.toString(this.type)),t}}var Qu;class lr{static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&t.extractable!==void 0}constructor(){this.items=new Map,this[Qu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(lr.DEFAULT,crypto)}clear(){this.items.clear()}delete(t){return this.items.delete(t)}forEach(t,r){return this.items.forEach(t,r)}has(t){return this.items.has(t)}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(t=lr.DEFAULT){const r=this.items.get(t.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${t}'`);return r}set(t,r){if(typeof t=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(t.toLowerCase(),r)}else this.items.set(lr.DEFAULT,t);return this}}Qu=Symbol.toStringTag,lr.DEFAULT="default";const Xe=new lr,$h=/^[0-2](?:\.[1-9][0-9]*)+$/;function Rh(e){return new RegExp($h).test(e)}class Xu{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Rh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Je=new Xu;Je.register("CN","2.5.4.3"),Je.register("L","2.5.4.7"),Je.register("ST","2.5.4.8"),Je.register("O","2.5.4.10"),Je.register("OU","2.5.4.11"),Je.register("C","2.5.4.6"),Je.register("DC","0.9.2342.19200300.100.1.25"),Je.register("E","1.2.840.113549.1.9.1"),Je.register("G","2.5.4.42"),Je.register("I","2.5.4.43"),Je.register("SN","2.5.4.4"),Je.register("T","2.5.4.12");function Uh(e,t){return`\\${L.ToHex(L.FromUtf8String(t)).toUpperCase()}`}function Lh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Uh)}class Ht{static isASCII(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return!1;return!0}constructor(t,r={}){this.extraNames=new Xu,this.asn=new Ie;for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)){const o=r[i];this.extraNames.register(i,o)}typeof t=="string"?this.asn=this.fromString(t):t instanceof Ie?this.asn=t:M.isBufferSource(t)?this.asn=G.parse(t,Ie):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||Je.findId(t),i=[];for(const o of this.asn)for(const s of o)s.type===r&&i.push(s.value.toString());return i}getName(t){return this.extraNames.get(t)||Je.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,o=r.value.anyValue?`#${L.ToHex(r.value.anyValue)}`:Lh(r.value.toString());return`${i}=${o}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const i of this.asn){const o={};for(const s of i){const a=this.getName(s.type)||s.type;(t=o[a])!==null&&t!==void 0||(o[a]=[]),o[a].push(s.value.anyValue?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new Ie,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=i.exec(`${t},`);){let[,a,c]=o;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),o[3]=l);const d=o[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const y=new Xr({type:a});if(c.charAt(0)==="#")y.value.anyValue=L.FromHex(c.slice(1));else{const p=/"(.*?[^\\])?"/.exec(c);p&&(c=p[1]),c=c.replace(/\\0a/ig,`
115
- `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Ht.isASCII(c)?y.value.printableString=c:y.value.utf8String=c}s==="+"?r[r.length-1].push(y):r.push(new br([y])),s=d}return r}fromJSON(t){const r=new Ie;for(const i of t){const o=new br;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Xr({type:a});if(typeof l=="object")for(const y in l)switch(y){case"ia5String":d.value.ia5String=l[y];break;case"utf8String":d.value.utf8String=l[y];break;case"universalString":d.value.universalString=l[y];break;case"bmpString":d.value.bmpString=l[y];break;case"printableString":d.value.printableString=l[y];break}else l[0]==="#"?d.value.anyValue=L.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return G.serialize(this.asn)}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Xe.get()):i=t[0]||Xe.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const ed="Cannot initialize GeneralName from ASN.1 data.",td=`${ed} Unsupported string format in use.`,Hh=`${ed} Value doesn't match to GUID regular expression.`,rd=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,id="1.3.6.1.4.1.311.25.1",nd="1.3.6.1.4.1.311.20.2.3",ma="dns",ba="dn",wa="email",va="ip",ka="url",Ca="guid",Sa="upn",to="id";class od extends Lt{constructor(...t){let r;if(t.length===2)switch(t[0]){case ba:{const i=new Ht(t[1]).toArrayBuffer(),o=G.parse(i,Ie);r=new ie({directoryName:o});break}case ma:r=new ie({dNSName:t[1]});break;case wa:r=new ie({rfc822Name:t[1]});break;case Ca:{const i=new RegExp(rd,"i").exec(t[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=i.slice(1).map((s,a)=>a<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ei({typeId:id,value:G.serialize(new ce(L.FromHex(o)))})});break}case va:r=new ie({iPAddress:t[1]});break;case to:r=new ie({registeredID:t[1]});break;case Sa:{r=new ie({otherName:new ei({typeId:nd,value:G.serialize(tl.toASN(t[1]))})});break}case ka:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else M.isBufferSource(t[0])?r=G.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=ma,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=wa,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=va,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=ka,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=to,this.value=t.registeredID;else if(t.directoryName!=null)this.type=ba,this.value=new Ht(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===id){this.type=Ca;const r=G.parse(t.otherName.value,ce),i=new RegExp(rd,"i").exec(L.ToHex(r));if(!i)throw new Error(Hh);this.value=i.slice(1).map((o,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===nd)this.type=Sa,this.value=G.parse(t.otherName.value,je).toString();else throw new Error(td);else throw new Error(td)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case ba:case ma:case Ca:case va:case to:case Sa:case ka:t=this.type.toUpperCase();break;case wa:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===to&&(r=Ut.toString(r)),new de(t,void 0,r)}}class Ci extends Lt{constructor(t){let r;if(t instanceof He)r=t;else if(Array.isArray(t)){const i=[];for(const o of t)if(o instanceof ie)i.push(o);else{const s=G.parse(new od(o.type,o.value).rawData,ie);i.push(s)}r=new He(i)}else if(M.isBufferSource(t))r=G.parse(t,He);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let o=null;try{o=new od(i)}catch{continue}r.push(o)}this.items=r}toJSON(){return this.items.map(t=>t.toJSON())}toTextObject(){const t=super.toTextObjectEmpty();for(const r of this.items){const i=r.toTextObject();let o=t[i[de.NAME]];Array.isArray(o)||(o=[],t[i[de.NAME]]=o),o.push(i)}return t}}Ci.NAME="GeneralNames";const Si="-{5}",xi="\\n",Fh=`[^${xi}]+`,qh=`${Si}BEGIN (${Fh}(?=${Si}))${Si}`,Kh=`${Si}END \\1${Si}`,$r="\\n",zh=`[^:${xi}]+`,Gh=`(?:[^${xi}]+${$r}(?: +[^${xi}]+${$r})*)`,Wh=`(?:[a-zA-Z0-9=+/]+${$r})+`,sd=`${qh}${$r}(?:((?:${zh}: ${Gh})+))?${$r}?(${Wh})${Kh}`;class et{static isPem(t){return typeof t=="string"&&new RegExp(sd,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(sd,"g"),i=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${xi}]+`,"g"),""),a={type:o[1],headers:[],rawData:L.FromBase64(s)},c=o[2];if(c){const l=c.split(new RegExp($r,"g"));let d=null;for(const y of l){const[p,B]=y.split(/:(.*)/);if(B===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=p.trim()}else d&&a.headers.push(d),d={key:p,value:B.trim()}}d&&a.headers.push(d)}i.push(a)}return i}static decode(t){return this.decodeWithHeaders(t).map(i=>i.rawData)}static decodeFirst(t){const r=this.decode(t);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(t,r){if(Array.isArray(t)){const i=new Array;return r?t.forEach(o=>{if(!M.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:M.toArrayBuffer(o)}))}):t.forEach(o=>{if(!("type"in o))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(o))}),i.join(`
115
+ `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Ht.isASCII(c)?y.value.printableString=c:y.value.utf8String=c}s==="+"?r[r.length-1].push(y):r.push(new br([y])),s=d}return r}fromJSON(t){const r=new Ie;for(const i of t){const o=new br;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Xr({type:a});if(typeof l=="object")for(const y in l)switch(y){case"ia5String":d.value.ia5String=l[y];break;case"utf8String":d.value.utf8String=l[y];break;case"universalString":d.value.universalString=l[y];break;case"bmpString":d.value.bmpString=l[y];break;case"printableString":d.value.printableString=l[y];break}else l[0]==="#"?d.value.anyValue=L.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return G.serialize(this.asn)}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Xe.get()):i=t[0]||Xe.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const ed="Cannot initialize GeneralName from ASN.1 data.",td=`${ed} Unsupported string format in use.`,Hh=`${ed} Value doesn't match to GUID regular expression.`,rd=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,id="1.3.6.1.4.1.311.25.1",nd="1.3.6.1.4.1.311.20.2.3",ga="dns",ba="dn",wa="email",va="ip",ka="url",Ca="guid",Sa="upn",to="id";class od extends Lt{constructor(...t){let r;if(t.length===2)switch(t[0]){case ba:{const i=new Ht(t[1]).toArrayBuffer(),o=G.parse(i,Ie);r=new ie({directoryName:o});break}case ga:r=new ie({dNSName:t[1]});break;case wa:r=new ie({rfc822Name:t[1]});break;case Ca:{const i=new RegExp(rd,"i").exec(t[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=i.slice(1).map((s,a)=>a<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ei({typeId:id,value:G.serialize(new ce(L.FromHex(o)))})});break}case va:r=new ie({iPAddress:t[1]});break;case to:r=new ie({registeredID:t[1]});break;case Sa:{r=new ie({otherName:new ei({typeId:nd,value:G.serialize(tl.toASN(t[1]))})});break}case ka:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else M.isBufferSource(t[0])?r=G.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=ga,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=wa,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=va,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=ka,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=to,this.value=t.registeredID;else if(t.directoryName!=null)this.type=ba,this.value=new Ht(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===id){this.type=Ca;const r=G.parse(t.otherName.value,ce),i=new RegExp(rd,"i").exec(L.ToHex(r));if(!i)throw new Error(Hh);this.value=i.slice(1).map((o,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===nd)this.type=Sa,this.value=G.parse(t.otherName.value,je).toString();else throw new Error(td);else throw new Error(td)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case ba:case ga:case Ca:case va:case to:case Sa:case ka:t=this.type.toUpperCase();break;case wa:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===to&&(r=Ut.toString(r)),new de(t,void 0,r)}}class Ci extends Lt{constructor(t){let r;if(t instanceof He)r=t;else if(Array.isArray(t)){const i=[];for(const o of t)if(o instanceof ie)i.push(o);else{const s=G.parse(new od(o.type,o.value).rawData,ie);i.push(s)}r=new He(i)}else if(M.isBufferSource(t))r=G.parse(t,He);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let o=null;try{o=new od(i)}catch{continue}r.push(o)}this.items=r}toJSON(){return this.items.map(t=>t.toJSON())}toTextObject(){const t=super.toTextObjectEmpty();for(const r of this.items){const i=r.toTextObject();let o=t[i[de.NAME]];Array.isArray(o)||(o=[],t[i[de.NAME]]=o),o.push(i)}return t}}Ci.NAME="GeneralNames";const Si="-{5}",xi="\\n",Fh=`[^${xi}]+`,qh=`${Si}BEGIN (${Fh}(?=${Si}))${Si}`,Kh=`${Si}END \\1${Si}`,$r="\\n",zh=`[^:${xi}]+`,Gh=`(?:[^${xi}]+${$r}(?: +[^${xi}]+${$r})*)`,Wh=`(?:[a-zA-Z0-9=+/]+${$r})+`,sd=`${qh}${$r}(?:((?:${zh}: ${Gh})+))?${$r}?(${Wh})${Kh}`;class et{static isPem(t){return typeof t=="string"&&new RegExp(sd,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(sd,"g"),i=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${xi}]+`,"g"),""),a={type:o[1],headers:[],rawData:L.FromBase64(s)},c=o[2];if(c){const l=c.split(new RegExp($r,"g"));let d=null;for(const y of l){const[p,B]=y.split(/:(.*)/);if(B===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=p.trim()}else d&&a.headers.push(d),d={key:p,value:B.trim()}}d&&a.headers.push(d)}i.push(a)}return i}static decode(t){return this.decodeWithHeaders(t).map(i=>i.rawData)}static decodeFirst(t){const r=this.decode(t);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(t,r){if(Array.isArray(t)){const i=new Array;return r?t.forEach(o=>{if(!M.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:M.toArrayBuffer(o)}))}):t.forEach(o=>{if(!("type"in o))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(o))}),i.join(`
116
116
  `)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:M.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),o=[];if(o.push(`-----BEGIN ${i}-----`),!((r=t.headers)===null||r===void 0)&&r.length){for(const d of t.headers)o.push(`${d.key}: ${d.value}`);o.push("")}const s=L.ToBase64(t.rawData);let a,c=0;const l=Array();for(;c<s.length&&(s.length-c<64?a=s.substring(c):(a=s.substring(c,c+64),c+=64),a.length!==0);)if(l.push(a),a.length<64)break;return o.push(...l),o.push(`-----END ${i}-----`),o.join(`
117
- `)}}et.CertificateTag="CERTIFICATE",et.CrlTag="CRL",et.CertificateRequestTag="CERTIFICATE REQUEST",et.PublicKeyTag="PUBLIC KEY",et.PrivateKeyTag="PRIVATE KEY";class Vt extends Lt{static isAsnEncoded(t){return M.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(et.isPem(t))return et.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return et.isPem(r)?et.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):M.toArrayBuffer(t)}}constructor(...t){Vt.isAsnEncoded(t[0])?super(Vt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return et.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ur extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Ot):super(t),this.tag=et.PublicKeyTag}async export(...t){let r,i=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,i=t[1]||i,r=t[2]||Xe.get()):r=t[0]||Xe.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=nt.resolve(Xn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Dr:{const o=G.parse(t.subjectPublicKey,zs),s=M.toUint8Array(o.modulus);i.publicExponent=M.toUint8Array(o.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Xe.get()):i=t[0]||Xe.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Xe.get());const r=G.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Ot);switch(t.Algorithm=cr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case yi:t["EC Point"]=r.subjectPublicKey;break;case Dr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class vt{static register(t,r){this.items.set(t,r)}static create(t){const r=new wt(t),i=this.items.get(r.type);return i?new i(t):r}}vt.items=new Map;const ro="crypto.signatureFormatter";class Jh{toAsnSignature(t,r){return M.toArrayBuffer(r)}toWebSignature(t,r){return M.toArrayBuffer(r)}}class io extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Cr):super(t),this.tag=et.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Ht(r.subject),this.subject=new Ht(r.subject).toString(),this.issuerName=new Ht(r.issuer),this.issuer=this.issuerName.toString();const i=nt.resolve(Xn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const o=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>vt.create(G.serialize(a)))),this.publicKey=new ur(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Xe.get()){let i,o;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(i,["verify"],r);else if(s instanceof ur)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(M.isBufferSource(s)){const d=new ur(s);i={...d.algorithm,...this.signatureAlgorithm},o=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=nt.resolveAll(ro).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,o,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Xe.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Xe.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Cr),i=r.tbsCertificate,o=new de("",{Version:`${kr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":cr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new de("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(o["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(o["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new de("");for(const a of this.extensions){const c=a.toTextObject();s[c[de.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new de("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends wt{static async create(t,r=!1,i=Xe.get()){if(t instanceof io||lr.isCryptoKey(t)){const o=t instanceof io?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new ur(s).getKeyIdentifier(i);return new Ai(L.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if(M.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new Lo(L.FromHex(t[0]))});super(Uo,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?G.parse(r.name.rawData,He):r.name,o=new tr({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Uo,t[1],G.serialize(o))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,tr);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,tr);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ci(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ai.NAME="Authority Key Identifier";class ad extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(cl,t[2],G.serialize(r)),this.ca=t[0],this.pathLength=t[1]}}toTextObject(){const t=this.toTextObjectWithoutValue();return this.ca&&(t.CA=this.ca),this.pathLength!==void 0&&(t["Path Length"]=this.pathLength),t}}ad.NAME="Basic Constraints";var cd;(function(e){e.serverAuth="1.3.6.1.5.5.7.3.1",e.clientAuth="1.3.6.1.5.5.7.3.2",e.codeSigning="1.3.6.1.5.5.7.3.3",e.emailProtection="1.3.6.1.5.5.7.3.4",e.timeStamping="1.3.6.1.5.5.7.3.8",e.ocspSigning="1.3.6.1.5.5.7.3.9"})(cd||(cd={}));class ld extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(hl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}ld.NAME="Extended Key Usages";var xa;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(xa||(xa={}));class Aa extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,rs);this.usages=r.toNumber()}else{const r=new rs(t[0]);super(gl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,rs);return t[""]=r.toJSON().join(", "),t}}Aa.NAME="Key Usages";class no extends wt{static async create(t,r=!1,i=Xe.get()){let o;t instanceof ur?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:M.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new ur(o).getKeyIdentifier(i);return new no(L.ToHex(a),r)}constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,$t);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new $t(r);super(Cl,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,$t);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ba extends wt{constructor(...t){M.isBufferSource(t[0])?super(t[0]):super(vl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,as);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Ba.NAME="Subject Alternative Name";class ud extends wt{constructor(...t){var r;if(M.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,sn);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(i.map(a=>new on({policyIdentifier:a})));super(ul,o,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new de("",{},Ut.toString(r))),t}}ud.NAME="Certificate Policies",vt.register(ul,ud);class Rr extends Lt{constructor(...t){let r;if(M.isBufferSource(t[0]))r=M.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>M.toArrayBuffer(s)):[];r=G.serialize(new Nt({type:i,values:o}))}super(r,Nt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new de("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[de.NAME]===Rr.NAME&&(t[de.NAME]=Ut.toString(this.type)),t}}Rr.NAME="Attribute";class dd extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(cu,[G.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[de.VALUE]=this.password,t}}dd.NAME="Challenge Password";class Ia extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new rr;for(const s of i)o.push(G.parse(s.rawData,lt));super(ca,[G.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],rr);this.items=r.map(i=>vt.create(G.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[de.NAME]]=i;return t}}Ia.NAME="Extensions";class oo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Rr(t),i=this.items.get(r.type);return i?new i(t):r}}oo.items=new Map;let Ea=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new K({algorithm:jn,parameters:null});case"sha-256":return new K({algorithm:Hs,parameters:null});case"sha-384":return new K({algorithm:Dn,parameters:null});case"sha-512":return new K({algorithm:Mn,parameters:null})}}else return new K({algorithm:Dr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Dr:return{name:"RSASSA-PKCS1-v1_5"};case jn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Hs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ea=u([Qs()],Ea),nt.registerSingleton(Qn,Ea);class ot{addPadding(t,r){const i=M.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=M.toUint8Array(t);for(let o=0;o<i.length;o++)if(i[o]){i=i.slice(o);break}if(r&&i[0]>127){const o=new Uint8Array(i.length+1);return o.set(i,1),o.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,o=ot.namedCurveSize.get(i)||ot.defaultNamedCurveSize,s=new Vn,a=M.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,Vn),o=t.namedCurve,s=ot.namedCurveSize.get(o)||ot.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return dp(a,c)}return null}}ot.namedCurveSize=new Map,ot.defaultNamedCurveSize=32;const fd="1.3.101.110",pd="1.3.101.111",hd="1.3.101.112",yd="1.3.101.113";let Na=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=hd;break;case"ed448":r=yd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=fd;break;case"x448":r=pd;break}}return r?new K({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case hd:return{name:"EdDSA",namedCurve:"Ed25519"};case yd:return{name:"EdDSA",namedCurve:"Ed448"};case fd:return{name:"ECDH-ES",namedCurve:"X25519"};case pd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Na=u([Qs()],Na),nt.registerSingleton(Qn,Na);class Yh extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,vi):super(t),this.tag=et.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new ur(t.certificationRequestInfo.subjectPKInfo);const r=nt.resolve(Xn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>oo.create(G.serialize(o)));const i=this.getAttribute(ca);this.extensions=[],i instanceof Ia&&(this.extensions=i.items),this.subjectName=new Ht(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Xe.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=nt.resolveAll(ro).reverse();let s=null;for(const c of o)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,vi),i=r.certificationRequestInfo,o=new de("",{Version:`${kr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new de("");for(const a of this.attributes){const c=a.toTextObject();s[c[de.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new de("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Yh.NAME="PKCS#10 Certificate Request";var gd;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(gd||(gd={})),vt.register(cl,ad),vt.register(hl,ld),vt.register(gl,Aa),vt.register(Cl,no),vt.register(Uo,Ai),vt.register(vl,Ba),oo.register(cu,dd),oo.register(ca,Ia),nt.registerSingleton(ro,Jh),nt.registerSingleton(ro,ot),ot.namedCurveSize.set("P-256",32),ot.namedCurveSize.set("K-256",32),ot.namedCurveSize.set("P-384",48),ot.namedCurveSize.set("P-521",66);function md(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new io(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ba){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof Aa){const s=Object.values(xa),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Zh(){const e=md(),t=n.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(o);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 Qh={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Xh(){const e=pr.createI18n("en-us",Qh);return{i18n:e,i18nT:pr.i18nTComponent(e)}}const kt={useCertificate:Zh,useI18n:Xh,useX509:md},Bi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}},ey={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},ty="Copy to clipboard",ry={message:ey,iconTitle:ty},iy="kong-ui-copy-uuid-notify",bd="24px",ny=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},oy=e=>(n.pushScopeId("data-v-ac7fcfb4"),e=e(),n.popScopeId(),e),sy=["aria-hidden"],ay={key:0,"data-testid":"kui-icon-svg-title"},cy=oy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),ly=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:bd,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return bd}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",ay,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),cy],8,sy))]),_:1},8,["aria-hidden","style"]))}}),uy=ny(ly,[["__scopeId","data-v-ac7fcfb4"]]),dy="16px",fy={class:"kong-ui-copy-uuid"},py=["onClick"],wd=15,hy=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=pr.createI18n("en-us",ry),i=e,o=t,s=i.notify||n.inject(iy,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var v;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(v=i.uuid)==null?void 0:v.substring(0,5)}`:i.uuid}),p=v=>{l.value=v,setTimeout(()=>{l.value=i.tooltip},1800)},B=v=>{var h,g;if(!v(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>wd,m=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((g=i.uuid)==null?void 0:g.substring(0,wd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(v,h)=>{const g=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",fy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(g,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>B(k),["stop"])},[n.createVNode(n.unref(uy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(dy),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,py)]),_:1})]),_:1},16))])}}}),yy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},gy=yy(hy,[["__scopeId","data-v-0c07874b"]]);var Oa=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(Oa||{}),dr=(e=>(e.Edit="edit",e.Create="create",e))(dr||{}),Ft=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ft||{}),le=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(le||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function _a(e={}){return{axiosInstance:op.create({withCredentials:!0,timeout:3e4,...e})}}function my(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ta="khcp-user-table-preferences",by={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function wy(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Ta));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=t();o.set(r,i),localStorage.setItem(Ta,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||by},deleteAllTablePreferences:()=>{localStorage.removeItem(Ta)}}}const vy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},ky={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Cy={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Configuring your API has never been easier. Use YAML for human-friendly simplicity or JSON for machine-readability. Streamline your settings effortlessly.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Sy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},xy={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},Ay={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},By={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Iy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ey={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ny={global:vy,deleteModal:ky,baseForm:Cy,baseTable:Sy,baseConfigCard:xy,filter:Ay,debouncedFilter:By,errors:Iy,toggleModal:Ey};function Va(){const e=pr.createI18n("en-us",Ny);return{i18n:e,i18nT:pr.i18nTComponent(e)}}function vd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const s of o){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function Oy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=_a({headers:e.requestHeaders}),{i18n:{t:s}}=Va(),{debounce:a}=my(),c=a(async w=>{await C(w)},200),l=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),B=n.ref([]),v=n.ref(void 0),h=n.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:k}=vd(),m=async()=>{try{l.value=!0;const{data:w}=await o.get(`${g}?size=${r}`);w!=null&&w.next||(v.value=i.fetchedItemsKey in w?w[i.fetchedItemsKey]:[]),B.value=i.fetchedItemsKey in w?w[i.fetchedItemsKey]:[],p.value=B.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},x=n.ref(""),C=async w=>{var O,$,re;if(x.value!==w)if(x.value=w||"",v.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let E=g+"";w&&(E+=`/${w}`);const{data:N}=await o.get(`${E}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(w){const E=[];k(w)&&i.searchKeys.includes("id")?E.push((async()=>{const{data:P}=await o.get(`${g}/${w}`);return[P[i.fetchedItemsKey]??P]})()):E.push(...i.searchKeys.filter(P=>P!=="id").map(async P=>{const{data:J}=await o.get(`${g}?${P}=${w}`);return J[i.fetchedItemsKey]}));const N=await Promise.all(E),q=new Set;p.value=[],(O=N==null?void 0:N.forEach)==null||O.call(N,P=>{var J;(J=P==null?void 0:P.forEach)==null||J.call(P,H=>{q.has(H.id)||(q.add(H.id),p.value.push(H))})})}else p.value=B.value}catch(E){(($=E==null?void 0:E.response)==null?void 0:$.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",w?(p.value=(re=v.value)==null?void 0:re.filter(E=>{var N;let q=!1;for(const P of i.searchKeys){const J=typeof E[P]=="string"?(N=E[P])==null?void 0:N.toLowerCase():E[P];J!=null&&J.includes(w.toLowerCase())&&(q=!0)}return q}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=v.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:v,loadItems:m,debouncedQueryChange:c}}function _y(e,t){const r=n.unref(t),i=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function Ty(){const{i18n:{t:e}}=Va();return{getMessageFromError:t=>{var r,i,o,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((o=t.response.data.details)!=null&&o.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Vy(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),o=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function kd(e,t){const r=n.ref(n.unref(e)),i=n.ref(n.unref(t)),o=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:B}=a;try{let v=new URL(s.value.href);return o.value&&B?(v.search="",v=r.value.app==="konnect"?new URL(`${v.href}?filter[name][contains]=${B}`):new URL(`${v.href}/${B}/`)):(o.value||new URLSearchParams(B).forEach((h,g)=>{v.searchParams.append(g,h)}),y&&v.searchParams.append("sort_by",y),p==="desc"&&v.searchParams.append("sort_desc","1"),v.searchParams.append("size",String(l))),d&&c!==1&&v.searchParams.append("offset",String(d)),v.href}catch(v){return console.error("RouteList(fetcher)",v),i.value}}}function jy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=_a({headers:e.requestHeaders}),s=kd(e,i),a=n.ref({status:Ft.Idle});return{fetcher:async c=>{try{a.value={status:Ft.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:d}=await o.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const B={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ft.Idle,response:B},B}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Ft.NoResults,response:d,error:l},d):(a.value={status:Ft.Error,response:d,error:l},d)}},fetcherState:a}}function Dy(){const e=(r,i="_")=>r?r.split(i).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Cd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Sd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Cd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},xd=e=>e==="*"||e==="x"||e==="X",Ad=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},My=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Py=(e,t)=>{if(xd(e)||xd(t))return 0;const[r,i]=My(Ad(e),Ad(t));return r>i?1:r<i?-1:0},Bd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Py(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},$y=(e,t)=>{const r=Sd(e),i=Sd(t),o=r.pop(),s=i.pop(),a=Bd(r,i);return a!==0?a:o&&s?Bd(o.split("."),s.split(".")):o||s?o?-1:1:0},Id=(e,t,r)=>{Ry(r);const i=$y(e,t);return Ed[r].includes(i)},Ed={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Nd=Object.keys(Ed),Ry=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Nd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Nd.join("|")}`)},Uy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Cd.test(e);function Ly(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Uy(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Id(o,a,"<")||c&&Id(o,c,">"))}function Hy(e){const t=n.ref(0),r=n.ref(0),i=n.ref(!1);return n.watch(e,o=>{o&&!i.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const Te={useAxios:_a,useDebouncedFilter:Oy,useDeleteUrlBuilder:_y,useErrors:Ty,useExternalLinkCreator:Vy,useFetcher:jy,useFetchUrlBuilder:kd,useHelpers:vd,useStringHelpers:Dy,useI18n:Va,useGatewayFeatureSupported:Ly,useTruncationDetector:Hy},Fy={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},qy="Copy to clipboard",Ky={message:Fy,iconTitle:qy},zy="kong-ui-copy-uuid-notify",Od="24px",Gy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Wy=e=>(n.pushScopeId("data-v-ac7fcfb4"),e=e(),n.popScopeId(),e),Jy=["aria-hidden"],Yy={key:0,"data-testid":"kui-icon-svg-title"},Zy=Wy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Qy=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Od,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Od}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Yy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Zy],8,Jy))]),_:1},8,["aria-hidden","style"]))}}),Xy=Gy(Qy,[["__scopeId","data-v-ac7fcfb4"]]),eg="16px",tg={class:"kong-ui-copy-uuid"},rg=["onClick"],_d=15,ig=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=pr.createI18n("en-us",Ky),i=e,o=t,s=i.notify||n.inject(zy,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var v;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(v=i.uuid)==null?void 0:v.substring(0,5)}`:i.uuid}),p=v=>{l.value=v,setTimeout(()=>{l.value=i.tooltip},1800)},B=v=>{var h,g;if(!v(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>_d,m=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((g=i.uuid)==null?void 0:g.substring(0,_d))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(v,h)=>{const g=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",tg,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(g,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>B(k),["stop"])},[n.createVNode(n.unref(Xy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(eg),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,rg)]),_:1})]),_:1},16))])}}}),ng=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Td=ng(ig,[["__scopeId","data-v-0c07874b"]]),og={key:0,class:"config-card-fieldset-title"},sg=n.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Te.useI18n(),{convertKeyToTitle:i}=Te.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=n.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:n.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:n.withCtx(()=>[e.isArrayItem?(n.openBlock(),n.createElementBlock("legend",og,[n.createElementVNode("b",null,n.toDisplayString(c.value),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(a.value),(y,p)=>(n.openBlock(),n.createBlock(Ii,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),dt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Vd=dt(sg,[["__scopeId","data-v-68ca83ec"]]),ag=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Te.useI18n();return(r,i)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.value||n.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),cg=dt(ag,[["__scopeId","data-v-c96811e5"]]),lg=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Te.useI18n();return(r,i)=>{const o=n.resolveComponent("KBadge");return n.openBlock(),n.createBlock(o,{appearance:e.status?"success":"neutral"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.status?n.unref(t)("baseConfigCard.statusBadge.enabledLabel"):n.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),ug="#0044f4",dg="#e0e4ea",fg="#3a3f51",pg="1px",hg="20px",yg={class:"config-card-details-row"},gg=["data-testid"],mg=["data-testid"],bg=["data-testid"],wg=["data-testid"],vg={key:1},kg=["data-testid"],Cg=["data-testid"],Sg=["data-testid"],xg=["data-testid"],Ag={name:"ConfigCardItem",components:{CopyUuid:Td,JsonCardItem:Vd,StatusBadge:lg,InternalLinkItem:cg}},Bg=n.defineComponent({...Ag,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){n.useCssVars(h=>({"0da74440":y.value?"none":`solid ${n.unref(pg)} ${n.unref(dg)}`,"02a039da":d.value&&c.value?"block":"flex","690f3ced":d.value&&c.value?"100%":r.slim?"50%":"25%","691182c8":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Te.useI18n(),c=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=n.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=n.computed(()=>r.item.type===le.Json||r.item.type===le.JsonArray),y=n.computed(()=>r.item.type===le.JsonArray),p=n.computed(()=>{switch(r.item.type){case le.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case le.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case le.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case le.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case le.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case le.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case le.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case le.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case le.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case le.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case le.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case le.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),B=n.ref(),{isTruncated:v}=Te.useTruncationDetector(B);return(h,g)=>{const k=n.resolveComponent("KLabel"),m=n.resolveComponent("KBadge"),x=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",yg,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(k,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(h.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,mg)]),key:"0"}:void 0]),1024)],!0)],8,gg),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(n.openBlock(),n.createElementBlock("div",vg,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value.tag),n.normalizeProps(n.guardReactiveProps(p.value.attrs)),{default:n.withCtx(()=>[p.value.additionalComponent==="KBadge"?(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(C,w)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-tag-${w}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${w}`,tooltip:C,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,kg)):n.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(C,w)=>(n.openBlock(),n.createBlock(n.unref(Td),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${w}`,"data-testid":`${e.item.key}-copy-uuid-${w}`,uuid:C}),null,16,["data-testid","uuid"]))),128))],8,Cg)):p.value.additionalComponent==="KMethodBadge"?(n.openBlock(),n.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(C,w)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-method-${w}`,appearance:Object.values(n.unref(sp.BadgeMethodAppearances)).includes(C.toLowerCase())?C.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${w}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Sg)):n.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(n.openBlock(),n.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(C,w)=>(n.openBlock(),n.createBlock(Vd,{key:`json-array-item-${w}`,index:w,"is-array-item":"",item:C},null,8,["index","item"]))),128))],8,xg)):(n.openBlock(),n.createBlock(x,{key:4,label:n.unref(v)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:B,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,wg))],!0)],8,bg)])}}}),Ii=dt(Bg,[["__scopeId","data-v-9c87856b"]]),Ig={class:"json-config"},Eg={key:0,class:"json-endpoint"},jd=n.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){n.useCssVars(o=>({cd7a6ba0:`${i.value}ch`}));const t=e,r=n.reactive(t.jsonRecord),i=n.computed(()=>{var o;if(!t.fetcherUrl)return 0;const s=(o=t.fetcherUrl)==null?void 0:o.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(o,s)=>{var a;const c=n.resolveComponent("KBadge"),l=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",Ig,[t.fetcherUrl&&(a=t.config)!=null&&a.jsonYamlMilestone2Enabled?(n.openBlock(),n.createElementBlock("div",Eg,[n.createVNode(c,{appearance:t.requestMethod},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),n.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),t.jsonRecord?(n.openBlock(),n.createBlock(l,{key:1,id:"json-codeblock",class:n.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r,null,2),language:"json",theme:"dark"},null,8,["class","code"])):n.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Dd(e){return typeof e>"u"||e===null}function Ng(e){return typeof e=="object"&&e!==null}function Og(e){return Array.isArray(e)?e:Dd(e)?[]:[e]}function _g(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}function Tg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function Vg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var jg=Dd,Dg=Ng,Mg=Og,Pg=Tg,$g=Vg,Rg=_g,Ne={isNothing:jg,isObject:Dg,toArray:Mg,repeat:Pg,isNegativeZero:$g,extend:Rg};function Md(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
117
+ `)}}et.CertificateTag="CERTIFICATE",et.CrlTag="CRL",et.CertificateRequestTag="CERTIFICATE REQUEST",et.PublicKeyTag="PUBLIC KEY",et.PrivateKeyTag="PRIVATE KEY";class Vt extends Lt{static isAsnEncoded(t){return M.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(et.isPem(t))return et.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return et.isPem(r)?et.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):M.toArrayBuffer(t)}}constructor(...t){Vt.isAsnEncoded(t[0])?super(Vt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return et.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ur extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Ot):super(t),this.tag=et.PublicKeyTag}async export(...t){let r,i=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,i=t[1]||i,r=t[2]||Xe.get()):r=t[0]||Xe.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=nt.resolve(Xn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Dr:{const o=G.parse(t.subjectPublicKey,zs),s=M.toUint8Array(o.modulus);i.publicExponent=M.toUint8Array(o.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Xe.get()):i=t[0]||Xe.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Xe.get());const r=G.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Ot);switch(t.Algorithm=cr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case yi:t["EC Point"]=r.subjectPublicKey;break;case Dr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class vt{static register(t,r){this.items.set(t,r)}static create(t){const r=new wt(t),i=this.items.get(r.type);return i?new i(t):r}}vt.items=new Map;const ro="crypto.signatureFormatter";class Jh{toAsnSignature(t,r){return M.toArrayBuffer(r)}toWebSignature(t,r){return M.toArrayBuffer(r)}}class io extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Cr):super(t),this.tag=et.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Ht(r.subject),this.subject=new Ht(r.subject).toString(),this.issuerName=new Ht(r.issuer),this.issuer=this.issuerName.toString();const i=nt.resolve(Xn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const o=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>vt.create(G.serialize(a)))),this.publicKey=new ur(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Xe.get()){let i,o;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(i,["verify"],r);else if(s instanceof ur)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(M.isBufferSource(s)){const d=new ur(s);i={...d.algorithm,...this.signatureAlgorithm},o=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=nt.resolveAll(ro).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,o,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Xe.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Xe.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Cr),i=r.tbsCertificate,o=new de("",{Version:`${kr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":cr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new de("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(o["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(o["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new de("");for(const a of this.extensions){const c=a.toTextObject();s[c[de.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new de("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends wt{static async create(t,r=!1,i=Xe.get()){if(t instanceof io||lr.isCryptoKey(t)){const o=t instanceof io?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new ur(s).getKeyIdentifier(i);return new Ai(L.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if(M.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new Lo(L.FromHex(t[0]))});super(Uo,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?G.parse(r.name.rawData,He):r.name,o=new tr({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Uo,t[1],G.serialize(o))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,tr);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,tr);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ci(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ai.NAME="Authority Key Identifier";class ad extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(cl,t[2],G.serialize(r)),this.ca=t[0],this.pathLength=t[1]}}toTextObject(){const t=this.toTextObjectWithoutValue();return this.ca&&(t.CA=this.ca),this.pathLength!==void 0&&(t["Path Length"]=this.pathLength),t}}ad.NAME="Basic Constraints";var cd;(function(e){e.serverAuth="1.3.6.1.5.5.7.3.1",e.clientAuth="1.3.6.1.5.5.7.3.2",e.codeSigning="1.3.6.1.5.5.7.3.3",e.emailProtection="1.3.6.1.5.5.7.3.4",e.timeStamping="1.3.6.1.5.5.7.3.8",e.ocspSigning="1.3.6.1.5.5.7.3.9"})(cd||(cd={}));class ld extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(hl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}ld.NAME="Extended Key Usages";var xa;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(xa||(xa={}));class Aa extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,rs);this.usages=r.toNumber()}else{const r=new rs(t[0]);super(ml,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,rs);return t[""]=r.toJSON().join(", "),t}}Aa.NAME="Key Usages";class no extends wt{static async create(t,r=!1,i=Xe.get()){let o;t instanceof ur?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:M.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new ur(o).getKeyIdentifier(i);return new no(L.ToHex(a),r)}constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,$t);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new $t(r);super(Cl,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,$t);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ba extends wt{constructor(...t){M.isBufferSource(t[0])?super(t[0]):super(vl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,as);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Ba.NAME="Subject Alternative Name";class ud extends wt{constructor(...t){var r;if(M.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,sn);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(i.map(a=>new on({policyIdentifier:a})));super(ul,o,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new de("",{},Ut.toString(r))),t}}ud.NAME="Certificate Policies",vt.register(ul,ud);class Rr extends Lt{constructor(...t){let r;if(M.isBufferSource(t[0]))r=M.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>M.toArrayBuffer(s)):[];r=G.serialize(new Nt({type:i,values:o}))}super(r,Nt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new de("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[de.NAME]===Rr.NAME&&(t[de.NAME]=Ut.toString(this.type)),t}}Rr.NAME="Attribute";class dd extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(cu,[G.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[de.VALUE]=this.password,t}}dd.NAME="Challenge Password";class Ia extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new rr;for(const s of i)o.push(G.parse(s.rawData,lt));super(ca,[G.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],rr);this.items=r.map(i=>vt.create(G.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[de.NAME]]=i;return t}}Ia.NAME="Extensions";class oo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Rr(t),i=this.items.get(r.type);return i?new i(t):r}}oo.items=new Map;let Ea=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new K({algorithm:jn,parameters:null});case"sha-256":return new K({algorithm:Hs,parameters:null});case"sha-384":return new K({algorithm:Dn,parameters:null});case"sha-512":return new K({algorithm:Mn,parameters:null})}}else return new K({algorithm:Dr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Dr:return{name:"RSASSA-PKCS1-v1_5"};case jn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Hs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ea=u([Qs()],Ea),nt.registerSingleton(Qn,Ea);class ot{addPadding(t,r){const i=M.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=M.toUint8Array(t);for(let o=0;o<i.length;o++)if(i[o]){i=i.slice(o);break}if(r&&i[0]>127){const o=new Uint8Array(i.length+1);return o.set(i,1),o.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,o=ot.namedCurveSize.get(i)||ot.defaultNamedCurveSize,s=new Vn,a=M.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,Vn),o=t.namedCurve,s=ot.namedCurveSize.get(o)||ot.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return dp(a,c)}return null}}ot.namedCurveSize=new Map,ot.defaultNamedCurveSize=32;const fd="1.3.101.110",pd="1.3.101.111",hd="1.3.101.112",yd="1.3.101.113";let Na=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=hd;break;case"ed448":r=yd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=fd;break;case"x448":r=pd;break}}return r?new K({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case hd:return{name:"EdDSA",namedCurve:"Ed25519"};case yd:return{name:"EdDSA",namedCurve:"Ed448"};case fd:return{name:"ECDH-ES",namedCurve:"X25519"};case pd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Na=u([Qs()],Na),nt.registerSingleton(Qn,Na);class Yh extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,vi):super(t),this.tag=et.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new ur(t.certificationRequestInfo.subjectPKInfo);const r=nt.resolve(Xn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>oo.create(G.serialize(o)));const i=this.getAttribute(ca);this.extensions=[],i instanceof Ia&&(this.extensions=i.items),this.subjectName=new Ht(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Xe.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=nt.resolveAll(ro).reverse();let s=null;for(const c of o)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,vi),i=r.certificationRequestInfo,o=new de("",{Version:`${kr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new de("");for(const a of this.attributes){const c=a.toTextObject();s[c[de.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new de("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Yh.NAME="PKCS#10 Certificate Request";var md;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(md||(md={})),vt.register(cl,ad),vt.register(hl,ld),vt.register(ml,Aa),vt.register(Cl,no),vt.register(Uo,Ai),vt.register(vl,Ba),oo.register(cu,dd),oo.register(ca,Ia),nt.registerSingleton(ro,Jh),nt.registerSingleton(ro,ot),ot.namedCurveSize.set("P-256",32),ot.namedCurveSize.set("K-256",32),ot.namedCurveSize.set("P-384",48),ot.namedCurveSize.set("P-521",66);function gd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new io(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ba){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof Aa){const s=Object.values(xa),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Zh(){const e=gd(),t=n.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(o);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 Qh={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Xh(){const e=pr.createI18n("en-us",Qh);return{i18n:e,i18nT:pr.i18nTComponent(e)}}const kt={useCertificate:Zh,useI18n:Xh,useX509:gd},Bi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}},ey={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},ty="Copy to clipboard",ry={message:ey,iconTitle:ty},iy="kong-ui-copy-uuid-notify",bd="24px",ny=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},oy=e=>(n.pushScopeId("data-v-ac7fcfb4"),e=e(),n.popScopeId(),e),sy=["aria-hidden"],ay={key:0,"data-testid":"kui-icon-svg-title"},cy=oy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),ly=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:bd,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return bd}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",ay,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),cy],8,sy))]),_:1},8,["aria-hidden","style"]))}}),uy=ny(ly,[["__scopeId","data-v-ac7fcfb4"]]),dy="16px",fy={class:"kong-ui-copy-uuid"},py=["onClick"],wd=15,hy=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=pr.createI18n("en-us",ry),i=e,o=t,s=i.notify||n.inject(iy,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var v;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(v=i.uuid)==null?void 0:v.substring(0,5)}`:i.uuid}),p=v=>{l.value=v,setTimeout(()=>{l.value=i.tooltip},1800)},B=v=>{var h,m;if(!v(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>wd,g=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((m=i.uuid)==null?void 0:m.substring(0,wd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(v,h)=>{const m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",fy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(g=>B(k),["stop"])},[n.createVNode(n.unref(uy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(dy),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,py)]),_:1})]),_:1},16))])}}}),yy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},my=yy(hy,[["__scopeId","data-v-0c07874b"]]);var Oa=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(Oa||{}),dr=(e=>(e.Edit="edit",e.Create="create",e))(dr||{}),Ft=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ft||{}),le=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(le||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function _a(e={}){return{axiosInstance:op.create({withCredentials:!0,timeout:3e4,...e})}}function gy(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ta="khcp-user-table-preferences",by={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function wy(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Ta));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=t();o.set(r,i),localStorage.setItem(Ta,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||by},deleteAllTablePreferences:()=>{localStorage.removeItem(Ta)}}}const vy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},ky={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Cy={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Configuring your API has never been easier. Use YAML for human-friendly simplicity or JSON for machine-readability. Streamline your settings effortlessly.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Sy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},xy={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},Ay={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},By={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Iy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ey={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ny={global:vy,deleteModal:ky,baseForm:Cy,baseTable:Sy,baseConfigCard:xy,filter:Ay,debouncedFilter:By,errors:Iy,toggleModal:Ey};function Va(){const e=pr.createI18n("en-us",Ny);return{i18n:e,i18nT:pr.i18nTComponent(e)}}function vd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const s of o){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function Oy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=_a({headers:e.requestHeaders}),{i18n:{t:s}}=Va(),{debounce:a}=gy(),c=a(async w=>{await C(w)},200),l=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),B=n.ref([]),v=n.ref(void 0),h=n.unref(t);let m=`${e.apiBaseUrl}${h}`;e.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:k}=vd(),g=async()=>{try{l.value=!0;const{data:w}=await o.get(`${m}?size=${r}`);w!=null&&w.next||(v.value=i.fetchedItemsKey in w?w[i.fetchedItemsKey]:[]),B.value=i.fetchedItemsKey in w?w[i.fetchedItemsKey]:[],p.value=B.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},x=n.ref(""),C=async w=>{var O,$,re;if(x.value!==w)if(x.value=w||"",v.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let E=m+"";w&&(E+=`/${w}`);const{data:N}=await o.get(`${E}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(w){const E=[];k(w)&&i.searchKeys.includes("id")?E.push((async()=>{const{data:P}=await o.get(`${m}/${w}`);return[P[i.fetchedItemsKey]??P]})()):E.push(...i.searchKeys.filter(P=>P!=="id").map(async P=>{const{data:J}=await o.get(`${m}?${P}=${w}`);return J[i.fetchedItemsKey]}));const N=await Promise.all(E),q=new Set;p.value=[],(O=N==null?void 0:N.forEach)==null||O.call(N,P=>{var J;(J=P==null?void 0:P.forEach)==null||J.call(P,H=>{q.has(H.id)||(q.add(H.id),p.value.push(H))})})}else p.value=B.value}catch(E){(($=E==null?void 0:E.response)==null?void 0:$.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",w?(p.value=(re=v.value)==null?void 0:re.filter(E=>{var N;let q=!1;for(const P of i.searchKeys){const J=typeof E[P]=="string"?(N=E[P])==null?void 0:N.toLowerCase():E[P];J!=null&&J.includes(w.toLowerCase())&&(q=!0)}return q}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=v.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:v,loadItems:g,debouncedQueryChange:c}}function _y(e,t){const r=n.unref(t),i=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function Ty(){const{i18n:{t:e}}=Va();return{getMessageFromError:t=>{var r,i,o,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((o=t.response.data.details)!=null&&o.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Vy(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),o=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function kd(e,t){const r=n.ref(n.unref(e)),i=n.ref(n.unref(t)),o=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:B}=a;try{let v=new URL(s.value.href);return o.value&&B?(v.search="",v=r.value.app==="konnect"?new URL(`${v.href}?filter[name][contains]=${B}`):new URL(`${v.href}/${B}/`)):(o.value||new URLSearchParams(B).forEach((h,m)=>{v.searchParams.append(m,h)}),y&&v.searchParams.append("sort_by",y),p==="desc"&&v.searchParams.append("sort_desc","1"),v.searchParams.append("size",String(l))),d&&c!==1&&v.searchParams.append("offset",String(d)),v.href}catch(v){return console.error("RouteList(fetcher)",v),i.value}}}function jy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=_a({headers:e.requestHeaders}),s=kd(e,i),a=n.ref({status:Ft.Idle});return{fetcher:async c=>{try{a.value={status:Ft.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:d}=await o.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const B={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ft.Idle,response:B},B}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Ft.NoResults,response:d,error:l},d):(a.value={status:Ft.Error,response:d,error:l},d)}},fetcherState:a}}function Dy(){const e=(r,i="_")=>r?r.split(i).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Cd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Sd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Cd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},xd=e=>e==="*"||e==="x"||e==="X",Ad=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},My=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Py=(e,t)=>{if(xd(e)||xd(t))return 0;const[r,i]=My(Ad(e),Ad(t));return r>i?1:r<i?-1:0},Bd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Py(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},$y=(e,t)=>{const r=Sd(e),i=Sd(t),o=r.pop(),s=i.pop(),a=Bd(r,i);return a!==0?a:o&&s?Bd(o.split("."),s.split(".")):o||s?o?-1:1:0},Id=(e,t,r)=>{Ry(r);const i=$y(e,t);return Ed[r].includes(i)},Ed={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Nd=Object.keys(Ed),Ry=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Nd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Nd.join("|")}`)},Uy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Cd.test(e);function Ly(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Uy(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Id(o,a,"<")||c&&Id(o,c,">"))}function Hy(e){const t=n.ref(0),r=n.ref(0),i=n.ref(!1);return n.watch(e,o=>{o&&!i.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const Te={useAxios:_a,useDebouncedFilter:Oy,useDeleteUrlBuilder:_y,useErrors:Ty,useExternalLinkCreator:Vy,useFetcher:jy,useFetchUrlBuilder:kd,useHelpers:vd,useStringHelpers:Dy,useI18n:Va,useGatewayFeatureSupported:Ly,useTruncationDetector:Hy},Fy={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},qy="Copy to clipboard",Ky={message:Fy,iconTitle:qy},zy="kong-ui-copy-uuid-notify",Od="24px",Gy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Wy=e=>(n.pushScopeId("data-v-ac7fcfb4"),e=e(),n.popScopeId(),e),Jy=["aria-hidden"],Yy={key:0,"data-testid":"kui-icon-svg-title"},Zy=Wy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Qy=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Od,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Od}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Yy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Zy],8,Jy))]),_:1},8,["aria-hidden","style"]))}}),Xy=Gy(Qy,[["__scopeId","data-v-ac7fcfb4"]]),em="16px",tm={class:"kong-ui-copy-uuid"},rm=["onClick"],_d=15,im=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=pr.createI18n("en-us",Ky),i=e,o=t,s=i.notify||n.inject(zy,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var v;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(v=i.uuid)==null?void 0:v.substring(0,5)}`:i.uuid}),p=v=>{l.value=v,setTimeout(()=>{l.value=i.tooltip},1800)},B=v=>{var h,m;if(!v(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>_d,g=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((m=i.uuid)==null?void 0:m.substring(0,_d))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(v,h)=>{const m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",tm,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(g=>B(k),["stop"])},[n.createVNode(n.unref(Xy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(em),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,rm)]),_:1})]),_:1},16))])}}}),nm=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Td=nm(im,[["__scopeId","data-v-0c07874b"]]),om={key:0,class:"config-card-fieldset-title"},sm=n.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Te.useI18n(),{convertKeyToTitle:i}=Te.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=n.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:n.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:n.withCtx(()=>[e.isArrayItem?(n.openBlock(),n.createElementBlock("legend",om,[n.createElementVNode("b",null,n.toDisplayString(c.value),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(a.value),(y,p)=>(n.openBlock(),n.createBlock(Ii,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),dt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Vd=dt(sm,[["__scopeId","data-v-68ca83ec"]]),am=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Te.useI18n();return(r,i)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.value||n.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),cm=dt(am,[["__scopeId","data-v-c96811e5"]]),lm=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Te.useI18n();return(r,i)=>{const o=n.resolveComponent("KBadge");return n.openBlock(),n.createBlock(o,{appearance:e.status?"success":"neutral"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.status?n.unref(t)("baseConfigCard.statusBadge.enabledLabel"):n.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),um="#0044f4",dm="#e0e4ea",fm="#3a3f51",pm="1px",hm="20px",ym={class:"config-card-details-row"},mm=["data-testid"],gm=["data-testid"],bm=["data-testid"],wm=["data-testid"],vm={key:1},km=["data-testid"],Cm=["data-testid"],Sm=["data-testid"],xm=["data-testid"],Am={name:"ConfigCardItem",components:{CopyUuid:Td,JsonCardItem:Vd,StatusBadge:lm,InternalLinkItem:cm}},Bm=n.defineComponent({...Am,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){n.useCssVars(h=>({"0da74440":y.value?"none":`solid ${n.unref(pm)} ${n.unref(dm)}`,"02a039da":d.value&&c.value?"block":"flex","690f3ced":d.value&&c.value?"100%":r.slim?"50%":"25%","691182c8":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Te.useI18n(),c=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=n.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=n.computed(()=>r.item.type===le.Json||r.item.type===le.JsonArray),y=n.computed(()=>r.item.type===le.JsonArray),p=n.computed(()=>{switch(r.item.type){case le.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case le.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case le.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case le.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case le.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case le.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case le.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case le.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case le.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case le.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case le.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case le.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),B=n.ref(),{isTruncated:v}=Te.useTruncationDetector(B);return(h,m)=>{const k=n.resolveComponent("KLabel"),g=n.resolveComponent("KBadge"),x=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",ym,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(k,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(h.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,gm)]),key:"0"}:void 0]),1024)],!0)],8,mm),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(n.openBlock(),n.createElementBlock("div",vm,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value.tag),n.normalizeProps(n.guardReactiveProps(p.value.attrs)),{default:n.withCtx(()=>[p.value.additionalComponent==="KBadge"?(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(C,w)=>(n.openBlock(),n.createBlock(g,{key:`${e.item.key}-badge-tag-${w}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${w}`,tooltip:C,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,km)):n.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(C,w)=>(n.openBlock(),n.createBlock(n.unref(Td),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${w}`,"data-testid":`${e.item.key}-copy-uuid-${w}`,uuid:C}),null,16,["data-testid","uuid"]))),128))],8,Cm)):p.value.additionalComponent==="KMethodBadge"?(n.openBlock(),n.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(C,w)=>(n.openBlock(),n.createBlock(g,{key:`${e.item.key}-badge-method-${w}`,appearance:Object.values(n.unref(sp.BadgeMethodAppearances)).includes(C.toLowerCase())?C.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${w}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Sm)):n.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(n.openBlock(),n.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(C,w)=>(n.openBlock(),n.createBlock(Vd,{key:`json-array-item-${w}`,index:w,"is-array-item":"",item:C},null,8,["index","item"]))),128))],8,xm)):(n.openBlock(),n.createBlock(x,{key:4,label:n.unref(v)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:B,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,wm))],!0)],8,bm)])}}}),Ii=dt(Bm,[["__scopeId","data-v-9c87856b"]]),Im={class:"json-config"},Em={key:0,class:"json-endpoint"},jd=n.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){n.useCssVars(o=>({50594668:`${i.value}ch`}));const t=e,r=n.reactive(t.jsonRecord),i=n.computed(()=>{var o;if(!t.fetcherUrl)return 0;const s=(o=t.fetcherUrl)==null?void 0:o.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(o,s)=>{var a;const c=n.resolveComponent("KBadge"),l=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",Im,[t.fetcherUrl&&(a=t.config)!=null&&a.jsonYamlFormsEnabled?(n.openBlock(),n.createElementBlock("div",Em,[n.createVNode(c,{appearance:t.requestMethod},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),n.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),t.jsonRecord?(n.openBlock(),n.createBlock(l,{key:1,id:"json-codeblock",class:n.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r,null,2),language:"json",theme:"dark"},null,8,["class","code"])):n.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Dd(e){return typeof e>"u"||e===null}function Nm(e){return typeof e=="object"&&e!==null}function Om(e){return Array.isArray(e)?e:Dd(e)?[]:[e]}function _m(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}function Tm(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function Vm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var jm=Dd,Dm=Nm,Mm=Om,Pm=Tm,$m=Vm,Rm=_m,Ne={isNothing:jm,isObject:Dm,toArray:Mm,repeat:Pm,isNegativeZero:$m,extend:Rm};function Md(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
118
118
 
119
- `+e.mark.snippet),i+" "+r):i}function Ei(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Md(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.toString=function(e){return this.name+": "+Md(this,e)};var Fe=Ei;function ja(e,t,r,i,o){var s="",a="",c=Math.floor(o/2)-1;return i-t>c&&(s=" ... ",t=i-c+s.length),r-i>c&&(a=" ...",r=i+c-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Da(e,t){return Ne.repeat(" ",t-e.length)+e}function Ug(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var c="",l,d,y=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+y+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=ja(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),p),c=Ne.repeat(" ",t.indent)+Da((e.line-l+1).toString(),y)+" | "+d.str+`
119
+ `+e.mark.snippet),i+" "+r):i}function Ei(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Md(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.toString=function(e){return this.name+": "+Md(this,e)};var Fe=Ei;function ja(e,t,r,i,o){var s="",a="",c=Math.floor(o/2)-1;return i-t>c&&(s=" ... ",t=i-c+s.length),r-i>c&&(a=" ...",r=i+c-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Da(e,t){return Ne.repeat(" ",t-e.length)+e}function Um(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var c="",l,d,y=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+y+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=ja(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),p),c=Ne.repeat(" ",t.indent)+Da((e.line-l+1).toString(),y)+" | "+d.str+`
120
120
  `+c;for(d=ja(e.buffer,i[a],o[a],e.position,p),c+=Ne.repeat(" ",t.indent)+Da((e.line+1).toString(),y)+" | "+d.str+`
121
121
  `,c+=Ne.repeat("-",t.indent+y+3+d.pos)+`^
122
122
  `,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)d=ja(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),p),c+=Ne.repeat(" ",t.indent)+Da((e.line+l+1).toString(),y)+" | "+d.str+`
123
- `;return c.replace(/\n$/,"")}var Lg=Ug,Hg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Fg=["scalar","sequence","mapping"];function qg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function Kg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Hg.indexOf(r)===-1)throw new Fe('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=qg(t.styleAliases||null),Fg.indexOf(this.kind)===-1)throw new Fe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Me=Kg;function Pd(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}function zg(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}function Ma(e){return this.extend(e)}Ma.prototype.extend=function(e){var t=[],r=[];if(e instanceof Me)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new Fe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof Me))throw new Fe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Fe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Fe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof Me))throw new Fe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Ma.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Pd(i,"implicit"),i.compiledExplicit=Pd(i,"explicit"),i.compiledTypeMap=zg(i.compiledImplicit,i.compiledExplicit),i};var $d=Ma,Rd=new Me("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ud=new Me("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ld=new Me("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Hd=new $d({explicit:[Rd,Ud,Ld]});function Gg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Wg(){return null}function Jg(e){return e===null}var Fd=new Me("tag:yaml.org,2002:null",{kind:"scalar",resolve:Gg,construct:Wg,predicate:Jg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Yg(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Zg(e){return e==="true"||e==="True"||e==="TRUE"}function Qg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var qd=new Me("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Yg,construct:Zg,predicate:Qg,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Xg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function em(e){return 48<=e&&e<=55}function tm(e){return 48<=e&&e<=57}function rm(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Xg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!em(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!tm(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function im(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function nm(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ne.isNegativeZero(e)}var Kd=new Me("tag:yaml.org,2002:int",{kind:"scalar",resolve:rm,construct:im,predicate:nm,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),om=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function sm(e){return!(e===null||!om.test(e)||e[e.length-1]==="_")}function am(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var cm=/^[-+]?[0-9]+e/;function lm(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ne.isNegativeZero(e))return"-0.0";return r=e.toString(10),cm.test(r)?r.replace("e",".e"):r}function um(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ne.isNegativeZero(e))}var zd=new Me("tag:yaml.org,2002:float",{kind:"scalar",resolve:sm,construct:am,predicate:um,represent:lm,defaultStyle:"lowercase"}),Gd=Hd.extend({implicit:[Fd,qd,Kd,zd]}),Wd=Gd,Jd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Yd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function dm(e){return e===null?!1:Jd.exec(e)!==null||Yd.exec(e)!==null}function fm(e){var t,r,i,o,s,a,c,l=0,d=null,y,p,B;if(t=Jd.exec(e),t===null&&(t=Yd.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(y=+t[10],p=+(t[11]||0),d=(y*60+p)*6e4,t[9]==="-"&&(d=-d)),B=new Date(Date.UTC(r,i,o,s,a,c,l)),d&&B.setTime(B.getTime()-d),B}function pm(e){return e.toISOString()}var Zd=new Me("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:dm,construct:fm,instanceOf:Date,represent:pm});function hm(e){return e==="<<"||e===null}var Qd=new Me("tag:yaml.org,2002:merge",{kind:"scalar",resolve:hm}),Pa=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
124
- \r`;function ym(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Pa;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function gm(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Pa,a=0,c=[];for(t=0;t<o;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):r===18?(c.push(a>>10&255),c.push(a>>2&255)):r===12&&c.push(a>>4&255),new Uint8Array(c)}function mm(e){var t="",r=0,i,o,s=e.length,a=Pa;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function bm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Xd=new Me("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ym,construct:gm,predicate:bm,represent:mm}),wm=Object.prototype.hasOwnProperty,vm=Object.prototype.toString;function km(e){if(e===null)return!0;var t=[],r,i,o,s,a,c=e;for(r=0,i=c.length;r<i;r+=1){if(o=c[r],a=!1,vm.call(o)!=="[object Object]")return!1;for(s in o)if(wm.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function Cm(e){return e!==null?e:[]}var ef=new Me("tag:yaml.org,2002:omap",{kind:"sequence",resolve:km,construct:Cm}),Sm=Object.prototype.toString;function xm(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],Sm.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function Am(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}var tf=new Me("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:xm,construct:Am}),Bm=Object.prototype.hasOwnProperty;function Im(e){if(e===null)return!0;var t,r=e;for(t in r)if(Bm.call(r,t)&&r[t]!==null)return!1;return!0}function Em(e){return e!==null?e:{}}var rf=new Me("tag:yaml.org,2002:set",{kind:"mapping",resolve:Im,construct:Em}),$a=Wd.extend({implicit:[Zd,Qd],explicit:[Xd,ef,tf,rf]}),qt=Object.prototype.hasOwnProperty,so=1,nf=2,of=3,ao=4,Ra=1,Nm=2,sf=3,Om=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_m=/[\x85\u2028\u2029]/,Tm=/[,\[\]\{\}]/,af=/^(?:!|!!|![a-z\-]+!)$/i,cf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function lf(e){return Object.prototype.toString.call(e)}function Ct(e){return e===10||e===13}function fr(e){return e===9||e===32}function Ye(e){return e===9||e===32||e===10||e===13}function Ur(e){return e===44||e===91||e===93||e===123||e===125}function Vm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function jm(e){return e===120?2:e===117?4:e===85?8:0}function Dm(e){return 48<=e&&e<=57?e-48:-1}function uf(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
125
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Mm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var df=new Array(256),ff=new Array(256),Lr=0;Lr<256;Lr++)df[Lr]=uf(Lr)?1:0,ff[Lr]=uf(Lr);function Pm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||$a,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function pf(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=Lg(r),new Fe(t,r)}function Z(e,t){throw pf(e,t)}function co(e,t){e.onWarning&&e.onWarning.call(null,pf(e,t))}var hf={YAML:function(e,t,r){var i,o,s;e.version!==null&&Z(e,"duplication of %YAML directive"),r.length!==1&&Z(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Z(e,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&Z(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&co(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,o;r.length!==2&&Z(e,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],af.test(i)||Z(e,"ill-formed tag handle (first argument) of the TAG directive"),qt.call(e.tagMap,i)&&Z(e,'there is a previously declared suffix for "'+i+'" tag handle'),cf.test(o)||Z(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{Z(e,"tag prefix is malformed: "+o)}e.tagMap[i]=o}};function Kt(e,t,r,i){var o,s,a,c;if(t<r){if(c=e.input.slice(t,r),i)for(o=0,s=c.length;o<s;o+=1)a=c.charCodeAt(o),a===9||32<=a&&a<=1114111||Z(e,"expected valid JSON character");else Om.test(c)&&Z(e,"the stream contains non-printable characters");e.result+=c}}function yf(e,t,r,i){var o,s,a,c;for(Ne.isObject(r)||Z(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,c=o.length;a<c;a+=1)s=o[a],qt.call(t,s)||(t[s]=r[s],i[s]=!0)}function Hr(e,t,r,i,o,s,a,c,l){var d,y;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),d=0,y=o.length;d<y;d+=1)Array.isArray(o[d])&&Z(e,"nested arrays are not supported inside keys"),typeof o=="object"&&lf(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&lf(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,y=s.length;d<y;d+=1)yf(e,t,s[d],r);else yf(e,t,s,r);else!e.json&&!qt.call(r,o)&&qt.call(t,o)&&(e.line=a||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,Z(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[o]=s,delete r[o];return t}function Ua(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Z(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Ae(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;fr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Ct(o))for(Ua(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&co(e,"deficient indentation"),i}function lo(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Ye(r)))}function La(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ne.repeat(`
126
- `,t-1))}function $m(e,t,r){var i,o,s,a,c,l,d,y,p=e.kind,B=e.result,v;if(v=e.input.charCodeAt(e.position),Ye(v)||Ur(v)||v===35||v===38||v===42||v===33||v===124||v===62||v===39||v===34||v===37||v===64||v===96||(v===63||v===45)&&(o=e.input.charCodeAt(e.position+1),Ye(o)||r&&Ur(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;v!==0;){if(v===58){if(o=e.input.charCodeAt(e.position+1),Ye(o)||r&&Ur(o))break}else if(v===35){if(i=e.input.charCodeAt(e.position-1),Ye(i))break}else{if(e.position===e.lineStart&&lo(e)||r&&Ur(v))break;if(Ct(v))if(l=e.line,d=e.lineStart,y=e.lineIndent,Ae(e,!1,-1),e.lineIndent>=t){c=!0,v=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=y;break}}c&&(Kt(e,s,a,!1),La(e,e.line-l),s=a=e.position,c=!1),fr(v)||(a=e.position+1),v=e.input.charCodeAt(++e.position)}return Kt(e,s,a,!1),e.result?!0:(e.kind=p,e.result=B,!1)}function Rm(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Kt(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else Ct(r)?(Kt(e,i,o,!0),La(e,Ae(e,!1,t)),i=o=e.position):e.position===e.lineStart&&lo(e)?Z(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);Z(e,"unexpected end of the stream within a single quoted scalar")}function Um(e,t){var r,i,o,s,a,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return Kt(e,r,e.position,!0),e.position++,!0;if(c===92){if(Kt(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),Ct(c))Ae(e,!1,t);else if(c<256&&df[c])e.result+=ff[c],e.position++;else if((a=jm(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=Vm(c))>=0?s=(s<<4)+a:Z(e,"expected hexadecimal character");e.result+=Mm(s),e.position++}else Z(e,"unknown escape sequence");r=i=e.position}else Ct(c)?(Kt(e,r,i,!0),La(e,Ae(e,!1,t)),r=i=e.position):e.position===e.lineStart&&lo(e)?Z(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Z(e,"unexpected end of the stream within a double quoted scalar")}function Lm(e,t){var r=!0,i,o,s,a=e.tag,c,l=e.anchor,d,y,p,B,v,h=Object.create(null),g,k,m,x;if(x=e.input.charCodeAt(e.position),x===91)y=93,v=!1,c=[];else if(x===123)y=125,v=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),x=e.input.charCodeAt(++e.position);x!==0;){if(Ae(e,!0,t),x=e.input.charCodeAt(e.position),x===y)return e.position++,e.tag=a,e.anchor=l,e.kind=v?"mapping":"sequence",e.result=c,!0;r?x===44&&Z(e,"expected the node content, but found ','"):Z(e,"missed comma between flow collection entries"),k=g=m=null,p=B=!1,x===63&&(d=e.input.charCodeAt(e.position+1),Ye(d)&&(p=B=!0,e.position++,Ae(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Fr(e,t,so,!1,!0),k=e.tag,g=e.result,Ae(e,!0,t),x=e.input.charCodeAt(e.position),(B||e.line===i)&&x===58&&(p=!0,x=e.input.charCodeAt(++e.position),Ae(e,!0,t),Fr(e,t,so,!1,!0),m=e.result),v?Hr(e,c,h,k,g,m,i,o,s):p?c.push(Hr(e,null,h,k,g,m,i,o,s)):c.push(g),Ae(e,!0,t),x=e.input.charCodeAt(e.position),x===44?(r=!0,x=e.input.charCodeAt(++e.position)):r=!1}Z(e,"unexpected end of the stream within a flow collection")}function Hm(e,t){var r,i,o=Ra,s=!1,a=!1,c=t,l=0,d=!1,y,p;if(p=e.input.charCodeAt(e.position),p===124)i=!1;else if(p===62)i=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Ra===o?o=p===43?sf:Nm:Z(e,"repeat of a chomping mode identifier");else if((y=Dm(p))>=0)y===0?Z(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Z(e,"repeat of an indentation width identifier"):(c=t+y-1,a=!0);else break;if(fr(p)){do p=e.input.charCodeAt(++e.position);while(fr(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Ct(p)&&p!==0)}for(;p!==0;){for(Ua(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),Ct(p)){l++;continue}if(e.lineIndent<c){o===sf?e.result+=Ne.repeat(`
123
+ `;return c.replace(/\n$/,"")}var Lm=Um,Hm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Fm=["scalar","sequence","mapping"];function qm(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function Km(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Hm.indexOf(r)===-1)throw new Fe('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=qm(t.styleAliases||null),Fm.indexOf(this.kind)===-1)throw new Fe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Me=Km;function Pd(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}function zm(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}function Ma(e){return this.extend(e)}Ma.prototype.extend=function(e){var t=[],r=[];if(e instanceof Me)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new Fe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof Me))throw new Fe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Fe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Fe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof Me))throw new Fe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Ma.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Pd(i,"implicit"),i.compiledExplicit=Pd(i,"explicit"),i.compiledTypeMap=zm(i.compiledImplicit,i.compiledExplicit),i};var $d=Ma,Rd=new Me("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ud=new Me("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ld=new Me("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Hd=new $d({explicit:[Rd,Ud,Ld]});function Gm(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Wm(){return null}function Jm(e){return e===null}var Fd=new Me("tag:yaml.org,2002:null",{kind:"scalar",resolve:Gm,construct:Wm,predicate:Jm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Ym(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Zm(e){return e==="true"||e==="True"||e==="TRUE"}function Qm(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var qd=new Me("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Ym,construct:Zm,predicate:Qm,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Xm(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function eg(e){return 48<=e&&e<=55}function tg(e){return 48<=e&&e<=57}function rg(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Xm(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!eg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!tg(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function ig(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function ng(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ne.isNegativeZero(e)}var Kd=new Me("tag:yaml.org,2002:int",{kind:"scalar",resolve:rg,construct:ig,predicate:ng,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),og=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function sg(e){return!(e===null||!og.test(e)||e[e.length-1]==="_")}function ag(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var cg=/^[-+]?[0-9]+e/;function lg(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ne.isNegativeZero(e))return"-0.0";return r=e.toString(10),cg.test(r)?r.replace("e",".e"):r}function ug(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ne.isNegativeZero(e))}var zd=new Me("tag:yaml.org,2002:float",{kind:"scalar",resolve:sg,construct:ag,predicate:ug,represent:lg,defaultStyle:"lowercase"}),Gd=Hd.extend({implicit:[Fd,qd,Kd,zd]}),Wd=Gd,Jd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Yd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function dg(e){return e===null?!1:Jd.exec(e)!==null||Yd.exec(e)!==null}function fg(e){var t,r,i,o,s,a,c,l=0,d=null,y,p,B;if(t=Jd.exec(e),t===null&&(t=Yd.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(y=+t[10],p=+(t[11]||0),d=(y*60+p)*6e4,t[9]==="-"&&(d=-d)),B=new Date(Date.UTC(r,i,o,s,a,c,l)),d&&B.setTime(B.getTime()-d),B}function pg(e){return e.toISOString()}var Zd=new Me("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:dg,construct:fg,instanceOf:Date,represent:pg});function hg(e){return e==="<<"||e===null}var Qd=new Me("tag:yaml.org,2002:merge",{kind:"scalar",resolve:hg}),Pa=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
124
+ \r`;function yg(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Pa;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function mg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Pa,a=0,c=[];for(t=0;t<o;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):r===18?(c.push(a>>10&255),c.push(a>>2&255)):r===12&&c.push(a>>4&255),new Uint8Array(c)}function gg(e){var t="",r=0,i,o,s=e.length,a=Pa;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function bg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Xd=new Me("tag:yaml.org,2002:binary",{kind:"scalar",resolve:yg,construct:mg,predicate:bg,represent:gg}),wg=Object.prototype.hasOwnProperty,vg=Object.prototype.toString;function kg(e){if(e===null)return!0;var t=[],r,i,o,s,a,c=e;for(r=0,i=c.length;r<i;r+=1){if(o=c[r],a=!1,vg.call(o)!=="[object Object]")return!1;for(s in o)if(wg.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function Cg(e){return e!==null?e:[]}var ef=new Me("tag:yaml.org,2002:omap",{kind:"sequence",resolve:kg,construct:Cg}),Sg=Object.prototype.toString;function xg(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],Sg.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function Ag(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}var tf=new Me("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:xg,construct:Ag}),Bg=Object.prototype.hasOwnProperty;function Ig(e){if(e===null)return!0;var t,r=e;for(t in r)if(Bg.call(r,t)&&r[t]!==null)return!1;return!0}function Eg(e){return e!==null?e:{}}var rf=new Me("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ig,construct:Eg}),$a=Wd.extend({implicit:[Zd,Qd],explicit:[Xd,ef,tf,rf]}),qt=Object.prototype.hasOwnProperty,so=1,nf=2,of=3,ao=4,Ra=1,Ng=2,sf=3,Og=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_g=/[\x85\u2028\u2029]/,Tg=/[,\[\]\{\}]/,af=/^(?:!|!!|![a-z\-]+!)$/i,cf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function lf(e){return Object.prototype.toString.call(e)}function Ct(e){return e===10||e===13}function fr(e){return e===9||e===32}function Ye(e){return e===9||e===32||e===10||e===13}function Ur(e){return e===44||e===91||e===93||e===123||e===125}function Vg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function jg(e){return e===120?2:e===117?4:e===85?8:0}function Dg(e){return 48<=e&&e<=57?e-48:-1}function uf(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
125
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Mg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var df=new Array(256),ff=new Array(256),Lr=0;Lr<256;Lr++)df[Lr]=uf(Lr)?1:0,ff[Lr]=uf(Lr);function Pg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||$a,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function pf(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=Lm(r),new Fe(t,r)}function Z(e,t){throw pf(e,t)}function co(e,t){e.onWarning&&e.onWarning.call(null,pf(e,t))}var hf={YAML:function(e,t,r){var i,o,s;e.version!==null&&Z(e,"duplication of %YAML directive"),r.length!==1&&Z(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Z(e,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&Z(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&co(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,o;r.length!==2&&Z(e,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],af.test(i)||Z(e,"ill-formed tag handle (first argument) of the TAG directive"),qt.call(e.tagMap,i)&&Z(e,'there is a previously declared suffix for "'+i+'" tag handle'),cf.test(o)||Z(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{Z(e,"tag prefix is malformed: "+o)}e.tagMap[i]=o}};function Kt(e,t,r,i){var o,s,a,c;if(t<r){if(c=e.input.slice(t,r),i)for(o=0,s=c.length;o<s;o+=1)a=c.charCodeAt(o),a===9||32<=a&&a<=1114111||Z(e,"expected valid JSON character");else Og.test(c)&&Z(e,"the stream contains non-printable characters");e.result+=c}}function yf(e,t,r,i){var o,s,a,c;for(Ne.isObject(r)||Z(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,c=o.length;a<c;a+=1)s=o[a],qt.call(t,s)||(t[s]=r[s],i[s]=!0)}function Hr(e,t,r,i,o,s,a,c,l){var d,y;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),d=0,y=o.length;d<y;d+=1)Array.isArray(o[d])&&Z(e,"nested arrays are not supported inside keys"),typeof o=="object"&&lf(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&lf(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,y=s.length;d<y;d+=1)yf(e,t,s[d],r);else yf(e,t,s,r);else!e.json&&!qt.call(r,o)&&qt.call(t,o)&&(e.line=a||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,Z(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[o]=s,delete r[o];return t}function Ua(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Z(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Ae(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;fr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Ct(o))for(Ua(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&co(e,"deficient indentation"),i}function lo(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Ye(r)))}function La(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ne.repeat(`
126
+ `,t-1))}function $g(e,t,r){var i,o,s,a,c,l,d,y,p=e.kind,B=e.result,v;if(v=e.input.charCodeAt(e.position),Ye(v)||Ur(v)||v===35||v===38||v===42||v===33||v===124||v===62||v===39||v===34||v===37||v===64||v===96||(v===63||v===45)&&(o=e.input.charCodeAt(e.position+1),Ye(o)||r&&Ur(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;v!==0;){if(v===58){if(o=e.input.charCodeAt(e.position+1),Ye(o)||r&&Ur(o))break}else if(v===35){if(i=e.input.charCodeAt(e.position-1),Ye(i))break}else{if(e.position===e.lineStart&&lo(e)||r&&Ur(v))break;if(Ct(v))if(l=e.line,d=e.lineStart,y=e.lineIndent,Ae(e,!1,-1),e.lineIndent>=t){c=!0,v=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=y;break}}c&&(Kt(e,s,a,!1),La(e,e.line-l),s=a=e.position,c=!1),fr(v)||(a=e.position+1),v=e.input.charCodeAt(++e.position)}return Kt(e,s,a,!1),e.result?!0:(e.kind=p,e.result=B,!1)}function Rg(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Kt(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else Ct(r)?(Kt(e,i,o,!0),La(e,Ae(e,!1,t)),i=o=e.position):e.position===e.lineStart&&lo(e)?Z(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);Z(e,"unexpected end of the stream within a single quoted scalar")}function Ug(e,t){var r,i,o,s,a,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return Kt(e,r,e.position,!0),e.position++,!0;if(c===92){if(Kt(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),Ct(c))Ae(e,!1,t);else if(c<256&&df[c])e.result+=ff[c],e.position++;else if((a=jg(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=Vg(c))>=0?s=(s<<4)+a:Z(e,"expected hexadecimal character");e.result+=Mg(s),e.position++}else Z(e,"unknown escape sequence");r=i=e.position}else Ct(c)?(Kt(e,r,i,!0),La(e,Ae(e,!1,t)),r=i=e.position):e.position===e.lineStart&&lo(e)?Z(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Z(e,"unexpected end of the stream within a double quoted scalar")}function Lg(e,t){var r=!0,i,o,s,a=e.tag,c,l=e.anchor,d,y,p,B,v,h=Object.create(null),m,k,g,x;if(x=e.input.charCodeAt(e.position),x===91)y=93,v=!1,c=[];else if(x===123)y=125,v=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),x=e.input.charCodeAt(++e.position);x!==0;){if(Ae(e,!0,t),x=e.input.charCodeAt(e.position),x===y)return e.position++,e.tag=a,e.anchor=l,e.kind=v?"mapping":"sequence",e.result=c,!0;r?x===44&&Z(e,"expected the node content, but found ','"):Z(e,"missed comma between flow collection entries"),k=m=g=null,p=B=!1,x===63&&(d=e.input.charCodeAt(e.position+1),Ye(d)&&(p=B=!0,e.position++,Ae(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Fr(e,t,so,!1,!0),k=e.tag,m=e.result,Ae(e,!0,t),x=e.input.charCodeAt(e.position),(B||e.line===i)&&x===58&&(p=!0,x=e.input.charCodeAt(++e.position),Ae(e,!0,t),Fr(e,t,so,!1,!0),g=e.result),v?Hr(e,c,h,k,m,g,i,o,s):p?c.push(Hr(e,null,h,k,m,g,i,o,s)):c.push(m),Ae(e,!0,t),x=e.input.charCodeAt(e.position),x===44?(r=!0,x=e.input.charCodeAt(++e.position)):r=!1}Z(e,"unexpected end of the stream within a flow collection")}function Hg(e,t){var r,i,o=Ra,s=!1,a=!1,c=t,l=0,d=!1,y,p;if(p=e.input.charCodeAt(e.position),p===124)i=!1;else if(p===62)i=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Ra===o?o=p===43?sf:Ng:Z(e,"repeat of a chomping mode identifier");else if((y=Dg(p))>=0)y===0?Z(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Z(e,"repeat of an indentation width identifier"):(c=t+y-1,a=!0);else break;if(fr(p)){do p=e.input.charCodeAt(++e.position);while(fr(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Ct(p)&&p!==0)}for(;p!==0;){for(Ua(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),Ct(p)){l++;continue}if(e.lineIndent<c){o===sf?e.result+=Ne.repeat(`
127
127
  `,s?1+l:l):o===Ra&&s&&(e.result+=`
128
128
  `);break}for(i?fr(p)?(d=!0,e.result+=Ne.repeat(`
129
129
  `,s?1+l:l)):d?(d=!1,e.result+=Ne.repeat(`
130
130
  `,l+1)):l===0?s&&(e.result+=" "):e.result+=Ne.repeat(`
131
131
  `,l):e.result+=Ne.repeat(`
132
- `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Ct(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Kt(e,r,e.position,!1)}return!0}function gf(e,t){var r,i=e.tag,o=e.anchor,s=[],a,c=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Z(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Ye(a))));){if(c=!0,e.position++,Ae(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Fr(e,t,of,!1,!0),s.push(e.result),Ae(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)Z(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function Fm(e,t,r){var i,o,s,a,c,l,d=e.tag,y=e.anchor,p={},B=Object.create(null),v=null,h=null,g=null,k=!1,m=!1,x;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),x=e.input.charCodeAt(e.position);x!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Z(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(x===63||x===58)&&Ye(i))x===63?(k&&(Hr(e,p,B,v,h,null,a,c,l),v=h=g=null),m=!0,k=!0,o=!0):k?(k=!1,o=!0):Z(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,x=i;else{if(a=e.line,c=e.lineStart,l=e.position,!Fr(e,r,nf,!1,!0))break;if(e.line===s){for(x=e.input.charCodeAt(e.position);fr(x);)x=e.input.charCodeAt(++e.position);if(x===58)x=e.input.charCodeAt(++e.position),Ye(x)||Z(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Hr(e,p,B,v,h,null,a,c,l),v=h=g=null),m=!0,k=!1,o=!1,v=e.tag,h=e.result;else if(m)Z(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(m)Z(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=y,!0}if((e.line===s||e.lineIndent>t)&&(k&&(a=e.line,c=e.lineStart,l=e.position),Fr(e,t,ao,!0,o)&&(k?h=e.result:g=e.result),k||(Hr(e,p,B,v,h,g,a,c,l),v=h=g=null),Ae(e,!0,-1),x=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&x!==0)Z(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Hr(e,p,B,v,h,null,a,c,l),m&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),m}function qm(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&Z(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):Z(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ye(a);)a===33&&(i?Z(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),af.test(o)||Z(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Tm.test(s)&&Z(e,"tag suffix cannot contain flow indicator characters")}s&&!cf.test(s)&&Z(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{Z(e,"tag name is malformed: "+s)}return r?e.tag=s:qt.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:Z(e,'undeclared tag handle "'+o+'"'),!0}function Km(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Z(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Ye(r)&&!Ur(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Z(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function zm(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ye(i)&&!Ur(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Z(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),qt.call(e.anchorMap,r)||Z(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Ae(e,!0,-1),!0}function Fr(e,t,r,i,o){var s,a,c,l=1,d=!1,y=!1,p,B,v,h,g,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=c=ao===r||of===r,i&&Ae(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;qm(e)||Km(e);)Ae(e,!0,-1)?(d=!0,c=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):c=!1;if(c&&(c=d||o),(l===1||ao===r)&&(so===r||nf===r?g=t:g=t+1,k=e.position-e.lineStart,l===1?c&&(gf(e,k)||Fm(e,k,g))||Lm(e,g)?y=!0:(a&&Hm(e,g)||Rm(e,g)||Um(e,g)?y=!0:zm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&Z(e,"alias node should not have any properties")):$m(e,g,so===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&gf(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Z(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,B=e.implicitTypes.length;p<B;p+=1)if(h=e.implicitTypes[p],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(qt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,v=e.typeMap.multi[e.kind||"fallback"],p=0,B=v.length;p<B;p+=1)if(e.tag.slice(0,v[p].tag.length)===v[p].tag){h=v[p];break}h||Z(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&Z(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Z(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||y}function Gm(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Ae(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Ye(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&Z(e,"directive name must not be less than one character in length");a!==0;){for(;fr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Ct(a));break}if(Ct(a))break;for(r=e.position;a!==0&&!Ye(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Ua(e),qt.call(hf,i)?hf[i](e,i,o):co(e,'unknown document directive "'+i+'"')}if(Ae(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Ae(e,!0,-1)):s&&Z(e,"directives end mark is expected"),Fr(e,e.lineIndent-1,ao,!1,!0),Ae(e,!0,-1),e.checkLineBreaks&&_m.test(e.input.slice(t,e.position))&&co(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&lo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Ae(e,!0,-1));return}if(e.position<e.length-1)Z(e,"end of the stream or a document separator is expected");else return}function mf(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
133
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Pm(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,Z(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Gm(r);return r.documents}function Wm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=mf(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Jm(e,t){var r=mf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Fe("expected a single document in the stream, but found more")}}var Ym=Wm,Zm=Jm,bf={loadAll:Ym,load:Zm},wf=Object.prototype.toString,vf=Object.prototype.hasOwnProperty,Ha=65279,Qm=9,Ni=10,Xm=13,e0=32,t0=33,r0=34,Fa=35,i0=37,n0=38,o0=39,s0=42,kf=44,a0=45,uo=58,c0=61,l0=62,u0=63,d0=64,Cf=91,Sf=93,f0=96,xf=123,p0=124,Af=125,Ue={};Ue[0]="\\0",Ue[7]="\\a",Ue[8]="\\b",Ue[9]="\\t",Ue[10]="\\n",Ue[11]="\\v",Ue[12]="\\f",Ue[13]="\\r",Ue[27]="\\e",Ue[34]='\\"',Ue[92]="\\\\",Ue[133]="\\N",Ue[160]="\\_",Ue[8232]="\\L",Ue[8233]="\\P";var h0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],y0=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function g0(e,t){var r,i,o,s,a,c,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],c=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&vf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function m0(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new Fe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ne.repeat("0",i-t.length)+t}var b0=1,Oi=2;function w0(e){this.schema=e.schema||$a,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ne.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=g0(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Oi:b0,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Bf(e,t){for(var r=Ne.repeat(" ",t),i=0,o=-1,s="",a,c=e.length;i<c;)o=e.indexOf(`
132
+ `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Ct(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Kt(e,r,e.position,!1)}return!0}function mf(e,t){var r,i=e.tag,o=e.anchor,s=[],a,c=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Z(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Ye(a))));){if(c=!0,e.position++,Ae(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Fr(e,t,of,!1,!0),s.push(e.result),Ae(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)Z(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function Fg(e,t,r){var i,o,s,a,c,l,d=e.tag,y=e.anchor,p={},B=Object.create(null),v=null,h=null,m=null,k=!1,g=!1,x;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),x=e.input.charCodeAt(e.position);x!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Z(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(x===63||x===58)&&Ye(i))x===63?(k&&(Hr(e,p,B,v,h,null,a,c,l),v=h=m=null),g=!0,k=!0,o=!0):k?(k=!1,o=!0):Z(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,x=i;else{if(a=e.line,c=e.lineStart,l=e.position,!Fr(e,r,nf,!1,!0))break;if(e.line===s){for(x=e.input.charCodeAt(e.position);fr(x);)x=e.input.charCodeAt(++e.position);if(x===58)x=e.input.charCodeAt(++e.position),Ye(x)||Z(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Hr(e,p,B,v,h,null,a,c,l),v=h=m=null),g=!0,k=!1,o=!1,v=e.tag,h=e.result;else if(g)Z(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(g)Z(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=y,!0}if((e.line===s||e.lineIndent>t)&&(k&&(a=e.line,c=e.lineStart,l=e.position),Fr(e,t,ao,!0,o)&&(k?h=e.result:m=e.result),k||(Hr(e,p,B,v,h,m,a,c,l),v=h=m=null),Ae(e,!0,-1),x=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&x!==0)Z(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Hr(e,p,B,v,h,null,a,c,l),g&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),g}function qg(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&Z(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):Z(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ye(a);)a===33&&(i?Z(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),af.test(o)||Z(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Tg.test(s)&&Z(e,"tag suffix cannot contain flow indicator characters")}s&&!cf.test(s)&&Z(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{Z(e,"tag name is malformed: "+s)}return r?e.tag=s:qt.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:Z(e,'undeclared tag handle "'+o+'"'),!0}function Kg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Z(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Ye(r)&&!Ur(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Z(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function zg(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ye(i)&&!Ur(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Z(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),qt.call(e.anchorMap,r)||Z(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Ae(e,!0,-1),!0}function Fr(e,t,r,i,o){var s,a,c,l=1,d=!1,y=!1,p,B,v,h,m,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=c=ao===r||of===r,i&&Ae(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;qg(e)||Kg(e);)Ae(e,!0,-1)?(d=!0,c=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):c=!1;if(c&&(c=d||o),(l===1||ao===r)&&(so===r||nf===r?m=t:m=t+1,k=e.position-e.lineStart,l===1?c&&(mf(e,k)||Fg(e,k,m))||Lg(e,m)?y=!0:(a&&Hg(e,m)||Rg(e,m)||Ug(e,m)?y=!0:zg(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&Z(e,"alias node should not have any properties")):$g(e,m,so===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&mf(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Z(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,B=e.implicitTypes.length;p<B;p+=1)if(h=e.implicitTypes[p],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(qt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,v=e.typeMap.multi[e.kind||"fallback"],p=0,B=v.length;p<B;p+=1)if(e.tag.slice(0,v[p].tag.length)===v[p].tag){h=v[p];break}h||Z(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&Z(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Z(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||y}function Gg(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Ae(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Ye(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&Z(e,"directive name must not be less than one character in length");a!==0;){for(;fr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Ct(a));break}if(Ct(a))break;for(r=e.position;a!==0&&!Ye(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Ua(e),qt.call(hf,i)?hf[i](e,i,o):co(e,'unknown document directive "'+i+'"')}if(Ae(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Ae(e,!0,-1)):s&&Z(e,"directives end mark is expected"),Fr(e,e.lineIndent-1,ao,!1,!0),Ae(e,!0,-1),e.checkLineBreaks&&_g.test(e.input.slice(t,e.position))&&co(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&lo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Ae(e,!0,-1));return}if(e.position<e.length-1)Z(e,"end of the stream or a document separator is expected");else return}function gf(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
133
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Pg(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,Z(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Gg(r);return r.documents}function Wg(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=gf(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Jg(e,t){var r=gf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Fe("expected a single document in the stream, but found more")}}var Yg=Wg,Zg=Jg,bf={loadAll:Yg,load:Zg},wf=Object.prototype.toString,vf=Object.prototype.hasOwnProperty,Ha=65279,Qg=9,Ni=10,Xg=13,e0=32,t0=33,r0=34,Fa=35,i0=37,n0=38,o0=39,s0=42,kf=44,a0=45,uo=58,c0=61,l0=62,u0=63,d0=64,Cf=91,Sf=93,f0=96,xf=123,p0=124,Af=125,Ue={};Ue[0]="\\0",Ue[7]="\\a",Ue[8]="\\b",Ue[9]="\\t",Ue[10]="\\n",Ue[11]="\\v",Ue[12]="\\f",Ue[13]="\\r",Ue[27]="\\e",Ue[34]='\\"',Ue[92]="\\\\",Ue[133]="\\N",Ue[160]="\\_",Ue[8232]="\\L",Ue[8233]="\\P";var h0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],y0=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function m0(e,t){var r,i,o,s,a,c,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],c=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&vf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function g0(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new Fe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ne.repeat("0",i-t.length)+t}var b0=1,Oi=2;function w0(e){this.schema=e.schema||$a,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ne.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=m0(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Oi:b0,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Bf(e,t){for(var r=Ne.repeat(" ",t),i=0,o=-1,s="",a,c=e.length;i<c;)o=e.indexOf(`
134
134
  `,i),o===-1?(a=e.slice(i),i=c):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
135
135
  `&&(s+=r),s+=a;return s}function qa(e,t){return`
136
- `+Ne.repeat(" ",e.indent*t)}function v0(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function fo(e){return e===e0||e===Qm}function _i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ha||65536<=e&&e<=1114111}function If(e){return _i(e)&&e!==Ha&&e!==Xm&&e!==Ni}function Ef(e,t,r){var i=If(e),o=i&&!fo(e);return(r?i:i&&e!==kf&&e!==Cf&&e!==Sf&&e!==xf&&e!==Af)&&e!==Fa&&!(t===uo&&!o)||If(t)&&!fo(t)&&e===Fa||t===uo&&o}function k0(e){return _i(e)&&e!==Ha&&!fo(e)&&e!==a0&&e!==u0&&e!==uo&&e!==kf&&e!==Cf&&e!==Sf&&e!==xf&&e!==Af&&e!==Fa&&e!==n0&&e!==s0&&e!==t0&&e!==p0&&e!==c0&&e!==l0&&e!==o0&&e!==r0&&e!==i0&&e!==d0&&e!==f0}function C0(e){return!fo(e)&&e!==uo}function Ti(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function Nf(e){var t=/^\n* /;return t.test(e)}var Of=1,Ka=2,_f=3,Tf=4,qr=5;function S0(e,t,r,i,o,s,a,c){var l,d=0,y=null,p=!1,B=!1,v=i!==-1,h=-1,g=k0(Ti(e,0))&&C0(Ti(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ti(e,l),!_i(d))return qr;g=g&&Ef(d,y,c),y=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ti(e,l),d===Ni)p=!0,v&&(B=B||l-h-1>i&&e[h+1]!==" ",h=l);else if(!_i(d))return qr;g=g&&Ef(d,y,c),y=d}B=B||v&&l-h-1>i&&e[h+1]!==" "}return!p&&!B?g&&!a&&!o(e)?Of:s===Oi?qr:Ka:r>9&&Nf(e)?qr:a?s===Oi?qr:Ka:B?Tf:_f}function x0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===Oi?'""':"''";if(!e.noCompatMode&&(h0.indexOf(t)!==-1||y0.test(t)))return e.quotingType===Oi?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=i||e.flowLevel>-1&&r>=e.flowLevel;function l(d){return v0(e,d)}switch(S0(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case Of:return t;case Ka:return"'"+t.replace(/'/g,"''")+"'";case _f:return"|"+Vf(t,e.indent)+jf(Bf(t,s));case Tf:return">"+Vf(t,e.indent)+jf(Bf(A0(t,a),s));case qr:return'"'+B0(t)+'"';default:throw new Fe("impossible error: invalid scalar style")}}()}function Vf(e,t){var r=Nf(e)?String(t):"",i=e[e.length-1]===`
136
+ `+Ne.repeat(" ",e.indent*t)}function v0(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function fo(e){return e===e0||e===Qg}function _i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ha||65536<=e&&e<=1114111}function If(e){return _i(e)&&e!==Ha&&e!==Xg&&e!==Ni}function Ef(e,t,r){var i=If(e),o=i&&!fo(e);return(r?i:i&&e!==kf&&e!==Cf&&e!==Sf&&e!==xf&&e!==Af)&&e!==Fa&&!(t===uo&&!o)||If(t)&&!fo(t)&&e===Fa||t===uo&&o}function k0(e){return _i(e)&&e!==Ha&&!fo(e)&&e!==a0&&e!==u0&&e!==uo&&e!==kf&&e!==Cf&&e!==Sf&&e!==xf&&e!==Af&&e!==Fa&&e!==n0&&e!==s0&&e!==t0&&e!==p0&&e!==c0&&e!==l0&&e!==o0&&e!==r0&&e!==i0&&e!==d0&&e!==f0}function C0(e){return!fo(e)&&e!==uo}function Ti(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function Nf(e){var t=/^\n* /;return t.test(e)}var Of=1,Ka=2,_f=3,Tf=4,qr=5;function S0(e,t,r,i,o,s,a,c){var l,d=0,y=null,p=!1,B=!1,v=i!==-1,h=-1,m=k0(Ti(e,0))&&C0(Ti(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ti(e,l),!_i(d))return qr;m=m&&Ef(d,y,c),y=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ti(e,l),d===Ni)p=!0,v&&(B=B||l-h-1>i&&e[h+1]!==" ",h=l);else if(!_i(d))return qr;m=m&&Ef(d,y,c),y=d}B=B||v&&l-h-1>i&&e[h+1]!==" "}return!p&&!B?m&&!a&&!o(e)?Of:s===Oi?qr:Ka:r>9&&Nf(e)?qr:a?s===Oi?qr:Ka:B?Tf:_f}function x0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===Oi?'""':"''";if(!e.noCompatMode&&(h0.indexOf(t)!==-1||y0.test(t)))return e.quotingType===Oi?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=i||e.flowLevel>-1&&r>=e.flowLevel;function l(d){return v0(e,d)}switch(S0(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case Of:return t;case Ka:return"'"+t.replace(/'/g,"''")+"'";case _f:return"|"+Vf(t,e.indent)+jf(Bf(t,s));case Tf:return">"+Vf(t,e.indent)+jf(Bf(A0(t,a),s));case qr:return'"'+B0(t)+'"';default:throw new Fe("impossible error: invalid scalar style")}}()}function Vf(e,t){var r=Nf(e)?String(t):"",i=e[e.length-1]===`
137
137
  `,o=i&&(e[e.length-2]===`
138
138
  `||e===`
139
139
  `),s=o?"+":i?"":"-";return r+s+`
@@ -144,5 +144,5 @@ ${t.join(`
144
144
  `:"")+Df(l,t),o=s}return i}function Df(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,c=0,l="";i=r.exec(e);)c=i.index,c-o>t&&(s=a>o?a:c,l+=`
145
145
  `+e.slice(o,s),o=s+1),a=c;return l+=`
146
146
  `,e.length-o>t&&a>o?l+=e.slice(o,a)+`
147
- `+e.slice(a+1):l+=e.slice(o),l.slice(1)}function B0(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=Ti(e,o),i=Ue[r],!i&&_i(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||m0(r);return t}function I0(e,t,r){var i="",o=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(jt(e,t,c,!1,!1)||typeof c>"u"&&jt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}function Mf(e,t,r,i){var o="",s=e.tag,a,c,l;for(a=0,c=r.length;a<c;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(jt(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&jt(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=qa(e,t)),e.dump&&Ni===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function E0(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,c,l,d,y;for(a=0,c=s.length;a<c;a+=1)y="",i!==""&&(y+=", "),e.condenseFlow&&(y+='"'),l=s[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),jt(e,t,l,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),jt(e,t,d,!1,!1)&&(y+=e.dump,i+=y));e.tag=o,e.dump="{"+i+"}"}function N0(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),c,l,d,y,p,B;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Fe("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)B="",(!i||o!=="")&&(B+=qa(e,t)),d=a[c],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),jt(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Ni===e.dump.charCodeAt(0)?B+="?":B+="? "),B+=e.dump,p&&(B+=qa(e,t)),jt(e,t+1,y,!0,p)&&(e.dump&&Ni===e.dump.charCodeAt(0)?B+=":":B+=": ",B+=e.dump,o+=B));e.tag=s,e.dump=o||"{}"}function Pf(e,t,r){var i,o,s,a,c,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(c=o[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(r?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(l=e.styleMap[c.tag]||c.defaultStyle,wf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(vf.call(c.represent,l))i=c.represent[l](t,l);else throw new Fe("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function jt(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Pf(e,r,!1)||Pf(e,r,!0);var c=wf.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var y=c==="[object Object]"||c==="[object Array]",p,B;if(y&&(p=e.duplicates.indexOf(r),B=p!==-1),(e.tag!==null&&e.tag!=="?"||B||e.indent!==2&&t>0)&&(o=!1),B&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&B&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(N0(e,t,e.dump,o),B&&(e.dump="&ref_"+p+e.dump)):(E0(e,t,e.dump),B&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Mf(e,t-1,e.dump,o):Mf(e,t,e.dump,o),B&&(e.dump="&ref_"+p+e.dump)):(I0(e,t,e.dump),B&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&x0(e,e.dump,t,s,l);else{if(c==="[object Undefined]"||e.skipInvalid)return!1;throw new Fe("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function O0(e,t){var r=[],i=[],o,s;for(za(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}function za(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)za(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)za(e[i[o]],t,r)}function _0(e,t){t=t||{};var r=new w0(t);r.noRefs||O0(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),jt(r,0,i,!0,!0)?r.dump+`
148
- `:""}var T0=_0,V0={dump:T0};function Ga(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var j0=Me,D0=$d,M0=Hd,P0=Gd,$0=Wd,R0=$a,U0=bf.load,L0=bf.loadAll,H0=V0.dump,F0=Fe,q0={binary:Xd,float:zd,map:Ld,null:Fd,pairs:tf,set:rf,timestamp:Zd,bool:qd,int:Kd,merge:Qd,omap:ef,seq:Ud,str:Rd},K0=Ga("safeLoad","load"),z0=Ga("safeLoadAll","loadAll"),G0=Ga("safeDump","dump"),W0={Type:j0,Schema:D0,FAILSAFE_SCHEMA:M0,JSON_SCHEMA:P0,CORE_SCHEMA:$0,DEFAULT_SCHEMA:R0,load:U0,loadAll:L0,dump:H0,YAMLException:F0,types:q0,safeLoad:K0,safeLoadAll:z0,safeDump:G0};const J0={class:"yaml-config"},$f=n.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=n.reactive(t.yamlRecord);return(i,o)=>{const s=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",J0,[t.yamlRecord?(n.openBlock(),n.createBlock(s,{key:0,id:"yaml-codeblock",code:n.unref(W0).dump(r),language:"yaml",theme:"dark"},null,8,["code"])):n.createCommentVNode("",!0)])}}}),Y0={key:0,class:"config-card-display-form"},Z0=["data-testid"],Q0={key:0,class:"config-card-prop-section-title"},X0=n.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=n.useSlots(),{i18n:{t:i}}=Te.useI18n(),o=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=n.computed(()=>{if(!t.record)return t.record;const a=JSON.parse(JSON.stringify(t.record));return delete a.created_at,delete a.updated_at,a});return(a,c)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",Y0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,l=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${l}-props`,class:n.normalizeClass(`config-card-details-${l}-props`),"data-testid":`config-card-details-${l}-props`},[l!=="basic"?(n.openBlock(),n.createElementBlock("div",Q0,n.toDisplayString(l==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[l],d=>(n.openBlock(),n.createBlock(Ii,{key:d.key,item:d},n.createSlots({label:n.withCtx(()=>[n.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:n.withCtx(({rowValue:y})=>[n.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[o(d)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Z0))),128))])):n.createCommentVNode("",!0),e.format==="json"&&t.record?(n.openBlock(),n.createBlock(jd,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):n.createCommentVNode("",!0),e.format==="yaml"&&t.record?(n.openBlock(),n.createBlock($f,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):n.createCommentVNode("",!0)],64))}}),e1=dt(X0,[["__scopeId","data-v-2b74ac63"]]),Rf="24px",t1=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},r1=e=>(n.pushScopeId("data-v-84d5ee61"),e=e(),n.popScopeId(),e),i1=["aria-hidden"],n1={key:0,"data-testid":"kui-icon-svg-title"},o1=r1(()=>n.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),s1=n.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Rf,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Rf}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",n1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),o1],8,i1))]),_:1},8,["aria-hidden","style"]))}}),a1=t1(s1,[["__scopeId","data-v-84d5ee61"]]),c1={"data-testid":"config-card-title"},l1={class:"config-card-actions"},u1=["href"],d1={key:2,class:"config-card-details-section"},f1={key:3,class:"config-card-details-section"},p1=["data-testid"],h1={key:0,class:"config-card-prop-section-title"},y1=n.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:t}){var r;const i=t,o=e,s=n.useSlots(),{i18n:{t:a}}=Te.useI18n(),{getMessageFromError:c}=Te.useErrors(),{convertKeyToTitle:l}=Te.useStringHelpers(),{axiosInstance:d}=Te.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),y=[{label:a("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),B=N=>{p.value=N==null?void 0:N.value},v={id:{type:le.ID,label:a("baseConfigCard.commonFields.id_label"),order:0,section:pe.Basic},name:{order:1,section:pe.Basic},enabled:{type:le.BadgeStatus,order:2,section:pe.Basic},updated_at:{type:le.Date,label:a("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:le.Date,label:a("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:le.BadgeTag,order:-1,section:pe.Basic}},h=n.ref(!1),g=n.ref(!1),k=n.ref(""),m=n.ref({}),x=n.computed(()=>{var N,q,P;if(!m.value)return[];const J=[],H=Object.keys(m.value).length;for(const R in m.value){const se=(q=(N=o.configSchema)==null?void 0:N[R])==null?void 0:q.order,fe=(P=v[R])==null?void 0:P.order;let ke=H;(fe||fe===0)&&(ke=fe===-1?H+1:fe),se&&(ke=se===-1?H+1:se),J.push([R,ke])}return J.sort(function(R,se){return R[1]-se[1]}),J.map(R=>{var se,fe;const ke=R[0],he=(se=m.value)==null?void 0:se[ke],ye=((fe=o.configSchema)==null?void 0:fe[ke])||{},Be=v[ke];return{key:ke,value:he,hidden:ye.hidden||!1,type:ye.type??((Be==null?void 0:Be.type)||le.Text),label:ye.label??((Be==null?void 0:Be.label)||l(ke)),tooltip:ye.tooltip??((Be==null?void 0:Be.tooltip)||void 0),section:ye.section??((Be==null?void 0:Be.section)||pe.Advanced)}}).filter(R=>!R.hidden&&R.key!==o.pluginConfigKey)}),C=n.computed(()=>{var N,q;if(!m.value||!o.pluginConfigKey)return[];const P=m.value[o.pluginConfigKey]||{},J=Object.keys(P).length,H=[];for(const R in P){const se=(q=(N=o.pluginConfigSchema)==null?void 0:N[R])==null?void 0:q.order,fe=P[R];let ke=fe!=null&&fe!==""?J-1:J;se&&(ke=se===-1?J+1:se),H.push([R,ke])}return H.sort(function(R,se){return R[1]-se[1]}),H.map(R=>{var se;const fe=R[0],ke=P[fe],he=((se=o.pluginConfigSchema)==null?void 0:se[fe])||{};return{key:fe,value:ke,hidden:he.hidden||!1,type:he.type??le.Text,label:he.label??l(fe),tooltip:he.tooltip??void 0,section:pe.Plugin}}).filter(R=>!R.hidden)}),w=n.computed(()=>{var N,q,P,J;return{basic:(N=x.value)==null?void 0:N.filter(H=>H.section===pe.Basic),advanced:(q=x.value)==null?void 0:q.filter(H=>H.section===pe.Advanced),plugin:(J=C.value)==null?void 0:J.concat((P=x.value)==null?void 0:P.filter(H=>H.section===pe.Plugin))}}),O=n.computed(()=>{const N=[];return w.value.basic.length&&N.push("basic"),w.value.advanced.length&&N.push("advanced"),w.value.plugin.length&&N.push("plugin"),N}),$=N=>!!(N.tooltip||s[`${N.key}-label-tooltip`]),re=n.computed(()=>{var N,q;let P=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?P=P.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):o.config.app==="kongManager"&&(P=P.replace(/\/{workspace}/gi,(q=o.config)!=null&&q.workspace?`/${o.config.workspace}`:"")),P=P.replace(/{id}/gi,o.config.entityId),P}),E=N=>{m.value&&N(JSON.stringify(m.value))?i("copy:success",m.value):i("copy:error")};return n.watch(h,N=>{i("loading",N)},{immediate:!0}),n.onBeforeMount(async()=>{g.value=!1,h.value=!0;try{const{data:N}=await d.get(re.value);if(o.dataKey)if(typeof N[o.dataKey]<"u")m.value={...N[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else m.value={...N};Object.keys(o.configSchema).filter(q=>o.configSchema[q].forceShow).forEach(q=>{m.value&&typeof m.value[q]>"u"&&(m.value[q]=null)}),i("fetch:success",N)}catch(N){const q=c(N);k.value=q.startsWith("code")?a("baseConfigCard.errors.load"):q,g.value=!0,i("fetch:error",N)}finally{h.value=!1}}),(N,q)=>{const P=n.resolveComponent("KLabel"),J=n.resolveComponent("KSelect"),H=n.resolveComponent("KButton"),R=n.resolveComponent("KClipboardProvider"),se=n.resolveComponent("KSkeleton"),fe=n.resolveComponent("KEmptyState"),ke=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(ke,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",l1,[n.renderSlot(N.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(P,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(J,{key:1,appearance:"select","data-testid":"select-config-format",items:y,onChange:B})):n.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(H,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(a1),{size:n.unref(hg)},null,8,["size"])],8,u1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(R,{key:3},{default:n.withCtx(({copyToClipboard:he})=>[!h.value&&!g.value?(n.openBlock(),n.createBlock(H,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:ye=>E(he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),default:n.withCtx(()=>[h.value?(n.openBlock(),n.createBlock(se,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):g.value?(n.openBlock(),n.createBlock(fe,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(k.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",d1,[n.createVNode(e1,{config:e.config,"fetcher-url":re.value,format:p.value,"prop-list-types":O.value,"property-collections":w.value,record:m.value},n.createSlots({_:2},[n.renderList(Object.keys(N.$slots),he=>({name:he,fn:n.withCtx(({row:ye,rowValue:Be})=>[n.renderSlot(N.$slots,he,{row:ye,rowValue:Be},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",f1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(O.value,he=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${he}-props`,class:n.normalizeClass(`config-card-details-${he}-props`),"data-testid":`config-card-details-${he}-props`},[he!=="basic"?(n.openBlock(),n.createElementBlock("div",h1,n.toDisplayString(he==="advanced"?n.unref(a)("baseConfigCard.sections.advanced"):n.unref(a)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value[he],ye=>(n.openBlock(),n.createBlock(Ii,{key:ye.key,item:ye},n.createSlots({label:n.withCtx(()=>[n.renderSlot(N.$slots,`${ye.key}-label`,{row:ye},void 0,!0)]),[ye.key]:n.withCtx(({rowValue:Be})=>[n.renderSlot(N.$slots,ye.key,{row:ye,rowValue:Be},void 0,!0)]),_:2},[$(ye)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(N.$slots,`${ye.key}-label-tooltip`,{row:ye},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,p1))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",c1,[n.renderSlot(N.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Uf=dt(y1,[["__scopeId","data-v-068b819b"]]),g1={class:"form-actions","data-testid":"form-actions"},m1={key:0},b1=n.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=t,o=e,s=Gr.useRouter(),{i18n:{t:a}}=Te.useI18n(),{getMessageFromError:c}=Te.useErrors(),{axiosInstance:l}=Te.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),d=n.ref(!1),y=n.ref(!1),p=n.ref(""),B=n.computed(()=>o.canSubmit===!1||o.isReadonly),v=n.ref(!1),h=n.computed(()=>{var w,O;let $=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((w=o.config)==null?void 0:w.controlPlaneId)||""):o.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(O=o.config)!=null&&O.workspace?`/${o.config.workspace}`:"")),o.editId?($=$.replace(/{id}/gi,o.editId),$):($=$.replace(/\/{id}/gi,""),$)}),g=()=>{v.value=!v.value},k=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):m()},m=()=>{i("cancel")},x=()=>{B.value||i("submit")},C=n.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return n.watch(()=>d.value,w=>{i("loading",w)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:w}=await l.get(h.value);i("fetch:success",w)}catch(w){const O=c(w);p.value=O.startsWith("code")?a("baseForm.errors.edit"):O,y.value=!0,i("fetch:error",w)}finally{d.value=!1}}),(w,O)=>{const $=n.resolveComponent("KSkeleton"),re=n.resolveComponent("KEmptyState"),E=n.resolveComponent("KAlert"),N=n.resolveComponent("KButton"),q=n.resolveComponent("KTabs"),P=n.resolveComponent("KSlideout"),J=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(J,{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock($,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(re,{key:1,"cta-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":k,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(m,["prevent"]),onSubmit:n.withModifiers(x,["prevent"])},[n.renderSlot(w.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(E,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",g1,[n.renderSlot(w.$slots,"form-actions",{},()=>[e.config.jsonYamlMilestone2Enabled?(n.openBlock(),n.createElementBlock("div",m1,[n.createVNode(N,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:O[0]||(O[0]=H=>g())},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(N,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(N,{appearance:"primary","data-testid":"form-submit",disabled:B.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),n.createVNode(P,{"close-button-alignment":"end","data-testid":"form-view-configuration-slideout","has-overlay":!1,"is-visible":v.value,"prevent-close-on-blur":"",title:n.unref(a)("baseForm.configuration.title"),onClose:O[1]||(O[1]=H=>g())},{default:n.withCtx(()=>[n.createElementVNode("div",null,n.toDisplayString(n.unref(a)("baseForm.configuration.message")),1),n.createVNode(q,{"data-testid":"form-view-configuration-slideout-tabs",tabs:C.value},{json:n.withCtx(()=>[n.createVNode(jd,{config:e.config,"fetcher-url":h.value,"json-record":o.formFields,"request-method":o.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:n.withCtx(()=>[n.createVNode($f,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["is-visible","title"])]),_:3})}}}),Lf=dt(b1,[["__scopeId","data-v-41712e71"]]),w1={key:0,"data-testid":"first-col"},v1=n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=n.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[data-testid="first-col"]'))||null}),o=n.computed(()=>{var g,k;const m=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return m?((k=m[0])==null?void 0:k.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,k,m;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,y.value=((k=r.value)==null?void 0:k.clientWidth)||0,p.value=((m=l.value)==null?void 0:m.innerText)||""},l=n.ref({}),d=n.ref(0),y=n.ref(0),p=n.ref(""),B=n.computed(()=>[i.value,r.value]),v=n.watch(B,g=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(k=>{window.requestAnimationFrame(()=>{!Array.isArray(k)||!k.length||c()})});for(const k of g)k&&s.observe(k)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>y.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{v()}),(g,k)=>{const m=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",w1,[n.createVNode(m,{label:h.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):n.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),k1=dt(v1,[["__scopeId","data-v-e42a20c9"]]),C1={class:"toolbar-container"},S1={key:0,class:"toolbar-button-container"},x1=["data-testid"],A1=n.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,i=t,{i18n:{t:o}}=Te.useI18n(),s=n.computed(()=>{var O,$;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(O=r.errorMessage)==null?void 0:O.title,message:($=r.errorMessage)==null?void 0:$.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=O=>O.hasData||!!r.query,l=n.computed(()=>{const O=[];return Object.keys(r.tableHeaders).forEach($=>{const re=r.tableHeaders[$];O.push({label:re.label??$,key:$,sortable:re.sortable??!1})}),r.enableEntityActions&&O.push({key:"actions",hideLabel:!0}),O}),d=O=>({"data-rowid":O.id,"data-testid":O.name,...r.rowAttributes(O)}),y=n.ref({}),p=O=>{var $;return($=y.value)==null?void 0:$.$el.querySelector(`[data-rowid="${O.id}"]`)},B=O=>{const $={"data-testid":O.headerKey,...r.cellAttributes(O)};return O.colIndex===0&&($.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),$},v=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=n.computed(()=>r.disableRowClick?void 0:(O,$)=>{i("click:row",$)}),k=O=>{i("sort",O)},{setTablePreferences:m,getTablePreferences:x}=wy(),C=n.computed(()=>{const O=x(r.preferencesStorageKey);return{...r.initialFetcherParams,...O}}),w=O=>{r.preferencesStorageKey&&m(r.preferencesStorageKey,O)};return(O,$)=>{const re=n.resolveComponent("KIcon"),E=n.resolveComponent("KButton"),N=n.resolveComponent("KDropdown"),q=n.resolveComponent("KTable"),P=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(P,{class:"kong-ui-entity-base-table",title:e.title},{default:n.withCtx(()=>[n.createVNode(q,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":B,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":C.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:v,"onRow:click":g.value,onSort:$[0]||($[0]=J=>k(J)),"onUpdate:tablePreferences":w},n.createSlots({toolbar:n.withCtx(({state:J})=>[n.withDirectives(n.createElementVNode("div",C1,[n.renderSlot(O.$slots,"toolbar-filter",{},void 0,!0),O.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",S1,[n.renderSlot(O.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,c(J)]])]),actions:n.withCtx(({row:J,rowKey:H,rowValue:R})=>[n.createElementVNode("div",{class:"actions-container","data-testid":J.name},[n.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(O.$slots,"actions",{row:J,rowKey:H,rowValue:R},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(E,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(re,{color:n.unref(fg),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,x1)]),_:2},[n.renderList(e.tableHeaders,(J,H)=>({name:H,fn:n.withCtx(({row:R,rowKey:se,rowValue:fe})=>[n.createVNode(k1,{"key-name":String(H),"row-el":p(R)},{default:n.withCtx(()=>[n.renderSlot(O.$slots,H,{row:R,rowKey:se,rowValue:fe},()=>[n.createTextVNode(n.toDisplayString(fe),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Hf=dt(A1,[["__scopeId","data-v-57b5a97b"]]),B1={key:0,class:"kong-ui-entity-delete-error"},I1={key:1,class:"description"},E1=n.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:t}){const{i18nT:r}=Te.useI18n(),i=e,o=t,s=n.computed(()=>i.needConfirm?i.entityName:""),a=()=>{o("cancel")},c=()=>{o("proceed")};return(l,d)=>{const y=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":s.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:a,onProceed:c},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",B1,[n.createVNode(y,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(n.openBlock(),n.createElementBlock("div",I1,[n.renderSlot(l.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Ff=dt(E1,[["__scopeId","data-v-1c9a2a07"]]),N1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},O1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},_1=["fill"],T1={mask:"url(#mask0_180_20349)"},V1=["fill"],qf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${ug})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",N1,[n.createElementVNode("mask",O1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,_1)]),n.createElementVNode("g",T1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,V1)])]))}}),j1={key:1,class:"kong-ui-entity-filter"},D1={class:"menu-item-title"},M1={class:"menu-item-indicator"},P1={class:"menu-item-body"},$1=["for"],R1={class:"menu-item-buttons"},U1={class:"filter-clear-button-container"},L1=n.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{i18n:{t:r}}=Te.useI18n(),i=e,o=t,s=n.ref(!1),a=n.ref({}),c=n.computed(()=>{const m=[];return new URLSearchParams(i.modelValue).forEach((x,C)=>{x!==""&&m.push(C)}),m}),l=n.computed(()=>{const m=i.config.fields;return Object.keys(m).filter(x=>m[x].searchable).map(x=>({label:m[x].label||x,value:x}))});n.watch(()=>i.modelValue,m=>{a.value={},new URLSearchParams(m).forEach((x,C)=>{a.value[C]=x})});const d=()=>{s.value=!s.value},y=m=>{o("update:modelValue",m)},p=m=>`filter-${m}`,B=m=>{var x,C;return(((C=(x=i.config.schema)==null?void 0:x[m])==null?void 0:C.values)??[]).map(w=>({value:w,label:w}))},v=m=>{var x,C;return((C=(x=i.config.schema)==null?void 0:x[m])==null?void 0:C.type)??"text"},h=m=>{a.value={...a.value,[m]:""},k()},g=()=>{a.value={},k(!0)},k=(m=!1)=>{const x=Object.keys(a.value).reduce((C,w)=>(a.value[w]&&(C[w]=`${a.value[w]}`),C),{});m&&(s.value=!1),o("update:modelValue",new URLSearchParams(x).toString())};return(m,x)=>{const C=n.resolveComponent("KInput"),w=n.resolveComponent("KButton"),O=n.resolveComponent("KSelect"),$=n.resolveComponent("KMenuItem"),re=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(C,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":y},{before:n.withCtx(()=>[n.createVNode(qf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",j1,[n.createVNode(w,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:n.withCtx(()=>[n.createVNode(qf),n.createTextVNode(" "+n.toDisplayString(n.unref(r)("filter.filterButtonText"))+" "+n.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:d},null,512),[[n.vShow,s.value]]),n.withDirectives(n.createVNode(re,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(E,N)=>(n.openBlock(),n.createBlock($,{key:E.value,"data-testid":E.value,expandable:"","last-menu-item":N===l.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",D1,[n.createTextVNode(n.toDisplayString(E.label)+" ",1),n.withDirectives(n.createElementVNode("span",M1,null,512),[[n.vShow,c.value.includes(E.value)]])])]),itemBody:n.withCtx(()=>{var q,P;return[n.createElementVNode("div",P1,[n.createElementVNode("label",{class:"menu-item-label",for:p(E.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,$1),((P=(q=e.config.schema)==null?void 0:q[E.value])==null?void 0:P.type)==="select"?(n.openBlock(),n.createBlock(O,{key:0,id:p(E.value),modelValue:a.value[E.value],"onUpdate:modelValue":J=>a.value[E.value]=J,appearance:"select",items:B(E.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(C,{key:1,id:p(E.value),modelValue:a.value[E.value],"onUpdate:modelValue":J=>a.value[E.value]=J,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:v(E.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",R1,[n.createVNode(w,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:x[0]||(x[0]=J=>k(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(w,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:J=>h(E.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createElementVNode("div",U1,[n.createVNode(w,{appearance:"tertiary",size:"small",onClick:g},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[n.vShow,s.value]])]))}}}),Kf=dt(L1,[["__scopeId","data-v-15962ee2"]]),Dt=n.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=n.ref(void 0),i=n.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return n.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>i.value?n.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):n.createCommentVNode("",!0)}}),H1={class:"form-section-wrapper"},F1={key:0,class:"form-section-title"},q1={key:1,class:"form-section-description"},K1={key:2,class:"form-section-footer"},z1={class:"form-section-content"},G1=n.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const t=n.useSlots();return(r,i)=>(n.openBlock(),n.createElementBlock("fieldset",{class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[n.createElementVNode("div",H1,[e.hideInfoHeader?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(n.openBlock(),n.createElementBlock("h4",F1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",q1,[n.renderSlot(r.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",K1,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",z1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),po=dt(G1,[["__scopeId","data-v-3565daa7"]]),{useAxios:ho,useDeleteUrlBuilder:zf,useErrors:Gf,useExternalLinkCreator:Db,useFetchUrlBuilder:Mb,useFetcher:Wf,useDebouncedFilter:Pb,useStringHelpers:Jf,useHelpers:Yf,useGatewayFeatureSupported:$b,useTruncationDetector:Rb}=Te,W1={class:"kong-ui-entities-certificates-list"},J1={key:0},Y1={key:1},Z1={key:0},Q1={key:1},X1={key:0},eb={key:1},tb={key:1},rb={key:1},ib=n.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var ge;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=ho({headers:(ge=i.config)==null?void 0:ge.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),B={subject:{label:o("certificates.list.table_headers.subject")},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},v=n.computed(()=>{var ae,me;let V=`${i.config.apiBaseUrl}${Bi.list[i.config.app]}`;return i.config.app==="konnect"?V=V.replace(/{controlPlaneId}/gi,((ae=i.config)==null?void 0:ae.controlPlaneId)||""):i.config.app==="kongManager"&&(V=V.replace(/\/{workspace}/gi,(me=i.config)!=null&&me.workspace?`/${i.config.workspace}`:"")),V}),h=n.ref(""),g=n.computed(()=>{const V=i.config.app==="konnect"||i.config.isExactMatch;return V?{isExactMatch:V,placeholder:o("certificates.search.placeholder")}:{isExactMatch:V,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:m}=Wf(i.config,v.value),x=()=>{h.value=""},C=()=>{d.value++},w=n.ref(null),O=(V,ae)=>{const me=V.id;if(!ae(me)){r("copy:error",{entity:V,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:V,field:"id",message:o("certificates.copy.success",{val:me})})},$=(V,ae)=>{const me=JSON.stringify(V);if(!ae(me)){r("copy:error",{entity:V,message:o("certificates.errors.copy")});return}r("copy:success",{entity:V,message:o("certificates.copy.success_brief")})},re=(V,ae)=>{V.type==="error"?r("copy:error",{entity:ae,field:"cert",message:o("certificates.errors.copy")}):r("copy:success",{entity:ae,field:"cert",message:o("certificates.copy.success_brief")})},E=async V=>{var me;await((me=i.canRetrieve)==null?void 0:me.call(i,V))&&c.push(i.config.getViewRoute(V.id))},N=V=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(V)}),q=V=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(V)}),P=V=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(V)}},J=n.ref(void 0),H=n.ref(!1),R=n.ref(!1),se=n.ref(""),fe=zf(i.config,v.value),{certificateDataCache:ke,getCertificateData:he}=kt.useCertificate(),ye=V=>{J.value=V,H.value=!0},Be=()=>{H.value=!1},zt=async()=>{var V,ae,me;if((V=J.value)!=null&&V.id){R.value=!0;try{await l.delete(fe(J.value.id)),R.value=!1,H.value=!1,d.value++,r("delete:success",J.value)}catch(Pe){se.value=((me=(ae=Pe.response)==null?void 0:ae.data)==null?void 0:me.message)||Pe.message||o("certificates.errors.delete"),r("error",Pe)}finally{R.value=!1}}},X=n.ref(!0);n.watch(m,V=>{var ae,me,Pe,Mt;if(Array.isArray((ae=V==null?void 0:V.response)==null?void 0:ae.data)&&(X.value=V.response.data.length>0),V.status===Ft.Error){w.value={title:o("certificates.errors.general")},(Mt=(Pe=(me=V.error)==null?void 0:me.response)==null?void 0:Pe.data)!=null&&Mt.message&&(w.value.message=V.error.response.data.message),r("error",V.error);return}ke.value={},w.value=null});const ee=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("certificates.list.empty_state.description"),title:o("certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(ee.value.title=o("certificates.list.empty_state.title"),ee.value.ctaText=o("certificates.actions.create"))}),(V,ae)=>{const me=n.resolveComponent("KButton"),Pe=n.resolveComponent("KBadge"),Mt=n.resolveComponent("KTruncate"),te=n.resolveComponent("KDropdownItem"),Oe=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",W1,[n.createVNode(n.unref(Hf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ee.value,"enable-entity-actions":"","error-message":w.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(B),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":ae[2]||(ae[2]=Y=>E(Y)),onSort:C},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Kf),{modelValue:h.value,"onUpdate:modelValue":ae[0]||(ae[0]=Y=>h.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:n.withCtx(()=>[n.createVNode(n.unref(Dt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(me,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,X.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:n.withCtx(({row:Y})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",J1,n.toDisplayString((Ce=Y==null?void 0:Y.metadata)!=null&&Ce.subject?Y.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",Y1,n.toDisplayString(n.unref(he)(Y).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:Y})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",Z1,n.toDisplayString((Ce=Y==null?void 0:Y.metadata)!=null&&Ce.expiry?n.unref(s)(Y.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",Q1,n.toDisplayString(n.unref(he)(Y).schemaExpiry?n.unref(s)(n.unref(he)(Y).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:Y})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",X1,n.toDisplayString((Ce=Y==null?void 0:Y.metadata)!=null&&Ce.dns_names?`dns=${Y.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",eb,n.toDisplayString(n.unref(he)(Y).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:Y})=>[Y!=null&&Y.cert?(n.openBlock(),n.createBlock(n.unref(gy),{key:0,"data-testid":"copy-certificate-cert",notify:Ce=>re(Ce,Y),truncated:!0,uuid:Y.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",tb,"-"))]),tags:n.withCtx(({row:Y})=>{var Ce;return[((Ce=Y==null?void 0:Y.tags)==null?void 0:Ce.length)>0?(n.openBlock(),n.createBlock(Mt,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Y==null?void 0:Y.tags,zr=>(n.openBlock(),n.createBlock(Pe,{key:zr,onClick:ae[1]||(ae[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(zr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",rb,"-"))]}),actions:n.withCtx(({row:Y})=>[n.createVNode(Oe,null,{default:n.withCtx(({copyToClipboard:Ce})=>[n.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:zr=>O(Y,Ce)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Oe,null,{default:n.withCtx(({copyToClipboard:Ce})=>[n.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:zr=>$(Y,Ce)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canRetrieve(Y)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:N(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canEdit(Y)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-edit",item:q(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Dt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-add-sni",item:P(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canDelete(Y)},{default:n.withCtx(()=>[n.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>ye(Y)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Ff),{"action-pending":R.value,"entity-type":n.unref(Oa).Certificate,error:se.value,title:n.unref(o)("certificates.delete.title"),visible:H.value,onCancel:Be,onProceed:zt},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Kr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},nb=Kr(ib,[["__scopeId","data-v-fa23e672"]]),ob={class:"kong-ui-entities-certificates-form"},sb=Kr(n.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var C;const r=t,i=e,o=Gr.useRouter(),{i18nT:s,i18n:{t:a}}=kt.useI18n(),{getMessageFromError:c}=Gf(),{axiosInstance:l}=ho({headers:(C=i.config)==null?void 0:C.requestHeaders}),d=n.computed(()=>Bi.form[i.config.app].edit),y=n.computed(()=>i.certificateId?dr.Edit:dr.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),B=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),v=n.computed(()=>(y.value===dr.Create||JSON.stringify(p.fields)!==JSON.stringify(B))&&!!p.fields.cert&&!!p.fields.key),h=w=>{var O;p.fields.cert=(w==null?void 0:w.cert)||"",p.fields.key=(w==null?void 0:w.key)||"",p.fields.certAlt=(w==null?void 0:w.cert_alt)||"",p.fields.keyAlt=(w==null?void 0:w.key_alt)||"",p.fields.tags=((O=w==null?void 0:w.tags)==null?void 0:O.join(", "))||"",Object.assign(B,p.fields)},g=()=>{o.push(i.config.cancelRoute)},k=n.computed(()=>{var O,$;let w=`${i.config.apiBaseUrl}${Bi.form[i.config.app].validate}`;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,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),w=w.replace(/{id}/gi,i.certificateId),w}),m=n.computed(()=>{var O,$;let w=`${i.config.apiBaseUrl}${Bi.form[i.config.app][y.value]}`;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,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),w=w.replace(/{id}/gi,i.certificateId),w}),x=async()=>{var w,O,$,re,E,N,q,P,J;try{p.isReadonly=!0;const H={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(O=(w=p.fields.tags.split(","))==null?void 0:w.map(se=>String(se||"").trim()))==null?void 0:O.filter(se=>se!=="")};let R;await l.post(k.value,H),y.value==="create"?R=await l.post(m.value,H):y.value==="edit"&&(R=(($=i.config)==null?void 0:$.app)==="konnect"?await l.put(m.value,H):await l.patch(m.value,H)),p.fields.cert=((re=R==null?void 0:R.data)==null?void 0:re.cert)||"",p.fields.key=((E=R==null?void 0:R.data)==null?void 0:E.key)||"",p.fields.certAlt=((N=R==null?void 0:R.data)==null?void 0:N.cert_alt)||"",p.fields.keyAlt=((q=R==null?void 0:R.data)==null?void 0:q.key_alt)||"",p.fields.tags=((J=(P=R==null?void 0:R.data)==null?void 0:P.tags)==null?void 0:J.join(", "))||"",Object.assign(B,p.fields),r("update",R==null?void 0:R.data)}catch(H){p.errorMessage=c(H),r("error",H)}finally{p.isReadonly=!1}};return(w,O)=>{const $=n.resolveComponent("KTextArea"),re=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",ob,[n.createVNode(n.unref(Lf),{"can-submit":v.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":p.fields,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":O[5]||(O[5]=E=>w.$emit("error",E)),"onFetch:success":h,onLoading:O[6]||(O[6]=E=>w.$emit("loading",E)),onSubmit:x},{default:n.withCtx(()=>[n.createVNode(n.unref(po),{description:n.unref(a)("certificates.form.sections.ssl.description"),title:n.unref(a)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode($,{modelValue:p.fields.cert,"onUpdate:modelValue":O[0]||(O[0]=E=>p.fields.cert=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:n.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode($,{modelValue:p.fields.key,"onUpdate:modelValue":O[1]||(O[1]=E=>p.fields.key=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:n.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode($,{modelValue:p.fields.certAlt,"onUpdate:modelValue":O[2]||(O[2]=E=>p.fields.certAlt=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:n.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode($,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":O[3]||(O[3]=E=>p.fields.keyAlt=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:n.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(po),{description:n.unref(a)("certificates.form.sections.general.description"),title:n.unref(a)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(re,{modelValue:p.fields.tags,"onUpdate:modelValue":O[4]||(O[4]=E=>p.fields.tags=E),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(a)("certificates.form.fields.tags.help"),label:n.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-bc34f24e"]]),Vi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/ca_certificates",kongManager:"/{workspace}/ca_certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/ca_certificates",edit:"/api/runtime_groups/{controlPlaneId}/ca_certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/ca-certificate/validate"},kongManager:{create:"/{workspace}/ca_certificates",edit:"/{workspace}/ca_certificates/{id}",validate:"/{workspace}/schemas/ca_certificates/validate"}}},ab={class:"kong-ui-ca-certificate-entity-config-card"},cb={key:0},lb=Kr(n.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],i=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=kt.useI18n(),{convertKeyToTitle:c}=Jf(),{getPropValue:l}=Yf(),{getCertificateData:d}=kt.useCertificate(),y=n.computed(()=>Vi.form[o.config.app].edit),p=n.ref(),B=n.computed(()=>{if(p.value)return d(p.value)}),v=n.computed(()=>{var C;return((C=B.value)==null?void 0:C.schemaIssuer)||""}),h=n.computed(()=>{var C,w;return(C=B.value)!=null&&C.schemaExpiry?a((w=B.value)==null?void 0:w.schemaExpiry):""}),g=n.computed(()=>{var C;return((C=B.value)==null?void 0:C.schemaKeyUsages)||[]}),k=(C,w)=>{const O=l("rowValue",w);if(C==="expiry")return h.value;if(C==="key_usages")return g.value;if(O)return O[C]},m=C=>{p.value=C,i("fetch:success",C)},x=n.ref({id:{},updated_at:{},created_at:{},cert:{section:pe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:pe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:pe.Basic,type:le.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:pe.Basic,order:1.7,forceShow:!0},issuer:{section:pe.Basic,order:1.5,forceShow:!0},key_usages:{section:pe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(C,w)=>{const O=n.resolveComponent("KCodeBlock"),$=n.resolveComponent("KLabel"),re=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",ab,[n.createVNode(n.unref(Uf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":x.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":w[0]||(w[0]=E=>C.$emit("copy:success",E)),"onFetch:error":w[1]||(w[1]=E=>C.$emit("fetch:error",E)),"onFetch:success":m,onLoading:w[2]||(w[2]=E=>C.$emit("loading",E))},{cert:n.withCtx(E=>[n.unref(l)("rowValue",E)?(n.openBlock(),n.createBlock(O,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",E),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode($,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(E=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",E)).filter(N=>!r.includes(N)),N=>(n.openBlock(),n.createBlock(n.unref(Ii),{key:N,"data-testid":`ca-cert-metadata-${N}`,item:{key:N,label:n.unref(c)(N),value:k(N,E),type:N==="key_usages"?n.unref(le).BadgeTag:n.unref(le).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),key_usages:n.withCtx(()=>[g.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",cb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(E,N)=>(n.openBlock(),n.createBlock(re,{key:`key_usages-badge-tag-${N}`,class:"config-badge","data-testid":`key_usages-badge-tag-${N}`,tooltip:E,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(E),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),ub={class:"kong-ui-entities-ca-certificates-list"},db={key:0},fb={key:1},pb={key:0},hb={key:1},yb={key:1},gb=Kr(n.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var X;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=ho({headers:(X=i.config)==null?void 0:X.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),B={issuer:{label:o("ca-certificates.list.table_headers.issuer")},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},v=n.computed(()=>{var ge,V;let ee=`${i.config.apiBaseUrl}${Vi.list[i.config.app]}`;return i.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((ge=i.config)==null?void 0:ge.controlPlaneId)||""):i.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(V=i.config)!=null&&V.workspace?`/${i.config.workspace}`:"")),ee}),h=n.ref(""),g=n.computed(()=>{const ee=i.config.app==="konnect"||i.config.isExactMatch;return ee?{isExactMatch:ee,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:ee,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:m}=Wf(i.config,v.value),x=()=>{h.value=""},C=()=>{d.value++},w=n.ref(null),O=(ee,ge)=>{const V=ee.id;if(!ge(V)){r("copy:error",{entity:ee,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,field:"id",message:o("ca-certificates.copy.success",{val:V})})},$=(ee,ge)=>{const V=JSON.stringify(ee);if(!ge(V)){r("copy:error",{entity:ee,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:o("ca-certificates.copy.success_brief")})},re=async ee=>{var V;await((V=i.canRetrieve)==null?void 0:V.call(i,ee))&&c.push(i.config.getViewRoute(ee.id))},E=ee=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),N=ee=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),q=n.ref(void 0),P=n.ref(!1),J=n.ref(!1),H=n.ref(""),R=zf(i.config,v.value),{certificateDataCache:se,getCertificateData:fe}=kt.useCertificate(),ke=ee=>{q.value=ee,P.value=!0},he=()=>{P.value=!1},ye=async()=>{var ee,ge,V;if((ee=q.value)!=null&&ee.id){J.value=!0;try{await l.delete(R(q.value.id)),J.value=!1,P.value=!1,d.value++,r("delete:success",q.value)}catch(ae){H.value=((V=(ge=ae.response)==null?void 0:ge.data)==null?void 0:V.message)||ae.message||o("ca-certificates.errors.delete"),r("error",ae)}finally{J.value=!1}}},Be=n.ref(!0);n.watch(m,ee=>{var ge,V,ae,me;if(Array.isArray((ge=ee==null?void 0:ee.response)==null?void 0:ge.data)&&(Be.value=ee.response.data.length>0),ee.status===Ft.Error){w.value={title:o("ca-certificates.errors.general")},(me=(ae=(V=ee.error)==null?void 0:V.response)==null?void 0:ae.data)!=null&&me.message&&(w.value.message=ee.error.response.data.message),r("error",ee.error);return}se.value={},w.value=null});const zt=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("ca-certificates.list.empty_state.description"),title:o("ca-certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(zt.value.title=o("ca-certificates.list.empty_state.title"),zt.value.ctaText=o("ca-certificates.actions.create"))}),(ee,ge)=>{const V=n.resolveComponent("KButton"),ae=n.resolveComponent("KBadge"),me=n.resolveComponent("KTruncate"),Pe=n.resolveComponent("KDropdownItem"),Mt=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",ub,[n.createVNode(n.unref(Hf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":zt.value,"enable-entity-actions":"","error-message":w.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(B),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":ge[2]||(ge[2]=te=>re(te)),onSort:C},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Kf),{modelValue:h.value,"onUpdate:modelValue":ge[0]||(ge[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:n.withCtx(()=>[n.createVNode(n.unref(Dt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(V,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,Be.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:n.withCtx(({row:te})=>{var Oe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",db,n.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.issuer?te.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",fb,n.toDisplayString(n.unref(fe)(te).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:te})=>{var Oe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",pb,n.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.expiry?n.unref(s)(te.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",hb,n.toDisplayString(n.unref(fe)(te).schemaExpiry?n.unref(s)(n.unref(fe)(te).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:te})=>{var Oe;return[((Oe=te==null?void 0:te.tags)==null?void 0:Oe.length)>0?(n.openBlock(),n.createBlock(me,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(te==null?void 0:te.tags,Y=>(n.openBlock(),n.createBlock(ae,{key:Y,onClick:ge[1]||(ge[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",yb,"-"))]}),actions:n.withCtx(({row:te})=>[n.createVNode(Mt,null,{default:n.withCtx(({copyToClipboard:Oe})=>[n.createVNode(Pe,{"data-testid":"action-entity-copy-id",onClick:Y=>O(te,Oe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Mt,null,{default:n.withCtx(({copyToClipboard:Oe})=>[n.createVNode(Pe,{"data-testid":"action-entity-copy-json",onClick:Y=>$(te,Oe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canRetrieve(te)},{default:n.withCtx(()=>[n.createVNode(Pe,{"data-testid":"action-entity-view","has-divider":"",item:E(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canEdit(te)},{default:n.withCtx(()=>[n.createVNode(Pe,{"data-testid":"action-entity-edit",item:N(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canDelete(te)},{default:n.withCtx(()=>[n.createVNode(Pe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Oe=>ke(te)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Ff),{"action-pending":J.value,"entity-type":n.unref(Oa).CACertificate,error:H.value,title:n.unref(o)("ca-certificates.delete.title"),visible:P.value,onCancel:he,onProceed:ye},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f25a63b4"]]),mb={class:"kong-ui-entities-ca-certificates-form"},bb=Kr(n.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var x;const r=t,i=e,o=Gr.useRouter(),{i18n:{t:s}}=kt.useI18n(),{getMessageFromError:a}=Gf(),{axiosInstance:c}=ho({headers:(x=i.config)==null?void 0:x.requestHeaders}),l=n.computed(()=>Vi.form[i.config.app].edit),d=n.computed(()=>i.certificateId?dr.Edit:dr.Create),y=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),B=n.computed(()=>(d.value===dr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),v=C=>{var w;y.fields.cert=(C==null?void 0:C.cert)||"",y.fields.certDigest=(C==null?void 0:C.cert_digest)||"",y.fields.tags=((w=C==null?void 0:C.tags)==null?void 0:w.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},g=n.computed(()=>{var w,O;let C=`${i.config.apiBaseUrl}${Vi.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),k=n.computed(()=>{var w,O;let C=`${i.config.apiBaseUrl}${Vi.form[i.config.app][d.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),m=async()=>{var C,w,O,$,re,E,N;try{y.isReadonly=!0;const q={cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(w=(C=y.fields.tags.split(","))==null?void 0:C.map(J=>String(J||"").trim()))==null?void 0:w.filter(J=>J!=="")};let P;await c.post(g.value,q),d.value==="create"?P=await c.post(k.value,q):d.value==="edit"&&(P=((O=i.config)==null?void 0:O.app)==="konnect"?await c.put(k.value,q):await c.patch(k.value,q)),y.fields.cert=(($=P==null?void 0:P.data)==null?void 0:$.cert)||"",y.fields.certDigest=((re=P==null?void 0:P.data)==null?void 0:re.cert_digest)||"",y.fields.tags=((N=(E=P==null?void 0:P.data)==null?void 0:E.tags)==null?void 0:N.join(", "))||"",Object.assign(p,y.fields),r("update",P==null?void 0:P.data)}catch(q){y.errorMessage=a(q),r("error",q)}finally{y.isReadonly=!1}};return(C,w)=>{const O=n.resolveComponent("KTextArea"),$=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",mb,[n.createVNode(n.unref(Lf),{"can-submit":B.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"form-fields":y.fields,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":w[3]||(w[3]=re=>C.$emit("error",re)),"onFetch:success":v,onLoading:w[4]||(w[4]=re=>C.$emit("loading",re)),onSubmit:m},{default:n.withCtx(()=>[n.createVNode(n.unref(po),{description:n.unref(s)("ca-certificates.form.sections.cert.description"),title:n.unref(s)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:y.fields.cert,"onUpdate:modelValue":w[0]||(w[0]=re=>y.fields.cert=re),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:n.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode($,{modelValue:y.fields.certDigest,"onUpdate:modelValue":w[1]||(w[1]=re=>y.fields.certDigest=re),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(po),{description:n.unref(s)("ca-certificates.form.sections.general.description"),title:n.unref(s)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode($,{modelValue:y.fields.tags,"onUpdate:modelValue":w[2]||(w[2]=re=>y.fields.tags=re),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(s)("ca-certificates.form.fields.tags.help"),label:n.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("ca-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","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-7f7e829d"]]),wb={class:"kong-ui-certificate-entity-config-card"},vb={key:0},kb=Kr(n.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),{convertKeyToTitle:c}=Jf(),{getPropValue:l}=Yf(),{getCertificateData:d}=kt.useCertificate(),y=n.computed(()=>Bi.form[i.config.app].edit),p=n.ref(),B=n.ref({id:{},cert:{section:pe.Basic},key:{section:pe.Basic,type:le.Redacted},metadata:{section:pe.Basic,type:le.Json},snis:{section:pe.Basic,type:le.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:pe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:pe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:pe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:pe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:pe.Advanced},key_alt:{section:pe.Advanced,type:le.Redacted}}),v=E=>{p.value=E,r("fetch:success",E)},h=(E,N)=>{const q=l("rowValue",N);if(E==="expiry")return k.value;if(E==="key_usages")return w.value;if(E==="san_names")return x.value;if(q)return q[E]},g=n.computed(()=>{if(p.value)return d(p.value)}),k=n.computed(()=>{var E,N;return(E=g.value)!=null&&E.schemaExpiry?s((N=g.value)==null?void 0:N.schemaExpiry):""}),m=n.computed(()=>{var E;return((E=g.value)==null?void 0:E.schemaIssuer)||""}),x=n.computed(()=>{var E;return((E=g.value)==null?void 0:E.schemaSanNames)||""}),C=n.computed(()=>{var E;return((E=g.value)==null?void 0:E.schemaSubject)||""}),w=n.computed(()=>{var E;return((E=g.value)==null?void 0:E.schemaKeyUsages)||[]}),O=n.computed(()=>{var E,N;return((N=(E=p==null?void 0:p.value)==null?void 0:E.snis)==null?void 0:N.length)>0}),$=n.computed(()=>{var E;return!!((E=p==null?void 0:p.value)!=null&&E.cert_alt)}),re=E=>{var N,q;return E==="san_names"?o("certificates.list.table_headers.san"):((q=(N=B.value)==null?void 0:N[E])==null?void 0:q.label)||c(E)};return(E,N)=>{const q=n.resolveComponent("KCodeBlock"),P=n.resolveComponent("KLabel"),J=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",wb,[n.createVNode(n.unref(Uf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":N[0]||(N[0]=H=>E.$emit("copy:success",H)),"onFetch:error":N[1]||(N[1]=H=>E.$emit("fetch:error",H)),"onFetch:success":v,onLoading:N[2]||(N[2]=H=>E.$emit("loading",H))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(H=>[n.unref(l)("rowValue",H)?(n.openBlock(),n.createBlock(q,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",H),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(P,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(H=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",H)),R=>(n.openBlock(),n.createBlock(n.unref(Ii),{key:R,item:{key:R,value:h(R,H),label:re(R),type:R==="key_usages"||R==="snis"||R==="dns_names"?n.unref(le).BadgeTag:n.unref(le).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(m.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[w.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",vb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value,(H,R)=>(n.openBlock(),n.createBlock(J,{key:`key_usages-badge-tag-${R}`,class:"config-badge","data-testid":`key_usages-badge-tag-${R}`,tooltip:H,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(H),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[O.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},$.value?{name:"cert_alt",fn:n.withCtx(H=>[n.createTextVNode(" > "),n.unref(l)("rowValue",H)?(n.openBlock(),n.createBlock(q,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(l)("rowValue",H),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-920043bf"]]);$e.CACertificateConfigCard=lb,$e.CACertificateForm=bb,$e.CACertificateList=gb,$e.CertificateConfigCard=kb,$e.CertificateForm=sb,$e.CertificateList=nb,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});
147
+ `+e.slice(a+1):l+=e.slice(o),l.slice(1)}function B0(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=Ti(e,o),i=Ue[r],!i&&_i(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||g0(r);return t}function I0(e,t,r){var i="",o=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(jt(e,t,c,!1,!1)||typeof c>"u"&&jt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}function Mf(e,t,r,i){var o="",s=e.tag,a,c,l;for(a=0,c=r.length;a<c;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(jt(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&jt(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=qa(e,t)),e.dump&&Ni===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function E0(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,c,l,d,y;for(a=0,c=s.length;a<c;a+=1)y="",i!==""&&(y+=", "),e.condenseFlow&&(y+='"'),l=s[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),jt(e,t,l,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),jt(e,t,d,!1,!1)&&(y+=e.dump,i+=y));e.tag=o,e.dump="{"+i+"}"}function N0(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),c,l,d,y,p,B;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Fe("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)B="",(!i||o!=="")&&(B+=qa(e,t)),d=a[c],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),jt(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Ni===e.dump.charCodeAt(0)?B+="?":B+="? "),B+=e.dump,p&&(B+=qa(e,t)),jt(e,t+1,y,!0,p)&&(e.dump&&Ni===e.dump.charCodeAt(0)?B+=":":B+=": ",B+=e.dump,o+=B));e.tag=s,e.dump=o||"{}"}function Pf(e,t,r){var i,o,s,a,c,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(c=o[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(r?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(l=e.styleMap[c.tag]||c.defaultStyle,wf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(vf.call(c.represent,l))i=c.represent[l](t,l);else throw new Fe("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function jt(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Pf(e,r,!1)||Pf(e,r,!0);var c=wf.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var y=c==="[object Object]"||c==="[object Array]",p,B;if(y&&(p=e.duplicates.indexOf(r),B=p!==-1),(e.tag!==null&&e.tag!=="?"||B||e.indent!==2&&t>0)&&(o=!1),B&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&B&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(N0(e,t,e.dump,o),B&&(e.dump="&ref_"+p+e.dump)):(E0(e,t,e.dump),B&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Mf(e,t-1,e.dump,o):Mf(e,t,e.dump,o),B&&(e.dump="&ref_"+p+e.dump)):(I0(e,t,e.dump),B&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&x0(e,e.dump,t,s,l);else{if(c==="[object Undefined]"||e.skipInvalid)return!1;throw new Fe("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function O0(e,t){var r=[],i=[],o,s;for(za(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}function za(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)za(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)za(e[i[o]],t,r)}function _0(e,t){t=t||{};var r=new w0(t);r.noRefs||O0(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),jt(r,0,i,!0,!0)?r.dump+`
148
+ `:""}var T0=_0,V0={dump:T0};function Ga(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var j0=Me,D0=$d,M0=Hd,P0=Gd,$0=Wd,R0=$a,U0=bf.load,L0=bf.loadAll,H0=V0.dump,F0=Fe,q0={binary:Xd,float:zd,map:Ld,null:Fd,pairs:tf,set:rf,timestamp:Zd,bool:qd,int:Kd,merge:Qd,omap:ef,seq:Ud,str:Rd},K0=Ga("safeLoad","load"),z0=Ga("safeLoadAll","loadAll"),G0=Ga("safeDump","dump"),W0={Type:j0,Schema:D0,FAILSAFE_SCHEMA:M0,JSON_SCHEMA:P0,CORE_SCHEMA:$0,DEFAULT_SCHEMA:R0,load:U0,loadAll:L0,dump:H0,YAMLException:F0,types:q0,safeLoad:K0,safeLoadAll:z0,safeDump:G0};const J0={class:"yaml-config"},$f=n.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=n.reactive(t.yamlRecord);return(i,o)=>{const s=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",J0,[t.yamlRecord?(n.openBlock(),n.createBlock(s,{key:0,id:"yaml-codeblock",code:n.unref(W0).dump(r),language:"yaml",theme:"dark"},null,8,["code"])):n.createCommentVNode("",!0)])}}}),Y0={key:0,class:"config-card-display-form"},Z0=["data-testid"],Q0={key:0,class:"config-card-prop-section-title"},X0=n.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=n.useSlots(),{i18n:{t:i}}=Te.useI18n(),o=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=n.computed(()=>{if(!t.record)return t.record;const a=JSON.parse(JSON.stringify(t.record));return delete a.created_at,delete a.updated_at,a});return(a,c)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",Y0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,l=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${l}-props`,class:n.normalizeClass(`config-card-details-${l}-props`),"data-testid":`config-card-details-${l}-props`},[l!=="basic"?(n.openBlock(),n.createElementBlock("div",Q0,n.toDisplayString(l==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[l],d=>(n.openBlock(),n.createBlock(Ii,{key:d.key,item:d},n.createSlots({label:n.withCtx(()=>[n.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:n.withCtx(({rowValue:y})=>[n.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[o(d)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Z0))),128))])):n.createCommentVNode("",!0),e.format==="json"&&t.record?(n.openBlock(),n.createBlock(jd,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):n.createCommentVNode("",!0),e.format==="yaml"&&t.record?(n.openBlock(),n.createBlock($f,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):n.createCommentVNode("",!0)],64))}}),e1=dt(X0,[["__scopeId","data-v-2b74ac63"]]),Rf="24px",t1=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},r1=e=>(n.pushScopeId("data-v-84d5ee61"),e=e(),n.popScopeId(),e),i1=["aria-hidden"],n1={key:0,"data-testid":"kui-icon-svg-title"},o1=r1(()=>n.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),s1=n.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Rf,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Rf}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",n1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),o1],8,i1))]),_:1},8,["aria-hidden","style"]))}}),a1=t1(s1,[["__scopeId","data-v-84d5ee61"]]),c1={"data-testid":"config-card-title"},l1={class:"config-card-actions"},u1=["href"],d1={key:2,class:"config-card-details-section"},f1={key:3,class:"config-card-details-section"},p1=["data-testid"],h1={key:0,class:"config-card-prop-section-title"},y1=n.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:t}){var r;const i=t,o=e,s=n.useSlots(),{i18n:{t:a}}=Te.useI18n(),{getMessageFromError:c}=Te.useErrors(),{convertKeyToTitle:l}=Te.useStringHelpers(),{axiosInstance:d}=Te.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),y=[{label:a("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),B=N=>{p.value=N==null?void 0:N.value},v={id:{type:le.ID,label:a("baseConfigCard.commonFields.id_label"),order:0,section:pe.Basic},name:{order:1,section:pe.Basic},enabled:{type:le.BadgeStatus,order:2,section:pe.Basic},updated_at:{type:le.Date,label:a("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:le.Date,label:a("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:le.BadgeTag,order:-1,section:pe.Basic}},h=n.ref(!1),m=n.ref(!1),k=n.ref(""),g=n.ref({}),x=n.computed(()=>{var N,q,P;if(!g.value)return[];const J=[],H=Object.keys(g.value).length;for(const R in g.value){const se=(q=(N=o.configSchema)==null?void 0:N[R])==null?void 0:q.order,fe=(P=v[R])==null?void 0:P.order;let ke=H;(fe||fe===0)&&(ke=fe===-1?H+1:fe),se&&(ke=se===-1?H+1:se),J.push([R,ke])}return J.sort(function(R,se){return R[1]-se[1]}),J.map(R=>{var se,fe;const ke=R[0],he=(se=g.value)==null?void 0:se[ke],ye=((fe=o.configSchema)==null?void 0:fe[ke])||{},Be=v[ke];return{key:ke,value:he,hidden:ye.hidden||!1,type:ye.type??((Be==null?void 0:Be.type)||le.Text),label:ye.label??((Be==null?void 0:Be.label)||l(ke)),tooltip:ye.tooltip??((Be==null?void 0:Be.tooltip)||void 0),section:ye.section??((Be==null?void 0:Be.section)||pe.Advanced)}}).filter(R=>!R.hidden&&R.key!==o.pluginConfigKey)}),C=n.computed(()=>{var N,q;if(!g.value||!o.pluginConfigKey)return[];const P=g.value[o.pluginConfigKey]||{},J=Object.keys(P).length,H=[];for(const R in P){const se=(q=(N=o.pluginConfigSchema)==null?void 0:N[R])==null?void 0:q.order,fe=P[R];let ke=fe!=null&&fe!==""?J-1:J;se&&(ke=se===-1?J+1:se),H.push([R,ke])}return H.sort(function(R,se){return R[1]-se[1]}),H.map(R=>{var se;const fe=R[0],ke=P[fe],he=((se=o.pluginConfigSchema)==null?void 0:se[fe])||{};return{key:fe,value:ke,hidden:he.hidden||!1,type:he.type??le.Text,label:he.label??l(fe),tooltip:he.tooltip??void 0,section:pe.Plugin}}).filter(R=>!R.hidden)}),w=n.computed(()=>{var N,q,P,J;return{basic:(N=x.value)==null?void 0:N.filter(H=>H.section===pe.Basic),advanced:(q=x.value)==null?void 0:q.filter(H=>H.section===pe.Advanced),plugin:(J=C.value)==null?void 0:J.concat((P=x.value)==null?void 0:P.filter(H=>H.section===pe.Plugin))}}),O=n.computed(()=>{const N=[];return w.value.basic.length&&N.push("basic"),w.value.advanced.length&&N.push("advanced"),w.value.plugin.length&&N.push("plugin"),N}),$=N=>!!(N.tooltip||s[`${N.key}-label-tooltip`]),re=n.computed(()=>{var N,q;let P=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?P=P.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):o.config.app==="kongManager"&&(P=P.replace(/\/{workspace}/gi,(q=o.config)!=null&&q.workspace?`/${o.config.workspace}`:"")),P=P.replace(/{id}/gi,o.config.entityId),P}),E=N=>{g.value&&N(JSON.stringify(g.value))?i("copy:success",g.value):i("copy:error")};return n.watch(h,N=>{i("loading",N)},{immediate:!0}),n.onBeforeMount(async()=>{m.value=!1,h.value=!0;try{const{data:N}=await d.get(re.value);if(o.dataKey)if(typeof N[o.dataKey]<"u")g.value={...N[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else g.value={...N};Object.keys(o.configSchema).filter(q=>o.configSchema[q].forceShow).forEach(q=>{g.value&&typeof g.value[q]>"u"&&(g.value[q]=null)}),i("fetch:success",N)}catch(N){const q=c(N);k.value=q.startsWith("code")?a("baseConfigCard.errors.load"):q,m.value=!0,i("fetch:error",N)}finally{h.value=!1}}),(N,q)=>{const P=n.resolveComponent("KLabel"),J=n.resolveComponent("KSelect"),H=n.resolveComponent("KButton"),R=n.resolveComponent("KClipboardProvider"),se=n.resolveComponent("KSkeleton"),fe=n.resolveComponent("KEmptyState"),ke=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(ke,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",l1,[n.renderSlot(N.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(P,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(J,{key:1,appearance:"select","data-testid":"select-config-format",items:y,onChange:B})):n.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(H,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(a1),{size:n.unref(hm)},null,8,["size"])],8,u1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(R,{key:3},{default:n.withCtx(({copyToClipboard:he})=>[!h.value&&!m.value?(n.openBlock(),n.createBlock(H,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:ye=>E(he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),default:n.withCtx(()=>[h.value?(n.openBlock(),n.createBlock(se,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):m.value?(n.openBlock(),n.createBlock(fe,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(k.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",d1,[n.createVNode(e1,{config:e.config,"fetcher-url":re.value,format:p.value,"prop-list-types":O.value,"property-collections":w.value,record:g.value},n.createSlots({_:2},[n.renderList(Object.keys(N.$slots),he=>({name:he,fn:n.withCtx(({row:ye,rowValue:Be})=>[n.renderSlot(N.$slots,he,{row:ye,rowValue:Be},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",f1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(O.value,he=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${he}-props`,class:n.normalizeClass(`config-card-details-${he}-props`),"data-testid":`config-card-details-${he}-props`},[he!=="basic"?(n.openBlock(),n.createElementBlock("div",h1,n.toDisplayString(he==="advanced"?n.unref(a)("baseConfigCard.sections.advanced"):n.unref(a)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value[he],ye=>(n.openBlock(),n.createBlock(Ii,{key:ye.key,item:ye},n.createSlots({label:n.withCtx(()=>[n.renderSlot(N.$slots,`${ye.key}-label`,{row:ye},void 0,!0)]),[ye.key]:n.withCtx(({rowValue:Be})=>[n.renderSlot(N.$slots,ye.key,{row:ye,rowValue:Be},void 0,!0)]),_:2},[$(ye)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(N.$slots,`${ye.key}-label-tooltip`,{row:ye},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,p1))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",c1,[n.renderSlot(N.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Uf=dt(y1,[["__scopeId","data-v-068b819b"]]),m1={class:"form-actions","data-testid":"form-actions"},g1={key:0},b1=n.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=t,o=e,s=Gr.useRouter(),{i18n:{t:a}}=Te.useI18n(),{getMessageFromError:c}=Te.useErrors(),{axiosInstance:l}=Te.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),d=n.ref(!1),y=n.ref(!1),p=n.ref(""),B=n.computed(()=>o.canSubmit===!1||o.isReadonly),v=n.ref(!1),h=n.computed(()=>{var w,O;let $=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((w=o.config)==null?void 0:w.controlPlaneId)||""):o.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(O=o.config)!=null&&O.workspace?`/${o.config.workspace}`:"")),o.editId?($=$.replace(/{id}/gi,o.editId),$):($=$.replace(/\/{id}/gi,""),$)}),m=()=>{v.value=!v.value},k=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):g()},g=()=>{i("cancel")},x=()=>{B.value||i("submit")},C=n.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return n.watch(()=>d.value,w=>{i("loading",w)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:w}=await l.get(h.value);i("fetch:success",w)}catch(w){const O=c(w);p.value=O.startsWith("code")?a("baseForm.errors.edit"):O,y.value=!0,i("fetch:error",w)}finally{d.value=!1}}),(w,O)=>{const $=n.resolveComponent("KSkeleton"),re=n.resolveComponent("KEmptyState"),E=n.resolveComponent("KAlert"),N=n.resolveComponent("KButton"),q=n.resolveComponent("KTabs"),P=n.resolveComponent("KSlideout"),J=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(J,{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock($,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(re,{key:1,"cta-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":k,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(g,["prevent"]),onSubmit:n.withModifiers(x,["prevent"])},[n.renderSlot(w.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(E,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",m1,[n.renderSlot(w.$slots,"form-actions",{},()=>[e.config.jsonYamlFormsEnabled?(n.openBlock(),n.createElementBlock("div",g1,[n.createVNode(N,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:O[0]||(O[0]=H=>m())},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(N,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(N,{appearance:"primary","data-testid":"form-submit",disabled:B.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),n.createVNode(P,{"close-button-alignment":"end","data-testid":"form-view-configuration-slideout","has-overlay":!1,"is-visible":v.value,"prevent-close-on-blur":"",title:n.unref(a)("baseForm.configuration.title"),onClose:O[1]||(O[1]=H=>m())},{default:n.withCtx(()=>[n.createElementVNode("div",null,n.toDisplayString(n.unref(a)("baseForm.configuration.message")),1),n.createVNode(q,{"data-testid":"form-view-configuration-slideout-tabs",tabs:C.value},{json:n.withCtx(()=>[n.createVNode(jd,{config:e.config,"fetcher-url":h.value,"json-record":o.formFields,"request-method":o.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:n.withCtx(()=>[n.createVNode($f,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["is-visible","title"])]),_:3})}}}),Lf=dt(b1,[["__scopeId","data-v-4ef70725"]]),w1={key:0,"data-testid":"first-col"},v1=n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=n.computed(()=>{var m;return((m=t.rowEl)==null?void 0:m.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var m;return((m=r.value)==null?void 0:m.querySelector('[data-testid="first-col"]'))||null}),o=n.computed(()=>{var m,k;const g=(m=t.rowEl)==null?void 0:m.querySelectorAll("td");return g?((k=g[0])==null?void 0:k.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var m,k,g;d.value=((m=i.value)==null?void 0:m.getBoundingClientRect().width)||0,y.value=((k=r.value)==null?void 0:k.clientWidth)||0,p.value=((g=l.value)==null?void 0:g.innerText)||""},l=n.ref({}),d=n.ref(0),y=n.ref(0),p=n.ref(""),B=n.computed(()=>[i.value,r.value]),v=n.watch(B,m=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(k=>{window.requestAnimationFrame(()=>{!Array.isArray(k)||!k.length||c()})});for(const k of m)k&&s.observe(k)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>y.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{v()}),(m,k)=>{const g=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",w1,[n.createVNode(g,{label:h.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(m.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):n.renderSlot(m.$slots,"default",{key:1},void 0,!0)],512)}}}),k1=dt(v1,[["__scopeId","data-v-e42a20c9"]]),C1={class:"toolbar-container"},S1={key:0,class:"toolbar-button-container"},x1=["data-testid"],A1=n.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,i=t,{i18n:{t:o}}=Te.useI18n(),s=n.computed(()=>{var O,$;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(O=r.errorMessage)==null?void 0:O.title,message:($=r.errorMessage)==null?void 0:$.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=O=>O.hasData||!!r.query,l=n.computed(()=>{const O=[];return Object.keys(r.tableHeaders).forEach($=>{const re=r.tableHeaders[$];O.push({label:re.label??$,key:$,sortable:re.sortable??!1})}),r.enableEntityActions&&O.push({key:"actions",hideLabel:!0}),O}),d=O=>({"data-rowid":O.id,"data-testid":O.name,...r.rowAttributes(O)}),y=n.ref({}),p=O=>{var $;return($=y.value)==null?void 0:$.$el.querySelector(`[data-rowid="${O.id}"]`)},B=O=>{const $={"data-testid":O.headerKey,...r.cellAttributes(O)};return O.colIndex===0&&($.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),$},v=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},m=n.computed(()=>r.disableRowClick?void 0:(O,$)=>{i("click:row",$)}),k=O=>{i("sort",O)},{setTablePreferences:g,getTablePreferences:x}=wy(),C=n.computed(()=>{const O=x(r.preferencesStorageKey);return{...r.initialFetcherParams,...O}}),w=O=>{r.preferencesStorageKey&&g(r.preferencesStorageKey,O)};return(O,$)=>{const re=n.resolveComponent("KIcon"),E=n.resolveComponent("KButton"),N=n.resolveComponent("KDropdown"),q=n.resolveComponent("KTable"),P=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(P,{class:"kong-ui-entity-base-table",title:e.title},{default:n.withCtx(()=>[n.createVNode(q,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":B,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":C.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:v,"onRow:click":m.value,onSort:$[0]||($[0]=J=>k(J)),"onUpdate:tablePreferences":w},n.createSlots({toolbar:n.withCtx(({state:J})=>[n.withDirectives(n.createElementVNode("div",C1,[n.renderSlot(O.$slots,"toolbar-filter",{},void 0,!0),O.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",S1,[n.renderSlot(O.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,c(J)]])]),actions:n.withCtx(({row:J,rowKey:H,rowValue:R})=>[n.createElementVNode("div",{class:"actions-container","data-testid":J.name},[n.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(O.$slots,"actions",{row:J,rowKey:H,rowValue:R},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(E,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(re,{color:n.unref(fm),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,x1)]),_:2},[n.renderList(e.tableHeaders,(J,H)=>({name:H,fn:n.withCtx(({row:R,rowKey:se,rowValue:fe})=>[n.createVNode(k1,{"key-name":String(H),"row-el":p(R)},{default:n.withCtx(()=>[n.renderSlot(O.$slots,H,{row:R,rowKey:se,rowValue:fe},()=>[n.createTextVNode(n.toDisplayString(fe),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Hf=dt(A1,[["__scopeId","data-v-57b5a97b"]]),B1={key:0,class:"kong-ui-entity-delete-error"},I1={key:1,class:"description"},E1=n.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:t}){const{i18nT:r}=Te.useI18n(),i=e,o=t,s=n.computed(()=>i.needConfirm?i.entityName:""),a=()=>{o("cancel")},c=()=>{o("proceed")};return(l,d)=>{const y=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":s.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:a,onProceed:c},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",B1,[n.createVNode(y,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(n.openBlock(),n.createElementBlock("div",I1,[n.renderSlot(l.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Ff=dt(E1,[["__scopeId","data-v-1c9a2a07"]]),N1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},O1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},_1=["fill"],T1={mask:"url(#mask0_180_20349)"},V1=["fill"],qf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${um})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",N1,[n.createElementVNode("mask",O1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,_1)]),n.createElementVNode("g",T1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,V1)])]))}}),j1={key:1,class:"kong-ui-entity-filter"},D1={class:"menu-item-title"},M1={class:"menu-item-indicator"},P1={class:"menu-item-body"},$1=["for"],R1={class:"menu-item-buttons"},U1={class:"filter-clear-button-container"},L1=n.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{i18n:{t:r}}=Te.useI18n(),i=e,o=t,s=n.ref(!1),a=n.ref({}),c=n.computed(()=>{const g=[];return new URLSearchParams(i.modelValue).forEach((x,C)=>{x!==""&&g.push(C)}),g}),l=n.computed(()=>{const g=i.config.fields;return Object.keys(g).filter(x=>g[x].searchable).map(x=>({label:g[x].label||x,value:x}))});n.watch(()=>i.modelValue,g=>{a.value={},new URLSearchParams(g).forEach((x,C)=>{a.value[C]=x})});const d=()=>{s.value=!s.value},y=g=>{o("update:modelValue",g)},p=g=>`filter-${g}`,B=g=>{var x,C;return(((C=(x=i.config.schema)==null?void 0:x[g])==null?void 0:C.values)??[]).map(w=>({value:w,label:w}))},v=g=>{var x,C;return((C=(x=i.config.schema)==null?void 0:x[g])==null?void 0:C.type)??"text"},h=g=>{a.value={...a.value,[g]:""},k()},m=()=>{a.value={},k(!0)},k=(g=!1)=>{const x=Object.keys(a.value).reduce((C,w)=>(a.value[w]&&(C[w]=`${a.value[w]}`),C),{});g&&(s.value=!1),o("update:modelValue",new URLSearchParams(x).toString())};return(g,x)=>{const C=n.resolveComponent("KInput"),w=n.resolveComponent("KButton"),O=n.resolveComponent("KSelect"),$=n.resolveComponent("KMenuItem"),re=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(C,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":y},{before:n.withCtx(()=>[n.createVNode(qf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",j1,[n.createVNode(w,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:n.withCtx(()=>[n.createVNode(qf),n.createTextVNode(" "+n.toDisplayString(n.unref(r)("filter.filterButtonText"))+" "+n.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:d},null,512),[[n.vShow,s.value]]),n.withDirectives(n.createVNode(re,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(E,N)=>(n.openBlock(),n.createBlock($,{key:E.value,"data-testid":E.value,expandable:"","last-menu-item":N===l.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",D1,[n.createTextVNode(n.toDisplayString(E.label)+" ",1),n.withDirectives(n.createElementVNode("span",M1,null,512),[[n.vShow,c.value.includes(E.value)]])])]),itemBody:n.withCtx(()=>{var q,P;return[n.createElementVNode("div",P1,[n.createElementVNode("label",{class:"menu-item-label",for:p(E.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,$1),((P=(q=e.config.schema)==null?void 0:q[E.value])==null?void 0:P.type)==="select"?(n.openBlock(),n.createBlock(O,{key:0,id:p(E.value),modelValue:a.value[E.value],"onUpdate:modelValue":J=>a.value[E.value]=J,appearance:"select",items:B(E.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(C,{key:1,id:p(E.value),modelValue:a.value[E.value],"onUpdate:modelValue":J=>a.value[E.value]=J,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:v(E.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",R1,[n.createVNode(w,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:x[0]||(x[0]=J=>k(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(w,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:J=>h(E.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createElementVNode("div",U1,[n.createVNode(w,{appearance:"tertiary",size:"small",onClick:m},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[n.vShow,s.value]])]))}}}),Kf=dt(L1,[["__scopeId","data-v-15962ee2"]]),Dt=n.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=n.ref(void 0),i=n.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return n.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>i.value?n.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):n.createCommentVNode("",!0)}}),H1={class:"form-section-wrapper"},F1={key:0,class:"form-section-title"},q1={key:1,class:"form-section-description"},K1={key:2,class:"form-section-footer"},z1={class:"form-section-content"},G1=n.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const t=n.useSlots();return(r,i)=>(n.openBlock(),n.createElementBlock("fieldset",{class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[n.createElementVNode("div",H1,[e.hideInfoHeader?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(n.openBlock(),n.createElementBlock("h4",F1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",q1,[n.renderSlot(r.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",K1,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",z1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),po=dt(G1,[["__scopeId","data-v-3565daa7"]]),{useAxios:ho,useDeleteUrlBuilder:zf,useErrors:Gf,useExternalLinkCreator:Db,useFetchUrlBuilder:Mb,useFetcher:Wf,useDebouncedFilter:Pb,useStringHelpers:Jf,useHelpers:Yf,useGatewayFeatureSupported:$b,useTruncationDetector:Rb}=Te,W1={class:"kong-ui-entities-certificates-list"},J1={key:0},Y1={key:1},Z1={key:0},Q1={key:1},X1={key:0},eb={key:1},tb={key:1},rb={key:1},ib=n.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var me;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=ho({headers:(me=i.config)==null?void 0:me.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),B={subject:{label:o("certificates.list.table_headers.subject")},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},v=n.computed(()=>{var ae,ge;let V=`${i.config.apiBaseUrl}${Bi.list[i.config.app]}`;return i.config.app==="konnect"?V=V.replace(/{controlPlaneId}/gi,((ae=i.config)==null?void 0:ae.controlPlaneId)||""):i.config.app==="kongManager"&&(V=V.replace(/\/{workspace}/gi,(ge=i.config)!=null&&ge.workspace?`/${i.config.workspace}`:"")),V}),h=n.ref(""),m=n.computed(()=>{const V=i.config.app==="konnect"||i.config.isExactMatch;return V?{isExactMatch:V,placeholder:o("certificates.search.placeholder")}:{isExactMatch:V,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:g}=Wf(i.config,v.value),x=()=>{h.value=""},C=()=>{d.value++},w=n.ref(null),O=(V,ae)=>{const ge=V.id;if(!ae(ge)){r("copy:error",{entity:V,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:V,field:"id",message:o("certificates.copy.success",{val:ge})})},$=(V,ae)=>{const ge=JSON.stringify(V);if(!ae(ge)){r("copy:error",{entity:V,message:o("certificates.errors.copy")});return}r("copy:success",{entity:V,message:o("certificates.copy.success_brief")})},re=(V,ae)=>{V.type==="error"?r("copy:error",{entity:ae,field:"cert",message:o("certificates.errors.copy")}):r("copy:success",{entity:ae,field:"cert",message:o("certificates.copy.success_brief")})},E=async V=>{var ge;await((ge=i.canRetrieve)==null?void 0:ge.call(i,V))&&c.push(i.config.getViewRoute(V.id))},N=V=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(V)}),q=V=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(V)}),P=V=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(V)}},J=n.ref(void 0),H=n.ref(!1),R=n.ref(!1),se=n.ref(""),fe=zf(i.config,v.value),{certificateDataCache:ke,getCertificateData:he}=kt.useCertificate(),ye=V=>{J.value=V,H.value=!0},Be=()=>{H.value=!1},zt=async()=>{var V,ae,ge;if((V=J.value)!=null&&V.id){R.value=!0;try{await l.delete(fe(J.value.id)),R.value=!1,H.value=!1,d.value++,r("delete:success",J.value)}catch(Pe){se.value=((ge=(ae=Pe.response)==null?void 0:ae.data)==null?void 0:ge.message)||Pe.message||o("certificates.errors.delete"),r("error",Pe)}finally{R.value=!1}}},X=n.ref(!0);n.watch(g,V=>{var ae,ge,Pe,Mt;if(Array.isArray((ae=V==null?void 0:V.response)==null?void 0:ae.data)&&(X.value=V.response.data.length>0),V.status===Ft.Error){w.value={title:o("certificates.errors.general")},(Mt=(Pe=(ge=V.error)==null?void 0:ge.response)==null?void 0:Pe.data)!=null&&Mt.message&&(w.value.message=V.error.response.data.message),r("error",V.error);return}ke.value={},w.value=null});const ee=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("certificates.list.empty_state.description"),title:o("certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(ee.value.title=o("certificates.list.empty_state.title"),ee.value.ctaText=o("certificates.actions.create"))}),(V,ae)=>{const ge=n.resolveComponent("KButton"),Pe=n.resolveComponent("KBadge"),Mt=n.resolveComponent("KTruncate"),te=n.resolveComponent("KDropdownItem"),Oe=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",W1,[n.createVNode(n.unref(Hf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ee.value,"enable-entity-actions":"","error-message":w.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(B),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":ae[2]||(ae[2]=Y=>E(Y)),onSort:C},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Kf),{modelValue:h.value,"onUpdate:modelValue":ae[0]||(ae[0]=Y=>h.value=Y),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:n.withCtx(()=>[n.createVNode(n.unref(Dt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(ge,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,X.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:n.withCtx(({row:Y})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",J1,n.toDisplayString((Ce=Y==null?void 0:Y.metadata)!=null&&Ce.subject?Y.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",Y1,n.toDisplayString(n.unref(he)(Y).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:Y})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",Z1,n.toDisplayString((Ce=Y==null?void 0:Y.metadata)!=null&&Ce.expiry?n.unref(s)(Y.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",Q1,n.toDisplayString(n.unref(he)(Y).schemaExpiry?n.unref(s)(n.unref(he)(Y).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:Y})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",X1,n.toDisplayString((Ce=Y==null?void 0:Y.metadata)!=null&&Ce.dns_names?`dns=${Y.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",eb,n.toDisplayString(n.unref(he)(Y).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:Y})=>[Y!=null&&Y.cert?(n.openBlock(),n.createBlock(n.unref(my),{key:0,"data-testid":"copy-certificate-cert",notify:Ce=>re(Ce,Y),truncated:!0,uuid:Y.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",tb,"-"))]),tags:n.withCtx(({row:Y})=>{var Ce;return[((Ce=Y==null?void 0:Y.tags)==null?void 0:Ce.length)>0?(n.openBlock(),n.createBlock(Mt,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Y==null?void 0:Y.tags,zr=>(n.openBlock(),n.createBlock(Pe,{key:zr,onClick:ae[1]||(ae[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(zr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",rb,"-"))]}),actions:n.withCtx(({row:Y})=>[n.createVNode(Oe,null,{default:n.withCtx(({copyToClipboard:Ce})=>[n.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:zr=>O(Y,Ce)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Oe,null,{default:n.withCtx(({copyToClipboard:Ce})=>[n.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:zr=>$(Y,Ce)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canRetrieve(Y)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:N(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canEdit(Y)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-edit",item:q(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Dt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-add-sni",item:P(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canDelete(Y)},{default:n.withCtx(()=>[n.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>ye(Y)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Ff),{"action-pending":R.value,"entity-type":n.unref(Oa).Certificate,error:se.value,title:n.unref(o)("certificates.delete.title"),visible:H.value,onCancel:Be,onProceed:zt},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Kr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},nb=Kr(ib,[["__scopeId","data-v-fa23e672"]]),ob={class:"kong-ui-entities-certificates-form"},sb=Kr(n.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var C;const r=t,i=e,o=Gr.useRouter(),{i18nT:s,i18n:{t:a}}=kt.useI18n(),{getMessageFromError:c}=Gf(),{axiosInstance:l}=ho({headers:(C=i.config)==null?void 0:C.requestHeaders}),d=n.computed(()=>Bi.form[i.config.app].edit),y=n.computed(()=>i.certificateId?dr.Edit:dr.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),B=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),v=n.computed(()=>(y.value===dr.Create||JSON.stringify(p.fields)!==JSON.stringify(B))&&!!p.fields.cert&&!!p.fields.key),h=w=>{var O;p.fields.cert=(w==null?void 0:w.cert)||"",p.fields.key=(w==null?void 0:w.key)||"",p.fields.certAlt=(w==null?void 0:w.cert_alt)||"",p.fields.keyAlt=(w==null?void 0:w.key_alt)||"",p.fields.tags=((O=w==null?void 0:w.tags)==null?void 0:O.join(", "))||"",Object.assign(B,p.fields)},m=()=>{o.push(i.config.cancelRoute)},k=n.computed(()=>{var O,$;let w=`${i.config.apiBaseUrl}${Bi.form[i.config.app].validate}`;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,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),w=w.replace(/{id}/gi,i.certificateId),w}),g=n.computed(()=>{var O,$;let w=`${i.config.apiBaseUrl}${Bi.form[i.config.app][y.value]}`;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,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),w=w.replace(/{id}/gi,i.certificateId),w}),x=async()=>{var w,O,$,re,E,N,q,P,J;try{p.isReadonly=!0;const H={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(O=(w=p.fields.tags.split(","))==null?void 0:w.map(se=>String(se||"").trim()))==null?void 0:O.filter(se=>se!=="")};let R;await l.post(k.value,H),y.value==="create"?R=await l.post(g.value,H):y.value==="edit"&&(R=(($=i.config)==null?void 0:$.app)==="konnect"?await l.put(g.value,H):await l.patch(g.value,H)),p.fields.cert=((re=R==null?void 0:R.data)==null?void 0:re.cert)||"",p.fields.key=((E=R==null?void 0:R.data)==null?void 0:E.key)||"",p.fields.certAlt=((N=R==null?void 0:R.data)==null?void 0:N.cert_alt)||"",p.fields.keyAlt=((q=R==null?void 0:R.data)==null?void 0:q.key_alt)||"",p.fields.tags=((J=(P=R==null?void 0:R.data)==null?void 0:P.tags)==null?void 0:J.join(", "))||"",Object.assign(B,p.fields),r("update",R==null?void 0:R.data)}catch(H){p.errorMessage=c(H),r("error",H)}finally{p.isReadonly=!1}};return(w,O)=>{const $=n.resolveComponent("KTextArea"),re=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",ob,[n.createVNode(n.unref(Lf),{"can-submit":v.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":p.fields,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":O[5]||(O[5]=E=>w.$emit("error",E)),"onFetch:success":h,onLoading:O[6]||(O[6]=E=>w.$emit("loading",E)),onSubmit:x},{default:n.withCtx(()=>[n.createVNode(n.unref(po),{description:n.unref(a)("certificates.form.sections.ssl.description"),title:n.unref(a)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode($,{modelValue:p.fields.cert,"onUpdate:modelValue":O[0]||(O[0]=E=>p.fields.cert=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:n.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode($,{modelValue:p.fields.key,"onUpdate:modelValue":O[1]||(O[1]=E=>p.fields.key=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:n.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode($,{modelValue:p.fields.certAlt,"onUpdate:modelValue":O[2]||(O[2]=E=>p.fields.certAlt=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:n.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode($,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":O[3]||(O[3]=E=>p.fields.keyAlt=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:n.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(po),{description:n.unref(a)("certificates.form.sections.general.description"),title:n.unref(a)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(re,{modelValue:p.fields.tags,"onUpdate:modelValue":O[4]||(O[4]=E=>p.fields.tags=E),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(a)("certificates.form.fields.tags.help"),label:n.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-bc34f24e"]]),Vi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/ca_certificates",kongManager:"/{workspace}/ca_certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/ca_certificates",edit:"/api/runtime_groups/{controlPlaneId}/ca_certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/ca-certificate/validate"},kongManager:{create:"/{workspace}/ca_certificates",edit:"/{workspace}/ca_certificates/{id}",validate:"/{workspace}/schemas/ca_certificates/validate"}}},ab={class:"kong-ui-ca-certificate-entity-config-card"},cb={key:0},lb=Kr(n.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],i=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=kt.useI18n(),{convertKeyToTitle:c}=Jf(),{getPropValue:l}=Yf(),{getCertificateData:d}=kt.useCertificate(),y=n.computed(()=>Vi.form[o.config.app].edit),p=n.ref(),B=n.computed(()=>{if(p.value)return d(p.value)}),v=n.computed(()=>{var C;return((C=B.value)==null?void 0:C.schemaIssuer)||""}),h=n.computed(()=>{var C,w;return(C=B.value)!=null&&C.schemaExpiry?a((w=B.value)==null?void 0:w.schemaExpiry):""}),m=n.computed(()=>{var C;return((C=B.value)==null?void 0:C.schemaKeyUsages)||[]}),k=(C,w)=>{const O=l("rowValue",w);if(C==="expiry")return h.value;if(C==="key_usages")return m.value;if(O)return O[C]},g=C=>{p.value=C,i("fetch:success",C)},x=n.ref({id:{},updated_at:{},created_at:{},cert:{section:pe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:pe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:pe.Basic,type:le.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:pe.Basic,order:1.7,forceShow:!0},issuer:{section:pe.Basic,order:1.5,forceShow:!0},key_usages:{section:pe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(C,w)=>{const O=n.resolveComponent("KCodeBlock"),$=n.resolveComponent("KLabel"),re=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",ab,[n.createVNode(n.unref(Uf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":x.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":w[0]||(w[0]=E=>C.$emit("copy:success",E)),"onFetch:error":w[1]||(w[1]=E=>C.$emit("fetch:error",E)),"onFetch:success":g,onLoading:w[2]||(w[2]=E=>C.$emit("loading",E))},{cert:n.withCtx(E=>[n.unref(l)("rowValue",E)?(n.openBlock(),n.createBlock(O,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",E),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode($,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(E=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",E)).filter(N=>!r.includes(N)),N=>(n.openBlock(),n.createBlock(n.unref(Ii),{key:N,"data-testid":`ca-cert-metadata-${N}`,item:{key:N,label:n.unref(c)(N),value:k(N,E),type:N==="key_usages"?n.unref(le).BadgeTag:n.unref(le).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),key_usages:n.withCtx(()=>[m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",cb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(E,N)=>(n.openBlock(),n.createBlock(re,{key:`key_usages-badge-tag-${N}`,class:"config-badge","data-testid":`key_usages-badge-tag-${N}`,tooltip:E,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(E),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),ub={class:"kong-ui-entities-ca-certificates-list"},db={key:0},fb={key:1},pb={key:0},hb={key:1},yb={key:1},mb=Kr(n.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var X;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=ho({headers:(X=i.config)==null?void 0:X.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),B={issuer:{label:o("ca-certificates.list.table_headers.issuer")},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},v=n.computed(()=>{var me,V;let ee=`${i.config.apiBaseUrl}${Vi.list[i.config.app]}`;return i.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((me=i.config)==null?void 0:me.controlPlaneId)||""):i.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(V=i.config)!=null&&V.workspace?`/${i.config.workspace}`:"")),ee}),h=n.ref(""),m=n.computed(()=>{const ee=i.config.app==="konnect"||i.config.isExactMatch;return ee?{isExactMatch:ee,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:ee,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:g}=Wf(i.config,v.value),x=()=>{h.value=""},C=()=>{d.value++},w=n.ref(null),O=(ee,me)=>{const V=ee.id;if(!me(V)){r("copy:error",{entity:ee,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,field:"id",message:o("ca-certificates.copy.success",{val:V})})},$=(ee,me)=>{const V=JSON.stringify(ee);if(!me(V)){r("copy:error",{entity:ee,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:o("ca-certificates.copy.success_brief")})},re=async ee=>{var V;await((V=i.canRetrieve)==null?void 0:V.call(i,ee))&&c.push(i.config.getViewRoute(ee.id))},E=ee=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),N=ee=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),q=n.ref(void 0),P=n.ref(!1),J=n.ref(!1),H=n.ref(""),R=zf(i.config,v.value),{certificateDataCache:se,getCertificateData:fe}=kt.useCertificate(),ke=ee=>{q.value=ee,P.value=!0},he=()=>{P.value=!1},ye=async()=>{var ee,me,V;if((ee=q.value)!=null&&ee.id){J.value=!0;try{await l.delete(R(q.value.id)),J.value=!1,P.value=!1,d.value++,r("delete:success",q.value)}catch(ae){H.value=((V=(me=ae.response)==null?void 0:me.data)==null?void 0:V.message)||ae.message||o("ca-certificates.errors.delete"),r("error",ae)}finally{J.value=!1}}},Be=n.ref(!0);n.watch(g,ee=>{var me,V,ae,ge;if(Array.isArray((me=ee==null?void 0:ee.response)==null?void 0:me.data)&&(Be.value=ee.response.data.length>0),ee.status===Ft.Error){w.value={title:o("ca-certificates.errors.general")},(ge=(ae=(V=ee.error)==null?void 0:V.response)==null?void 0:ae.data)!=null&&ge.message&&(w.value.message=ee.error.response.data.message),r("error",ee.error);return}se.value={},w.value=null});const zt=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("ca-certificates.list.empty_state.description"),title:o("ca-certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(zt.value.title=o("ca-certificates.list.empty_state.title"),zt.value.ctaText=o("ca-certificates.actions.create"))}),(ee,me)=>{const V=n.resolveComponent("KButton"),ae=n.resolveComponent("KBadge"),ge=n.resolveComponent("KTruncate"),Pe=n.resolveComponent("KDropdownItem"),Mt=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",ub,[n.createVNode(n.unref(Hf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":zt.value,"enable-entity-actions":"","error-message":w.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(B),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":me[2]||(me[2]=te=>re(te)),onSort:C},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Kf),{modelValue:h.value,"onUpdate:modelValue":me[0]||(me[0]=te=>h.value=te),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:n.withCtx(()=>[n.createVNode(n.unref(Dt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(V,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,Be.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:n.withCtx(({row:te})=>{var Oe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",db,n.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.issuer?te.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",fb,n.toDisplayString(n.unref(fe)(te).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:te})=>{var Oe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",pb,n.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.expiry?n.unref(s)(te.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",hb,n.toDisplayString(n.unref(fe)(te).schemaExpiry?n.unref(s)(n.unref(fe)(te).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:te})=>{var Oe;return[((Oe=te==null?void 0:te.tags)==null?void 0:Oe.length)>0?(n.openBlock(),n.createBlock(ge,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(te==null?void 0:te.tags,Y=>(n.openBlock(),n.createBlock(ae,{key:Y,onClick:me[1]||(me[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",yb,"-"))]}),actions:n.withCtx(({row:te})=>[n.createVNode(Mt,null,{default:n.withCtx(({copyToClipboard:Oe})=>[n.createVNode(Pe,{"data-testid":"action-entity-copy-id",onClick:Y=>O(te,Oe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Mt,null,{default:n.withCtx(({copyToClipboard:Oe})=>[n.createVNode(Pe,{"data-testid":"action-entity-copy-json",onClick:Y=>$(te,Oe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canRetrieve(te)},{default:n.withCtx(()=>[n.createVNode(Pe,{"data-testid":"action-entity-view","has-divider":"",item:E(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canEdit(te)},{default:n.withCtx(()=>[n.createVNode(Pe,{"data-testid":"action-entity-edit",item:N(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canDelete(te)},{default:n.withCtx(()=>[n.createVNode(Pe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Oe=>ke(te)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Ff),{"action-pending":J.value,"entity-type":n.unref(Oa).CACertificate,error:H.value,title:n.unref(o)("ca-certificates.delete.title"),visible:P.value,onCancel:he,onProceed:ye},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f25a63b4"]]),gb={class:"kong-ui-entities-ca-certificates-form"},bb=Kr(n.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var x;const r=t,i=e,o=Gr.useRouter(),{i18n:{t:s}}=kt.useI18n(),{getMessageFromError:a}=Gf(),{axiosInstance:c}=ho({headers:(x=i.config)==null?void 0:x.requestHeaders}),l=n.computed(()=>Vi.form[i.config.app].edit),d=n.computed(()=>i.certificateId?dr.Edit:dr.Create),y=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),B=n.computed(()=>(d.value===dr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),v=C=>{var w;y.fields.cert=(C==null?void 0:C.cert)||"",y.fields.certDigest=(C==null?void 0:C.cert_digest)||"",y.fields.tags=((w=C==null?void 0:C.tags)==null?void 0:w.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},m=n.computed(()=>{var w,O;let C=`${i.config.apiBaseUrl}${Vi.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),k=n.computed(()=>{var w,O;let C=`${i.config.apiBaseUrl}${Vi.form[i.config.app][d.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),g=async()=>{var C,w,O,$,re,E,N;try{y.isReadonly=!0;const q={cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(w=(C=y.fields.tags.split(","))==null?void 0:C.map(J=>String(J||"").trim()))==null?void 0:w.filter(J=>J!=="")};let P;await c.post(m.value,q),d.value==="create"?P=await c.post(k.value,q):d.value==="edit"&&(P=((O=i.config)==null?void 0:O.app)==="konnect"?await c.put(k.value,q):await c.patch(k.value,q)),y.fields.cert=(($=P==null?void 0:P.data)==null?void 0:$.cert)||"",y.fields.certDigest=((re=P==null?void 0:P.data)==null?void 0:re.cert_digest)||"",y.fields.tags=((N=(E=P==null?void 0:P.data)==null?void 0:E.tags)==null?void 0:N.join(", "))||"",Object.assign(p,y.fields),r("update",P==null?void 0:P.data)}catch(q){y.errorMessage=a(q),r("error",q)}finally{y.isReadonly=!1}};return(C,w)=>{const O=n.resolveComponent("KTextArea"),$=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",gb,[n.createVNode(n.unref(Lf),{"can-submit":B.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"form-fields":y.fields,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":w[3]||(w[3]=re=>C.$emit("error",re)),"onFetch:success":v,onLoading:w[4]||(w[4]=re=>C.$emit("loading",re)),onSubmit:g},{default:n.withCtx(()=>[n.createVNode(n.unref(po),{description:n.unref(s)("ca-certificates.form.sections.cert.description"),title:n.unref(s)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:y.fields.cert,"onUpdate:modelValue":w[0]||(w[0]=re=>y.fields.cert=re),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:n.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode($,{modelValue:y.fields.certDigest,"onUpdate:modelValue":w[1]||(w[1]=re=>y.fields.certDigest=re),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(po),{description:n.unref(s)("ca-certificates.form.sections.general.description"),title:n.unref(s)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode($,{modelValue:y.fields.tags,"onUpdate:modelValue":w[2]||(w[2]=re=>y.fields.tags=re),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(s)("ca-certificates.form.fields.tags.help"),label:n.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("ca-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","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-7f7e829d"]]),wb={class:"kong-ui-certificate-entity-config-card"},vb={key:0},kb=Kr(n.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),{convertKeyToTitle:c}=Jf(),{getPropValue:l}=Yf(),{getCertificateData:d}=kt.useCertificate(),y=n.computed(()=>Bi.form[i.config.app].edit),p=n.ref(),B=n.ref({id:{},cert:{section:pe.Basic},key:{section:pe.Basic,type:le.Redacted},metadata:{section:pe.Basic,type:le.Json},snis:{section:pe.Basic,type:le.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:pe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:pe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:pe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:pe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:pe.Advanced},key_alt:{section:pe.Advanced,type:le.Redacted}}),v=E=>{p.value=E,r("fetch:success",E)},h=(E,N)=>{const q=l("rowValue",N);if(E==="expiry")return k.value;if(E==="key_usages")return w.value;if(E==="san_names")return x.value;if(q)return q[E]},m=n.computed(()=>{if(p.value)return d(p.value)}),k=n.computed(()=>{var E,N;return(E=m.value)!=null&&E.schemaExpiry?s((N=m.value)==null?void 0:N.schemaExpiry):""}),g=n.computed(()=>{var E;return((E=m.value)==null?void 0:E.schemaIssuer)||""}),x=n.computed(()=>{var E;return((E=m.value)==null?void 0:E.schemaSanNames)||""}),C=n.computed(()=>{var E;return((E=m.value)==null?void 0:E.schemaSubject)||""}),w=n.computed(()=>{var E;return((E=m.value)==null?void 0:E.schemaKeyUsages)||[]}),O=n.computed(()=>{var E,N;return((N=(E=p==null?void 0:p.value)==null?void 0:E.snis)==null?void 0:N.length)>0}),$=n.computed(()=>{var E;return!!((E=p==null?void 0:p.value)!=null&&E.cert_alt)}),re=E=>{var N,q;return E==="san_names"?o("certificates.list.table_headers.san"):((q=(N=B.value)==null?void 0:N[E])==null?void 0:q.label)||c(E)};return(E,N)=>{const q=n.resolveComponent("KCodeBlock"),P=n.resolveComponent("KLabel"),J=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",wb,[n.createVNode(n.unref(Uf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":N[0]||(N[0]=H=>E.$emit("copy:success",H)),"onFetch:error":N[1]||(N[1]=H=>E.$emit("fetch:error",H)),"onFetch:success":v,onLoading:N[2]||(N[2]=H=>E.$emit("loading",H))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(H=>[n.unref(l)("rowValue",H)?(n.openBlock(),n.createBlock(q,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",H),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(P,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(H=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",H)),R=>(n.openBlock(),n.createBlock(n.unref(Ii),{key:R,item:{key:R,value:h(R,H),label:re(R),type:R==="key_usages"||R==="snis"||R==="dns_names"?n.unref(le).BadgeTag:n.unref(le).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[w.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",vb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value,(H,R)=>(n.openBlock(),n.createBlock(J,{key:`key_usages-badge-tag-${R}`,class:"config-badge","data-testid":`key_usages-badge-tag-${R}`,tooltip:H,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(H),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[O.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},$.value?{name:"cert_alt",fn:n.withCtx(H=>[n.createTextVNode(" > "),n.unref(l)("rowValue",H)?(n.openBlock(),n.createBlock(q,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(l)("rowValue",H),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-920043bf"]]);$e.CACertificateConfigCard=lb,$e.CACertificateForm=bb,$e.CACertificateList=mb,$e.CertificateConfigCard=kb,$e.CertificateForm=sb,$e.CertificateList=nb,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});