@kong-ui-public/entities-certificates 2.3.19 → 2.3.20

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.
@@ -1,4 +1,4 @@
1
- (function($e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],i):($e=typeof globalThis<"u"?globalThis:$e||self,i($e["kong-ui-public-entities-certificates"]={},$e.Vue,$e.VueRouter,$e["kong-ui-public-i18n"],$e.axios,$e.Kongponents))})(this,function($e,i,Gr,pr,Za,sp){"use strict";var yo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
1
+ (function($e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],n):($e=typeof globalThis<"u"?globalThis:$e||self,n($e["kong-ui-public-entities-certificates"]={},$e.Vue,$e.VueRouter,$e["kong-ui-public-i18n"],$e.axios,$e.Kongponents))})(this,function($e,n,Gr,pr,Za,sp){"use strict";var yo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
2
2
  Copyright (C) Microsoft. All rights reserved.
3
3
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
4
  this file except in compliance with the License. You may obtain a copy of the
@@ -11,7 +11,7 @@
11
11
 
12
12
  See the Apache Version 2.0 License for specific language governing permissions
13
13
  and limitations under the License.
14
- ***************************************************************************** */var Qa;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof yo=="object"?yo:typeof self=="object"?self:typeof this=="object"?this:c(),n=o(e);typeof r.Reflect<"u"&&(n=o(r.Reflect,n)),t(n,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 n=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(k,x){return n.call(k,x)}:function(k,x){return x in k},get:d?function(k,x){return n.call(k,x)?k[x]:void 0}:function(k,x){return k[x]}},p=Object.getPrototypeOf(Function),E=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ib(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Eb(),h=typeof WeakMap=="function"?WeakMap:Nb(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,v=xb(),m=Ab(v);function C(k,x,N,D){if(X(N)){if(!Oe(k))throw new TypeError;if(!Ce(x))throw new TypeError;return M(k,x)}else{if(!Oe(k))throw new TypeError;if(!j(x))throw new TypeError;if(!j(D)&&!X(D)&&!ee(D))throw new TypeError;return ee(D)&&(D=void 0),N=te(N),J(k,x,N,D)}}t("decorate",C);function A(k,x){function N(D,Z){if(!j(D))throw new TypeError;if(!X(Z)&&!zr(Z))throw new TypeError;he(k,x,D,Z)}return N}t("metadata",A);function S(k,x,N,D){if(!j(N))throw new TypeError;return X(D)||(D=te(D)),he(k,x,N,D)}t("defineMetadata",S);function I(k,x,N){if(!j(x))throw new TypeError;return X(N)||(N=te(N)),re(k,x,N)}t("hasMetadata",I);function T(k,x,N){if(!j(x))throw new TypeError;return X(N)||(N=te(N)),de(k,x,N)}t("hasOwnMetadata",T);function Q(k,x,N){if(!j(x))throw new TypeError;return X(N)||(N=te(N)),fe(k,x,N)}t("getMetadata",Q);function O(k,x,N){if(!j(x))throw new TypeError;return X(N)||(N=te(N)),ke(k,x,N)}t("getOwnMetadata",O);function B(k,x){if(!j(k))throw new TypeError;return X(x)||(x=te(x)),ye(k,x)}t("getMetadataKeys",B);function Y(k,x){if(!j(k))throw new TypeError;return X(x)||(x=te(x)),Be(k,x)}t("getOwnMetadataKeys",Y);function W(k,x,N){if(!j(x))throw new TypeError;if(X(N)||(N=te(N)),!j(x))throw new TypeError;X(N)||(N=te(N));var D=ji(x,N,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(k,x,N)}t("deleteMetadata",W);function M(k,x){for(var N=k.length-1;N>=0;--N){var D=k[N],Z=D(x);if(!X(Z)&&!ee(Z)){if(!Ce(Z))throw new TypeError;x=Z}}return x}function J(k,x,N,D){for(var Z=k.length-1;Z>=0;--Z){var Se=k[Z],_e=Se(x,N,D);if(!X(_e)&&!ee(_e)){if(!j(_e))throw new TypeError;D=_e}}return D}function re(k,x,N){var D=de(k,x,N);if(D)return!0;var Z=Ja(x);return ee(Z)?!1:re(k,Z,N)}function de(k,x,N){var D=ji(x,N,!1);return X(D)?!1:Pe(D.OrdinaryHasOwnMetadata(k,x,N))}function fe(k,x,N){var D=de(k,x,N);if(D)return ke(k,x,N);var Z=Ja(x);if(!ee(Z))return fe(k,Z,N)}function ke(k,x,N){var D=ji(x,N,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(k,x,N)}function he(k,x,N,D){var Z=ji(N,D,!0);Z.OrdinaryDefineOwnMetadata(k,x,N,D)}function ye(k,x){var N=Be(k,x),D=Ja(k);if(D===null)return N;var Z=ye(D,x);if(Z.length<=0)return N;if(N.length<=0)return Z;for(var Se=new w,_e=[],ne=0,P=N;ne<P.length;ne++){var F=P[ne],L=Se.has(F);L||(Se.add(F),_e.push(F))}for(var K=0,oe=Z;K<oe.length;K++){var F=oe[K],L=Se.has(F);L||(Se.add(F),_e.push(F))}return _e}function Be(k,x){var N=ji(k,x,!1);return N?N.OrdinaryOwnMetadataKeys(k,x):[]}function zt(k){if(k===null)return 1;switch(typeof k){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return k===null?1:6;default:return 6}}function X(k){return k===void 0}function ee(k){return k===null}function ge(k){return typeof k=="symbol"}function j(k){return typeof k=="object"?k!==null:typeof k=="function"}function se(k,x){switch(zt(k)){case 0:return k;case 1:return k;case 2:return k;case 3:return k;case 4:return k;case 5:return k}var N=x===3?"string":x===5?"number":"default",D=Qf(k,s);if(D!==void 0){var Z=D.call(k,N);if(j(Z))throw new TypeError;return Z}return me(k,N==="default"?"number":N)}function me(k,x){if(x==="string"){var N=k.toString;if(z(N)){var D=N.call(k);if(!j(D))return D}var Z=k.valueOf;if(z(Z)){var D=Z.call(k);if(!j(D))return D}}else{var Z=k.valueOf;if(z(Z)){var D=Z.call(k);if(!j(D))return D}var Se=k.toString;if(z(Se)){var D=Se.call(k);if(!j(D))return D}}throw new TypeError}function Pe(k){return!!k}function Mt(k){return""+k}function te(k){var x=se(k,3);return ge(x)?x:Mt(x)}function Oe(k){return Array.isArray?Array.isArray(k):k instanceof Object?k instanceof Array:Object.prototype.toString.call(k)==="[object Array]"}function z(k){return typeof k=="function"}function Ce(k){return typeof k=="function"}function zr(k){switch(zt(k)){case 3:return!0;case 4:return!0;default:return!1}}function Wa(k,x){return k===x||k!==k&&x!==x}function Qf(k,x){var N=k[x];if(N!=null){if(!z(N))throw new TypeError;return N}}function Xf(k){var x=Qf(k,a);if(!z(x))throw new TypeError;var N=x.call(k);if(!j(N))throw new TypeError;return N}function ep(k){return k.value}function tp(k){var x=k.next();return x.done?!1:x}function rp(k){var x=k.return;x&&x.call(k)}function Ja(k){var x=Object.getPrototypeOf(k);if(typeof k!="function"||k===p||x!==p)return x;var N=k.prototype,D=N&&Object.getPrototypeOf(N);if(D==null||D===Object.prototype)return x;var Z=D.constructor;return typeof Z!="function"||Z===k?x:Z}function Sb(){var k;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(k=Bb(r.Reflect));var x,N,D,Z=new h,Se={registerProvider:_e,getProvider:P,setProvider:L};return Se;function _e(K){if(!Object.isExtensible(Se))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case k===K:break;case X(x):x=K;break;case x===K:break;case X(N):N=K;break;case N===K:break;default:D===void 0&&(D=new w),D.add(K);break}}function ne(K,oe){if(!X(x)){if(x.isProviderFor(K,oe))return x;if(!X(N)){if(N.isProviderFor(K,oe))return x;if(!X(D))for(var be=Xf(D);;){var xe=tp(be);if(!xe)return;var ft=ep(xe);if(ft.isProviderFor(K,oe))return rp(be),ft}}}if(!X(k)&&k.isProviderFor(K,oe))return k}function P(K,oe){var be=Z.get(K),xe;return X(be)||(xe=be.get(oe)),X(xe)&&(xe=ne(K,oe),X(xe)||(X(be)&&(be=new E,Z.set(K,be)),be.set(oe,xe))),xe}function F(K){if(X(K))throw new TypeError;return x===K||N===K||!X(D)&&D.has(K)}function L(K,oe,be){if(!F(be))throw new Error("Metadata provider not registered.");var xe=P(K,oe);if(xe!==be){if(!X(xe))return!1;var ft=Z.get(K);X(ft)&&(ft=new E,Z.set(K,ft)),ft.set(oe,be)}return!0}}function xb(){var k;return!X(g)&&j(r.Reflect)&&Object.isExtensible(r.Reflect)&&(k=r.Reflect[g]),X(k)&&(k=Sb()),!X(g)&&j(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:k}),k}function Ab(k){var x=new h,N={isProviderFor:function(F,L){var K=x.get(F);return X(K)?!1:K.has(L)},OrdinaryDefineOwnMetadata:_e,OrdinaryHasOwnMetadata:Z,OrdinaryGetOwnMetadata:Se,OrdinaryOwnMetadataKeys:ne,OrdinaryDeleteMetadata:P};return v.registerProvider(N),N;function D(F,L,K){var oe=x.get(F),be=!1;if(X(oe)){if(!K)return;oe=new E,x.set(F,oe),be=!0}var xe=oe.get(L);if(X(xe)){if(!K)return;if(xe=new E,oe.set(L,xe),!k.setProvider(F,L,N))throw oe.delete(L),be&&x.delete(F),new Error("Wrong provider for target.")}return xe}function Z(F,L,K){var oe=D(L,K,!1);return X(oe)?!1:Pe(oe.has(F))}function Se(F,L,K){var oe=D(L,K,!1);if(!X(oe))return oe.get(F)}function _e(F,L,K,oe){var be=D(K,oe,!0);be.set(F,L)}function ne(F,L){var K=[],oe=D(F,L,!1);if(X(oe))return K;for(var be=oe.keys(),xe=Xf(be),ft=0;;){var ip=tp(xe);if(!ip)return K.length=ft,K;var Ob=ep(ip);try{K[ft]=Ob}catch(_b){try{rp(xe)}finally{throw _b}}ft++}}function P(F,L,K){var oe=D(L,K,!1);if(X(oe)||!oe.delete(F))return!1;if(oe.size===0){var be=x.get(L);X(be)||(be.delete(K),be.size===0&&x.delete(be))}return!0}}function Bb(k){var x=k.defineMetadata,N=k.hasOwnMetadata,D=k.getOwnMetadata,Z=k.getOwnMetadataKeys,Se=k.deleteMetadata,_e=new h,ne={isProviderFor:function(P,F){var L=_e.get(P);return X(L)?Z(P,F).length?(X(L)&&(L=new w,_e.set(P,L)),L.add(F),!0):!1:L.has(F)},OrdinaryDefineOwnMetadata:x,OrdinaryHasOwnMetadata:N,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Z,OrdinaryDeleteMetadata:Se};return ne}function ji(k,x,N){var D=v.getProvider(k,x);if(!X(D))return D;if(N){if(v.setProvider(k,x,m))return m;throw new Error("Illegal state.")}}function Ib(){var k={},x=[],N=function(){function ne(P,F,L){this._index=0,this._keys=P,this._values=F,this._selector=L}return ne.prototype["@@iterator"]=function(){return this},ne.prototype[a]=function(){return this},ne.prototype.next=function(){var P=this._index;if(P>=0&&P<this._keys.length){var F=this._selector(this._keys[P],this._values[P]);return P+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:F,done:!1}}return{value:void 0,done:!0}},ne.prototype.throw=function(P){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),P},ne.prototype.return=function(P){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:P,done:!0}},ne}(),D=function(){function ne(){this._keys=[],this._values=[],this._cacheKey=k,this._cacheIndex=-2}return Object.defineProperty(ne.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ne.prototype.has=function(P){return this._find(P,!1)>=0},ne.prototype.get=function(P){var F=this._find(P,!1);return F>=0?this._values[F]:void 0},ne.prototype.set=function(P,F){var L=this._find(P,!0);return this._values[L]=F,this},ne.prototype.delete=function(P){var F=this._find(P,!1);if(F>=0){for(var L=this._keys.length,K=F+1;K<L;K++)this._keys[K-1]=this._keys[K],this._values[K-1]=this._values[K];return this._keys.length--,this._values.length--,Wa(P,this._cacheKey)&&(this._cacheKey=k,this._cacheIndex=-2),!0}return!1},ne.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=k,this._cacheIndex=-2},ne.prototype.keys=function(){return new N(this._keys,this._values,Z)},ne.prototype.values=function(){return new N(this._keys,this._values,Se)},ne.prototype.entries=function(){return new N(this._keys,this._values,_e)},ne.prototype["@@iterator"]=function(){return this.entries()},ne.prototype[a]=function(){return this.entries()},ne.prototype._find=function(P,F){if(!Wa(this._cacheKey,P)){this._cacheIndex=-1;for(var L=0;L<this._keys.length;L++)if(Wa(this._keys[L],P)){this._cacheIndex=L;break}}return this._cacheIndex<0&&F&&(this._cacheIndex=this._keys.length,this._keys.push(P),this._values.push(void 0)),this._cacheIndex},ne}();return D;function Z(ne,P){return ne}function Se(ne,P){return P}function _e(ne,P){return[ne,P]}}function Eb(){var k=function(){function x(){this._map=new E}return Object.defineProperty(x.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),x.prototype.has=function(N){return this._map.has(N)},x.prototype.add=function(N){return this._map.set(N,N),this},x.prototype.delete=function(N){return this._map.delete(N)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.keys()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[a]=function(){return this.keys()},x}();return k}function Nb(){var k=16,x=y.create(),N=D();return function(){function P(){this._key=D()}return P.prototype.has=function(F){var L=Z(F,!1);return L!==void 0?y.has(L,this._key):!1},P.prototype.get=function(F){var L=Z(F,!1);return L!==void 0?y.get(L,this._key):void 0},P.prototype.set=function(F,L){var K=Z(F,!0);return K[this._key]=L,this},P.prototype.delete=function(F){var L=Z(F,!1);return L!==void 0?delete L[this._key]:!1},P.prototype.clear=function(){this._key=D()},P}();function D(){var P;do P="@@WeakMap@@"+ne();while(y.has(x,P));return x[P]=!0,P}function Z(P,F){if(!n.call(P,N)){if(!F)return;Object.defineProperty(P,N,{value:y.create()})}return P[N]}function Se(P,F){for(var L=0;L<F;++L)P[L]=Math.random()*255|0;return P}function _e(P){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(P)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(P)):Se(new Uint8Array(P),P):Se(new Array(P),P)}function ne(){var P=_e(k);P[6]=P[6]&79|64,P[8]=P[8]&191|128;for(var F="",L=0;L<k;++L){var K=P[L];(L===4||L===6||L===8)&&(F+="-"),K<16&&(F+="0"),F+=K.toString(16).toLowerCase()}return F}}function Ya(k){return k.__=void 0,delete k.__,k}})})(Qa||(Qa={}));/*!
14
+ ***************************************************************************** */var Qa;(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(k,x){return i.call(k,x)}:function(k,x){return x in k},get:d?function(k,x){return i.call(k,x)?k[x]:void 0}:function(k,x){return k[x]}},p=Object.getPrototypeOf(Function),E=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ib(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Eb(),h=typeof WeakMap=="function"?WeakMap:Nb(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,v=xb(),m=Ab(v);function C(k,x,N,D){if(X(N)){if(!Oe(k))throw new TypeError;if(!Ce(x))throw new TypeError;return M(k,x)}else{if(!Oe(k))throw new TypeError;if(!j(x))throw new TypeError;if(!j(D)&&!X(D)&&!ee(D))throw new TypeError;return ee(D)&&(D=void 0),N=te(N),J(k,x,N,D)}}t("decorate",C);function A(k,x){function N(D,Z){if(!j(D))throw new TypeError;if(!X(Z)&&!zr(Z))throw new TypeError;he(k,x,D,Z)}return N}t("metadata",A);function S(k,x,N,D){if(!j(N))throw new TypeError;return X(D)||(D=te(D)),he(k,x,N,D)}t("defineMetadata",S);function I(k,x,N){if(!j(x))throw new TypeError;return X(N)||(N=te(N)),re(k,x,N)}t("hasMetadata",I);function T(k,x,N){if(!j(x))throw new TypeError;return X(N)||(N=te(N)),de(k,x,N)}t("hasOwnMetadata",T);function Q(k,x,N){if(!j(x))throw new TypeError;return X(N)||(N=te(N)),fe(k,x,N)}t("getMetadata",Q);function O(k,x,N){if(!j(x))throw new TypeError;return X(N)||(N=te(N)),ke(k,x,N)}t("getOwnMetadata",O);function B(k,x){if(!j(k))throw new TypeError;return X(x)||(x=te(x)),ye(k,x)}t("getMetadataKeys",B);function Y(k,x){if(!j(k))throw new TypeError;return X(x)||(x=te(x)),Be(k,x)}t("getOwnMetadataKeys",Y);function W(k,x,N){if(!j(x))throw new TypeError;if(X(N)||(N=te(N)),!j(x))throw new TypeError;X(N)||(N=te(N));var D=ji(x,N,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(k,x,N)}t("deleteMetadata",W);function M(k,x){for(var N=k.length-1;N>=0;--N){var D=k[N],Z=D(x);if(!X(Z)&&!ee(Z)){if(!Ce(Z))throw new TypeError;x=Z}}return x}function J(k,x,N,D){for(var Z=k.length-1;Z>=0;--Z){var Se=k[Z],_e=Se(x,N,D);if(!X(_e)&&!ee(_e)){if(!j(_e))throw new TypeError;D=_e}}return D}function re(k,x,N){var D=de(k,x,N);if(D)return!0;var Z=Ja(x);return ee(Z)?!1:re(k,Z,N)}function de(k,x,N){var D=ji(x,N,!1);return X(D)?!1:Pe(D.OrdinaryHasOwnMetadata(k,x,N))}function fe(k,x,N){var D=de(k,x,N);if(D)return ke(k,x,N);var Z=Ja(x);if(!ee(Z))return fe(k,Z,N)}function ke(k,x,N){var D=ji(x,N,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(k,x,N)}function he(k,x,N,D){var Z=ji(N,D,!0);Z.OrdinaryDefineOwnMetadata(k,x,N,D)}function ye(k,x){var N=Be(k,x),D=Ja(k);if(D===null)return N;var Z=ye(D,x);if(Z.length<=0)return N;if(N.length<=0)return Z;for(var Se=new w,_e=[],ne=0,P=N;ne<P.length;ne++){var F=P[ne],L=Se.has(F);L||(Se.add(F),_e.push(F))}for(var K=0,oe=Z;K<oe.length;K++){var F=oe[K],L=Se.has(F);L||(Se.add(F),_e.push(F))}return _e}function Be(k,x){var N=ji(k,x,!1);return N?N.OrdinaryOwnMetadataKeys(k,x):[]}function zt(k){if(k===null)return 1;switch(typeof k){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return k===null?1:6;default:return 6}}function X(k){return k===void 0}function ee(k){return k===null}function ge(k){return typeof k=="symbol"}function j(k){return typeof k=="object"?k!==null:typeof k=="function"}function se(k,x){switch(zt(k)){case 0:return k;case 1:return k;case 2:return k;case 3:return k;case 4:return k;case 5:return k}var N=x===3?"string":x===5?"number":"default",D=Qf(k,s);if(D!==void 0){var Z=D.call(k,N);if(j(Z))throw new TypeError;return Z}return me(k,N==="default"?"number":N)}function me(k,x){if(x==="string"){var N=k.toString;if(z(N)){var D=N.call(k);if(!j(D))return D}var Z=k.valueOf;if(z(Z)){var D=Z.call(k);if(!j(D))return D}}else{var Z=k.valueOf;if(z(Z)){var D=Z.call(k);if(!j(D))return D}var Se=k.toString;if(z(Se)){var D=Se.call(k);if(!j(D))return D}}throw new TypeError}function Pe(k){return!!k}function Mt(k){return""+k}function te(k){var x=se(k,3);return ge(x)?x:Mt(x)}function Oe(k){return Array.isArray?Array.isArray(k):k instanceof Object?k instanceof Array:Object.prototype.toString.call(k)==="[object Array]"}function z(k){return typeof k=="function"}function Ce(k){return typeof k=="function"}function zr(k){switch(zt(k)){case 3:return!0;case 4:return!0;default:return!1}}function Wa(k,x){return k===x||k!==k&&x!==x}function Qf(k,x){var N=k[x];if(N!=null){if(!z(N))throw new TypeError;return N}}function Xf(k){var x=Qf(k,a);if(!z(x))throw new TypeError;var N=x.call(k);if(!j(N))throw new TypeError;return N}function ep(k){return k.value}function tp(k){var x=k.next();return x.done?!1:x}function rp(k){var x=k.return;x&&x.call(k)}function Ja(k){var x=Object.getPrototypeOf(k);if(typeof k!="function"||k===p||x!==p)return x;var N=k.prototype,D=N&&Object.getPrototypeOf(N);if(D==null||D===Object.prototype)return x;var Z=D.constructor;return typeof Z!="function"||Z===k?x:Z}function Sb(){var k;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(k=Bb(r.Reflect));var x,N,D,Z=new h,Se={registerProvider:_e,getProvider:P,setProvider:L};return Se;function _e(K){if(!Object.isExtensible(Se))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case k===K:break;case X(x):x=K;break;case x===K:break;case X(N):N=K;break;case N===K:break;default:D===void 0&&(D=new w),D.add(K);break}}function ne(K,oe){if(!X(x)){if(x.isProviderFor(K,oe))return x;if(!X(N)){if(N.isProviderFor(K,oe))return x;if(!X(D))for(var be=Xf(D);;){var xe=tp(be);if(!xe)return;var ft=ep(xe);if(ft.isProviderFor(K,oe))return rp(be),ft}}}if(!X(k)&&k.isProviderFor(K,oe))return k}function P(K,oe){var be=Z.get(K),xe;return X(be)||(xe=be.get(oe)),X(xe)&&(xe=ne(K,oe),X(xe)||(X(be)&&(be=new E,Z.set(K,be)),be.set(oe,xe))),xe}function F(K){if(X(K))throw new TypeError;return x===K||N===K||!X(D)&&D.has(K)}function L(K,oe,be){if(!F(be))throw new Error("Metadata provider not registered.");var xe=P(K,oe);if(xe!==be){if(!X(xe))return!1;var ft=Z.get(K);X(ft)&&(ft=new E,Z.set(K,ft)),ft.set(oe,be)}return!0}}function xb(){var k;return!X(g)&&j(r.Reflect)&&Object.isExtensible(r.Reflect)&&(k=r.Reflect[g]),X(k)&&(k=Sb()),!X(g)&&j(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:k}),k}function Ab(k){var x=new h,N={isProviderFor:function(F,L){var K=x.get(F);return X(K)?!1:K.has(L)},OrdinaryDefineOwnMetadata:_e,OrdinaryHasOwnMetadata:Z,OrdinaryGetOwnMetadata:Se,OrdinaryOwnMetadataKeys:ne,OrdinaryDeleteMetadata:P};return v.registerProvider(N),N;function D(F,L,K){var oe=x.get(F),be=!1;if(X(oe)){if(!K)return;oe=new E,x.set(F,oe),be=!0}var xe=oe.get(L);if(X(xe)){if(!K)return;if(xe=new E,oe.set(L,xe),!k.setProvider(F,L,N))throw oe.delete(L),be&&x.delete(F),new Error("Wrong provider for target.")}return xe}function Z(F,L,K){var oe=D(L,K,!1);return X(oe)?!1:Pe(oe.has(F))}function Se(F,L,K){var oe=D(L,K,!1);if(!X(oe))return oe.get(F)}function _e(F,L,K,oe){var be=D(K,oe,!0);be.set(F,L)}function ne(F,L){var K=[],oe=D(F,L,!1);if(X(oe))return K;for(var be=oe.keys(),xe=Xf(be),ft=0;;){var ip=tp(xe);if(!ip)return K.length=ft,K;var Ob=ep(ip);try{K[ft]=Ob}catch(_b){try{rp(xe)}finally{throw _b}}ft++}}function P(F,L,K){var oe=D(L,K,!1);if(X(oe)||!oe.delete(F))return!1;if(oe.size===0){var be=x.get(L);X(be)||(be.delete(K),be.size===0&&x.delete(be))}return!0}}function Bb(k){var x=k.defineMetadata,N=k.hasOwnMetadata,D=k.getOwnMetadata,Z=k.getOwnMetadataKeys,Se=k.deleteMetadata,_e=new h,ne={isProviderFor:function(P,F){var L=_e.get(P);return X(L)?Z(P,F).length?(X(L)&&(L=new w,_e.set(P,L)),L.add(F),!0):!1:L.has(F)},OrdinaryDefineOwnMetadata:x,OrdinaryHasOwnMetadata:N,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Z,OrdinaryDeleteMetadata:Se};return ne}function ji(k,x,N){var D=v.getProvider(k,x);if(!X(D))return D;if(N){if(v.setProvider(k,x,m))return m;throw new Error("Illegal state.")}}function Ib(){var k={},x=[],N=function(){function ne(P,F,L){this._index=0,this._keys=P,this._values=F,this._selector=L}return ne.prototype["@@iterator"]=function(){return this},ne.prototype[a]=function(){return this},ne.prototype.next=function(){var P=this._index;if(P>=0&&P<this._keys.length){var F=this._selector(this._keys[P],this._values[P]);return P+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:F,done:!1}}return{value:void 0,done:!0}},ne.prototype.throw=function(P){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),P},ne.prototype.return=function(P){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:P,done:!0}},ne}(),D=function(){function ne(){this._keys=[],this._values=[],this._cacheKey=k,this._cacheIndex=-2}return Object.defineProperty(ne.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ne.prototype.has=function(P){return this._find(P,!1)>=0},ne.prototype.get=function(P){var F=this._find(P,!1);return F>=0?this._values[F]:void 0},ne.prototype.set=function(P,F){var L=this._find(P,!0);return this._values[L]=F,this},ne.prototype.delete=function(P){var F=this._find(P,!1);if(F>=0){for(var L=this._keys.length,K=F+1;K<L;K++)this._keys[K-1]=this._keys[K],this._values[K-1]=this._values[K];return this._keys.length--,this._values.length--,Wa(P,this._cacheKey)&&(this._cacheKey=k,this._cacheIndex=-2),!0}return!1},ne.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=k,this._cacheIndex=-2},ne.prototype.keys=function(){return new N(this._keys,this._values,Z)},ne.prototype.values=function(){return new N(this._keys,this._values,Se)},ne.prototype.entries=function(){return new N(this._keys,this._values,_e)},ne.prototype["@@iterator"]=function(){return this.entries()},ne.prototype[a]=function(){return this.entries()},ne.prototype._find=function(P,F){if(!Wa(this._cacheKey,P)){this._cacheIndex=-1;for(var L=0;L<this._keys.length;L++)if(Wa(this._keys[L],P)){this._cacheIndex=L;break}}return this._cacheIndex<0&&F&&(this._cacheIndex=this._keys.length,this._keys.push(P),this._values.push(void 0)),this._cacheIndex},ne}();return D;function Z(ne,P){return ne}function Se(ne,P){return P}function _e(ne,P){return[ne,P]}}function Eb(){var k=function(){function x(){this._map=new E}return Object.defineProperty(x.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),x.prototype.has=function(N){return this._map.has(N)},x.prototype.add=function(N){return this._map.set(N,N),this},x.prototype.delete=function(N){return this._map.delete(N)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.keys()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[a]=function(){return this.keys()},x}();return k}function Nb(){var k=16,x=y.create(),N=D();return function(){function P(){this._key=D()}return P.prototype.has=function(F){var L=Z(F,!1);return L!==void 0?y.has(L,this._key):!1},P.prototype.get=function(F){var L=Z(F,!1);return L!==void 0?y.get(L,this._key):void 0},P.prototype.set=function(F,L){var K=Z(F,!0);return K[this._key]=L,this},P.prototype.delete=function(F){var L=Z(F,!1);return L!==void 0?delete L[this._key]:!1},P.prototype.clear=function(){this._key=D()},P}();function D(){var P;do P="@@WeakMap@@"+ne();while(y.has(x,P));return x[P]=!0,P}function Z(P,F){if(!i.call(P,N)){if(!F)return;Object.defineProperty(P,N,{value:y.create()})}return P[N]}function Se(P,F){for(var L=0;L<F;++L)P[L]=Math.random()*255|0;return P}function _e(P){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(P)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(P)):Se(new Uint8Array(P),P):Se(new Array(P),P)}function ne(){var P=_e(k);P[6]=P[6]&79|64,P[8]=P[8]&191|128;for(var F="",L=0;L<k;++L){var K=P[L];(L===4||L===6||L===8)&&(F+="-"),K<16&&(F+="0"),F+=K.toString(16).toLowerCase()}return F}}function Ya(k){return k.__=void 0,delete k.__,k}})})(Qa||(Qa={}));/*!
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 ${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 n=$.toUint8Array(t),o=$.toUint8Array(r);if(n.length!==o.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[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 n=0;for(const a of r)n+=a.byteLength;const o=new Uint8Array(n);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 Xa{static fromString(t){const r=unescape(encodeURIComponent(t)),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n.buffer}static toString(t){const r=$.toUint8Array(t);let n="";for(let s=0;s<r.length;s++)n+=String.fromCharCode(r[s]);return decodeURIComponent(escape(n))}}class pt{static toString(t,r=!1){const n=$.toArrayBuffer(t),o=new DataView(n);let s="";for(let a=0;a<n.byteLength;a+=2){const c=o.getUint16(a,r);s+=String.fromCharCode(c)}return s}static fromString(t,r=!1){const n=new ArrayBuffer(t.length*2),o=new DataView(n);for(let s=0;s<t.length;s++)o.setUint16(s*2,t.charCodeAt(s),r);return n}}class U{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 n=$.toUint8Array(t);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return pt.toString(n,!0);case"utf16":case"utf16be":return pt.toString(n);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=$.toUint8Array(t);if(typeof btoa<"u"){const n=this.ToString(r,"binary");return btoa(n)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!U.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(!U.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=U.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return Xa.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=U.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return Xa.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,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);return n.buffer}static ToBinary(t){const r=$.toUint8Array(t);let n="";for(let o=0;o<r.length;o++)n+=String.fromCharCode(r[o]);return n}static ToHex(t){const r=$.toUint8Array(t);let n="";const o=r.length;for(let s=0;s<o;s++){const a=r[s];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!U.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const n=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const s=r.slice(o,o+2);n[o/2]=parseInt(s,16)}return n.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 n=0;n<r;n++)t+="=";return t}static formatString(t){return(t==null?void 0:t.replace(/[\n\r\t ]/g,""))||""}}U.DEFAULT_UTF8_ENCODING="utf8";function dp(...e){const t=e.map(o=>o.byteLength).reduce((o,s)=>o+s),r=new Uint8Array(t);let n=0;return e.map(o=>new Uint8Array(o)).forEach(o=>{for(const s of o)r[n++]=s}),r.buffer}function ec(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==n[o])return!1;return!0}/*!
37
+ */const ap="[object ArrayBuffer]";class ${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=$.toUint8Array(t),o=$.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 Xa{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=$.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=$.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 U{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=$.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=$.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(!U.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(!U.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=U.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return Xa.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=U.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return Xa.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=$.toUint8Array(t);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(t){const r=$.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(!U.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,""))||""}}U.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 ec(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 n=e.length-1;n>=0;n--)r+=e[e.length-1-n]*Math.pow(2,t*n);return r}function Gt(e,t,r=-1){const n=r;let o=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(n<0)l=new ArrayBuffer(c),s=c;else{if(n<c)return new ArrayBuffer(0);l=new ArrayBuffer(n),s=n}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 n=new ArrayBuffer(t),o=new Uint8Array(n);for(const s of e)o.set(s,r),r+=s.length;return o}function tc(){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 n=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)-n}function fp(e){const t=e<0?e*-1:e;let r=128;for(let n=1;n<8;n++){if(t<=r){if(e<0){const a=r-t,c=Gt(a,8,n),l=new Uint8Array(c);return l[0]|=128,c}let o=Gt(t,8,n),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),n=new Uint8Array(t);for(let o=0;o<r.length;o++)if(r[o]!==n[o])return!1;return!0}function Ze(e,t){const r=e.toString(10);if(t<r.length)return"";const n=t-r.length,o=new Array(n);for(let a=0;a<n;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 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 tc(){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 n=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];n.set(new Uint8Array(s),r),r+=s.byteLength}return n.buffer}function St(e,t,r,n){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):n<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-n<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])],rc="0123456789",wo="name",ic="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",nc="OCTET STRING",oc="BIT STRING";function ht(e){var t;return t=class extends e{constructor(...n){var o;super(...n);const s=n[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?$.toUint8Array(s.valueHex):Pi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,o,s){const a=n instanceof ArrayBuffer?new Uint8Array(n):n;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(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",st)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:U.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Wt{constructor({blockLength:t=0,error:r=qe,warnings:n=[],valueBeforeDecode:o=Pi}={}){this.blockLength=t,this.error=r,this.warnings=n,this.valueBeforeDecodeView=$.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:U.ToHex(this.valueBeforeDecodeView)}}}Wt.NAME="baseBlock";class Le extends Wt{fromBER(t,r,n){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 sc extends ht(Wt){constructor({idBlock:t={}}={}){var r,n,o,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?$.toUint8Array(t.valueHex):Pi,this.tagClass=(n=t.tagClass)!==null&&n!==void 0?n:-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 n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=r|31,!t){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)n[s+1]=o[s]|128;n[this.valueHexView.byteLength]=o[o.length-1]}return n.buffer}fromBER(t,r,n){const o=$.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);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 E=new Uint8Array(y);for(let w=0;w<d.length;w++)E[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let E=0;E<l;E++)p[E]=d[E];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}}}sc.NAME="identificationBlock";class ac extends Wt{constructor({lenBlock:t={}}={}){var r,n,o;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(n=t.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(o=t.length)!==null&&o!==void 0?o:0}fromBER(t,r,n){const o=$.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);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,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(n=new Uint8Array(r),n[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);n=new Uint8Array(r),n[0]=o.byteLength|128;for(let a=0;a<o.byteLength;a++)n[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(n=new Uint8Array(r),n[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}ac.NAME="lengthBlock";const R={};class Ve extends Wt{constructor({name:t=qe,optional:r=!1,primitiveSchema:n,...o}={},s){super(o),this.name=t,this.optional=r,n&&(this.primitiveSchema=n),this.idBlock=new sc(o),this.lenBlock=new ac(o),this.valueBlock=s?new s(o):new Le(o)}fromBER(t,r,n){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?n: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 n=r||new Mi;r||cc(this);const o=this.idBlock.toBER(t);if(n.write(o),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,n),n.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);n.write(a),n.write(s)}return r?st:n.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():U.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${U.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),n=t.toBER();return pp(r,n)}}Ve.NAME="BaseBlock";function cc(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)cc(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class vo extends Ve{constructor({value:t=qe,...r}={},n){super(r,n),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,n){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?n: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 lc extends ht(Le){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}lc.NAME="PrimitiveValueBlock";var uc;class Yr extends Ve{constructor(t={}){super(t,lc),this.idBlock.isConstructed=!1}}uc=Yr,R.Primitive=uc,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 n=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=R.EndOfContent;break;case 1:l=R.Boolean;break;case 2:l=R.Integer;break;case 3:l=R.BitString;break;case 4:l=R.OctetString;break;case 5:l=R.Null;break;case 6:l=R.ObjectIdentifier;break;case 10:l=R.Enumerated;break;case 12:l=R.Utf8String;break;case 13:l=R.RelativeObjectIdentifier;break;case 14:l=R.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=R.Sequence;break;case 17:l=R.Set;break;case 18:l=R.NumericString;break;case 19:l=R.PrintableString;break;case 20:l=R.TeletexString;break;case 21:l=R.VideotexString;break;case 22:l=R.IA5String;break;case 23:l=R.UTCTime;break;case 24:l=R.GeneralizedTime;break;case 25:l=R.GraphicString;break;case 26:l=R.VisibleString;break;case 27:l=R.GeneralString;break;case 28:l=R.UniversalString;break;case 29:l=R.CharacterString;break;case 30:l=R.BmpString;break;case 31:l=R.DATE;break;case 32:l=R.TimeOfDay;break;case 33:l=R.DateTime;break;case 34:l=R.Duration;break;default:{const d=o.idBlock.isConstructed?new R.Constructed:new R.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?R.Constructed:R.Primitive}return o=Cp(o,l),c=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(n,n+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($.toUint8Array(e).slice(),0,e.byteLength)}function Sp(e,t){return e?1:t}class Pt extends Le{constructor({value:t=[],isIndefiniteForm:r=!1,...n}={}){super(n),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,n){const o=$.toUint8Array(t);if(!St(this,o,r,n))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;Sp(this.isIndefiniteForm,n)>0;){const a=yr(o,s,n);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,n-=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 n=r||new Mi;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,n);return r?st:n.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 dc;class Ke extends Ve{constructor(t={}){super(t,Pt),this.idBlock.isConstructed=!0}fromBER(t,r,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?n: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 n of this.valueBlock.value)t.push(n.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])],rc="0123456789",wo="name",ic="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",nc="OCTET STRING",oc="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?$.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:U.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=$.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:U.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 sc 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?$.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=$.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 E=new Uint8Array(y);for(let w=0;w<d.length;w++)E[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let E=0;E<l;E++)p[E]=d[E];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}}}sc.NAME="identificationBlock";class ac 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=$.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}}}ac.NAME="lengthBlock";const R={};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 sc(o),this.lenBlock=new ac(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||cc(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():U.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${U.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 cc(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)cc(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 lc extends ht(Le){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}lc.NAME="PrimitiveValueBlock";var uc;class Yr extends Ve{constructor(t={}){super(t,lc),this.idBlock.isConstructed=!1}}uc=Yr,R.Primitive=uc,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=R.EndOfContent;break;case 1:l=R.Boolean;break;case 2:l=R.Integer;break;case 3:l=R.BitString;break;case 4:l=R.OctetString;break;case 5:l=R.Null;break;case 6:l=R.ObjectIdentifier;break;case 10:l=R.Enumerated;break;case 12:l=R.Utf8String;break;case 13:l=R.RelativeObjectIdentifier;break;case 14:l=R.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=R.Sequence;break;case 17:l=R.Set;break;case 18:l=R.NumericString;break;case 19:l=R.PrintableString;break;case 20:l=R.TeletexString;break;case 21:l=R.VideotexString;break;case 22:l=R.IA5String;break;case 23:l=R.UTCTime;break;case 24:l=R.GeneralizedTime;break;case 25:l=R.GraphicString;break;case 26:l=R.VisibleString;break;case 27:l=R.GeneralString;break;case 28:l=R.UniversalString;break;case 29:l=R.CharacterString;break;case 30:l=R.BmpString;break;case 31:l=R.DATE;break;case 32:l=R.TimeOfDay;break;case 33:l=R.DateTime;break;case 34:l=R.Duration;break;default:{const d=o.idBlock.isConstructed?new R.Constructed:new R.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?R.Constructed:R.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($.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=$.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 dc;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} :`}}dc=Ke,R.Constructed=dc,Ke.NAME="CONSTRUCTED";class fc extends Le{fromBER(t,r,n){return r}toBER(t){return st}}fc.override="EndOfContentValueBlock";var pc;class ko extends Ve{constructor(t={}){super(t,fc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}pc=ko,R.EndOfContent=pc,ko.NAME=Jr;var hc;class Jt extends Ve{constructor(t={}){super(t,Le),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,n){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+=n,r+n>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+n}toBER(t,r){const n=new ArrayBuffer(2);if(!t){const o=new Uint8Array(n);o[0]=5,o[1]=0}return r&&r.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}}hc=Jt,R.Null=hc,Jt.NAME="NULL";class yc extends ht(Le){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=$.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,n){const o=$.toUint8Array(t);return St(this,o,r,n)?(this.valueHexView=o.subarray(r,r+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,tc.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}yc.NAME="BooleanValueBlock";var gc;let $i=class extends Ve{constructor(t={}){super(t,yc),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}`}};gc=$i,R.Boolean=gc,$i.NAME="BOOLEAN";class mc extends ht(Pt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,n){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=Pt.prototype.fromBER.call(this,t,r,n),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!==nc)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,n),this.blockLength=n;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 bc;let Yt=class np extends Ve{constructor({idBlock:t={},lenBlock:r={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},mc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===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+n);try{if(s.byteLength){const a=yr(s,0,s.byteLength);a.offset!==-1&&a.offset===n&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,n)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Ke.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${U.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 np&&t.push(r.valueBlock.valueHexView);return $.concat(t)}};bc=Yt,R.OctetString=bc,Yt.NAME=nc;class wc extends ht(Pt){constructor({unusedBits:t=0,isConstructed:r=!1,...n}={}){super(n),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,n){if(!n)return r;let o=-1;if(this.isConstructed){if(o=Pt.prototype.fromBER.call(this,t,r,n),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!==oc)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=$.toUint8Array(t);if(!St(this,s,r,n))return-1;const a=s.subarray(r,r+n);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===n-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+n}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 n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}wc.NAME="BitStringValueBlock";var vc;let Zt=class extends Ve{constructor({idBlock:t={},lenBlock:r={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},wc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,n)}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 n=t.join("");return`${this.constructor.NAME} : ${n.substring(0,n.length-this.valueBlock.unusedBits)}`}}};vc=Zt,R.BitString=vc,Zt.NAME=oc;var kc;function xp(e,t){const r=new Uint8Array([0]),n=new Uint8Array(e),o=new Uint8Array(t);let s=n.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 E=y;E>=0;E--,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 Cc(e){if(e>=Wr.length)for(let t=Wr.length;t<=e;t++){const r=new Uint8Array([0]);let n=Wr[t-1].slice(0);for(let o=n.length-1;o>=0;o--){const s=new Uint8Array([(n[o]<<1)+r[0]]);r[0]=s[0]/10,n[o]=s[0]%10}r[0]>0&&(n=mo(r,n)),Wr.push(n)}return Wr[e]}function Ap(e,t){let r=0;const n=new Uint8Array(e),o=new Uint8Array(t),s=n.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=tc.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,n,o=0){const s=this.fromBER(t,r,n);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 n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(r,1),this.valueHexView=n}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,n){const o=super.fromBER(t,r,n);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),n=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(n){case t:r=Ap(Cc(n),r),a="-";break;default:r=xp(r,Cc(n))}n++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=rc.charAt(r[l]));return c===!1&&(a+=rc.charAt(0)),a}}kc=Co,Co.NAME="IntegerValueBlock",Object.defineProperty(kc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Sc;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),n=new Mi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(U.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${U.ToHex(c)}`)+r,y=$.toUint8Array(U.FromHex(d.toString(16)));y[0]|=128,n.write(y)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new yt({valueHex:n.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()}`}}Sc=yt,R.Integer=Sc,yt.NAME="INTEGER";var xc;class Ri extends yt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}xc=Ri,R.Enumerated=xc,Ri.NAME="ENUMERATED";class So extends ht(Le){constructor({valueDec:t=-1,isFirstSid:r=!1,...n}={}){super(n),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,n){if(!n)return r;const o=$.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let c=0;c<n&&(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 n=new Uint8Array(r.length/7);for(let o=0;o<n.length;o++)n[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<n.length?128:0);this.fromBER(n.buffer,0,n.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 n=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)n[a]=o[a]|128;n[s]=o[s]}return n}toString(){let t="";if(this.isHexOnly)t=U.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 Ac extends Le{constructor({value:t=qe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new So;if(o=s.fromBER(t,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let n=0;n<this.value.length;n++){const o=this.value[n].toBER(t);if(o.byteLength===0)return this.error=this.value[n].error,st;r.push(o)}return bo(r)}fromString(t){this.value=[];let r=0,n=0,o="",s=!1;do if(n=t.indexOf(".",r),n===-1?o=t.substring(r):o=t.substring(r,n),r=n+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(n!==-1)}toString(){let t="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[n].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}}Ac.NAME="ObjectIdentifierValueBlock";var Bc;class Ui extends Ve{constructor(t={}){super(t,Ac),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()}}}Bc=Ui,R.ObjectIdentifier=Bc,Ui.NAME="OBJECT IDENTIFIER";class xo extends ht(Wt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,n){if(n===0)return r;const o=$.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let c=0;c<n&&(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 n=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)n[a]=o[a]|128;n[s]=o[s]}return n.buffer}toString(){let t="";return this.isHexOnly?t=U.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}xo.NAME="relativeSidBlock";class Ic extends Le{constructor({value:t=qe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new xo;if(o=s.fromBER(t,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const n=[];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;n.push(s)}return bo(n)}fromString(t){this.value=[];let r=0,n=0,o="";do{n=t.indexOf(".",r),n===-1?o=t.substring(r):o=t.substring(r,n),r=n+1;const s=new xo;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let t="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let o=this.value[n].toString();n!==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}}Ic.NAME="RelativeObjectIdentifierValueBlock";var Ec;class Ao extends Ve{constructor(t={}){super(t,Ic),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()}}}Ec=Ao,R.RelativeObjectIdentifier=Ec,Ao.NAME="RelativeObjectIdentifier";var Nc;class xt extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Nc=xt,R.Sequence=Nc,xt.NAME="SEQUENCE";var Oc;let At=class extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Oc=At,R.Set=Oc,At.NAME="SET";class _c extends ht(Le){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=qe}toJSON(){return{...super.toJSON(),value:this.value}}}_c.NAME="StringValueBlock";class Tc extends _c{}Tc.NAME="SimpleStringValueBlock";class Qe extends vo{constructor({...t}={}){super(t,Tc)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,$.toUint8Array(t))}fromString(t){const r=t.length,n=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);this.valueBlock.value=t}}Qe.NAME="SIMPLE STRING";class Vc extends Qe{fromBuffer(t){this.valueBlock.valueHexView=$.toUint8Array(t);try{this.valueBlock.value=U.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=U.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(U.FromUtf8String(t)),this.valueBlock.value=t}}Vc.NAME="Utf8StringValueBlock";var jc;class Bt extends Vc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}jc=Bt,R.Utf8String=jc,Bt.NAME="UTF8String";class Dc extends Qe{fromBuffer(t){this.valueBlock.value=U.ToUtf16String(t),this.valueBlock.valueHexView=$.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(U.FromUtf16String(t))}}Dc.NAME="BmpStringValueBlock";var Mc;class Li extends Dc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Mc=Li,R.BmpString=Mc,Li.NAME="BMPString";class Pc extends Qe{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),n=new Uint8Array(r);for(let o=0;o<n.length;o+=4)n[o]=n[o+3],n[o+1]=n[o+2],n[o+2]=0,n[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,n=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--)n[o*4+l+c]=a[l]}this.valueBlock.value=t}}Pc.NAME="UniversalStringValueBlock";var $c;class Hi extends Pc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}$c=Hi,R.UniversalString=$c,Hi.NAME="UniversalString";var Rc;class Fi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Rc=Fi,R.NumericString=Rc,Fi.NAME="NumericString";var Uc;class qi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Uc=qi,R.PrintableString=Uc,qi.NAME="PrintableString";var Lc;class Ki extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Lc=Ki,R.TeletexString=Lc,Ki.NAME="TeletexString";var Hc;class zi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Hc=zi,R.VideotexString=Hc,zi.NAME="VideotexString";var Fc;class Gi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Fc=Gi,R.IA5String=Fc,Gi.NAME="IA5String";var qc;class Wi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}qc=Wi,R.GraphicString=qc,Wi.NAME="GraphicString";var Kc;class Zr extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Kc=Zr,R.VisibleString=Kc,Zr.NAME="VisibleString";var zc;class Ji extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}zc=Ji,R.GeneralString=zc,Ji.NAME="GeneralString";var Gc;class Yi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Gc=Yi,R.CharacterString=Gc,Yi.NAME="CharacterString";var Wc;class Qr extends Zr{constructor({value:t,valueDate:r,...n}={}){if(super(n),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,$.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),n=new Uint8Array(r);for(let o=0;o<t.length;o++)n[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 n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(n===null){this.error="Wrong input string for conversion";return}const o=parseInt(n[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[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}}}Wc=Qr,R.UTCTime=Wc,Qr.NAME="UTCTime";var Jc;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,n="",o="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")n=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");n=t}if(r){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,E=n.indexOf("+"),w="";if(E===-1&&(E=n.indexOf("-"),p=-1),E!==-1){if(w=n.substring(E+1),n=n.substring(0,E),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(w.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=n.indexOf(".");if(d===-1&&(d=n.indexOf(",")),d!==-1){const p=new Number(`0${n.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),o=n.substring(0,d)}else o=n;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}}}Jc=Zi,R.GeneralizedTime=Jc,Zi.NAME="GeneralizedTime";var Yc;class Bo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Yc=Bo,R.DATE=Yc,Bo.NAME="DATE";var Zc;class Io extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Zc=Io,R.TimeOfDay=Zc,Io.NAME="TimeOfDay";var Qc;class Eo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Qc=Eo,R.DateTime=Qc,Eo.NAME="DateTime";var Xc;class No extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Xc=No,R.Duration=Xc,No.NAME="Duration";var el;class Oo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}el=Oo,R.TIME=el,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,...n}={}){super(n),this.value=t,this.local=r}}class Bp{constructor({data:t=Pi}={}){this.dataView=$.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=$.toUint8Array(t)}fromBER(t,r,n){const o=r+n;return this.dataView=$.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 n=r.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(n,0,n.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(!(ic 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 R.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&&ic 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($.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Xt(r.result,r.result,t)}const tl=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($.isBufferSource(t))this.unusedBits=r,this.value=$.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 n of r)t+=n.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 n=r.length+7>>3;this.unusedBits=(n<<3)-r.length;const o=new Uint8Array(n);r=r.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class ae{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):$.isBufferSource(t)?this.buffer=$.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 ae(e.getValue()),toASN:e=>e.toASN()};function tt(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const rl=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 rl;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 il(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:il(r)}return!1}function Jp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==n[o])return!1;return!0}class Yp{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const n=this.items.get(t);if(!n)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!n.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:_.Sequence,items:{}},n=this.findParentSchema(t);return n&&(Object.assign(r,n),r.items=Object.assign({},r.items,n.items)),r}create(t,r){const n=this.items.get(t)||this.createDefault(t),o=[];for(const s in n.items){const a=n.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const y=b[a.type],p=tl[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(n.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,V=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 n;rt.has(t.constructor)?n=rt.get(t.constructor):(n=rt.createDefault(t.constructor),rt.set(t.constructor,n));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}n.items[r]=o};class nl extends Error{constructor(){super(...arguments),this.schemas=[]}}class Zp{static parse(t,r){const n=gr(t);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r)}static fromASN(t,r){var n;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 nl(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(il(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 E=(n=y.converter)!==null&&n!==void 0?n:It(p)?new p:null;if(!E)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?xt:At,h=new w;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 v=g.result.valueBlock.value;c[l]=Array.from(v,m=>E.fromASN(m))}else c[l]=Array.from(d,w=>E.fromASN(w));else{let w=d;if(y.implicit){let h;if(It(p))h=new p().toSchema("");else{const g=b[p],v=tl[g];if(!v)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new v}h.valueBlock=w.valueBlock,w=gr(h.toBER(!1)).result}c[l]=E.fromASN(w)}}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,E=>this.fromASN(E,p))}else c[l]=this.fromASN(d,p)}return c}catch(o){throw o instanceof nl&&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,n=rt.get(r);rt.cache(r);let o=[];if(n.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){const a=To(n.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:n.itemType},"[]",r,a))}else for(const a in n.items){const c=n.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(n.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,n,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 '${n.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 le extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class q{static serialize(t){return Vo.serialize(t)}static parse(t,r){return Zp.parse(t,r)}static toString(t){const r=$.isBufferSource(t)?$.toArrayBuffer(t):q.serialize(t),n=gr(r);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}}function u(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);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 ol={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",n={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 v=0,m=-1,C=(h.match(l.zoneIndex)||[])[0],A,S;for(C&&(C=C.substring(1),h=h.replace(/%.+$/,""));(m=h.indexOf(":",m+1))>=0;)v++;if(h.substr(0,2)==="::"&&v--,h.substr(-2,2)==="::"&&v--,v>g)return null;for(S=g-v,A=":";S--;)A+="0:";return h=h.replace("::",A),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const I=h.split(":"),T=[];for(let Q=0;Q<I.length;Q++)T.push(parseInt(I[Q],16));return T}(),{parts:g,zoneId:C}}function y(h,g,v,m){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let C=0,A;for(;m>0;){if(A=v-m,A<0&&(A=0),h[C]>>A!==g[C]>>A)return!1;m-=v,C+=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 E(h,g){for(;h.length<g;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,m;for(v=0;v<g.length;v++)if(m=g[v],!(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,v){let m;if(v===void 0&&(m=g,g=m[0],v=m[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,v)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!1;const m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let C,A,S;for(C=3;C>=0;C-=1)if(A=this.octets[C],A in m){if(S=m[A],v&&S!==0)return null;S!==8&&(v=!0),g+=S}else return null;return 32-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return w.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),w.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),v=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),C=[];let A=0;for(;A<4;)C.push(parseInt(v[A],10)|parseInt(m[A],10)^255),A++;return new this(C)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.isIPv4=function(h){return this.parser(h)!==null},w.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},w.IPv4.isValidFourPartDecimal=function(h){return!!(w.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},w.IPv4.networkAddressFromCIDR=function(h){let g,v,m,C,A;try{for(g=this.parseCIDR(h),m=g[0].toByteArray(),A=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),C=[],v=0;v<4;)C.push(parseInt(m[v],10)&parseInt(A[v],10)),v++;return new this(C)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.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)},w.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const v=parseInt(g[2]);if(v>=0&&v<=32){const m=[this.parse(g[1]),v];return Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,v,m;if(g=h.match(n.fourOctet))return function(){const C=g.slice(1,6),A=[];for(let S=0;S<C.length;S++)v=C[S],A.push(p(v));return A}();if(g=h.match(n.longValue)){if(m=p(g[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){const C=[];let A;for(A=0;A<=24;A+=8)C.push(m>>A&255);return C}().reverse()}else return(g=h.match(n.twoOctet))?function(){const C=g.slice(1,4),A=[];if(m=p(C[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return A.push(p(C[0])),A.push(m>>16&255),A.push(m>>8&255),A.push(m&255),A}():(g=h.match(n.threeOctet))?function(){const C=g.slice(1,5),A=[];if(m=p(C[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return A.push(p(C[0])),A.push(p(C[1])),A.push(m>>8&255),A.push(m&255),A}():null},w.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 v=0;const m=Math.floor(h/8);for(;v<m;)g[v]=255,v++;return m<4&&(g[m]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,v){let m,C;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(C=this.parts[m],!(0<=C&&C<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");v&&(this.zoneId=v)}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,v){let m;if(v===void 0&&(m=g,g=m[0],v=m[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,v)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!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 C,A;for(let S=7;S>=0;S-=1)if(C=this.parts[S],C in m){if(A=m[C],v&&A!==0)return null;A!==16&&(v=!0),g+=A}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const v=[],m=this.parts;for(let C=0;C<m.length;C++)g=m[C],v.push(g>>8),v.push(g&255);return v},h.prototype.toFixedLengthString=function(){const g=(function(){const m=[];for(let C=0;C<this.parts.length;C++)m.push(E(this.parts[C].toString(16),4));return m}).call(this).join(":");let v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},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),v=g[0],m=g[1];return new w.IPv4([v>>8,v&255,m>>8,m&255])},h.prototype.toNormalizedString=function(){const g=(function(){const m=[];for(let C=0;C<this.parts.length;C++)m.push(this.parts[C].toString(16));return m}).call(this).join(":");let v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString();let m=0,C=-1,A;for(;A=g.exec(v);)A[0].length>C&&(m=A.index,C=A[0].length);return C<0?v:`${v.substring(0,m)}::${v.substring(m+C)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),v=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),C=[];let A=0;for(;A<16;)C.push(parseInt(v[A],10)|parseInt(m[A],10)^255),A++;return new this(C)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},w.IPv6.isIPv6=function(h){return this.parser(h)!==null},w.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}},w.IPv6.networkAddressFromCIDR=function(h){let g,v,m,C,A;try{for(g=this.parseCIDR(h),m=g[0].toByteArray(),A=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),C=[],v=0;v<16;)C.push(parseInt(m[v],10)&parseInt(A[v],10)),v++;return new this(C)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},w.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)},w.IPv6.parseCIDR=function(h){let g,v,m;if((v=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(v[2]),g>=0&&g<=128))return m=[this.parse(v[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")},w.IPv6.parser=function(h){let g,v,m,C,A,S;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))&&(S=m[6]||"",g=d(m[1].slice(0,-1)+S,6),g.parts)){for(A=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],v=0;v<A.length;v++)if(C=A[v],!(0<=C&&C<=255))return null;return g.parts.push(A[0]<<8|A[1]),g.parts.push(A[2]<<8|A[3]),{parts:g.parts,zoneId:g.zoneId}}return null},w.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 v=0;const m=Math.floor(h/8);for(;v<m;)g[v]=255,v++;return m<16&&(g[m]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.fromByteArray=function(h){const g=h.length;if(g===4)return new w.IPv4(h);if(g===16)return new w.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},w.isValid=function(h){return w.IPv6.isValid(h)||w.IPv4.isValid(h)},w.parse=function(h){if(w.IPv6.isValid(h))return w.IPv6.parse(h);if(w.IPv4.isValid(h))return w.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},w.parseCIDR=function(h){try{return w.IPv6.parseCIDR(h)}catch{try{return w.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},w.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},w.subnetMatch=function(h,g,v){let m,C,A,S;v==null&&(v="unicast");for(C in g)if(Object.prototype.hasOwnProperty.call(g,C)){for(A=g[C],A[0]&&!(A[0]instanceof Array)&&(A=[A]),m=0;m<A.length;m++)if(S=A[m],h.kind()===S[0].kind()&&h.match.apply(h,S))return C}return v},e.exports?e.exports=w:t.ipaddr=w})(yo)})(ol);var sl=ol.exports;class al{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 n=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return n=n.slice(0,-1),`${n}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return sl.fromByteArray(Array.from(r)).toString()}return this.decodeIP(U.ToHex(t))}static fromString(t){const r=sl.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([V({type:_.Choice})],je);let mr=class extends je{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?U.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([V({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 le{constructor(t){super(t),Object.setPrototypeOf(this,jo.prototype)}};br=jo=u([V({type:_.Set,itemType:Xr})],br);let Po=Do=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};Po=Do=u([V({type:_.Sequence,itemType:br})],Po);let Ie=Mo=class extends Po{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};Ie=Mo=u([V({type:_.Sequence})],Ie);const Qp={fromASN:e=>al.toString(en.fromASN(e)),toASN:e=>en.toASN(al.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([V({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 cl=Ro=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};cl=Ro=u([V({type:_.Sequence,itemType:tn})],cl);const Uo=`${er}.35`;class Lo extends ae{}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 ll=`${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 le{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};He=Ho=u([V({type:_.Sequence,itemType:ie})],He);var Fo;let ul=Fo=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};ul=Fo=u([V({type:_.Sequence})],ul);var qo;const dl=`${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([V({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([V({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 le{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};sn=qo=u([V({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([V({type:_.Choice})],an);let fl=class extends an{};fl=u([V({type:_.Choice})],fl);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 pl 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([V({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:pl,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 le{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};Jo=Wo=u([V({type:_.Sequence,itemType:ti})],Jo);var Yo;let hl=Yo=class extends Jo{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};hl=Yo=u([V({type:_.Sequence,itemType:ti})],hl);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:pl,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([V({type:_.Choice})],Zo);var Qo;const yl=`${er}.37`;let cn=Qo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};cn=Qo=u([V({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([V({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([V({type:_.Choice})],es);var ts;let gl=ts=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};gl=ts=u([V({type:_.Sequence})],gl);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 le{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};un=is=u([V({type:_.Sequence,itemType:ln})],un);class bl{constructor(t={}){Object.assign(this,t)}}u([f({type:un,context:0,optional:!0,implicit:!0})],bl.prototype,"permittedSubtrees",void 0),u([f({type:un,context:1,optional:!0,implicit:!0})],bl.prototype,"excludedSubtrees",void 0);class wl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.Integer,context:0,implicit:!0,optional:!0,converter:we})],wl.prototype,"requireExplicitPolicy",void 0),u([f({type:b.Integer,context:1,implicit:!0,optional:!0,converter:we})],wl.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 vl=ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};vl=ns=u([V({type:_.Sequence,itemType:os})],vl);var ss;const kl=`${er}.17`;let as=ss=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};as=ss=u([V({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 Cl=cs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};Cl=cs=u([V({type:_.Sequence,itemType:Nt})],Cl);const Sl=`${er}.14`;class $t extends Lo{}class xl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.GeneralizedTime,context:0,implicit:!0,optional:!0})],xl.prototype,"notBefore",void 0),u([f({type:b.GeneralizedTime,context:1,implicit:!0,optional:!0})],xl.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 Al 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 Bl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Al,Object.assign(this,t)}}u([f({type:b.GeneralString})],Bl.prototype,"entrustVers",void 0),u([f({type:Al})],Bl.prototype,"entrustInfoFlags",void 0);var ls;let Il=ls=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};Il=ls=u([V({type:_.Sequence,itemType:tn})],Il);class H{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof H&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&ec(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:b.ObjectIdentifier})],H.prototype,"algorithm",void 0),u([f({type:b.Any,optional:!0})],H.prototype,"parameters",void 0);class Ot{constructor(t={}){this.algorithm=new H,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],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([V({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 op{constructor(t={}){this.extnID="",this.critical=op.CRITICAL,this.extnValue=new ae,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:ae})],lt.prototype,"extnValue",void 0);let rr=us=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};rr=us=u([V({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 H,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:H})],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 H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:it})],Cr.prototype,"tbsCertificate",void 0),u([f({type:H})],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 H,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:H})],_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 H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:_t})],ds.prototype,"tbsCertList",void 0),u([f({type:H})],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([V({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 H{};ni=u([V({type:_.Sequence})],ni);let pn=class extends H{};pn=u([V({type:_.Sequence})],pn);let gt=class extends H{};gt=u([V({type:_.Sequence})],gt);let hn=class extends H{};hn=u([V({type:_.Sequence})],hn);let El=class extends H{};El=u([V({type:_.Sequence})],El);let fs=class extends H{};fs=u([V({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 ae,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:ae})],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 le{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};yn=ps=u([V({type:_.Set,itemType:mt})],yn);let Nl=class extends De{};Nl=u([V({type:_.Choice})],Nl);let Ol=class extends mt{};Ol=u([V({type:_.Sequence})],Ol);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 le{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};gn=ys=u([V({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 H,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:H})],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([V({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 H,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:H})],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 H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ut})],vn.prototype,"acinfo",void 0),u([f({type:H})],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:ae})],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 _l{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],_l.prototype,"policyAuthority",void 0),u([f({type:Cn,repeated:"sequence"})],_l.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([V({type:_.Choice})],Ir);let Cs=ks=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};Cs=ks=u([V({type:_.Sequence,itemType:Ir})],Cs);var Ss;let Tl=Ss=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};Tl=Ss=u([V({type:_.Sequence,itemType:Cs})],Tl);class Vl{constructor(t={}){Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Vl.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Vl.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:ae,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([V({type:_.Choice})],Er);let xn=As=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};xn=As=u([V({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:ae})],si.prototype,"single",void 0),u([f({type:b.Any})],si.prototype,"any",void 0),si=u([V({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:ae,context:0,implicit:!0,optional:!0})],ai.prototype,"value",void 0),u([f({type:ae,converter:jp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ai.prototype,"constructedValue",void 0),ai=u([V({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([V({type:_.Choice})],Or);class Es{constructor(t={}){this.rid=new Or,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Or})],Es.prototype,"rid",void 0),u([f({type:ae})],Es.prototype,"encryptedKey",void 0);let En=Is=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};En=Is=u([V({type:_.Sequence,itemType:Es})],En);class Ns{constructor(t={}){this.algorithm=new H,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],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([V({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:ae,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([V({type:_.Choice})],Tr);class li{constructor(t={}){this.version=Tt.v0,this.rid=new Tr,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ae,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:ae})],li.prototype,"encryptedKey",void 0);class ui{constructor(t={}){this.keyIdentifier=new ae,Object.assign(this,t)}}u([f({type:ae})],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 ae,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:ae})],di.prototype,"encryptedKey",void 0);class fi{constructor(t={}){this.version=Tt.v0,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ae,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:ae})],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([V({type:_.Choice})],Rt);var _s;let Nn=_s=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};Nn=_s=u([V({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([V({type:_.Choice})],pi);let Vs=Ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Vs=Ts=u([V({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 le{constructor(t){super(t),Object.setPrototypeOf(this,Ds.prototype)}};Ms=Ds=u([V({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 le{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};_n=Ps=u([V({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",jl="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",Dl="1.2.840.10045.3.1.7",Ml="1.3.132.0.34",Pl="1.3.132.0.35";function gi(e){return new H({algorithm:e})}const sh=gi($s);gi(jl);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([V({type:_.Choice})],jr);class Tn{constructor(t={}){this.version=1,this.privateKey=new ae,Object.assign(this,t)}}u([f({type:b.Integer})],Tn.prototype,"version",void 0),u([f({type:ae})],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`,$l=`${ze}.15`,Rl=`${ze}.16`,Ul="1.3.14.3.2.26",Ll="2.16.840.1.101.3.4.2.4",Hl="2.16.840.1.101.3.4.2.1",Fl="2.16.840.1.101.3.4.2.2",ql="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 H({algorithm:e,parameters:null})}Ee(bh),Ee(wh);const sr=Ee(Ul);Ee(Ll),Ee(Hl),Ee(Fl),Ee(ql),Ee(gh),Ee(mh);const Kl=new H({algorithm:Fs,parameters:q.serialize(sr)}),zl=new H({algorithm:dh,parameters:q.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($l),Ee(Rl),Ee(Dn),Ee(Mn),Ee($l),Ee(Rl);class Pn{constructor(t={}){this.hashAlgorithm=new H(sr),this.maskGenAlgorithm=new H({algorithm:Fs,parameters:q.serialize(sr)}),this.pSourceAlgorithm=new H(zl),Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:sr})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Kl})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:zl})],Pn.prototype,"pSourceAlgorithm",void 0),new H({algorithm:uh,parameters:q.serialize(new Pn)});class mi{constructor(t={}){this.hashAlgorithm=new H(sr),this.maskGenAlgorithm=new H({algorithm:Fs,parameters:q.serialize(sr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:sr})],mi.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Kl})],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 H({algorithm:fh,parameters:q.serialize(new mi)});class $n{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],$n.prototype,"digestAlgorithm",void 0),u([f({type:ae})],$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 le{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([V({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} :`}}dc=Ke,R.Constructed=dc,Ke.NAME="CONSTRUCTED";class fc extends Le{fromBER(t,r,i){return r}toBER(t){return st}}fc.override="EndOfContentValueBlock";var pc;class ko extends Ve{constructor(t={}){super(t,fc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}pc=ko,R.EndOfContent=pc,ko.NAME=Jr;var hc;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}`}}hc=Jt,R.Null=hc,Jt.NAME="NULL";class yc extends ht(Le){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=$.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=$.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,tc.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}yc.NAME="BooleanValueBlock";var gc;let $i=class extends Ve{constructor(t={}){super(t,yc),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}`}};gc=$i,R.Boolean=gc,$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!==nc)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 bc;let Yt=class np 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} : ${U.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 np&&t.push(r.valueBlock.valueHexView);return $.concat(t)}};bc=Yt,R.OctetString=bc,Yt.NAME=nc;class wc 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!==oc)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=$.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}}}wc.NAME="BitStringValueBlock";var vc;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},wc),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)}`}}};vc=Zt,R.BitString=vc,Zt.NAME=oc;var kc;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 E=y;E>=0;E--,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 Cc(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=tc.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(Cc(i),r),a="-";break;default:r=xp(r,Cc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=rc.charAt(r[l]));return c===!1&&(a+=rc.charAt(0)),a}}kc=Co,Co.NAME="IntegerValueBlock",Object.defineProperty(kc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Sc;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(U.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${U.ToHex(c)}`)+r,y=$.toUint8Array(U.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()}`}}Sc=yt,R.Integer=Sc,yt.NAME="INTEGER";var xc;class Ri extends yt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}xc=Ri,R.Enumerated=xc,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=$.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=U.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 Ac 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}}Ac.NAME="ObjectIdentifierValueBlock";var Bc;class Ui extends Ve{constructor(t={}){super(t,Ac),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()}}}Bc=Ui,R.ObjectIdentifier=Bc,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=$.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=U.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}xo.NAME="relativeSidBlock";class Ic 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}}Ic.NAME="RelativeObjectIdentifierValueBlock";var Ec;class Ao extends Ve{constructor(t={}){super(t,Ic),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()}}}Ec=Ao,R.RelativeObjectIdentifier=Ec,Ao.NAME="RelativeObjectIdentifier";var Nc;class xt extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Nc=xt,R.Sequence=Nc,xt.NAME="SEQUENCE";var Oc;let At=class extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Oc=At,R.Set=Oc,At.NAME="SET";class _c extends ht(Le){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=qe}toJSON(){return{...super.toJSON(),value:this.value}}}_c.NAME="StringValueBlock";class Tc extends _c{}Tc.NAME="SimpleStringValueBlock";class Qe extends vo{constructor({...t}={}){super(t,Tc)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,$.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 Vc extends Qe{fromBuffer(t){this.valueBlock.valueHexView=$.toUint8Array(t);try{this.valueBlock.value=U.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=U.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(U.FromUtf8String(t)),this.valueBlock.value=t}}Vc.NAME="Utf8StringValueBlock";var jc;class Bt extends Vc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}jc=Bt,R.Utf8String=jc,Bt.NAME="UTF8String";class Dc extends Qe{fromBuffer(t){this.valueBlock.value=U.ToUtf16String(t),this.valueBlock.valueHexView=$.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(U.FromUtf16String(t))}}Dc.NAME="BmpStringValueBlock";var Mc;class Li extends Dc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Mc=Li,R.BmpString=Mc,Li.NAME="BMPString";class Pc 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}}Pc.NAME="UniversalStringValueBlock";var $c;class Hi extends Pc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}$c=Hi,R.UniversalString=$c,Hi.NAME="UniversalString";var Rc;class Fi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Rc=Fi,R.NumericString=Rc,Fi.NAME="NumericString";var Uc;class qi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Uc=qi,R.PrintableString=Uc,qi.NAME="PrintableString";var Lc;class Ki extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Lc=Ki,R.TeletexString=Lc,Ki.NAME="TeletexString";var Hc;class zi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Hc=zi,R.VideotexString=Hc,zi.NAME="VideotexString";var Fc;class Gi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Fc=Gi,R.IA5String=Fc,Gi.NAME="IA5String";var qc;class Wi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}qc=Wi,R.GraphicString=qc,Wi.NAME="GraphicString";var Kc;class Zr extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Kc=Zr,R.VisibleString=Kc,Zr.NAME="VisibleString";var zc;class Ji extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}zc=Ji,R.GeneralString=zc,Ji.NAME="GeneralString";var Gc;class Yi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Gc=Yi,R.CharacterString=Gc,Yi.NAME="CharacterString";var Wc;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,$.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}}}Wc=Qr,R.UTCTime=Wc,Qr.NAME="UTCTime";var Jc;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,E=i.indexOf("+"),w="";if(E===-1&&(E=i.indexOf("-"),p=-1),E!==-1){if(w=i.substring(E+1),i=i.substring(0,E),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(w.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,w.length===4){if(h=parseInt(w.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}}}Jc=Zi,R.GeneralizedTime=Jc,Zi.NAME="GeneralizedTime";var Yc;class Bo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Yc=Bo,R.DATE=Yc,Bo.NAME="DATE";var Zc;class Io extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Zc=Io,R.TimeOfDay=Zc,Io.NAME="TimeOfDay";var Qc;class Eo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Qc=Eo,R.DateTime=Qc,Eo.NAME="DateTime";var Xc;class No extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Xc=No,R.Duration=Xc,No.NAME="Duration";var el;class Oo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}el=Oo,R.TIME=el,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=$.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=$.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=$.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(!(ic 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 R.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&&ic 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($.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Xt(r.result,r.result,t)}const tl=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($.isBufferSource(t))this.unusedBits=r,this.value=$.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 ae{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):$.isBufferSource(t)?this.buffer=$.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 ae(e.getValue()),toASN:e=>e.toASN()};function tt(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const rl=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 rl;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 il(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:il(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=tl[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,V=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 nl 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 nl(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(il(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 E=(i=y.converter)!==null&&i!==void 0?i:It(p)?new p:null;if(!E)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?xt:At,h=new w;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 v=g.result.valueBlock.value;c[l]=Array.from(v,m=>E.fromASN(m))}else c[l]=Array.from(d,w=>E.fromASN(w));else{let w=d;if(y.implicit){let h;if(It(p))h=new p().toSchema("");else{const g=b[p],v=tl[g];if(!v)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new v}h.valueBlock=w.valueBlock,w=gr(h.toBER(!1)).result}c[l]=E.fromASN(w)}}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,E=>this.fromASN(E,p))}else c[l]=this.fromASN(d,p)}return c}catch(o){throw o instanceof nl&&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 le extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class q{static serialize(t){return Vo.serialize(t)}static parse(t,r){return Zp.parse(t,r)}static toString(t){const r=$.isBufferSource(t)?$.toArrayBuffer(t):q.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 ol={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 v=0,m=-1,C=(h.match(l.zoneIndex)||[])[0],A,S;for(C&&(C=C.substring(1),h=h.replace(/%.+$/,""));(m=h.indexOf(":",m+1))>=0;)v++;if(h.substr(0,2)==="::"&&v--,h.substr(-2,2)==="::"&&v--,v>g)return null;for(S=g-v,A=":";S--;)A+="0:";return h=h.replace("::",A),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const I=h.split(":"),T=[];for(let Q=0;Q<I.length;Q++)T.push(parseInt(I[Q],16));return T}(),{parts:g,zoneId:C}}function y(h,g,v,m){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let C=0,A;for(;m>0;){if(A=v-m,A<0&&(A=0),h[C]>>A!==g[C]>>A)return!1;m-=v,C+=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 E(h,g){for(;h.length<g;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,m;for(v=0;v<g.length;v++)if(m=g[v],!(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,v){let m;if(v===void 0&&(m=g,g=m[0],v=m[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,v)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!1;const m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let C,A,S;for(C=3;C>=0;C-=1)if(A=this.octets[C],A in m){if(S=m[A],v&&S!==0)return null;S!==8&&(v=!0),g+=S}else return null;return 32-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return w.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),w.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),v=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),C=[];let A=0;for(;A<4;)C.push(parseInt(v[A],10)|parseInt(m[A],10)^255),A++;return new this(C)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.isIPv4=function(h){return this.parser(h)!==null},w.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},w.IPv4.isValidFourPartDecimal=function(h){return!!(w.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},w.IPv4.networkAddressFromCIDR=function(h){let g,v,m,C,A;try{for(g=this.parseCIDR(h),m=g[0].toByteArray(),A=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),C=[],v=0;v<4;)C.push(parseInt(m[v],10)&parseInt(A[v],10)),v++;return new this(C)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.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)},w.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const v=parseInt(g[2]);if(v>=0&&v<=32){const m=[this.parse(g[1]),v];return Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,v,m;if(g=h.match(i.fourOctet))return function(){const C=g.slice(1,6),A=[];for(let S=0;S<C.length;S++)v=C[S],A.push(p(v));return A}();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 C=[];let A;for(A=0;A<=24;A+=8)C.push(m>>A&255);return C}().reverse()}else return(g=h.match(i.twoOctet))?function(){const C=g.slice(1,4),A=[];if(m=p(C[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return A.push(p(C[0])),A.push(m>>16&255),A.push(m>>8&255),A.push(m&255),A}():(g=h.match(i.threeOctet))?function(){const C=g.slice(1,5),A=[];if(m=p(C[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return A.push(p(C[0])),A.push(p(C[1])),A.push(m>>8&255),A.push(m&255),A}():null},w.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 v=0;const m=Math.floor(h/8);for(;v<m;)g[v]=255,v++;return m<4&&(g[m]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,v){let m,C;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(C=this.parts[m],!(0<=C&&C<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");v&&(this.zoneId=v)}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,v){let m;if(v===void 0&&(m=g,g=m[0],v=m[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,v)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!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 C,A;for(let S=7;S>=0;S-=1)if(C=this.parts[S],C in m){if(A=m[C],v&&A!==0)return null;A!==16&&(v=!0),g+=A}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const v=[],m=this.parts;for(let C=0;C<m.length;C++)g=m[C],v.push(g>>8),v.push(g&255);return v},h.prototype.toFixedLengthString=function(){const g=(function(){const m=[];for(let C=0;C<this.parts.length;C++)m.push(E(this.parts[C].toString(16),4));return m}).call(this).join(":");let v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},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),v=g[0],m=g[1];return new w.IPv4([v>>8,v&255,m>>8,m&255])},h.prototype.toNormalizedString=function(){const g=(function(){const m=[];for(let C=0;C<this.parts.length;C++)m.push(this.parts[C].toString(16));return m}).call(this).join(":");let v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString();let m=0,C=-1,A;for(;A=g.exec(v);)A[0].length>C&&(m=A.index,C=A[0].length);return C<0?v:`${v.substring(0,m)}::${v.substring(m+C)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),v=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),C=[];let A=0;for(;A<16;)C.push(parseInt(v[A],10)|parseInt(m[A],10)^255),A++;return new this(C)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},w.IPv6.isIPv6=function(h){return this.parser(h)!==null},w.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}},w.IPv6.networkAddressFromCIDR=function(h){let g,v,m,C,A;try{for(g=this.parseCIDR(h),m=g[0].toByteArray(),A=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),C=[],v=0;v<16;)C.push(parseInt(m[v],10)&parseInt(A[v],10)),v++;return new this(C)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},w.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)},w.IPv6.parseCIDR=function(h){let g,v,m;if((v=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(v[2]),g>=0&&g<=128))return m=[this.parse(v[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")},w.IPv6.parser=function(h){let g,v,m,C,A,S;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))&&(S=m[6]||"",g=d(m[1].slice(0,-1)+S,6),g.parts)){for(A=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],v=0;v<A.length;v++)if(C=A[v],!(0<=C&&C<=255))return null;return g.parts.push(A[0]<<8|A[1]),g.parts.push(A[2]<<8|A[3]),{parts:g.parts,zoneId:g.zoneId}}return null},w.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 v=0;const m=Math.floor(h/8);for(;v<m;)g[v]=255,v++;return m<16&&(g[m]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.fromByteArray=function(h){const g=h.length;if(g===4)return new w.IPv4(h);if(g===16)return new w.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},w.isValid=function(h){return w.IPv6.isValid(h)||w.IPv4.isValid(h)},w.parse=function(h){if(w.IPv6.isValid(h))return w.IPv6.parse(h);if(w.IPv4.isValid(h))return w.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},w.parseCIDR=function(h){try{return w.IPv6.parseCIDR(h)}catch{try{return w.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},w.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},w.subnetMatch=function(h,g,v){let m,C,A,S;v==null&&(v="unicast");for(C in g)if(Object.prototype.hasOwnProperty.call(g,C)){for(A=g[C],A[0]&&!(A[0]instanceof Array)&&(A=[A]),m=0;m<A.length;m++)if(S=A[m],h.kind()===S[0].kind()&&h.match.apply(h,S))return C}return v},e.exports?e.exports=w:t.ipaddr=w})(yo)})(ol);var sl=ol.exports;class al{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 sl.fromByteArray(Array.from(r)).toString()}return this.decodeIP(U.ToHex(t))}static fromString(t){const r=sl.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([V({type:_.Choice})],je);let mr=class extends je{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?U.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([V({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 le{constructor(t){super(t),Object.setPrototypeOf(this,jo.prototype)}};br=jo=u([V({type:_.Set,itemType:Xr})],br);let Po=Do=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};Po=Do=u([V({type:_.Sequence,itemType:br})],Po);let Ie=Mo=class extends Po{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};Ie=Mo=u([V({type:_.Sequence})],Ie);const Qp={fromASN:e=>al.toString(en.fromASN(e)),toASN:e=>en.toASN(al.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([V({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 cl=Ro=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};cl=Ro=u([V({type:_.Sequence,itemType:tn})],cl);const Uo=`${er}.35`;class Lo extends ae{}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 ll=`${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 le{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};He=Ho=u([V({type:_.Sequence,itemType:ie})],He);var Fo;let ul=Fo=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};ul=Fo=u([V({type:_.Sequence})],ul);var qo;const dl=`${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([V({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([V({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 le{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};sn=qo=u([V({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([V({type:_.Choice})],an);let fl=class extends an{};fl=u([V({type:_.Choice})],fl);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 pl 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([V({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:pl,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 le{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};Jo=Wo=u([V({type:_.Sequence,itemType:ti})],Jo);var Yo;let hl=Yo=class extends Jo{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};hl=Yo=u([V({type:_.Sequence,itemType:ti})],hl);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:pl,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([V({type:_.Choice})],Zo);var Qo;const yl=`${er}.37`;let cn=Qo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};cn=Qo=u([V({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([V({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([V({type:_.Choice})],es);var ts;let gl=ts=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};gl=ts=u([V({type:_.Sequence})],gl);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 le{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};un=is=u([V({type:_.Sequence,itemType:ln})],un);class bl{constructor(t={}){Object.assign(this,t)}}u([f({type:un,context:0,optional:!0,implicit:!0})],bl.prototype,"permittedSubtrees",void 0),u([f({type:un,context:1,optional:!0,implicit:!0})],bl.prototype,"excludedSubtrees",void 0);class wl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.Integer,context:0,implicit:!0,optional:!0,converter:we})],wl.prototype,"requireExplicitPolicy",void 0),u([f({type:b.Integer,context:1,implicit:!0,optional:!0,converter:we})],wl.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 vl=ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};vl=ns=u([V({type:_.Sequence,itemType:os})],vl);var ss;const kl=`${er}.17`;let as=ss=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};as=ss=u([V({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 Cl=cs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};Cl=cs=u([V({type:_.Sequence,itemType:Nt})],Cl);const Sl=`${er}.14`;class $t extends Lo{}class xl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.GeneralizedTime,context:0,implicit:!0,optional:!0})],xl.prototype,"notBefore",void 0),u([f({type:b.GeneralizedTime,context:1,implicit:!0,optional:!0})],xl.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 Al 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 Bl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Al,Object.assign(this,t)}}u([f({type:b.GeneralString})],Bl.prototype,"entrustVers",void 0),u([f({type:Al})],Bl.prototype,"entrustInfoFlags",void 0);var ls;let Il=ls=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};Il=ls=u([V({type:_.Sequence,itemType:tn})],Il);class H{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof H&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&ec(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:b.ObjectIdentifier})],H.prototype,"algorithm",void 0),u([f({type:b.Any,optional:!0})],H.prototype,"parameters",void 0);class Ot{constructor(t={}){this.algorithm=new H,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],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([V({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 op{constructor(t={}){this.extnID="",this.critical=op.CRITICAL,this.extnValue=new ae,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:ae})],lt.prototype,"extnValue",void 0);let rr=us=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};rr=us=u([V({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 H,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:H})],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 H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:it})],Cr.prototype,"tbsCertificate",void 0),u([f({type:H})],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 H,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:H})],_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 H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:_t})],ds.prototype,"tbsCertList",void 0),u([f({type:H})],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([V({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 H{};ni=u([V({type:_.Sequence})],ni);let pn=class extends H{};pn=u([V({type:_.Sequence})],pn);let gt=class extends H{};gt=u([V({type:_.Sequence})],gt);let hn=class extends H{};hn=u([V({type:_.Sequence})],hn);let El=class extends H{};El=u([V({type:_.Sequence})],El);let fs=class extends H{};fs=u([V({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 ae,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:ae})],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 le{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};yn=ps=u([V({type:_.Set,itemType:mt})],yn);let Nl=class extends De{};Nl=u([V({type:_.Choice})],Nl);let Ol=class extends mt{};Ol=u([V({type:_.Sequence})],Ol);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 le{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};gn=ys=u([V({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 H,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:H})],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([V({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 H,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:H})],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 H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ut})],vn.prototype,"acinfo",void 0),u([f({type:H})],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:ae})],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 _l{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],_l.prototype,"policyAuthority",void 0),u([f({type:Cn,repeated:"sequence"})],_l.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([V({type:_.Choice})],Ir);let Cs=ks=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};Cs=ks=u([V({type:_.Sequence,itemType:Ir})],Cs);var Ss;let Tl=Ss=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};Tl=Ss=u([V({type:_.Sequence,itemType:Cs})],Tl);class Vl{constructor(t={}){Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Vl.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Vl.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:ae,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([V({type:_.Choice})],Er);let xn=As=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};xn=As=u([V({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:ae})],si.prototype,"single",void 0),u([f({type:b.Any})],si.prototype,"any",void 0),si=u([V({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:ae,context:0,implicit:!0,optional:!0})],ai.prototype,"value",void 0),u([f({type:ae,converter:jp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ai.prototype,"constructedValue",void 0),ai=u([V({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([V({type:_.Choice})],Or);class Es{constructor(t={}){this.rid=new Or,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Or})],Es.prototype,"rid",void 0),u([f({type:ae})],Es.prototype,"encryptedKey",void 0);let En=Is=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};En=Is=u([V({type:_.Sequence,itemType:Es})],En);class Ns{constructor(t={}){this.algorithm=new H,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],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([V({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:ae,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([V({type:_.Choice})],Tr);class li{constructor(t={}){this.version=Tt.v0,this.rid=new Tr,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ae,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:ae})],li.prototype,"encryptedKey",void 0);class ui{constructor(t={}){this.keyIdentifier=new ae,Object.assign(this,t)}}u([f({type:ae})],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 ae,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:ae})],di.prototype,"encryptedKey",void 0);class fi{constructor(t={}){this.version=Tt.v0,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ae,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:ae})],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([V({type:_.Choice})],Rt);var _s;let Nn=_s=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};Nn=_s=u([V({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([V({type:_.Choice})],pi);let Vs=Ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Vs=Ts=u([V({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 le{constructor(t){super(t),Object.setPrototypeOf(this,Ds.prototype)}};Ms=Ds=u([V({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 le{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};_n=Ps=u([V({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",jl="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",Dl="1.2.840.10045.3.1.7",Ml="1.3.132.0.34",Pl="1.3.132.0.35";function gi(e){return new H({algorithm:e})}const sh=gi($s);gi(jl);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([V({type:_.Choice})],jr);class Tn{constructor(t={}){this.version=1,this.privateKey=new ae,Object.assign(this,t)}}u([f({type:b.Integer})],Tn.prototype,"version",void 0),u([f({type:ae})],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`,$l=`${ze}.15`,Rl=`${ze}.16`,Ul="1.3.14.3.2.26",Ll="2.16.840.1.101.3.4.2.4",Hl="2.16.840.1.101.3.4.2.1",Fl="2.16.840.1.101.3.4.2.2",ql="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 H({algorithm:e,parameters:null})}Ee(bh),Ee(wh);const sr=Ee(Ul);Ee(Ll),Ee(Hl),Ee(Fl),Ee(ql),Ee(gh),Ee(mh);const Kl=new H({algorithm:Fs,parameters:q.serialize(sr)}),zl=new H({algorithm:dh,parameters:q.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($l),Ee(Rl),Ee(Dn),Ee(Mn),Ee($l),Ee(Rl);class Pn{constructor(t={}){this.hashAlgorithm=new H(sr),this.maskGenAlgorithm=new H({algorithm:Fs,parameters:q.serialize(sr)}),this.pSourceAlgorithm=new H(zl),Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:sr})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Kl})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:zl})],Pn.prototype,"pSourceAlgorithm",void 0),new H({algorithm:uh,parameters:q.serialize(new Pn)});class mi{constructor(t={}){this.hashAlgorithm=new H(sr),this.maskGenAlgorithm=new H({algorithm:Fs,parameters:q.serialize(sr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:sr})],mi.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Kl})],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 H({algorithm:fh,parameters:q.serialize(new mi)});class $n{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],$n.prototype,"digestAlgorithm",void 0),u([f({type:ae})],$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 le{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([V({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
@@ -85,9 +85,9 @@ ${t.join(`
85
85
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
86
86
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
87
87
  PERFORMANCE OF THIS SOFTWARE.
88
- ***************************************************************************** */var Ws=function(e,t){return Ws=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[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,n){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(n.next(y))}catch(p){a(p)}}function l(y){try{d(n.throw(y))}catch(p){a(p)}}function d(y){y.done?s(y.value):o(y.value).then(c,l)}d((n=n.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:[]},n,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(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=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{n=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],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],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 n=r.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(c){a={error:c}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}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(n){t[+n]=r[n]}),t}function Gl(e){return!!e.useClass}function Ys(e){return!!e.useFactory}var Wl=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,n={},o=!1,s,a=function(){return o||(s=t(r.wrap()),o=!0),s};return new Proxy(n,this.createHandler(a))},e.prototype.createHandler=function(t){var r={},n=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(n),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 Jl(e){return typeof e=="object"&&"token"in e&&"transform"in e}function Ah(e){return typeof e=="function"||e instanceof Wl}function Hn(e){return!!e.useToken}function Fn(e){return e.useValue!=null}function Bh(e){return Gl(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),Yl=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
- `).map(function(n){return r+n})).join(`
90
- `)}function Oh(e,t,r){var n=Ln(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=n[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}(),Zl=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,n){n===void 0&&(n={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((n.lifecycle===Ge.Singleton||n.lifecycle==Ge.ContainerScoped||n.lifecycle==Ge.ResolutionScoped)&&(Fn(o)||Ys(o)))throw new Error('Cannot use lifecycle "'+Ge[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:n}),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 n=t;return r&&!Mr(r)&&(n=r),this.register(t,{useClass:n},{lifecycle:Ge.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Yl),this.ensureNotDisposed();var n=this.getRegistration(t);if(!n&&Mr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),n){var o=this.resolveRegistration(n,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 n,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){n={error:d}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,n){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,n)}}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 n=t.options.lifecycle===Ge.Singleton,o=t.options.lifecycle===Ge.ContainerScoped,s=n||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):Gl(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 n=this;r===void 0&&(r=new Yl),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 n.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 n=Un(this._registry.entries()),o=n.next();!o.done;o=n.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=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var n=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})&&n._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 n},e.prototype.beforeResolution=function(t,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:n})},e.prototype.afterResolution=function(t,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:n})},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(n){var o=n.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 n=this;if(t instanceof Wl)return t.createProxy(function(s){return n.resolve(s,r)});var o=function(){var s=Zl.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(n.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 n=this;return function(o,s){var a,c,l;try{return xh(o)?Jl(o)?o.multiple?(a=n.resolve(o.transform)).transform.apply(a,ar([n.resolveAll(o.token)],o.transformArgs)):(c=n.resolve(o.transform)).transform.apply(c,ar([n.resolve(o.token,t)],o.transformArgs)):o.multiple?n.resolveAll(o.token):n.resolve(o.token,t):Jl(o)?(l=n.resolve(o.transform,t)).transform.apply(l,ar([n.resolve(o.token,t)],o.transformArgs)):n.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){Zl.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 Ql=Xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};Ql=Xs=u([V({type:_.Sequence,itemType:qn})],Ql);var ea;let Xl=ea=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};Xl=ea=u([V({type:_.Sequence,itemType:Nr})],Xl);class eu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],eu.prototype,"certId",void 0),u([f({type:b.Any,context:0})],eu.prototype,"certValue",void 0);class tu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],tu.prototype,"crlId",void 0),u([f({type:b.Any,context:0})],tu.prototype,"crltValue",void 0);class ru extends ae{}let Kn=class{constructor(t={}){this.encryptionAlgorithm=new H,this.encryptedData=new ru,Object.assign(this,t)}};u([f({type:H})],Kn.prototype,"encryptionAlgorithm",void 0),u([f({type:ru})],Kn.prototype,"encryptedData",void 0);var ta,ra;(function(e){e[e.v1=0]="v1"})(ra||(ra={}));class iu extends ae{}let ia=ta=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};ia=ta=u([V({type:_.Sequence,itemType:Nt})],ia);class bi{constructor(t={}){this.version=ra.v1,this.privateKeyAlgorithm=new H,this.privateKey=new iu,Object.assign(this,t)}}u([f({type:b.Integer})],bi.prototype,"version",void 0),u([f({type:H})],bi.prototype,"privateKeyAlgorithm",void 0),u([f({type:iu})],bi.prototype,"privateKey",void 0),u([f({type:ia,implicit:!0,context:0,optional:!0})],bi.prototype,"attributes",void 0);let nu=class extends bi{};nu=u([V({type:_.Sequence})],nu);let ou=class extends Kn{};ou=u([V({type:_.Sequence})],ou);class su{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],su.prototype,"secretTypeId",void 0),u([f({type:b.Any,context:0})],su.prototype,"secretValue",void 0);class wi{constructor(t={}){this.mac=new $n,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:$n})],wi.prototype,"mac",void 0),u([f({type:ae})],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 au=na=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,na.prototype)}};au=na=u([V({type:_.Sequence,itemType:Gn})],au);var oa,sa,aa;const cu="1.2.840.113549.1.9",lu=`${cu}.7`,ca=`${cu}.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([V({type:_.Choice})],Wn);let uu=class extends Nr{};uu=u([V({type:_.Sequence})],uu);let du=class extends zn{};du=u([V({type:_.Sequence})],du);let fu=class extends Kn{};fu=u([V({type:_.Sequence})],fu);let la=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.IA5String})],la.prototype,"value",void 0),la=u([V({type:_.Choice})],la);let pu=class extends Wn{};pu=u([V({type:_.Choice})],pu);let hu=class extends je{};hu=u([V({type:_.Choice})],hu);let ua=class{constructor(t=new Date){this.value=t}};u([f({type:b.GeneralizedTime})],ua.prototype,"value",void 0),ua=u([V({type:_.Choice})],ua);let yu=class extends je{};yu=u([V({type:_.Choice})],yu);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([V({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([V({type:_.Choice})],Jn);let gu=class extends Jn{};gu=u([V({type:_.Choice})],gu);let mu=class extends je{};mu=u([V({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([V({type:_.Choice})],fa);let bu=class extends De{};bu=u([V({type:_.Choice})],bu);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([V({type:_.Choice})],pa);let wu=class extends mt{};wu=u([V({type:_.Sequence})],wu);let Yn=class extends je{};Yn=u([V({type:_.Choice})],Yn);let vu=oa=class extends rr{constructor(t){super(t),Object.setPrototypeOf(this,oa.prototype)}};vu=oa=u([V({type:_.Sequence})],vu);let ku=sa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,sa.prototype)}};ku=sa=u([V({type:_.Set,itemType:Ar})],ku);let ha=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.BmpString})],ha.prototype,"value",void 0),ha=u([V({type:_.Choice})],ha);let ya=class extends H{};ya=u([V({type:_.Sequence})],ya);let Cu=aa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}};Cu=aa=u([V({type:_.Sequence,itemType:ya})],Cu);var ga;let Zn=ga=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Zn=ga=u([V({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 H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pr})],vi.prototype,"certificationRequestInfo",void 0),u([f({type:H})],vi.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],vi.prototype,"signature",void 0);/*!
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 Gl(e){return!!e.useClass}function Ys(e){return!!e.useFactory}var Wl=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 Jl(e){return typeof e=="object"&&"token"in e&&"transform"in e}function Ah(e){return typeof e=="function"||e instanceof Wl}function Hn(e){return!!e.useToken}function Fn(e){return e.useValue!=null}function Bh(e){return Gl(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),Yl=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
+ `).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}(),Zl=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 Yl),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):Gl(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 Yl),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 Wl)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=Zl.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)?Jl(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):Jl(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){Zl.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 Ql=Xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};Ql=Xs=u([V({type:_.Sequence,itemType:qn})],Ql);var ea;let Xl=ea=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};Xl=ea=u([V({type:_.Sequence,itemType:Nr})],Xl);class eu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],eu.prototype,"certId",void 0),u([f({type:b.Any,context:0})],eu.prototype,"certValue",void 0);class tu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],tu.prototype,"crlId",void 0),u([f({type:b.Any,context:0})],tu.prototype,"crltValue",void 0);class ru extends ae{}let Kn=class{constructor(t={}){this.encryptionAlgorithm=new H,this.encryptedData=new ru,Object.assign(this,t)}};u([f({type:H})],Kn.prototype,"encryptionAlgorithm",void 0),u([f({type:ru})],Kn.prototype,"encryptedData",void 0);var ta,ra;(function(e){e[e.v1=0]="v1"})(ra||(ra={}));class iu extends ae{}let ia=ta=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};ia=ta=u([V({type:_.Sequence,itemType:Nt})],ia);class bi{constructor(t={}){this.version=ra.v1,this.privateKeyAlgorithm=new H,this.privateKey=new iu,Object.assign(this,t)}}u([f({type:b.Integer})],bi.prototype,"version",void 0),u([f({type:H})],bi.prototype,"privateKeyAlgorithm",void 0),u([f({type:iu})],bi.prototype,"privateKey",void 0),u([f({type:ia,implicit:!0,context:0,optional:!0})],bi.prototype,"attributes",void 0);let nu=class extends bi{};nu=u([V({type:_.Sequence})],nu);let ou=class extends Kn{};ou=u([V({type:_.Sequence})],ou);class su{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],su.prototype,"secretTypeId",void 0),u([f({type:b.Any,context:0})],su.prototype,"secretValue",void 0);class wi{constructor(t={}){this.mac=new $n,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:$n})],wi.prototype,"mac",void 0),u([f({type:ae})],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 au=na=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,na.prototype)}};au=na=u([V({type:_.Sequence,itemType:Gn})],au);var oa,sa,aa;const cu="1.2.840.113549.1.9",lu=`${cu}.7`,ca=`${cu}.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([V({type:_.Choice})],Wn);let uu=class extends Nr{};uu=u([V({type:_.Sequence})],uu);let du=class extends zn{};du=u([V({type:_.Sequence})],du);let fu=class extends Kn{};fu=u([V({type:_.Sequence})],fu);let la=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.IA5String})],la.prototype,"value",void 0),la=u([V({type:_.Choice})],la);let pu=class extends Wn{};pu=u([V({type:_.Choice})],pu);let hu=class extends je{};hu=u([V({type:_.Choice})],hu);let ua=class{constructor(t=new Date){this.value=t}};u([f({type:b.GeneralizedTime})],ua.prototype,"value",void 0),ua=u([V({type:_.Choice})],ua);let yu=class extends je{};yu=u([V({type:_.Choice})],yu);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([V({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([V({type:_.Choice})],Jn);let gu=class extends Jn{};gu=u([V({type:_.Choice})],gu);let mu=class extends je{};mu=u([V({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([V({type:_.Choice})],fa);let bu=class extends De{};bu=u([V({type:_.Choice})],bu);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([V({type:_.Choice})],pa);let wu=class extends mt{};wu=u([V({type:_.Sequence})],wu);let Yn=class extends je{};Yn=u([V({type:_.Choice})],Yn);let vu=oa=class extends rr{constructor(t){super(t),Object.setPrototypeOf(this,oa.prototype)}};vu=oa=u([V({type:_.Sequence})],vu);let ku=sa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,sa.prototype)}};ku=sa=u([V({type:_.Set,itemType:Ar})],ku);let ha=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.BmpString})],ha.prototype,"value",void 0),ha=u([V({type:_.Choice})],ha);let ya=class extends H{};ya=u([V({type:_.Sequence})],ya);let Cu=aa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}};Cu=aa=u([V({type:_.Sequence,itemType:ya})],Cu);var ga;let Zn=ga=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Zn=ga=u([V({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 H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pr})],vi.prototype,"certificationRequestInfo",void 0),u([f({type:H})],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.
@@ -110,39 +110,39 @@ ${t.join(`
110
110
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
111
111
  * SOFTWARE.
112
112
  *
113
- */const Qn="crypto.algorithm";class Mh{getAlgorithms(){return nt.resolveAll(Qn)}toAsnAlgorithm(t){({...t});for(const r of this.getAlgorithms()){const n=r.toAsnAlgorithm(t);if(n)return n}if(/^[0-9.]+$/.test(t.name)){const r=new H({algorithm:t.name});if("parameters"in t){const n=t;r.parameters=n.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const n of this.getAlgorithms()){const o=n.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",Su=`${We}.1`,xu=`${We}.2`,Au=`${We}.3`,Bu=`${We}.4`,Iu=`${We}.5`,Eu=`${We}.6`,Nu=`${We}.7`,Ou=`${We}.8`,_u=`${We}.9`,Tu=`${We}.10`,Vu=`${We}.11`,ju=`${We}.12`,Du=`${We}.13`,Mu=`${We}.14`,Pu="brainpoolP160r1",$u="brainpoolP160t1",Ru="brainpoolP192r1",Uu="brainpoolP192t1",Lu="brainpoolP224r1",Hu="brainpoolP224t1",Fu="brainpoolP256r1",qu="brainpoolP256t1",Ku="brainpoolP320r1",zu="brainpoolP320t1",Gu="brainpoolP384r1",Wu="brainpoolP384t1",Ju="brainpoolP512r1",Yu="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=Dl;break;case"K-256":r=eo.SECP256K1;break;case"P-384":r=Ml;break;case"P-521":r=Pl;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;case Yu:r=Mu;break}if(r)return new H({algorithm:yi,parameters:q.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(q.parse(t.parameters,jr).namedCurve){case Dl:return{name:ve,namedCurve:"P-256"};case eo.SECP256K1:return{name:ve,namedCurve:"K-256"};case Ml:return{name:ve,namedCurve:"P-384"};case Pl:return{name:ve,namedCurve:"P-521"};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};case Mu:return{name:ve,namedCurve:Yu}}}}return null}};ki.SECP256K1="1.3.132.0.10",ki=eo=u([Qs()],ki),nt.registerSingleton(Qn,ki);const Zu=Symbol("name"),Qu=Symbol("value");class ue{constructor(t,r={},n=""){this[Zu]=t,this[Qu]=n;for(const o in r)this[o]=r[o]}}ue.NAME=Zu,ue.VALUE=Qu;class Ph{static toTextObject(t){const r=new ue("Algorithm Identifier",{},Ut.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case yi:{const n=new ki().toWebAlgorithm(t);n&&"namedCurve"in n?r["Named Curve"]=n.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={[Ul]:"sha1",[Ll]:"sha224",[Hl]:"sha256",[Fl]:"sha384",[ql]:"sha512",[Dr]:"rsaEncryption",[jn]:"sha1WithRSAEncryption",[yh]:"sha224WithRSAEncryption",[Hs]:"sha256WithRSAEncryption",[Dn]:"sha384WithRSAEncryption",[Mn]:"sha512WithRSAEncryption",[yi]:"ecPublicKey",[$s]:"ecdsaWithSHA1",[jl]:"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
- `)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const n=[];let o=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),n.push(`${o}${t[ue.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")n.push(`${o}${d}${l}`);else if(l instanceof Date)n.push(`${o}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const y of l)y[ue.NAME]=c,n.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,n.push(...this.serializeObj(l,r));else if($.isBufferSource(l))c?(n.push(`${o}${d}`),n.push(...this.serializeBufferSource(l,r+1))):n.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const y=l.toTextObject();y[ue.NAME]=c,n.push(...this.serializeObj(y,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return n}static serializeBufferSource(t,r=0){const n=this.pad(r),o=$.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(`${n}${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=q.serialize(r),this.onInit(r)}else{const r=q.parse(t[0],t[1]);this.rawData=$.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Lt?ec(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return q.toString(this.rawData);case"text":return cr.serialize(this.toTextObject());case"hex":return U.ToHex(this.rawData);case"base64":return U.ToBase64(this.rawData);case"base64url":return U.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 ue(this.getTextName(),{},t)}}Lt.NAME="ASN";class wt extends Lt{constructor(...t){let r;$.isBufferSource(t[0])?r=$.toArrayBuffer(t[0]):r=q.serialize(new lt({extnID:t[0],critical:t[1],extnValue:new ae($.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[ue.NAME]===wt.NAME&&(t[ue.NAME]=Ut.toString(this.type)),t}}var Xu;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[Xu]="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}}Xu=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 ed{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 ed;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`\\${U.ToHex(U.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 ed,this.asn=new Ie;for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)){const o=r[n];this.extraNames.register(n,o)}typeof t=="string"?this.asn=this.fromString(t):t instanceof Ie?this.asn=t:$.isBufferSource(t)?this.asn=q.parse(t,Ie):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||Je.findId(t),n=[];for(const o of this.asn)for(const s of o)s.type===r&&n.push(s.value.toString());return n}getName(t){return this.extraNames.get(t)||Je.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const n=this.getName(r.type)||r.type,o=r.value.anyValue?`#${U.ToHex(r.value.anyValue)}`:Lh(r.value.toString());return`${n}=${o}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const n of this.asn){const o={};for(const s of n){const a=this.getName(s.type)||s.type;(t=o[a])!==null&&t!==void 0||(o[a]=[]),o[a].push(s.value.anyValue?`#${U.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new Ie,n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=n.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=U.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 n of t){const o=new br;for(const s in n){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=n[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=U.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 q.serialize(this.asn)}async getThumbprint(...t){var r;let n,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,n=t[1]||Xe.get()):n=t[0]||Xe.get(),await n.subtle.digest(o,this.toArrayBuffer())}}const td="Cannot initialize GeneralName from ASN.1 data.",rd=`${td} Unsupported string format in use.`,Hh=`${td} Value doesn't match to GUID regular expression.`,id=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,nd="1.3.6.1.4.1.311.25.1",od="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 sd extends Lt{constructor(...t){let r;if(t.length===2)switch(t[0]){case ba:{const n=new Ht(t[1]).toArrayBuffer(),o=q.parse(n,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 n=new RegExp(id,"i").exec(t[1]);if(!n)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=n.slice(1).map((s,a)=>a<3?U.ToHex(new Uint8Array(U.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ei({typeId:nd,value:q.serialize(new ae(U.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:od,value:q.serialize(rl.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 $.isBufferSource(t[0])?r=q.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===nd){this.type=Ca;const r=q.parse(t.otherName.value,ae),n=new RegExp(id,"i").exec(U.ToHex(r));if(!n)throw new Error(Hh);this.value=n.slice(1).map((o,s)=>s<3?U.ToHex(new Uint8Array(U.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===od)this.type=Sa,this.value=q.parse(t.otherName.value,je).toString();else throw new Error(rd);else throw new Error(rd)}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 ue(t,void 0,r)}}class Ci extends Lt{constructor(t){let r;if(t instanceof He)r=t;else if(Array.isArray(t)){const n=[];for(const o of t)if(o instanceof ie)n.push(o);else{const s=q.parse(new sd(o.type,o.value).rawData,ie);n.push(s)}r=new He(n)}else if($.isBufferSource(t))r=q.parse(t,He);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const n of t){let o=null;try{o=new sd(n)}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 n=r.toTextObject();let o=t[n[ue.NAME]];Array.isArray(o)||(o=[],t[n[ue.NAME]]=o),o.push(n)}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})+`,ad=`${qh}${$r}(?:((?:${zh}: ${Gh})+))?${$r}?(${Wh})${Kh}`;class et{static isPem(t){return typeof t=="string"&&new RegExp(ad,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(ad,"g"),n=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${xi}]+`,"g"),""),a={type:o[1],headers:[],rawData:U.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,E]=y.split(/:(.*)/);if(E===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:E.trim()}}d&&a.headers.push(d)}n.push(a)}return n}static decode(t){return this.decodeWithHeaders(t).map(n=>n.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 n=new Array;return r?t.forEach(o=>{if(!$.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");n.push(this.encodeStruct({type:r,rawData:$.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");n.push(this.encodeStruct(o))}),n.join(`
116
- `)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:$.toArrayBuffer(t)})}}static encodeStruct(t){var r;const n=t.type.toLocaleUpperCase(),o=[];if(o.push(`-----BEGIN ${n}-----`),!((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=U.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 ${n}-----`),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 $.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(et.isPem(t))return et.decode(t)[0];if(U.isHex(t))return U.FromHex(t);if(U.isBase64(t))return U.FromBase64(t);if(U.isBase64Url(t))return U.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=U.ToBinary(t);return et.isPem(r)?et.decode(r)[0]:U.isHex(r)?U.FromHex(r):U.isBase64(r)?U.FromBase64(r):U.isBase64Url(r)?U.FromBase64Url(r):$.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,n=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,n=t[1]||n,r=t[2]||Xe.get()):r=t[0]||Xe.get(),r.subtle.importKey("spki",this.rawData,o,!0,n)}onInit(t){const r=nt.resolve(Xn),n=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Dr:{const o=q.parse(t.subjectPublicKey,zs),s=$.toUint8Array(o.modulus);n.publicExponent=$.toUint8Array(o.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let n,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,n=t[1]||Xe.get()):n=t[0]||Xe.get(),await n.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Xe.get());const r=q.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=q.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),n=this.items.get(r.type);return n?new n(t):r}}vt.items=new Map;const ro="crypto.signatureFormatter";class Jh{toAsnSignature(t,r){return $.toArrayBuffer(r)}toWebSignature(t,r){return $.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=q.serialize(r),this.serialNumber=U.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 n=nt.resolve(Xn);this.signatureAlgorithm=n.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(q.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 n,o;const s=t.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(n,["verify"],r);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(n,["verify"],r);else if(s instanceof ur)n={...s.algorithm,...this.signatureAlgorithm},o=await s.export(n,["verify"],r);else if($.isBufferSource(s)){const d=new ur(s);n={...d.algorithm,...this.signatureAlgorithm},o=await d.export(n,["verify"],r)}else n={...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(n,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,n="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(n=t[0]||n,r=t[1])),r??(r=Xe.get()),await r.subtle.digest(n,this.rawData)}async isSelfSigned(t=Xe.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=q.parse(this.rawData,Cr),n=r.tbsCertificate,o=new ue("",{Version:`${kr[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":cr.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new ue("",{"Not Before":n.validity.notBefore.getTime(),"Not After":n.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(n.issuerUniqueID&&(o["Issuer Unique ID"]=n.issuerUniqueID),n.subjectUniqueID&&(o["Subject Unique ID"]=n.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ue("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends wt{static async create(t,r=!1,n=Xe.get()){if(t instanceof io||lr.isCryptoKey(t)){const o=t instanceof io?await t.publicKey.export(n):t,s=await n.subtle.exportKey("spki",o),c=await new ur(s).getKeyIdentifier(n);return new Ai(U.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if($.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new Lo(U.FromHex(t[0]))});super(Uo,t[1],q.serialize(r))}else{const r=t[0],n=r.name instanceof Ci?q.parse(r.name.rawData,He):r.name,o=new tr({authorityCertIssuer:n,authorityCertSerialNumber:U.FromHex(r.serialNumber)});super(Uo,t[1],q.serialize(o))}}onInit(t){super.onInit(t);const r=q.parse(t.extnValue,tr);r.keyIdentifier&&(this.keyId=U.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:U.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.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 cd extends wt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(ll,t[2],q.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}}cd.NAME="Basic Constraints";var ld;(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"})(ld||(ld={}));class ud extends wt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,cn);this.usages=r.map(n=>n)}else{const r=new cn(t[0]);super(yl,t[1],q.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}ud.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($.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,rs);this.usages=r.toNumber()}else{const r=new rs(t[0]);super(ml,t[1],q.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.parse(this.value,rs);return t[""]=r.toJSON().join(", "),t}}Aa.NAME="Key Usages";class no extends wt{static async create(t,r=!1,n=Xe.get()){let o;t instanceof ur?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:$.isBufferSource(t)?o=t:o=await n.subtle.exportKey("spki",t);const a=await new ur(o).getKeyIdentifier(n);return new no(U.ToHex(a),r)}constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,$t);this.keyId=U.ToHex(r)}else{const r=typeof t[0]=="string"?U.FromHex(t[0]):t[0],n=new $t(r);super(Sl,t[1],q.serialize(n)),this.keyId=U.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.parse(this.value,$t);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ba extends wt{constructor(...t){$.isBufferSource(t[0])?super(t[0]):super(kl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=q.parse(t.extnValue,as);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const n in r)t[n]=r[n];return t}}Ba.NAME="Subject Alternative Name";class dd extends wt{constructor(...t){var r;if($.isBufferSource(t[0])){super(t[0]);const n=q.parse(this.value,sn);this.policies=n.map(o=>o.policyIdentifier)}else{const n=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(n.map(a=>new on({policyIdentifier:a})));super(dl,o,q.serialize(s)),this.policies=n}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Ut.toString(r))),t}}dd.NAME="Certificate Policies",vt.register(dl,dd);class Rr extends Lt{constructor(...t){let r;if($.isBufferSource(t[0]))r=$.toArrayBuffer(t[0]);else{const n=t[0],o=Array.isArray(t[1])?t[1].map(s=>$.toArrayBuffer(s)):[];r=q.serialize(new Nt({type:n,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 ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===Rr.NAME&&(t[ue.NAME]=Ut.toString(this.type)),t}}Rr.NAME="Attribute";class fd extends Rr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const n=new Yn({printableString:t[0]});super(lu,[q.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=q.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}fd.NAME="Challenge Password";class Ia extends Rr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const n=t[0],o=new rr;for(const s of n)o.push(q.parse(s.rawData,lt));super(ca,[q.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=q.parse(this.values[0],rr);this.items=r.map(n=>vt.create(q.serialize(n)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(n=>n.toTextObject());for(const n of r)t[n[ue.NAME]]=n;return t}}Ia.NAME="Extensions";class oo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Rr(t),n=this.items.get(r.type);return n?new n(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 H({algorithm:jn,parameters:null});case"sha-256":return new H({algorithm:Hs,parameters:null});case"sha-384":return new H({algorithm:Dn,parameters:null});case"sha-512":return new H({algorithm:Mn,parameters:null})}}else return new H({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 n=$.toUint8Array(r),o=new Uint8Array(t);return o.set(n,t-n.length),o}removePadding(t,r=!1){let n=$.toUint8Array(t);for(let o=0;o<n.length;o++)if(n[o]){n=n.slice(o);break}if(r&&n[0]>127){const o=new Uint8Array(n.length+1);return o.set(n,1),o.buffer}return n.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const n=t.namedCurve,o=ot.namedCurveSize.get(n)||ot.defaultNamedCurveSize,s=new Vn,a=$.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),q.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const n=q.parse(r,Vn),o=t.namedCurve,s=ot.namedCurveSize.get(o)||ot.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(n.r)),c=this.addPadding(s,this.removePadding(n.s));return dp(a,c)}return null}}ot.namedCurveSize=new Map,ot.defaultNamedCurveSize=32;const pd="1.3.101.110",hd="1.3.101.111",yd="1.3.101.112",gd="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=yd;break;case"ed448":r=gd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=pd;break;case"x448":r=hd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case yd:return{name:"EdDSA",namedCurve:"Ed25519"};case gd:return{name:"EdDSA",namedCurve:"Ed448"};case pd:return{name:"ECDH-ES",namedCurve:"X25519"};case hd: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=q.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(q.serialize(o)));const n=this.getAttribute(ca);this.extensions=[],n instanceof Ia&&(this.extensions=n.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},n=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,n,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=q.parse(this.rawData,vi),n=r.certificationRequestInfo,o=new ue("",{Version:`${kr[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ue("",{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(ll,cd),vt.register(yl,ud),vt.register(ml,Aa),vt.register(Sl,no),vt.register(Uo,Ai),vt.register(kl,Ba),oo.register(lu,fd),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 bd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new io(t),n={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)n.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},[]);n.keyUsage=a}return n}}}function Zh(){const e=bd(),t=i.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:bd},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",wd="24px",ny=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},oy=e=>(i.pushScopeId("data-v-13f41aa3"),e=e(),i.popScopeId(),e),sy=["aria-hidden"],ay={key:0,"data-testid":"kui-icon-svg-title"},cy=oy(()=>i.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=i.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:wd,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=i.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 wd}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.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?(i.openBlock(),i.createElementBlock("title",ay,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),cy],8,sy))]),_:1},8,["aria-hidden","style"]))}}),uy=ny(ly,[["__scopeId","data-v-13f41aa3"]]),dy="16px",fy={class:"kong-ui-copy-uuid"},py=["onClick"],vd=15,hy=i.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),n=e,o=t,s=n.notify||i.inject(iy,()=>{}),a=i.computed(()=>n.idTooltip?{label:n.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:n.uuid}),c=i.computed(()=>!!(n.tooltip&&n.successTooltip)),l=i.ref(n.tooltip),d=i.computed(()=>n.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=i.computed(()=>{var w;return n.format==="redacted"?"*****":n.format==="deleted"?`*${(w=n.uuid)==null?void 0:w.substring(0,5)}`:n.uuid}),p=w=>{l.value=w,setTimeout(()=>{l.value=n.tooltip},1800)},E=w=>{var h,g;if(!w(n.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",n.uuid);return}const v=((h=n.uuid)==null?void 0:h.length)>vd,m=n.format==="hidden"||n.format==="redacted"?r("message.success.prefix"):`"${((g=n.uuid)==null?void 0:g.substring(0,vd))+(v?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(n.successTooltip):o("success",n.uuid)};return(w,h)=>{const g=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",fy,[e.format!=="hidden"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),i.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},i.toDisplayString(y.value),3)]),_:1},16)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),i.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:i.withCtx(()=>[i.createVNode(g,null,{default:i.withCtx(({copyToClipboard:v})=>[i.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:i.withModifiers(m=>E(v),["stop"])},[i.createVNode(i.unref(uy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:i.unref(dy),title:i.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,py)]),_:1})]),_:1},16))])}}}),yy=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=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||{}),ce=(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))(ce||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function my(){return{getAxiosInstance:(e={})=>{try{const t=i.inject("get-axios-instance");return typeof t=="function"?t(e):Za.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Za.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function by(){return{debounce:(e,t)=>{let r;return(...n)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...n)},t)}}}}const _a="khcp-user-table-preferences",wy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function vy(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},t=()=>{const r=e(localStorage.getItem(_a));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,n)=>{try{const o=t();o.set(r,n),localStorage.setItem(_a,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const n=t();return(n==null?void 0:n.get(r))||void 0||wy},deleteAllTablePreferences:()=>{localStorage.removeItem(_a)}}}function Ta(e={}){const{getAxiosInstance:t}=my();return{axiosInstance:t(e)}}const ky={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Cy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Sy={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},xy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Ay={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"}},By={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Iy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ey={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ny={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"}},Oy={global:ky,deleteModal:Cy,baseForm:Sy,baseTable:xy,baseConfigCard:Ay,filter:By,debouncedFilter:Iy,errors:Ey,toggleModal:Ny};function Va(){const e=pr.createI18n("en-us",Oy);return{i18n:e,i18nT:pr.i18nTComponent(e)}}function kd(){const e=(r,n)=>(n==null?void 0:n[r])??void 0,t=(r,n)=>{if(r.length!==n.length)return!1;const o=new Set([...r,...n]);for(const s of o){const a=r.filter(l=>l===s).length,c=n.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,n,o)=>{if(o){if(Object.keys(r).length===Object.keys(n).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(n[s])){if(t(r[s],n[s]))continue;return!1}else{if(r[s]===n[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(n)}catch{return!1}},sortAlpha:r=>(n,o)=>{let s=n[r]===void 0||n[r]===null?"":n[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(n[r])&&(s=n[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 _y(e,t,r,n={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=Ta({headers:e.requestHeaders}),{i18n:{t:s}}=Va(),{debounce:a}=by(),c=a(async S=>{await A(S)},200),l=i.ref(!1),d=i.ref(""),y=i.ref(""),p=i.ref([]),E=i.ref([]),w=i.ref(void 0),h=i.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:v}=kd(),m=async()=>{try{l.value=!0;const{data:S}=await o.get(`${g}?size=${r}`);S!=null&&S.next||(w.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[]),E.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[],p.value=E.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},C=i.ref(""),A=async S=>{var I,T,Q;if(C.value!==S)if(C.value=S||"",w.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let O=g+"";S&&(O+=`/${S}`);const{data:B}=await o.get(`${O}?size=${r}`);n.fetchedItemsKey in B?p.value=B[n.fetchedItemsKey]:B!=null&&B.id?p.value=[B]:p.value=[]}else if(S){const O=[];v(S)&&n.searchKeys.includes("id")?O.push((async()=>{const{data:W}=await o.get(`${g}/${S}`);return[W[n.fetchedItemsKey]??W]})()):O.push(...n.searchKeys.filter(W=>W!=="id").map(async W=>{const{data:M}=await o.get(`${g}?${W}=${S}`);return M[n.fetchedItemsKey]}));const B=await Promise.all(O),Y=new Set;p.value=[],(I=B==null?void 0:B.forEach)==null||I.call(B,W=>{var M;(M=W==null?void 0:W.forEach)==null||M.call(W,J=>{Y.has(J.id)||(Y.add(J.id),p.value.push(J))})})}else p.value=E.value}catch(O){((T=O==null?void 0:O.response)==null?void 0:T.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="",S?(p.value=(Q=w.value)==null?void 0:Q.filter(O=>{var B;let Y=!1;for(const W of n.searchKeys){const M=typeof O[W]=="string"?(B=O[W])==null?void 0:B.toLowerCase():O[W];M!=null&&M.includes(S.toLowerCase())&&(Y=!0)}return Y}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:w,loadItems:m,debouncedQueryChange:c}}function Ty(e,t){const r=i.unref(t),n=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return n.value.search="",o=>`${n.value.href}/${o}`}function Vy(){const{i18n:{t:e}}=Va();return{getMessageFromError:t=>{var r,n,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((n=t==null?void 0:t.response)!=null&&n.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 jy(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const n=e.join("/"),o=`${r}${n}`,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}${n}`;throw new Error("Invalid url")}catch(n){return console.warn("Failed to build valid URL:",n),""}}function Cd(e,t){const r=i.ref(i.unref(e)),n=i.ref(i.unref(t)),o=i.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=i.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:E}=a;try{let w=new URL(s.value.href);return o.value&&E?(w.search="",w=r.value.app==="konnect"?new URL(`${w.href}?filter[name][contains]=${E}`):new URL(`${w.href}/${E}/`)):(o.value||new URLSearchParams(E).forEach((h,g)=>{w.searchParams.append(g,h)}),y&&w.searchParams.append("sort_by",y),p==="desc"&&w.searchParams.append("sort_desc","1"),w.searchParams.append("size",String(l))),d&&c!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),n.value}}}function Dy(e,t,r="data"){const n=i.unref(t),{axiosInstance:o}=Ta({headers:e.requestHeaders}),s=Cd(e,n),a=i.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 E={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ft.Idle,response:E},E}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 My(){const e=(r,n="_")=>r?r.split(n).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,n=>n.toUpperCase()):"",convertKeyToTitle:e}}const Sd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,xd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Sd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ad=e=>e==="*"||e==="x"||e==="X",Bd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Py=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],$y=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,n]=Py(Bd(e),Bd(t));return r>n?1:r<n?-1:0},Id=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=$y(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0},Ry=(e,t)=>{const r=xd(e),n=xd(t),o=r.pop(),s=n.pop(),a=Id(r,n);return a!==0?a:o&&s?Id(o.split("."),s.split(".")):o||s?o?-1:1:0},Ed=(e,t,r)=>{Uy(r);const n=Ry(e,t);return Nd[r].includes(n)},Nd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Od=Object.keys(Nd),Uy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Od.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Od.join("|")}`)},Ly=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Sd.test(e);function Hy(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:n,version:o}=t;if(!Ly(o))return console.error("Invalid version"),!1;const s=r[n];if(!s)return!1;const[a,c]=s;return!(a&&Ed(o,a,"<")||c&&Ed(o,c,">"))}function Fy(e){const t=i.ref(0),r=i.ref(0),n=i.ref(!1);return i.watch(e,o=>{o&&!n.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,n.value=!0)}),{isTruncated:i.computed(()=>t.value<r.value)}}const Te={useAxios:Ta,useDebouncedFilter:_y,useDeleteUrlBuilder:Ty,useErrors:Vy,useExternalLinkCreator:jy,useFetcher:Dy,useFetchUrlBuilder:Cd,useHelpers:kd,useStringHelpers:My,useI18n:Va,useGatewayFeatureSupported:Hy,useTruncationDetector:Fy},qy={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ky="Copy to clipboard",zy={message:qy,iconTitle:Ky},Gy="kong-ui-copy-uuid-notify",_d="24px",Wy=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},Jy=e=>(i.pushScopeId("data-v-13f41aa3"),e=e(),i.popScopeId(),e),Yy=["aria-hidden"],Zy={key:0,"data-testid":"kui-icon-svg-title"},Qy=Jy(()=>i.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)),Xy=i.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:_d,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=i.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 _d}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.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?(i.openBlock(),i.createElementBlock("title",Zy,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),Qy],8,Yy))]),_:1},8,["aria-hidden","style"]))}}),eg=Wy(Xy,[["__scopeId","data-v-13f41aa3"]]),tg="16px",rg={class:"kong-ui-copy-uuid"},ig=["onClick"],Td=15,ng=i.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",zy),n=e,o=t,s=n.notify||i.inject(Gy,()=>{}),a=i.computed(()=>n.idTooltip?{label:n.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:n.uuid}),c=i.computed(()=>!!(n.tooltip&&n.successTooltip)),l=i.ref(n.tooltip),d=i.computed(()=>n.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=i.computed(()=>{var w;return n.format==="redacted"?"*****":n.format==="deleted"?`*${(w=n.uuid)==null?void 0:w.substring(0,5)}`:n.uuid}),p=w=>{l.value=w,setTimeout(()=>{l.value=n.tooltip},1800)},E=w=>{var h,g;if(!w(n.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",n.uuid);return}const v=((h=n.uuid)==null?void 0:h.length)>Td,m=n.format==="hidden"||n.format==="redacted"?r("message.success.prefix"):`"${((g=n.uuid)==null?void 0:g.substring(0,Td))+(v?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(n.successTooltip):o("success",n.uuid)};return(w,h)=>{const g=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",rg,[e.format!=="hidden"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),i.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},i.toDisplayString(y.value),3)]),_:1},16)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),i.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:i.withCtx(()=>[i.createVNode(g,null,{default:i.withCtx(({copyToClipboard:v})=>[i.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:i.withModifiers(m=>E(v),["stop"])},[i.createVNode(i.unref(eg),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:i.unref(tg),title:i.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,ig)]),_:1})]),_:1},16))])}}}),og=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},Vd=og(ng,[["__scopeId","data-v-0c07874b"]]),sg={key:0,class:"config-card-fieldset-title"},ag=i.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:n}=Te.useStringHelpers(),o=i.computed(()=>t.item.key??"json-array-item"),s=i.computed(()=>t.item.value??t.item),a=i.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=i.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?n(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:i.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:i.withCtx(()=>[e.isArrayItem?(i.openBlock(),i.createElementBlock("legend",sg,[i.createElementVNode("b",null,i.toDisplayString(c.value),1)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(a.value),(y,p)=>(i.openBlock(),i.createBlock(Ii,{key:`${o.value}-property-${p}`,item:{key:y,label:i.unref(n)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),dt=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},jd=dt(ag,[["__scopeId","data-v-68ca83ec"]]),cg=i.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Te.useI18n();return(r,n)=>{const o=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:n[0]||(n[0]=s=>r.$emit("navigation-click",e.item))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.value||i.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),lg=dt(cg,[["__scopeId","data-v-c96811e5"]]),ug=i.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Te.useI18n();return(r,n)=>{const o=i.resolveComponent("KBadge");return i.openBlock(),i.createBlock(o,{appearance:e.status?"success":"neutral"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.status?i.unref(t)("baseConfigCard.statusBadge.enabledLabel"):i.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),dg="#0044f4",fg="#e0e4ea",pg="#3a3f51",hg="1px",yg="20px",gg={class:"config-card-details-row"},mg=["data-testid"],bg=["data-testid"],wg=["data-testid"],vg=["data-testid"],kg={key:1},Cg=["data-testid"],Sg=["data-testid"],xg=["data-testid"],Ag=["data-testid"],Bg={name:"ConfigCardItem",components:{CopyUuid:Vd,JsonCardItem:jd,StatusBadge:ug,InternalLinkItem:lg}},Ig=i.defineComponent({...Bg,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}){i.useCssVars(h=>({"5ae2770e":y.value?"none":`solid ${i.unref(hg)} ${i.unref(fg)}`,"4db3977e":d.value&&c.value?"block":"flex","1a7c5e02":d.value&&c.value?"100%":r.slim?"50%":"25%","1a77d24c":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,n=t,o=i.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Te.useI18n(),c=i.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=i.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=i.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=i.computed(()=>r.item.type===ce.JsonArray),p=i.computed(()=>{switch(r.item.type){case ce.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 ce.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 ce.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 ce.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 ce.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case ce.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ce.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ce.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{n("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.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}}}),E=i.ref(),{isTruncated:w}=Te.useTruncationDetector(E);return(h,g)=>{const v=i.resolveComponent("KLabel"),m=i.resolveComponent("KBadge"),C=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("div",gg,[i.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[i.renderSlot(h.$slots,"label",{item:e.item},()=>[i.createVNode(v,{"tooltip-attributes":{maxWidth:"500px"}},i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:i.withCtx(()=>[i.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[i.renderSlot(h.$slots,"label-tooltip",{},()=>[i.createTextVNode(i.toDisplayString(e.item.tooltip),1)],!0)],8,bg)]),key:"0"}:void 0]),1024)],!0)],8,mg),i.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[i.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(i.openBlock(),i.createElementBlock("div",kg,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(p.value.tag),i.normalizeProps(i.guardReactiveProps(p.value.attrs)),{default:i.withCtx(()=>[p.value.additionalComponent==="KBadge"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(A,S)=>(i.openBlock(),i.createBlock(m,{key:`${e.item.key}-badge-tag-${S}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${S}`,tooltip:A,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(A),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Cg)):i.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(A,S)=>(i.openBlock(),i.createBlock(i.unref(Vd),i.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${S}`,"data-testid":`${e.item.key}-copy-uuid-${S}`,uuid:A}),null,16,["data-testid","uuid"]))),128))],8,Sg)):p.value.additionalComponent==="KMethodBadge"?(i.openBlock(),i.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(A,S)=>(i.openBlock(),i.createBlock(m,{key:`${e.item.key}-badge-method-${S}`,appearance:Object.values(i.unref(sp.BadgeMethodAppearances)).includes(A.toLowerCase())?A.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${S}`},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(A),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,xg)):i.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(i.openBlock(),i.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(A,S)=>(i.openBlock(),i.createBlock(jd,{key:`json-array-item-${S}`,index:S,"is-array-item":"",item:A},null,8,["index","item"]))),128))],8,Ag)):(i.openBlock(),i.createBlock(C,{key:4,text:i.unref(w)?e.item.value:""},{default:i.withCtx(()=>[i.createElementVNode("span",{ref_key:"textContent",ref:E,class:i.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},i.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,vg))],!0)],8,wg)])}}}),Ii=dt(Ig,[["__scopeId","data-v-f65fc52c"]]),Eg={class:"json-config"},Ng={key:0,class:"json-endpoint"},Dd=i.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){i.useCssVars(o=>({"2d178975":`${n.value}ch`}));const t=e,r=i.computed(()=>t.jsonRecord),n=i.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=i.resolveComponent("KBadge"),l=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",Eg,[t.fetcherUrl&&(a=t.config)!=null&&a.jsonYamlFormsEnabled?(i.openBlock(),i.createElementBlock("div",Ng,[i.createVNode(c,{appearance:t.requestMethod},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),i.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):i.createCommentVNode("",!0),t.jsonRecord?(i.openBlock(),i.createBlock(l,{key:1,id:"json-codeblock",class:i.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):i.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Md(e){return typeof e>"u"||e===null}function Og(e){return typeof e=="object"&&e!==null}function _g(e){return Array.isArray(e)?e:Md(e)?[]:[e]}function Tg(e,t){var r,n,o,s;if(t)for(s=Object.keys(t),r=0,n=s.length;r<n;r+=1)o=s[r],e[o]=t[o];return e}function Vg(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function jg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Dg=Md,Mg=Og,Pg=_g,$g=Vg,Rg=jg,Ug=Tg,Ne={isNothing:Dg,isObject:Mg,toArray:Pg,repeat:$g,isNegativeZero:Rg,extend:Ug};function Pd(e,t){var r="",n=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+=`
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 H({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",Su=`${We}.1`,xu=`${We}.2`,Au=`${We}.3`,Bu=`${We}.4`,Iu=`${We}.5`,Eu=`${We}.6`,Nu=`${We}.7`,Ou=`${We}.8`,_u=`${We}.9`,Tu=`${We}.10`,Vu=`${We}.11`,ju=`${We}.12`,Du=`${We}.13`,Mu=`${We}.14`,Pu="brainpoolP160r1",$u="brainpoolP160t1",Ru="brainpoolP192r1",Uu="brainpoolP192t1",Lu="brainpoolP224r1",Hu="brainpoolP224t1",Fu="brainpoolP256r1",qu="brainpoolP256t1",Ku="brainpoolP320r1",zu="brainpoolP320t1",Gu="brainpoolP384r1",Wu="brainpoolP384t1",Ju="brainpoolP512r1",Yu="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=Dl;break;case"K-256":r=eo.SECP256K1;break;case"P-384":r=Ml;break;case"P-521":r=Pl;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;case Yu:r=Mu;break}if(r)return new H({algorithm:yi,parameters:q.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(q.parse(t.parameters,jr).namedCurve){case Dl:return{name:ve,namedCurve:"P-256"};case eo.SECP256K1:return{name:ve,namedCurve:"K-256"};case Ml:return{name:ve,namedCurve:"P-384"};case Pl:return{name:ve,namedCurve:"P-521"};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};case Mu:return{name:ve,namedCurve:Yu}}}}return null}};ki.SECP256K1="1.3.132.0.10",ki=eo=u([Qs()],ki),nt.registerSingleton(Qn,ki);const Zu=Symbol("name"),Qu=Symbol("value");class ue{constructor(t,r={},i=""){this[Zu]=t,this[Qu]=i;for(const o in r)this[o]=r[o]}}ue.NAME=Zu,ue.VALUE=Qu;class Ph{static toTextObject(t){const r=new ue("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={[Ul]:"sha1",[Ll]:"sha224",[Hl]:"sha256",[Fl]:"sha384",[ql]:"sha512",[Dr]:"rsaEncryption",[jn]:"sha1WithRSAEncryption",[yh]:"sha224WithRSAEncryption",[Hs]:"sha256WithRSAEncryption",[Dn]:"sha384WithRSAEncryption",[Mn]:"sha512WithRSAEncryption",[yi]:"ecPublicKey",[$s]:"ecdsaWithSHA1",[jl]:"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
+ `)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ue.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[ue.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,i.push(...this.serializeObj(l,r));else if($.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[ue.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=$.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=q.serialize(r),this.onInit(r)}else{const r=q.parse(t[0],t[1]);this.rawData=$.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Lt?ec(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return q.toString(this.rawData);case"text":return cr.serialize(this.toTextObject());case"hex":return U.ToHex(this.rawData);case"base64":return U.ToBase64(this.rawData);case"base64url":return U.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 ue(this.getTextName(),{},t)}}Lt.NAME="ASN";class wt extends Lt{constructor(...t){let r;$.isBufferSource(t[0])?r=$.toArrayBuffer(t[0]):r=q.serialize(new lt({extnID:t[0],critical:t[1],extnValue:new ae($.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[ue.NAME]===wt.NAME&&(t[ue.NAME]=Ut.toString(this.type)),t}}var Xu;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[Xu]="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}}Xu=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 ed{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 ed;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`\\${U.ToHex(U.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 ed,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:$.isBufferSource(t)?this.asn=q.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?`#${U.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?`#${U.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=U.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=U.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 q.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 td="Cannot initialize GeneralName from ASN.1 data.",rd=`${td} Unsupported string format in use.`,Hh=`${td} Value doesn't match to GUID regular expression.`,id=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,nd="1.3.6.1.4.1.311.25.1",od="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 sd extends Lt{constructor(...t){let r;if(t.length===2)switch(t[0]){case ba:{const i=new Ht(t[1]).toArrayBuffer(),o=q.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(id,"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?U.ToHex(new Uint8Array(U.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ei({typeId:nd,value:q.serialize(new ae(U.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:od,value:q.serialize(rl.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 $.isBufferSource(t[0])?r=q.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===nd){this.type=Ca;const r=q.parse(t.otherName.value,ae),i=new RegExp(id,"i").exec(U.ToHex(r));if(!i)throw new Error(Hh);this.value=i.slice(1).map((o,s)=>s<3?U.ToHex(new Uint8Array(U.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===od)this.type=Sa,this.value=q.parse(t.otherName.value,je).toString();else throw new Error(rd);else throw new Error(rd)}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 ue(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=q.parse(new sd(o.type,o.value).rawData,ie);i.push(s)}r=new He(i)}else if($.isBufferSource(t))r=q.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 sd(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[ue.NAME]];Array.isArray(o)||(o=[],t[i[ue.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})+`,ad=`${qh}${$r}(?:((?:${zh}: ${Gh})+))?${$r}?(${Wh})${Kh}`;class et{static isPem(t){return typeof t=="string"&&new RegExp(ad,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(ad,"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:U.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,E]=y.split(/:(.*)/);if(E===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:E.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(!$.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:$.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
+ `)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:$.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=U.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 $.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(et.isPem(t))return et.decode(t)[0];if(U.isHex(t))return U.FromHex(t);if(U.isBase64(t))return U.FromBase64(t);if(U.isBase64Url(t))return U.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=U.ToBinary(t);return et.isPem(r)?et.decode(r)[0]:U.isHex(r)?U.FromHex(r):U.isBase64(r)?U.FromBase64(r):U.isBase64Url(r)?U.FromBase64Url(r):$.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=q.parse(t.subjectPublicKey,zs),s=$.toUint8Array(o.modulus);i.publicExponent=$.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=q.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=q.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 $.toArrayBuffer(r)}toWebSignature(t,r){return $.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=q.serialize(r),this.serialNumber=U.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(q.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($.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=q.parse(this.rawData,Cr),i=r.tbsCertificate,o=new ue("",{Version:`${kr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":cr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"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 ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ue("",{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(U.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if($.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new Lo(U.FromHex(t[0]))});super(Uo,t[1],q.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?q.parse(r.name.rawData,He):r.name,o=new tr({authorityCertIssuer:i,authorityCertSerialNumber:U.FromHex(r.serialNumber)});super(Uo,t[1],q.serialize(o))}}onInit(t){super.onInit(t);const r=q.parse(t.extnValue,tr);r.keyIdentifier&&(this.keyId=U.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:U.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.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 cd extends wt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(ll,t[2],q.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}}cd.NAME="Basic Constraints";var ld;(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"})(ld||(ld={}));class ud extends wt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(yl,t[1],q.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}ud.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($.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,rs);this.usages=r.toNumber()}else{const r=new rs(t[0]);super(ml,t[1],q.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.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:$.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new ur(o).getKeyIdentifier(i);return new no(U.ToHex(a),r)}constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,$t);this.keyId=U.ToHex(r)}else{const r=typeof t[0]=="string"?U.FromHex(t[0]):t[0],i=new $t(r);super(Sl,t[1],q.serialize(i)),this.keyId=U.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.parse(this.value,$t);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ba extends wt{constructor(...t){$.isBufferSource(t[0])?super(t[0]):super(kl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=q.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 dd extends wt{constructor(...t){var r;if($.isBufferSource(t[0])){super(t[0]);const i=q.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(dl,o,q.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Ut.toString(r))),t}}dd.NAME="Certificate Policies",vt.register(dl,dd);class Rr extends Lt{constructor(...t){let r;if($.isBufferSource(t[0]))r=$.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>$.toArrayBuffer(s)):[];r=q.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 ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===Rr.NAME&&(t[ue.NAME]=Ut.toString(this.type)),t}}Rr.NAME="Attribute";class fd extends Rr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(lu,[q.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=q.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}fd.NAME="Challenge Password";class Ia extends Rr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new rr;for(const s of i)o.push(q.parse(s.rawData,lt));super(ca,[q.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=q.parse(this.values[0],rr);this.items=r.map(i=>vt.create(q.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ue.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 H({algorithm:jn,parameters:null});case"sha-256":return new H({algorithm:Hs,parameters:null});case"sha-384":return new H({algorithm:Dn,parameters:null});case"sha-512":return new H({algorithm:Mn,parameters:null})}}else return new H({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=$.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=$.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=$.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),q.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=q.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 pd="1.3.101.110",hd="1.3.101.111",yd="1.3.101.112",gd="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=yd;break;case"ed448":r=gd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=pd;break;case"x448":r=hd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case yd:return{name:"EdDSA",namedCurve:"Ed25519"};case gd:return{name:"EdDSA",namedCurve:"Ed448"};case pd:return{name:"ECDH-ES",namedCurve:"X25519"};case hd: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=q.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(q.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=q.parse(this.rawData,vi),i=r.certificationRequestInfo,o=new ue("",{Version:`${kr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ue("",{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(ll,cd),vt.register(yl,ud),vt.register(ml,Aa),vt.register(Sl,no),vt.register(Uo,Ai),vt.register(kl,Ba),oo.register(lu,fd),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 bd(){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=bd(),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:bd},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",wd="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-13f41aa3"),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:wd,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 wd}),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-13f41aa3"]]),dy="16px",fy={class:"kong-ui-copy-uuid"},py=["onClick"],vd=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 w;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(w=i.uuid)==null?void 0:w.substring(0,5)}`:i.uuid}),p=w=>{l.value=w,setTimeout(()=>{l.value=i.tooltip},1800)},E=w=>{var h,g;if(!w(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const v=((h=i.uuid)==null?void 0:h.length)>vd,m=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((g=i.uuid)==null?void 0:g.substring(0,vd))+(v?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(w,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:v})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>E(v),["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||{}),ce=(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))(ce||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function my(){return{getAxiosInstance:(e={})=>{try{const t=n.inject("get-axios-instance");return typeof t=="function"?t(e):Za.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Za.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function by(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const _a="khcp-user-table-preferences",wy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function vy(){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(_a));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(_a,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||wy},deleteAllTablePreferences:()=>{localStorage.removeItem(_a)}}}function Ta(e={}){const{getAxiosInstance:t}=my();return{axiosInstance:t(e)}}const ky={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Cy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Sy={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},xy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Ay={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"}},By={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Iy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ey={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ny={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"}},Oy={global:ky,deleteModal:Cy,baseForm:Sy,baseTable:xy,baseConfigCard:Ay,filter:By,debouncedFilter:Iy,errors:Ey,toggleModal:Ny};function Va(){const e=pr.createI18n("en-us",Oy);return{i18n:e,i18nT:pr.i18nTComponent(e)}}function kd(){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 _y(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=Ta({headers:e.requestHeaders}),{i18n:{t:s}}=Va(),{debounce:a}=by(),c=a(async S=>{await A(S)},200),l=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),E=n.ref([]),w=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:v}=kd(),m=async()=>{try{l.value=!0;const{data:S}=await o.get(`${g}?size=${r}`);S!=null&&S.next||(w.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[]),E.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[],p.value=E.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},C=n.ref(""),A=async S=>{var I,T,Q;if(C.value!==S)if(C.value=S||"",w.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let O=g+"";S&&(O+=`/${S}`);const{data:B}=await o.get(`${O}?size=${r}`);i.fetchedItemsKey in B?p.value=B[i.fetchedItemsKey]:B!=null&&B.id?p.value=[B]:p.value=[]}else if(S){const O=[];v(S)&&i.searchKeys.includes("id")?O.push((async()=>{const{data:W}=await o.get(`${g}/${S}`);return[W[i.fetchedItemsKey]??W]})()):O.push(...i.searchKeys.filter(W=>W!=="id").map(async W=>{const{data:M}=await o.get(`${g}?${W}=${S}`);return M[i.fetchedItemsKey]}));const B=await Promise.all(O),Y=new Set;p.value=[],(I=B==null?void 0:B.forEach)==null||I.call(B,W=>{var M;(M=W==null?void 0:W.forEach)==null||M.call(W,J=>{Y.has(J.id)||(Y.add(J.id),p.value.push(J))})})}else p.value=E.value}catch(O){((T=O==null?void 0:O.response)==null?void 0:T.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="",S?(p.value=(Q=w.value)==null?void 0:Q.filter(O=>{var B;let Y=!1;for(const W of i.searchKeys){const M=typeof O[W]=="string"?(B=O[W])==null?void 0:B.toLowerCase():O[W];M!=null&&M.includes(S.toLowerCase())&&(Y=!0)}return Y}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:w,loadItems:m,debouncedQueryChange:c}}function Ty(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 Vy(){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 jy(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 Cd(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:E}=a;try{let w=new URL(s.value.href);return o.value&&E?(w.search="",w=r.value.app==="konnect"?new URL(`${w.href}?filter[name][contains]=${E}`):new URL(`${w.href}/${E}/`)):(o.value||new URLSearchParams(E).forEach((h,g)=>{w.searchParams.append(g,h)}),y&&w.searchParams.append("sort_by",y),p==="desc"&&w.searchParams.append("sort_desc","1"),w.searchParams.append("size",String(l))),d&&c!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),i.value}}}function Dy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=Ta({headers:e.requestHeaders}),s=Cd(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 E={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ft.Idle,response:E},E}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 My(){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 Sd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,xd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Sd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ad=e=>e==="*"||e==="x"||e==="X",Bd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Py=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],$y=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,i]=Py(Bd(e),Bd(t));return r>i?1:r<i?-1:0},Id=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=$y(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Ry=(e,t)=>{const r=xd(e),i=xd(t),o=r.pop(),s=i.pop(),a=Id(r,i);return a!==0?a:o&&s?Id(o.split("."),s.split(".")):o||s?o?-1:1:0},Ed=(e,t,r)=>{Uy(r);const i=Ry(e,t);return Nd[r].includes(i)},Nd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Od=Object.keys(Nd),Uy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Od.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Od.join("|")}`)},Ly=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Sd.test(e);function Hy(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Ly(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Ed(o,a,"<")||c&&Ed(o,c,">"))}function Fy(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:Ta,useDebouncedFilter:_y,useDeleteUrlBuilder:Ty,useErrors:Vy,useExternalLinkCreator:jy,useFetcher:Dy,useFetchUrlBuilder:Cd,useHelpers:kd,useStringHelpers:My,useI18n:Va,useGatewayFeatureSupported:Hy,useTruncationDetector:Fy},qy={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ky="Copy to clipboard",zy={message:qy,iconTitle:Ky},Gy="kong-ui-copy-uuid-notify",_d="24px",Wy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Jy=e=>(n.pushScopeId("data-v-13f41aa3"),e=e(),n.popScopeId(),e),Yy=["aria-hidden"],Zy={key:0,"data-testid":"kui-icon-svg-title"},Qy=Jy(()=>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)),Xy=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:_d,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 _d}),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",Zy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Qy],8,Yy))]),_:1},8,["aria-hidden","style"]))}}),eg=Wy(Xy,[["__scopeId","data-v-13f41aa3"]]),tg="16px",rg={class:"kong-ui-copy-uuid"},ig=["onClick"],Td=15,ng=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",zy),i=e,o=t,s=i.notify||n.inject(Gy,()=>{}),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 w;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(w=i.uuid)==null?void 0:w.substring(0,5)}`:i.uuid}),p=w=>{l.value=w,setTimeout(()=>{l.value=i.tooltip},1800)},E=w=>{var h,g;if(!w(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const v=((h=i.uuid)==null?void 0:h.length)>Td,m=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((g=i.uuid)==null?void 0:g.substring(0,Td))+(v?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(w,h)=>{const g=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",rg,[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:v})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>E(v),["stop"])},[n.createVNode(n.unref(eg),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(tg),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,ig)]),_:1})]),_:1},16))])}}}),og=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Vd=og(ng,[["__scopeId","data-v-0c07874b"]]),sg={key:0,class:"config-card-fieldset-title"},ag=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",sg,[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},jd=dt(ag,[["__scopeId","data-v-68ca83ec"]]),cg=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})])}}}),lg=dt(cg,[["__scopeId","data-v-c96811e5"]]),ug=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"])}}}),dg="#0044f4",fg="#e0e4ea",pg="#3a3f51",hg="1px",yg="20px",gg={class:"config-card-details-row"},mg=["data-testid"],bg=["data-testid"],wg=["data-testid"],vg=["data-testid"],kg={key:1},Cg=["data-testid"],Sg=["data-testid"],xg=["data-testid"],Ag=["data-testid"],Bg={name:"ConfigCardItem",components:{CopyUuid:Vd,JsonCardItem:jd,StatusBadge:ug,InternalLinkItem:lg}},Ig=n.defineComponent({...Bg,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=>({"5ae2770e":y.value?"none":`solid ${n.unref(hg)} ${n.unref(fg)}`,"4db3977e":d.value&&c.value?"block":"flex","1a7c5e02":d.value&&c.value?"100%":r.slim?"50%":"25%","1a77d24c":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===ce.Json||r.item.type===ce.JsonArray),y=n.computed(()=>r.item.type===ce.JsonArray),p=n.computed(()=>{switch(r.item.type){case ce.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 ce.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 ce.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 ce.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 ce.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case ce.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ce.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ce.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.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}}}),E=n.ref(),{isTruncated:w}=Te.useTruncationDetector(E);return(h,g)=>{const v=n.resolveComponent("KLabel"),m=n.resolveComponent("KBadge"),C=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",gg,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(v,{"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,bg)]),key:"0"}:void 0]),1024)],!0)],8,mg),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",kg,[(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,(A,S)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-tag-${S}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${S}`,tooltip:A,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(A),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Cg)):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,(A,S)=>(n.openBlock(),n.createBlock(n.unref(Vd),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${S}`,"data-testid":`${e.item.key}-copy-uuid-${S}`,uuid:A}),null,16,["data-testid","uuid"]))),128))],8,Sg)):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,(A,S)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-method-${S}`,appearance:Object.values(n.unref(sp.BadgeMethodAppearances)).includes(A.toLowerCase())?A.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${S}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(A),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,xg)):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,(A,S)=>(n.openBlock(),n.createBlock(jd,{key:`json-array-item-${S}`,index:S,"is-array-item":"",item:A},null,8,["index","item"]))),128))],8,Ag)):(n.openBlock(),n.createBlock(C,{key:4,text:n.unref(w)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:E,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,vg))],!0)],8,wg)])}}}),Ii=dt(Ig,[["__scopeId","data-v-f65fc52c"]]),Eg={class:"json-config"},Ng={key:0,class:"json-endpoint"},Dd=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=>({"2d178975":`${i.value}ch`}));const t=e,r=n.computed(()=>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",Eg,[t.fetcherUrl&&(a=t.config)!=null&&a.jsonYamlFormsEnabled?(n.openBlock(),n.createElementBlock("div",Ng,[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.value,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 Md(e){return typeof e>"u"||e===null}function Og(e){return typeof e=="object"&&e!==null}function _g(e){return Array.isArray(e)?e:Md(e)?[]:[e]}function Tg(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 Vg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function jg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Dg=Md,Mg=Og,Pg=_g,$g=Vg,Rg=jg,Ug=Tg,Ne={isNothing:Dg,isObject:Mg,toArray:Pg,repeat:$g,isNegativeZero:Rg,extend:Ug};function Pd(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),n+" "+r):n}function Ei(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Pd(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+": "+Pd(this,e)};var Fe=Ei;function ja(e,t,r,n,o){var s="",a="",c=Math.floor(o/2)-1;return n-t>c&&(s=" ... ",t=n-c+s.length),r-n>c&&(a=" ...",r=n+c-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:n-t+s.length}}function Da(e,t){return Ne.repeat(" ",t-e.length)+e}function Lg(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,n=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),n.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.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,n[a-l],o[a-l],e.position-(n[a]-n[a-l]),p),c=Ne.repeat(" ",t.indent)+Da((e.line-l+1).toString(),y)+" | "+d.str+`
120
- `+c;for(d=ja(e.buffer,n[a],o[a],e.position,p),c+=Ne.repeat(" ",t.indent)+Da((e.line+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=Pd(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+": "+Pd(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 Lg(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
+ `+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
- `,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)d=ja(e.buffer,n[a+l],o[a+l],e.position-(n[a]-n[a+l]),p),c+=Ne.repeat(" ",t.indent)+Da((e.line+l+1).toString(),y)+" | "+d.str+`
123
- `;return c.replace(/\n$/,"")}var Hg=Lg,Fg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],qg=["scalar","sequence","mapping"];function Kg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function zg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Fg.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=Kg(t.styleAliases||null),qg.indexOf(this.kind)===-1)throw new Fe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Me=zg;function $d(e,t){var r=[];return e[t].forEach(function(n){var o=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(o=a)}),r[o]=n}),r}function Gg(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(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(n);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 n=Object.create(Ma.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=$d(n,"implicit"),n.compiledExplicit=$d(n,"explicit"),n.compiledTypeMap=Gg(n.compiledImplicit,n.compiledExplicit),n};var Rd=Ma,Ud=new Me("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ld=new Me("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Hd=new Me("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Fd=new Rd({explicit:[Ud,Ld,Hd]});function Wg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Jg(){return null}function Yg(e){return e===null}var qd=new Me("tag:yaml.org,2002:null",{kind:"scalar",resolve:Wg,construct:Jg,predicate:Yg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Zg(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 Qg(e){return e==="true"||e==="True"||e==="TRUE"}function Xg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Kd=new Me("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Zg,construct:Qg,predicate:Xg,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 em(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function tm(e){return 48<=e&&e<=55}function rm(e){return 48<=e&&e<=57}function im(e){if(e===null)return!1;var t=e.length,r=0,n=!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;n=!0}return n&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!em(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!tm(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!rm(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function nm(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="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 om(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ne.isNegativeZero(e)}var zd=new Me("tag:yaml.org,2002:int",{kind:"scalar",resolve:im,construct:nm,predicate:om,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"]}}),sm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function am(e){return!(e===null||!sm.test(e)||e[e.length-1]==="_")}function cm(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 lm=/^[-+]?[0-9]+e/;function um(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),lm.test(r)?r.replace("e",".e"):r}function dm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ne.isNegativeZero(e))}var Gd=new Me("tag:yaml.org,2002:float",{kind:"scalar",resolve:am,construct:cm,predicate:dm,represent:um,defaultStyle:"lowercase"}),Wd=Fd.extend({implicit:[qd,Kd,zd,Gd]}),Jd=Wd,Yd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Zd=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 fm(e){return e===null?!1:Yd.exec(e)!==null||Zd.exec(e)!==null}function pm(e){var t,r,n,o,s,a,c,l=0,d=null,y,p,E;if(t=Yd.exec(e),t===null&&(t=Zd.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,n,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)),E=new Date(Date.UTC(r,n,o,s,a,c,l)),d&&E.setTime(E.getTime()-d),E}function hm(e){return e.toISOString()}var Qd=new Me("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:fm,construct:pm,instanceOf:Date,represent:hm});function ym(e){return e==="<<"||e===null}var Xd=new Me("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ym}),Pa=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
124
- \r`;function gm(e){if(e===null)return!1;var t,r,n=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;n+=6}return n%8===0}function mm(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.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(n.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 bm(e){var t="",r=0,n,o,s=e.length,a=Pa;for(n=0;n<s;n++)n%3===0&&n&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[n];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 wm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var ef=new Me("tag:yaml.org,2002:binary",{kind:"scalar",resolve:gm,construct:mm,predicate:wm,represent:bm}),vm=Object.prototype.hasOwnProperty,km=Object.prototype.toString;function Cm(e){if(e===null)return!0;var t=[],r,n,o,s,a,c=e;for(r=0,n=c.length;r<n;r+=1){if(o=c[r],a=!1,km.call(o)!=="[object Object]")return!1;for(s in o)if(vm.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 Sm(e){return e!==null?e:[]}var tf=new Me("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Cm,construct:Sm}),xm=Object.prototype.toString;function Am(e){if(e===null)return!0;var t,r,n,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(n=a[t],xm.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;s[t]=[o[0],n[o[0]]]}return!0}function Bm(e){if(e===null)return[];var t,r,n,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)n=a[t],o=Object.keys(n),s[t]=[o[0],n[o[0]]];return s}var rf=new Me("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Am,construct:Bm}),Im=Object.prototype.hasOwnProperty;function Em(e){if(e===null)return!0;var t,r=e;for(t in r)if(Im.call(r,t)&&r[t]!==null)return!1;return!0}function Nm(e){return e!==null?e:{}}var nf=new Me("tag:yaml.org,2002:set",{kind:"mapping",resolve:Em,construct:Nm}),$a=Jd.extend({implicit:[Qd,Xd],explicit:[ef,tf,rf,nf]}),qt=Object.prototype.hasOwnProperty,so=1,of=2,sf=3,ao=4,Ra=1,Om=2,af=3,_m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tm=/[\x85\u2028\u2029]/,Vm=/[,\[\]\{\}]/,cf=/^(?:!|!!|![a-z\-]+!)$/i,lf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function uf(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 jm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Dm(e){return e===120?2:e===117?4:e===85?8:0}function Mm(e){return 48<=e&&e<=57?e-48:-1}function df(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 Pm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ff=new Array(256),pf=new Array(256),Lr=0;Lr<256;Lr++)ff[Lr]=df(Lr)?1:0,pf[Lr]=df(Lr);function $m(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 hf(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=Hg(r),new Fe(t,r)}function G(e,t){throw hf(e,t)}function co(e,t){e.onWarning&&e.onWarning.call(null,hf(e,t))}var yf={YAML:function(e,t,r){var n,o,s;e.version!==null&&G(e,"duplication of %YAML directive"),r.length!==1&&G(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),n===null&&G(e,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),s=parseInt(n[2],10),o!==1&&G(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 n,o;r.length!==2&&G(e,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],cf.test(n)||G(e,"ill-formed tag handle (first argument) of the TAG directive"),qt.call(e.tagMap,n)&&G(e,'there is a previously declared suffix for "'+n+'" tag handle'),lf.test(o)||G(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{G(e,"tag prefix is malformed: "+o)}e.tagMap[n]=o}};function Kt(e,t,r,n){var o,s,a,c;if(t<r){if(c=e.input.slice(t,r),n)for(o=0,s=c.length;o<s;o+=1)a=c.charCodeAt(o),a===9||32<=a&&a<=1114111||G(e,"expected valid JSON character");else _m.test(c)&&G(e,"the stream contains non-printable characters");e.result+=c}}function gf(e,t,r,n){var o,s,a,c;for(Ne.isObject(r)||G(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],n[s]=!0)}function Hr(e,t,r,n,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])&&G(e,"nested arrays are not supported inside keys"),typeof o=="object"&&uf(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&uf(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,y=s.length;d<y;d+=1)gf(e,t,s[d],r);else gf(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,G(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++):G(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Ae(e,t,r){for(var n=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),n++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&co(e,"deficient indentation"),n}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 Rm(e,t,r){var n,o,s,a,c,l,d,y,p=e.kind,E=e.result,w;if(w=e.input.charCodeAt(e.position),Ye(w)||Ur(w)||w===35||w===38||w===42||w===33||w===124||w===62||w===39||w===34||w===37||w===64||w===96||(w===63||w===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;w!==0;){if(w===58){if(o=e.input.charCodeAt(e.position+1),Ye(o)||r&&Ur(o))break}else if(w===35){if(n=e.input.charCodeAt(e.position-1),Ye(n))break}else{if(e.position===e.lineStart&&lo(e)||r&&Ur(w))break;if(Ct(w))if(l=e.line,d=e.lineStart,y=e.lineIndent,Ae(e,!1,-1),e.lineIndent>=t){c=!0,w=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(w)||(a=e.position+1),w=e.input.charCodeAt(++e.position)}return Kt(e,s,a,!1),e.result?!0:(e.kind=p,e.result=E,!1)}function Um(e,t){var r,n,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Kt(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,o=e.position;else return!0;else Ct(r)?(Kt(e,n,o,!0),La(e,Ae(e,!1,t)),n=o=e.position):e.position===e.lineStart&&lo(e)?G(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);G(e,"unexpected end of the stream within a single quoted scalar")}function Lm(e,t){var r,n,o,s,a,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=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&&ff[c])e.result+=pf[c],e.position++;else if((a=Dm(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=jm(c))>=0?s=(s<<4)+a:G(e,"expected hexadecimal character");e.result+=Pm(s),e.position++}else G(e,"unknown escape sequence");r=n=e.position}else Ct(c)?(Kt(e,r,n,!0),La(e,Ae(e,!1,t)),r=n=e.position):e.position===e.lineStart&&lo(e)?G(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}G(e,"unexpected end of the stream within a double quoted scalar")}function Hm(e,t){var r=!0,n,o,s,a=e.tag,c,l=e.anchor,d,y,p,E,w,h=Object.create(null),g,v,m,C;if(C=e.input.charCodeAt(e.position),C===91)y=93,w=!1,c=[];else if(C===123)y=125,w=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),C=e.input.charCodeAt(++e.position);C!==0;){if(Ae(e,!0,t),C=e.input.charCodeAt(e.position),C===y)return e.position++,e.tag=a,e.anchor=l,e.kind=w?"mapping":"sequence",e.result=c,!0;r?C===44&&G(e,"expected the node content, but found ','"):G(e,"missed comma between flow collection entries"),v=g=m=null,p=E=!1,C===63&&(d=e.input.charCodeAt(e.position+1),Ye(d)&&(p=E=!0,e.position++,Ae(e,!0,t))),n=e.line,o=e.lineStart,s=e.position,Fr(e,t,so,!1,!0),v=e.tag,g=e.result,Ae(e,!0,t),C=e.input.charCodeAt(e.position),(E||e.line===n)&&C===58&&(p=!0,C=e.input.charCodeAt(++e.position),Ae(e,!0,t),Fr(e,t,so,!1,!0),m=e.result),w?Hr(e,c,h,v,g,m,n,o,s):p?c.push(Hr(e,null,h,v,g,m,n,o,s)):c.push(g),Ae(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}G(e,"unexpected end of the stream within a flow collection")}function Fm(e,t){var r,n,o=Ra,s=!1,a=!1,c=t,l=0,d=!1,y,p;if(p=e.input.charCodeAt(e.position),p===124)n=!1;else if(p===62)n=!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?af:Om:G(e,"repeat of a chomping mode identifier");else if((y=Mm(p))>=0)y===0?G(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?G(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===af?e.result+=Ne.repeat(`
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 Hg=Lg,Fg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],qg=["scalar","sequence","mapping"];function Kg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function zg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Fg.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=Kg(t.styleAliases||null),qg.indexOf(this.kind)===-1)throw new Fe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Me=zg;function $d(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 Gg(){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=$d(i,"implicit"),i.compiledExplicit=$d(i,"explicit"),i.compiledTypeMap=Gg(i.compiledImplicit,i.compiledExplicit),i};var Rd=Ma,Ud=new Me("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ld=new Me("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Hd=new Me("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Fd=new Rd({explicit:[Ud,Ld,Hd]});function Wg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Jg(){return null}function Yg(e){return e===null}var qd=new Me("tag:yaml.org,2002:null",{kind:"scalar",resolve:Wg,construct:Jg,predicate:Yg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Zg(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 Qg(e){return e==="true"||e==="True"||e==="TRUE"}function Xg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Kd=new Me("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Zg,construct:Qg,predicate:Xg,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 em(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function tm(e){return 48<=e&&e<=55}function rm(e){return 48<=e&&e<=57}function im(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(!em(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!tm(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!rm(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function nm(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 om(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ne.isNegativeZero(e)}var zd=new Me("tag:yaml.org,2002:int",{kind:"scalar",resolve:im,construct:nm,predicate:om,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"]}}),sm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function am(e){return!(e===null||!sm.test(e)||e[e.length-1]==="_")}function cm(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 lm=/^[-+]?[0-9]+e/;function um(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),lm.test(r)?r.replace("e",".e"):r}function dm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ne.isNegativeZero(e))}var Gd=new Me("tag:yaml.org,2002:float",{kind:"scalar",resolve:am,construct:cm,predicate:dm,represent:um,defaultStyle:"lowercase"}),Wd=Fd.extend({implicit:[qd,Kd,zd,Gd]}),Jd=Wd,Yd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Zd=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 fm(e){return e===null?!1:Yd.exec(e)!==null||Zd.exec(e)!==null}function pm(e){var t,r,i,o,s,a,c,l=0,d=null,y,p,E;if(t=Yd.exec(e),t===null&&(t=Zd.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)),E=new Date(Date.UTC(r,i,o,s,a,c,l)),d&&E.setTime(E.getTime()-d),E}function hm(e){return e.toISOString()}var Qd=new Me("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:fm,construct:pm,instanceOf:Date,represent:hm});function ym(e){return e==="<<"||e===null}var Xd=new Me("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ym}),Pa=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
124
+ \r`;function gm(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 mm(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 bm(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 wm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var ef=new Me("tag:yaml.org,2002:binary",{kind:"scalar",resolve:gm,construct:mm,predicate:wm,represent:bm}),vm=Object.prototype.hasOwnProperty,km=Object.prototype.toString;function Cm(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,km.call(o)!=="[object Object]")return!1;for(s in o)if(vm.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 Sm(e){return e!==null?e:[]}var tf=new Me("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Cm,construct:Sm}),xm=Object.prototype.toString;function Am(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],xm.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function Bm(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 rf=new Me("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Am,construct:Bm}),Im=Object.prototype.hasOwnProperty;function Em(e){if(e===null)return!0;var t,r=e;for(t in r)if(Im.call(r,t)&&r[t]!==null)return!1;return!0}function Nm(e){return e!==null?e:{}}var nf=new Me("tag:yaml.org,2002:set",{kind:"mapping",resolve:Em,construct:Nm}),$a=Jd.extend({implicit:[Qd,Xd],explicit:[ef,tf,rf,nf]}),qt=Object.prototype.hasOwnProperty,so=1,of=2,sf=3,ao=4,Ra=1,Om=2,af=3,_m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tm=/[\x85\u2028\u2029]/,Vm=/[,\[\]\{\}]/,cf=/^(?:!|!!|![a-z\-]+!)$/i,lf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function uf(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 jm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Dm(e){return e===120?2:e===117?4:e===85?8:0}function Mm(e){return 48<=e&&e<=57?e-48:-1}function df(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 Pm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ff=new Array(256),pf=new Array(256),Lr=0;Lr<256;Lr++)ff[Lr]=df(Lr)?1:0,pf[Lr]=df(Lr);function $m(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 hf(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=Hg(r),new Fe(t,r)}function G(e,t){throw hf(e,t)}function co(e,t){e.onWarning&&e.onWarning.call(null,hf(e,t))}var yf={YAML:function(e,t,r){var i,o,s;e.version!==null&&G(e,"duplication of %YAML directive"),r.length!==1&&G(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&G(e,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&G(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&&G(e,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],cf.test(i)||G(e,"ill-formed tag handle (first argument) of the TAG directive"),qt.call(e.tagMap,i)&&G(e,'there is a previously declared suffix for "'+i+'" tag handle'),lf.test(o)||G(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{G(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||G(e,"expected valid JSON character");else _m.test(c)&&G(e,"the stream contains non-printable characters");e.result+=c}}function gf(e,t,r,i){var o,s,a,c;for(Ne.isObject(r)||G(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])&&G(e,"nested arrays are not supported inside keys"),typeof o=="object"&&uf(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&uf(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)gf(e,t,s[d],r);else gf(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,G(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++):G(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 Rm(e,t,r){var i,o,s,a,c,l,d,y,p=e.kind,E=e.result,w;if(w=e.input.charCodeAt(e.position),Ye(w)||Ur(w)||w===35||w===38||w===42||w===33||w===124||w===62||w===39||w===34||w===37||w===64||w===96||(w===63||w===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;w!==0;){if(w===58){if(o=e.input.charCodeAt(e.position+1),Ye(o)||r&&Ur(o))break}else if(w===35){if(i=e.input.charCodeAt(e.position-1),Ye(i))break}else{if(e.position===e.lineStart&&lo(e)||r&&Ur(w))break;if(Ct(w))if(l=e.line,d=e.lineStart,y=e.lineIndent,Ae(e,!1,-1),e.lineIndent>=t){c=!0,w=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(w)||(a=e.position+1),w=e.input.charCodeAt(++e.position)}return Kt(e,s,a,!1),e.result?!0:(e.kind=p,e.result=E,!1)}function Um(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)?G(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);G(e,"unexpected end of the stream within a single quoted scalar")}function Lm(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&&ff[c])e.result+=pf[c],e.position++;else if((a=Dm(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=jm(c))>=0?s=(s<<4)+a:G(e,"expected hexadecimal character");e.result+=Pm(s),e.position++}else G(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)?G(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}G(e,"unexpected end of the stream within a double quoted scalar")}function Hm(e,t){var r=!0,i,o,s,a=e.tag,c,l=e.anchor,d,y,p,E,w,h=Object.create(null),g,v,m,C;if(C=e.input.charCodeAt(e.position),C===91)y=93,w=!1,c=[];else if(C===123)y=125,w=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),C=e.input.charCodeAt(++e.position);C!==0;){if(Ae(e,!0,t),C=e.input.charCodeAt(e.position),C===y)return e.position++,e.tag=a,e.anchor=l,e.kind=w?"mapping":"sequence",e.result=c,!0;r?C===44&&G(e,"expected the node content, but found ','"):G(e,"missed comma between flow collection entries"),v=g=m=null,p=E=!1,C===63&&(d=e.input.charCodeAt(e.position+1),Ye(d)&&(p=E=!0,e.position++,Ae(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Fr(e,t,so,!1,!0),v=e.tag,g=e.result,Ae(e,!0,t),C=e.input.charCodeAt(e.position),(E||e.line===i)&&C===58&&(p=!0,C=e.input.charCodeAt(++e.position),Ae(e,!0,t),Fr(e,t,so,!1,!0),m=e.result),w?Hr(e,c,h,v,g,m,i,o,s):p?c.push(Hr(e,null,h,v,g,m,i,o,s)):c.push(g),Ae(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}G(e,"unexpected end of the stream within a flow collection")}function Fm(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?af:Om:G(e,"repeat of a chomping mode identifier");else if((y=Mm(p))>=0)y===0?G(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?G(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===af?e.result+=Ne.repeat(`
127
127
  `,s?1+l:l):o===Ra&&s&&(e.result+=`
128
- `);break}for(n?fr(p)?(d=!0,e.result+=Ne.repeat(`
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 mf(e,t){var r,n=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,G(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,sf,!1,!0),s.push(e.result),Ae(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)G(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function qm(e,t,r){var n,o,s,a,c,l,d=e.tag,y=e.anchor,p={},E=Object.create(null),w=null,h=null,g=null,v=!1,m=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),C=e.input.charCodeAt(e.position);C!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,G(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&Ye(n))C===63?(v&&(Hr(e,p,E,w,h,null,a,c,l),w=h=g=null),m=!0,v=!0,o=!0):v?(v=!1,o=!0):G(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=n;else{if(a=e.line,c=e.lineStart,l=e.position,!Fr(e,r,of,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);fr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),Ye(C)||G(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(Hr(e,p,E,w,h,null,a,c,l),w=h=g=null),m=!0,v=!1,o=!1,w=e.tag,h=e.result;else if(m)G(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(m)G(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)&&(v&&(a=e.line,c=e.lineStart,l=e.position),Fr(e,t,ao,!0,o)&&(v?h=e.result:g=e.result),v||(Hr(e,p,E,w,h,g,a,c,l),w=h=g=null),Ae(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)G(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&Hr(e,p,E,w,h,null,a,c,l),m&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),m}function Km(e){var t,r=!1,n=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&G(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(n=!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)):G(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ye(a);)a===33&&(n?G(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),cf.test(o)||G(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Vm.test(s)&&G(e,"tag suffix cannot contain flow indicator characters")}s&&!lf.test(s)&&G(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{G(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:G(e,'undeclared tag handle "'+o+'"'),!0}function zm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&G(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&&G(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Gm(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ye(n)&&!Ur(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),qt.call(e.anchorMap,r)||G(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Ae(e,!0,-1),!0}function Fr(e,t,r,n,o){var s,a,c,l=1,d=!1,y=!1,p,E,w,h,g,v;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||sf===r,n&&Ae(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Km(e)||zm(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||of===r?g=t:g=t+1,v=e.position-e.lineStart,l===1?c&&(mf(e,v)||qm(e,v,g))||Hm(e,g)?y=!0:(a&&Fm(e,g)||Um(e,g)||Lm(e,g)?y=!0:Gm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&G(e,"alias node should not have any properties")):Rm(e,g,so===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&mf(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&G(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,E=e.implicitTypes.length;p<E;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,w=e.typeMap.multi[e.kind||"fallback"],p=0,E=w.length;p<E;p+=1)if(e.tag.slice(0,w[p].tag.length)===w[p].tag){h=w[p];break}h||G(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&G(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)):G(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 Wm(e){var t=e.position,r,n,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(n=e.input.slice(r,e.position),o=[],n.length<1&&G(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(yf,n)?yf[n](e,n,o):co(e,'unknown document directive "'+n+'"')}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&&G(e,"directives end mark is expected"),Fr(e,e.lineIndent-1,ao,!1,!0),Ae(e,!0,-1),e.checkLineBreaks&&Tm.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)G(e,"end of the stream or a document separator is expected");else return}function bf(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 $m(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,G(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;)Wm(r);return r.documents}function Jm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=bf(e,r);if(typeof t!="function")return n;for(var o=0,s=n.length;o<s;o+=1)t(n[o])}function Ym(e,t){var r=bf(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 Zm=Jm,Qm=Ym,wf={loadAll:Zm,load:Qm},vf=Object.prototype.toString,kf=Object.prototype.hasOwnProperty,Ha=65279,Xm=9,Ni=10,e0=13,t0=32,r0=33,i0=34,Fa=35,n0=37,o0=38,s0=39,a0=42,Cf=44,c0=45,uo=58,l0=61,u0=62,d0=63,f0=64,Sf=91,xf=93,p0=96,Af=123,h0=124,Bf=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 y0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],g0=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function m0(e,t){var r,n,o,s,a,c,l;if(t===null)return{};for(r={},n=Object.keys(t),o=0,s=n.length;o<s;o+=1)a=n[o],c=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&kf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function b0(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new Fe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ne.repeat("0",n-t.length)+t}var w0=1,Oi=2;function v0(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:w0,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 If(e,t){for(var r=Ne.repeat(" ",t),n=0,o=-1,s="",a,c=e.length;n<c;)o=e.indexOf(`
134
- `,n),o===-1?(a=e.slice(n),n=c):(a=e.slice(n,o+1),n=o+1),a.length&&a!==`
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,G(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,sf,!1,!0),s.push(e.result),Ae(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)G(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 qm(e,t,r){var i,o,s,a,c,l,d=e.tag,y=e.anchor,p={},E=Object.create(null),w=null,h=null,g=null,v=!1,m=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),C=e.input.charCodeAt(e.position);C!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,G(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&Ye(i))C===63?(v&&(Hr(e,p,E,w,h,null,a,c,l),w=h=g=null),m=!0,v=!0,o=!0):v?(v=!1,o=!0):G(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=i;else{if(a=e.line,c=e.lineStart,l=e.position,!Fr(e,r,of,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);fr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),Ye(C)||G(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(Hr(e,p,E,w,h,null,a,c,l),w=h=g=null),m=!0,v=!1,o=!1,w=e.tag,h=e.result;else if(m)G(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(m)G(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)&&(v&&(a=e.line,c=e.lineStart,l=e.position),Fr(e,t,ao,!0,o)&&(v?h=e.result:g=e.result),v||(Hr(e,p,E,w,h,g,a,c,l),w=h=g=null),Ae(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)G(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&Hr(e,p,E,w,h,null,a,c,l),m&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),m}function Km(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&&G(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)):G(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ye(a);)a===33&&(i?G(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),cf.test(o)||G(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),Vm.test(s)&&G(e,"tag suffix cannot contain flow indicator characters")}s&&!lf.test(s)&&G(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{G(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:G(e,'undeclared tag handle "'+o+'"'),!0}function zm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&G(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&&G(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Gm(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&&G(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),qt.call(e.anchorMap,r)||G(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,E,w,h,g,v;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||sf===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(;Km(e)||zm(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||of===r?g=t:g=t+1,v=e.position-e.lineStart,l===1?c&&(mf(e,v)||qm(e,v,g))||Hm(e,g)?y=!0:(a&&Fm(e,g)||Um(e,g)||Lm(e,g)?y=!0:Gm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&G(e,"alias node should not have any properties")):Rm(e,g,so===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&mf(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&G(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,E=e.implicitTypes.length;p<E;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,w=e.typeMap.multi[e.kind||"fallback"],p=0,E=w.length;p<E;p+=1)if(e.tag.slice(0,w[p].tag.length)===w[p].tag){h=w[p];break}h||G(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&G(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)):G(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 Wm(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&&G(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(yf,i)?yf[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&&G(e,"directives end mark is expected"),Fr(e,e.lineIndent-1,ao,!1,!0),Ae(e,!0,-1),e.checkLineBreaks&&Tm.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)G(e,"end of the stream or a document separator is expected");else return}function bf(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 $m(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,G(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;)Wm(r);return r.documents}function Jm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=bf(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Ym(e,t){var r=bf(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 Zm=Jm,Qm=Ym,wf={loadAll:Zm,load:Qm},vf=Object.prototype.toString,kf=Object.prototype.hasOwnProperty,Ha=65279,Xm=9,Ni=10,e0=13,t0=32,r0=33,i0=34,Fa=35,n0=37,o0=38,s0=39,a0=42,Cf=44,c0=45,uo=58,l0=61,u0=62,d0=63,f0=64,Sf=91,xf=93,p0=96,Af=123,h0=124,Bf=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 y0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],g0=/^[-+]?[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&&kf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function b0(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 w0=1,Oi=2;function v0(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:w0,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 If(e,t){for(var r=Ne.repeat(" ",t),i=0,o=-1,s="",a,c=e.length;i<c;)o=e.indexOf(`
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 k0(e,t){var r,n,o;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function fo(e){return e===t0||e===Xm}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 Ef(e){return _i(e)&&e!==Ha&&e!==e0&&e!==Ni}function Nf(e,t,r){var n=Ef(e),o=n&&!fo(e);return(r?n:n&&e!==Cf&&e!==Sf&&e!==xf&&e!==Af&&e!==Bf)&&e!==Fa&&!(t===uo&&!o)||Ef(t)&&!fo(t)&&e===Fa||t===uo&&o}function C0(e){return _i(e)&&e!==Ha&&!fo(e)&&e!==c0&&e!==d0&&e!==uo&&e!==Cf&&e!==Sf&&e!==xf&&e!==Af&&e!==Bf&&e!==Fa&&e!==o0&&e!==a0&&e!==r0&&e!==h0&&e!==l0&&e!==u0&&e!==s0&&e!==i0&&e!==n0&&e!==f0&&e!==p0}function S0(e){return!fo(e)&&e!==uo}function Ti(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function Of(e){var t=/^\n* /;return t.test(e)}var _f=1,Ka=2,Tf=3,Vf=4,qr=5;function x0(e,t,r,n,o,s,a,c){var l,d=0,y=null,p=!1,E=!1,w=n!==-1,h=-1,g=C0(Ti(e,0))&&S0(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&&Nf(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,w&&(E=E||l-h-1>n&&e[h+1]!==" ",h=l);else if(!_i(d))return qr;g=g&&Nf(d,y,c),y=d}E=E||w&&l-h-1>n&&e[h+1]!==" "}return!p&&!E?g&&!a&&!o(e)?_f:s===Oi?qr:Ka:r>9&&Of(e)?qr:a?s===Oi?qr:Ka:E?Vf:Tf}function A0(e,t,r,n,o){e.dump=function(){if(t.length===0)return e.quotingType===Oi?'""':"''";if(!e.noCompatMode&&(y0.indexOf(t)!==-1||g0.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=n||e.flowLevel>-1&&r>=e.flowLevel;function l(d){return k0(e,d)}switch(x0(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!n,o)){case _f:return t;case Ka:return"'"+t.replace(/'/g,"''")+"'";case Tf:return"|"+jf(t,e.indent)+Df(If(t,s));case Vf:return">"+jf(t,e.indent)+Df(If(B0(t,a),s));case qr:return'"'+I0(t)+'"';default:throw new Fe("impossible error: invalid scalar style")}}()}function jf(e,t){var r=Of(e)?String(t):"",n=e[e.length-1]===`
137
- `,o=n&&(e[e.length-2]===`
136
+ `+Ne.repeat(" ",e.indent*t)}function k0(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===t0||e===Xm}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 Ef(e){return _i(e)&&e!==Ha&&e!==e0&&e!==Ni}function Nf(e,t,r){var i=Ef(e),o=i&&!fo(e);return(r?i:i&&e!==Cf&&e!==Sf&&e!==xf&&e!==Af&&e!==Bf)&&e!==Fa&&!(t===uo&&!o)||Ef(t)&&!fo(t)&&e===Fa||t===uo&&o}function C0(e){return _i(e)&&e!==Ha&&!fo(e)&&e!==c0&&e!==d0&&e!==uo&&e!==Cf&&e!==Sf&&e!==xf&&e!==Af&&e!==Bf&&e!==Fa&&e!==o0&&e!==a0&&e!==r0&&e!==h0&&e!==l0&&e!==u0&&e!==s0&&e!==i0&&e!==n0&&e!==f0&&e!==p0}function S0(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 Of(e){var t=/^\n* /;return t.test(e)}var _f=1,Ka=2,Tf=3,Vf=4,qr=5;function x0(e,t,r,i,o,s,a,c){var l,d=0,y=null,p=!1,E=!1,w=i!==-1,h=-1,g=C0(Ti(e,0))&&S0(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&&Nf(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,w&&(E=E||l-h-1>i&&e[h+1]!==" ",h=l);else if(!_i(d))return qr;g=g&&Nf(d,y,c),y=d}E=E||w&&l-h-1>i&&e[h+1]!==" "}return!p&&!E?g&&!a&&!o(e)?_f:s===Oi?qr:Ka:r>9&&Of(e)?qr:a?s===Oi?qr:Ka:E?Vf:Tf}function A0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===Oi?'""':"''";if(!e.noCompatMode&&(y0.indexOf(t)!==-1||g0.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 k0(e,d)}switch(x0(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case _f:return t;case Ka:return"'"+t.replace(/'/g,"''")+"'";case Tf:return"|"+jf(t,e.indent)+Df(If(t,s));case Vf:return">"+jf(t,e.indent)+Df(If(B0(t,a),s));case qr:return'"'+I0(t)+'"';default:throw new Fe("impossible error: invalid scalar style")}}()}function jf(e,t){var r=Of(e)?String(t):"",i=e[e.length-1]===`
137
+ `,o=i&&(e[e.length-2]===`
138
138
  `||e===`
139
- `),s=o?"+":n?"":"-";return r+s+`
139
+ `),s=o?"+":i?"":"-";return r+s+`
140
140
  `}function Df(e){return e[e.length-1]===`
141
- `?e.slice(0,-1):e}function B0(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var d=e.indexOf(`
141
+ `?e.slice(0,-1):e}function B0(e,t){for(var r=/(\n+)([^\n]*)/g,i=function(){var d=e.indexOf(`
142
142
  `);return d=d!==-1?d:e.length,r.lastIndex=d,Mf(e.slice(0,d),t)}(),o=e[0]===`
143
- `||e[0]===" ",s,a;a=r.exec(e);){var c=a[1],l=a[2];s=l[0]===" ",n+=c+(!o&&!s&&l!==""?`
144
- `:"")+Mf(l,t),o=s}return n}function Mf(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,s,a=0,c=0,l="";n=r.exec(e);)c=n.index,c-o>t&&(s=a>o?a:c,l+=`
143
+ `||e[0]===" ",s,a;a=r.exec(e);){var c=a[1],l=a[2];s=l[0]===" ",i+=c+(!o&&!s&&l!==""?`
144
+ `:"")+Mf(l,t),o=s}return i}function Mf(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 I0(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=Ti(e,o),n=Ue[r],!n&&_i(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||b0(r);return t}function E0(e,t,r){var n="",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))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function Pf(e,t,r,n){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))&&((!n||o!=="")&&(o+=qa(e,t)),e.dump&&Ni===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function N0(e,t,r){var n="",o=e.tag,s=Object.keys(r),a,c,l,d,y;for(a=0,c=s.length;a<c;a+=1)y="",n!==""&&(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,n+=y));e.tag=o,e.dump="{"+n+"}"}function O0(e,t,r,n){var o="",s=e.tag,a=Object.keys(r),c,l,d,y,p,E;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)E="",(!n||o!=="")&&(E+=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)?E+="?":E+="? "),E+=e.dump,p&&(E+=qa(e,t)),jt(e,t+1,y,!0,p)&&(e.dump&&Ni===e.dump.charCodeAt(0)?E+=":":E+=": ",E+=e.dump,o+=E));e.tag=s,e.dump=o||"{}"}function $f(e,t,r){var n,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,vf.call(c.represent)==="[object Function]")n=c.represent(t,l);else if(kf.call(c.represent,l))n=c.represent[l](t,l);else throw new Fe("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=n}return!0}return!1}function jt(e,t,r,n,o,s,a){e.tag=null,e.dump=r,$f(e,r,!1)||$f(e,r,!0);var c=vf.call(e.dump),l=n,d;n&&(n=e.flowLevel<0||e.flowLevel>t);var y=c==="[object Object]"||c==="[object Array]",p,E;if(y&&(p=e.duplicates.indexOf(r),E=p!==-1),(e.tag!==null&&e.tag!=="?"||E||e.indent!==2&&t>0)&&(o=!1),E&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&E&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")n&&Object.keys(e.dump).length!==0?(O0(e,t,e.dump,o),E&&(e.dump="&ref_"+p+e.dump)):(N0(e,t,e.dump),E&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Pf(e,t-1,e.dump,o):Pf(e,t,e.dump,o),E&&(e.dump="&ref_"+p+e.dump)):(E0(e,t,e.dump),E&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&A0(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 _0(e,t){var r=[],n=[],o,s;for(za(e,r,n),o=0,s=n.length;o<s;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(s)}function za(e,t,r){var n,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(n=Object.keys(e),o=0,s=n.length;o<s;o+=1)za(e[n[o]],t,r)}function T0(e,t){t=t||{};var r=new v0(t);r.noRefs||_0(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),jt(r,0,n,!0,!0)?r.dump+`
148
- `:""}var V0=T0,j0={dump:V0};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 D0=Me,M0=Rd,P0=Fd,$0=Wd,R0=Jd,U0=$a,L0=wf.load,H0=wf.loadAll,F0=j0.dump,q0=Fe,K0={binary:ef,float:Gd,map:Hd,null:qd,pairs:rf,set:nf,timestamp:Qd,bool:Kd,int:zd,merge:Xd,omap:tf,seq:Ld,str:Ud},z0=Ga("safeLoad","load"),G0=Ga("safeLoadAll","loadAll"),W0=Ga("safeDump","dump"),J0={Type:D0,Schema:M0,FAILSAFE_SCHEMA:P0,JSON_SCHEMA:$0,CORE_SCHEMA:R0,DEFAULT_SCHEMA:U0,load:L0,loadAll:H0,dump:F0,YAMLException:q0,types:K0,safeLoad:z0,safeLoadAll:G0,safeDump:W0};const Y0={class:"yaml-config"},Rf=i.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=i.computed(()=>t.yamlRecord);return(n,o)=>{const s=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",Y0,[t.yamlRecord?(i.openBlock(),i.createBlock(s,{key:0,id:"yaml-codeblock",code:i.unref(J0).dump(r.value),language:"yaml",theme:"dark"},null,8,["code"])):i.createCommentVNode("",!0)])}}}),Z0={key:0,class:"config-card-display-form"},Q0=["data-testid"],X0={key:0,class:"config-card-prop-section-title"},e1=i.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=i.useSlots(),{i18n:{t:n}}=Te.useI18n(),o=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=i.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)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[e.format==="structured"?(i.openBlock(),i.createElementBlock("div",Z0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propListTypes,l=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${l}-props`,class:i.normalizeClass(`config-card-details-${l}-props`),"data-testid":`config-card-details-${l}-props`},[l!=="basic"?(i.openBlock(),i.createElementBlock("div",X0,i.toDisplayString(l==="advanced"?i.unref(n)("baseConfigCard.sections.advanced"):i.unref(n)("baseConfigCard.sections.plugin")),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propertyCollections[l],d=>(i.openBlock(),i.createBlock(Ii,{key:d.key,item:d},i.createSlots({label:i.withCtx(()=>[i.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:i.withCtx(({rowValue:y})=>[i.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[o(d)?{name:"label-tooltip",fn:i.withCtx(()=>[i.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Q0))),128))])):i.createCommentVNode("",!0),e.format==="json"&&t.record?(i.openBlock(),i.createBlock(Dd,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):i.createCommentVNode("",!0),e.format==="yaml"&&t.record?(i.openBlock(),i.createBlock(Rf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):i.createCommentVNode("",!0)],64))}}),t1=dt(e1,[["__scopeId","data-v-2b74ac63"]]),Uf="24px",r1=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},i1=e=>(i.pushScopeId("data-v-40a7f387"),e=e(),i.popScopeId(),e),n1=["aria-hidden"],o1={key:0,"data-testid":"kui-icon-svg-title"},s1=i1(()=>i.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)),a1=i.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:Uf,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=i.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 Uf}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.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?(i.openBlock(),i.createElementBlock("title",o1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),s1],8,n1))]),_:1},8,["aria-hidden","style"]))}}),c1=r1(a1,[["__scopeId","data-v-40a7f387"]]),l1={"data-testid":"config-card-title"},u1={class:"config-card-actions"},d1=["href"],f1={key:2,class:"config-card-details-section"},p1={key:3,class:"config-card-details-section"},h1=["data-testid"],y1={key:0,class:"config-card-prop-section-title"},g1=i.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 n=t,o=e,s=i.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=i.ref("structured"),E=B=>{p.value=B==null?void 0:B.value},w={id:{type:ce.ID,label:a("baseConfigCard.commonFields.id_label"),order:0,section:pe.Basic},name:{order:1,section:pe.Basic},enabled:{type:ce.BadgeStatus,order:2,section:pe.Basic},updated_at:{type:ce.Date,label:a("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:ce.Date,label:a("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:ce.BadgeTag,order:-1,section:pe.Basic}},h=i.ref(!1),g=i.ref(!1),v=i.ref(""),m=i.ref({}),C=i.computed(()=>{var B,Y,W;if(!m.value)return[];const M=[],J=Object.keys(m.value).length;for(const re in m.value){const de=(Y=(B=o.configSchema)==null?void 0:B[re])==null?void 0:Y.order,fe=(W=w[re])==null?void 0:W.order;let ke=J;(fe||fe===0)&&(ke=fe===-1?J+1:fe),de&&(ke=de===-1?J+1:de),M.push([re,ke])}return M.sort(function(re,de){return re[1]-de[1]}),M.map(re=>{var de,fe;const ke=re[0],he=(de=m.value)==null?void 0:de[ke],ye=((fe=o.configSchema)==null?void 0:fe[ke])||{},Be=w[ke];return{key:ke,value:he,hidden:ye.hidden||!1,type:ye.type??((Be==null?void 0:Be.type)||ce.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(re=>!re.hidden&&re.key!==o.pluginConfigKey)}),A=i.computed(()=>{var B,Y;if(!m.value||!o.pluginConfigKey)return[];const W=m.value[o.pluginConfigKey]||{},M=Object.keys(W).length,J=[];for(const re in W){const de=(Y=(B=o.pluginConfigSchema)==null?void 0:B[re])==null?void 0:Y.order,fe=W[re];let ke=fe!=null&&fe!==""?M-1:M;de&&(ke=de===-1?M+1:de),J.push([re,ke])}return J.sort(function(re,de){return re[1]-de[1]}),J.map(re=>{var de;const fe=re[0],ke=W[fe],he=((de=o.pluginConfigSchema)==null?void 0:de[fe])||{};return{key:fe,value:ke,hidden:he.hidden||!1,type:he.type??ce.Text,label:he.label??l(fe),tooltip:he.tooltip??void 0,section:pe.Plugin}}).filter(re=>!re.hidden)}),S=i.computed(()=>{var B,Y,W,M;return{basic:(B=C.value)==null?void 0:B.filter(J=>J.section===pe.Basic),advanced:(Y=C.value)==null?void 0:Y.filter(J=>J.section===pe.Advanced),plugin:(M=A.value)==null?void 0:M.concat((W=C.value)==null?void 0:W.filter(J=>J.section===pe.Plugin))}}),I=i.computed(()=>{const B=[];return S.value.basic.length&&B.push("basic"),S.value.advanced.length&&B.push("advanced"),S.value.plugin.length&&B.push("plugin"),B}),T=B=>!!(B.tooltip||s[`${B.key}-label-tooltip`]),Q=i.computed(()=>{var B,Y;let W=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?W=W.replace(/{controlPlaneId}/gi,((B=o.config)==null?void 0:B.controlPlaneId)||""):o.config.app==="kongManager"&&(W=W.replace(/\/{workspace}/gi,(Y=o.config)!=null&&Y.workspace?`/${o.config.workspace}`:"")),W=W.replace(/{id}/gi,o.config.entityId),W}),O=B=>{m.value&&B(JSON.stringify(m.value))?n("copy:success",m.value):n("copy:error")};return i.watch(h,B=>{n("loading",B)},{immediate:!0}),i.onBeforeMount(async()=>{g.value=!1,h.value=!0;try{const{data:B}=await d.get(Q.value);if(o.dataKey)if(typeof B[o.dataKey]<"u")m.value={...B[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else m.value={...B};Object.keys(o.configSchema).filter(Y=>o.configSchema[Y].forceShow).forEach(Y=>{m.value&&typeof m.value[Y]>"u"&&(m.value[Y]=null)}),n("fetch:success",B)}catch(B){const Y=c(B);v.value=Y.startsWith("code")?a("baseConfigCard.errors.load"):Y,g.value=!0,n("fetch:error",B)}finally{h.value=!1}}),(B,Y)=>{const W=i.resolveComponent("KLabel"),M=i.resolveComponent("KSelect"),J=i.resolveComponent("KButton"),re=i.resolveComponent("KClipboardProvider"),de=i.resolveComponent("KSkeleton"),fe=i.resolveComponent("KEmptyState"),ke=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(ke,{class:"kong-ui-entity-base-config-card"},i.createSlots({actions:i.withCtx(()=>[i.createElementVNode("div",u1,[i.renderSlot(B.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(i.openBlock(),i.createBlock(W,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.label),1)]),_:1})):i.createCommentVNode("",!0),e.config.jsonYamlEnabled?(i.openBlock(),i.createBlock(M,{key:1,"data-testid":"select-config-format",items:y,onChange:E})):i.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(i.openBlock(),i.createBlock(J,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:i.withCtx(()=>[i.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[i.createVNode(i.unref(c1),{size:i.unref(yg)},null,8,["size"])],8,d1)]),_:1})):i.createCommentVNode("",!0),e.config.jsonYamlEnabled?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(re,{key:3},{default:i.withCtx(({copyToClipboard:he})=>[!h.value&&!g.value?(i.openBlock(),i.createBlock(J,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:ye=>O(he)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]),_:1}))])]),default:i.withCtx(()=>[h.value?(i.openBlock(),i.createBlock(de,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):g.value?(i.openBlock(),i.createBlock(fe,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(v.value),1)]),_:1})):i.createCommentVNode("",!0),e.config.jsonYamlEnabled?(i.openBlock(),i.createElementBlock("div",f1,[i.createVNode(t1,{config:e.config,"fetcher-url":Q.value,format:p.value,"prop-list-types":I.value,"property-collections":S.value,record:m.value},i.createSlots({_:2},[i.renderList(Object.keys(B.$slots),he=>({name:he,fn:i.withCtx(({row:ye,rowValue:Be})=>[i.renderSlot(B.$slots,he,{row:ye,rowValue:Be},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])):(i.openBlock(),i.createElementBlock("div",p1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(I.value,he=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${he}-props`,class:i.normalizeClass(`config-card-details-${he}-props`),"data-testid":`config-card-details-${he}-props`},[he!=="basic"?(i.openBlock(),i.createElementBlock("div",y1,i.toDisplayString(he==="advanced"?i.unref(a)("baseConfigCard.sections.advanced"):i.unref(a)("baseConfigCard.sections.plugin")),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(S.value[he],ye=>(i.openBlock(),i.createBlock(Ii,{key:ye.key,item:ye},i.createSlots({label:i.withCtx(()=>[i.renderSlot(B.$slots,`${ye.key}-label`,{row:ye},void 0,!0)]),[ye.key]:i.withCtx(({rowValue:Be})=>[i.renderSlot(B.$slots,ye.key,{row:ye,rowValue:Be},void 0,!0)]),_:2},[T(ye)?{name:"label-tooltip",fn:i.withCtx(()=>[i.renderSlot(B.$slots,`${ye.key}-label-tooltip`,{row:ye},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,h1))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("div",l1,[i.renderSlot(B.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Lf=dt(g1,[["__scopeId","data-v-3fd4a3a4"]]),m1={class:"form-actions","data-testid":"form-actions"},b1={key:0},w1=i.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 n=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=i.ref(!1),y=i.ref(!1),p=i.ref(""),E=i.computed(()=>o.canSubmit===!1||o.isReadonly),w=i.ref(!1),h=i.computed(()=>{var S,I;let T=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?T=T.replace(/{controlPlaneId}/gi,((S=o.config)==null?void 0:S.controlPlaneId)||""):o.config.app==="kongManager"&&(T=T.replace(/\/{workspace}/gi,(I=o.config)!=null&&I.workspace?`/${o.config.workspace}`:"")),o.editId?(T=T.replace(/{id}/gi,o.editId),T):(T=T.replace(/\/{id}/gi,""),T)}),g=()=>{w.value=!w.value},v=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):m()},m=()=>{n("cancel")},C=()=>{E.value||n("submit")},A=i.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return i.watch(()=>d.value,S=>{n("loading",S)},{immediate:!0}),i.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:S}=await l.get(h.value);n("fetch:success",S)}catch(S){const I=c(S);p.value=I.startsWith("code")?a("baseForm.errors.edit"):I,y.value=!0,n("fetch:error",S)}finally{d.value=!1}}),(S,I)=>{const T=i.resolveComponent("KSkeleton"),Q=i.resolveComponent("KEmptyState"),O=i.resolveComponent("KAlert"),B=i.resolveComponent("KButton"),Y=i.resolveComponent("KTabs"),W=i.resolveComponent("KSlideout"),M=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(M,{class:"kong-ui-entity-base-form"},{default:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(T,{key:0,type:"form"})):y.value?(i.openBlock(),i.createBlock(Q,{key:1,"cta-text":i.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":v,"is-error":!0},{message:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(i.openBlock(),i.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:i.withModifiers(m,["prevent"]),onSubmit:i.withModifiers(C,["prevent"])},[i.renderSlot(S.$slots,"default",{},void 0,!0),e.errorMessage?(i.openBlock(),i.createBlock(O,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):i.createCommentVNode("",!0),i.createElementVNode("div",m1,[i.renderSlot(S.$slots,"form-actions",{},()=>[e.config.jsonYamlFormsEnabled?(i.openBlock(),i.createElementBlock("div",b1,[i.createVNode(B,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:I[0]||(I[0]=J=>g())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(B,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),i.createVNode(B,{appearance:"primary","data-testid":"form-submit",disabled:E.value,type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),i.createVNode(W,{"close-button-alignment":"end","data-testid":"form-view-configuration-slideout","has-overlay":!1,"is-visible":w.value,"prevent-close-on-blur":"",title:i.unref(a)("baseForm.configuration.title"),onClose:I[1]||(I[1]=J=>g())},{default:i.withCtx(()=>[i.createElementVNode("div",null,i.toDisplayString(i.unref(a)("baseForm.configuration.message")),1),i.createVNode(Y,{"data-testid":"form-view-configuration-slideout-tabs",tabs:A.value},{json:i.withCtx(()=>[i.createVNode(Dd,{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:i.withCtx(()=>[i.createVNode(Rf,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["is-visible","title"])]),_:3})}}}),Hf=dt(w1,[["__scopeId","data-v-4ef70725"]]),v1={key:0,"data-testid":"first-col"},k1=i.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=i.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),n=i.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[data-testid="first-col"]'))||null}),o=i.computed(()=>{var g,v;const m=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return m?((v=m[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,v,m;d.value=((g=n.value)==null?void 0:g.getBoundingClientRect().width)||0,y.value=((v=r.value)==null?void 0:v.clientWidth)||0,p.value=((m=l.value)==null?void 0:m.innerText)||""},l=i.ref({}),d=i.ref(0),y=i.ref(0),p=i.ref(""),E=i.computed(()=>[n.value,r.value]),w=i.watch(E,g=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of g)v&&s.observe(v)}},{immediate:!0,flush:"post",deep:!0}),h=i.computed(()=>o.value?d.value>y.value:!1);return i.onMounted(()=>{c()}),i.onUnmounted(()=>{w()}),(g,v)=>{const m=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(i.openBlock(),i.createElementBlock("span",v1,[i.createVNode(m,{"max-width":"300",placement:"bottomStart",text:h.value?p.value:""},{default:i.withCtx(()=>[i.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):i.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),C1=dt(k1,[["__scopeId","data-v-c4379fd4"]]),S1={class:"toolbar-container"},x1={key:0,class:"toolbar-button-container"},A1=["data-testid"],B1=i.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,n=t,{i18n:{t:o}}=Te.useI18n(),s=i.computed(()=>{var I,T;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(I=r.errorMessage)==null?void 0:I.title,message:(T=r.errorMessage)==null?void 0:T.message}}),a=i.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=I=>I.hasData||!!r.query,l=i.computed(()=>{const I=[];return Object.keys(r.tableHeaders).forEach(T=>{const Q=r.tableHeaders[T];I.push({label:Q.label??T,key:T,sortable:Q.sortable??!1})}),r.enableEntityActions&&I.push({key:"actions",hideLabel:!0}),I}),d=I=>({"data-rowid":I.id,"data-testid":I.name,...r.rowAttributes(I)}),y=i.ref({}),p=I=>{var T;return(T=y.value)==null?void 0:T.$el.querySelector(`[data-rowid="${I.id}"]`)},E=I=>{const T={"data-testid":I.headerKey,...r.cellAttributes(I)};return I.colIndex===0&&(T.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),T},w=()=>{n("empty-state-cta-clicked"),h()},h=()=>{n("clear-search-input")},g=i.computed(()=>r.disableRowClick?void 0:(I,T)=>{n("click:row",T)}),v=I=>{n("sort",I)},{setTablePreferences:m,getTablePreferences:C}=vy(),A=i.computed(()=>{const I=C(r.preferencesStorageKey);return{...r.initialFetcherParams,...I}}),S=I=>{r.preferencesStorageKey&&m(r.preferencesStorageKey,I)};return(I,T)=>{const Q=i.resolveComponent("KIcon"),O=i.resolveComponent("KButton"),B=i.resolveComponent("KDropdown"),Y=i.resolveComponent("KTable"),W=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(W,{class:"kong-ui-entity-base-table",title:e.title},{default:i.withCtx(()=>[i.createVNode(Y,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":E,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?i.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?i.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?i.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":A.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:w,"onRow:click":g.value,onSort:T[0]||(T[0]=M=>v(M)),"onUpdate:tablePreferences":S},i.createSlots({toolbar:i.withCtx(({state:M})=>[i.withDirectives(i.createElementVNode("div",S1,[i.renderSlot(I.$slots,"toolbar-filter",{},void 0,!0),I.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",x1,[i.renderSlot(I.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,c(M)]])]),actions:i.withCtx(({row:M,rowKey:J,rowValue:re})=>[i.createElementVNode("div",{class:"actions-container","data-testid":M.name},[i.createVNode(B,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(I.$slots,"actions",{row:M,rowKey:J,rowValue:re},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(O,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:i.withCtx(()=>[i.createVNode(Q,{color:i.unref(pg),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,A1)]),_:2},[i.renderList(e.tableHeaders,(M,J)=>({name:J,fn:i.withCtx(({row:re,rowKey:de,rowValue:fe})=>[i.createVNode(C1,{"key-name":String(J),"row-el":p(re)},{default:i.withCtx(()=>[i.renderSlot(I.$slots,J,{row:re,rowKey:de,rowValue:fe},()=>[i.createTextVNode(i.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"])}}}),Ff=dt(B1,[["__scopeId","data-v-ecfaa7cf"]]),I1={key:0,class:"kong-ui-entity-delete-error"},E1={key:1,class:"description"},N1=i.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(),n=e,o=t,s=i.computed(()=>n.needConfirm?n.entityName:""),a=()=>{o("cancel")},c=()=>{o("proceed")};return(l,d)=>{const y=i.resolveComponent("KAlert"),p=i.resolveComponent("KPrompt");return i.openBlock(),i.createBlock(p,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:c},{default:i.withCtx(()=>[e.error?(i.openBlock(),i.createElementBlock("div",I1,[i.createVNode(y,{appearance:"danger"},{alertMessage:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.error),1)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(i.unref(r),{class:"message",keypath:n.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},i.createSlots({entityType:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.entityType),1)]),_:2},[n.entityName?{name:"entityName",fn:i.withCtx(()=>[i.createElementVNode("strong",null,i.toDisplayString(n.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),n.description||l.$slots.description?(i.openBlock(),i.createElementBlock("div",E1,[i.renderSlot(l.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(n.description),1)],!0)])):i.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),qf=dt(N1,[["__scopeId","data-v-efe8f34b"]]),O1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},_1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},T1=["fill"],V1={mask:"url(#mask0_180_20349)"},j1=["fill"],Kf=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${dg})`}},setup(e){return(t,r)=>(i.openBlock(),i.createElementBlock("svg",O1,[i.createElementVNode("mask",_1,[i.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,T1)]),i.createElementVNode("g",V1,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,j1)])]))}}),D1={key:1,class:"kong-ui-entity-filter"},M1={class:"menu-item-title"},P1={class:"menu-item-indicator"},$1={class:"menu-item-body"},R1=["for"],U1={class:"menu-item-buttons"},L1={class:"filter-clear-button-container"},H1=i.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(),n=e,o=t,s=i.ref(!1),a=i.ref({}),c=i.computed(()=>{const m=[];return new URLSearchParams(n.modelValue).forEach((C,A)=>{C!==""&&m.push(A)}),m}),l=i.computed(()=>{const m=n.config.fields;return Object.keys(m).filter(C=>m[C].searchable).map(C=>({label:m[C].label||C,value:C}))});i.watch(()=>n.modelValue,m=>{a.value={},new URLSearchParams(m).forEach((C,A)=>{a.value[A]=C})});const d=()=>{s.value=!s.value},y=m=>{o("update:modelValue",m)},p=m=>`filter-${m}`,E=m=>{var C,A;return(((A=(C=n.config.schema)==null?void 0:C[m])==null?void 0:A.values)??[]).map(S=>({value:S,label:S}))},w=m=>{var C,A;return((A=(C=n.config.schema)==null?void 0:C[m])==null?void 0:A.type)??"text"},h=m=>{a.value={...a.value,[m]:""},v()},g=()=>{a.value={},v(!0)},v=(m=!1)=>{const C=Object.keys(a.value).reduce((A,S)=>(a.value[S]&&(A[S]=`${a.value[S]}`),A),{});m&&(s.value=!1),o("update:modelValue",new URLSearchParams(C).toString())};return(m,C)=>{const A=i.resolveComponent("KInput"),S=i.resolveComponent("KButton"),I=i.resolveComponent("KSelect"),T=i.resolveComponent("KMenuItem"),Q=i.resolveComponent("KMenu");return e.config.isExactMatch?(i.openBlock(),i.createBlock(A,{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:i.withCtx(()=>[i.createVNode(Kf)]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",D1,[i.createVNode(S,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:i.withCtx(()=>[i.createVNode(Kf),i.createTextVNode(" "+i.toDisplayString(i.unref(r)("filter.filterButtonText"))+" "+i.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),i.withDirectives(i.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:d},null,512),[[i.vShow,s.value]]),i.withDirectives(i.createVNode(Q,{class:"kong-ui-entity-filter-menu"},{body:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(O,B)=>(i.openBlock(),i.createBlock(T,{key:O.value,"data-testid":O.value,expandable:"","last-menu-item":B===l.value.length-1},{itemTitle:i.withCtx(()=>[i.createElementVNode("span",M1,[i.createTextVNode(i.toDisplayString(O.label)+" ",1),i.withDirectives(i.createElementVNode("span",P1,null,512),[[i.vShow,c.value.includes(O.value)]])])]),itemBody:i.withCtx(()=>{var Y,W;return[i.createElementVNode("div",$1,[i.createElementVNode("label",{class:"menu-item-label",for:p(O.value)},i.toDisplayString(i.unref(r)("filter.fieldLabel")),9,R1),((W=(Y=e.config.schema)==null?void 0:Y[O.value])==null?void 0:W.type)==="select"?(i.openBlock(),i.createBlock(I,{key:0,id:p(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":M=>a.value[O.value]=M,items:E(O.value),placeholder:i.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(A,{key:1,id:p(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":M=>a.value[O.value]=M,autocomplete:"off",placeholder:i.unref(r)("filter.inputPlaceholder"),type:w(O.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),i.createElementVNode("div",U1,[i.createVNode(S,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:C[0]||(C[0]=M=>v(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.applyButtonText")),1)]),_:1}),i.createVNode(S,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:M=>h(O.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:i.withCtx(()=>[i.createElementVNode("div",L1,[i.createVNode(S,{appearance:"tertiary",size:"small",onClick:g},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[i.vShow,s.value]])]))}}}),zf=dt(H1,[["__scopeId","data-v-e9512e8f"]]),Dt=i.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=i.ref(void 0),n=i.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return i.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>n.value?i.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):i.createCommentVNode("",!0)}}),F1={class:"form-section-wrapper"},q1={key:0,class:"form-section-title"},K1={key:1,class:"form-section-description"},z1={key:2,class:"form-section-footer"},G1={class:"form-section-content"},W1=i.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=i.useSlots();return(r,n)=>(i.openBlock(),i.createElementBlock("fieldset",{class:i.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[i.createElementVNode("div",F1,[e.hideInfoHeader?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(i.openBlock(),i.createElementBlock("h4",q1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),e.description||i.unref(t).description?(i.openBlock(),i.createElementBlock("div",K1,[i.renderSlot(r.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(e.description),1)],!0)])):i.createCommentVNode("",!0),i.unref(t).footer?(i.openBlock(),i.createElementBlock("div",z1,[i.renderSlot(r.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",G1,[i.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),po=dt(W1,[["__scopeId","data-v-3565daa7"]]),{useAxios:ho,useDeleteUrlBuilder:Gf,useErrors:Wf,useExternalLinkCreator:Mb,useFetchUrlBuilder:Pb,useFetcher:Jf,useDebouncedFilter:$b,useStringHelpers:Yf,useHelpers:Zf,useGatewayFeatureSupported:Rb,useTruncationDetector:Ub}=Te,J1={class:"kong-ui-entities-certificates-list"},Y1={key:0},Z1={key:1},Q1={key:0},X1={key:1},eb={key:0},tb={key:1},rb={key:1},ib={key:1},nb=i.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,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=ho({headers:(ge=n.config)==null?void 0:ge.requestHeaders}),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),E={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}},w=i.computed(()=>{var se,me;let j=`${n.config.apiBaseUrl}${Bi.list[n.config.app]}`;return n.config.app==="konnect"?j=j.replace(/{controlPlaneId}/gi,((se=n.config)==null?void 0:se.controlPlaneId)||""):n.config.app==="kongManager"&&(j=j.replace(/\/{workspace}/gi,(me=n.config)!=null&&me.workspace?`/${n.config.workspace}`:"")),j}),h=i.ref(""),g=i.computed(()=>{const j=n.config.app==="konnect"||n.config.isExactMatch;return j?{isExactMatch:j,placeholder:o("certificates.search.placeholder")}:{isExactMatch:j,schema:n.config.filterSchema}}),{fetcher:v,fetcherState:m}=Jf(n.config,w.value),C=()=>{h.value=""},A=()=>{d.value++},S=i.ref(null),I=(j,se)=>{const me=j.id;if(!se(me)){r("copy:error",{entity:j,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:j,field:"id",message:o("certificates.copy.success",{val:me})})},T=(j,se)=>{const me=JSON.stringify(j);if(!se(me)){r("copy:error",{entity:j,message:o("certificates.errors.copy")});return}r("copy:success",{entity:j,message:o("certificates.copy.success_brief")})},Q=(j,se)=>{j.type==="error"?r("copy:error",{entity:se,field:"cert",message:o("certificates.errors.copy")}):r("copy:success",{entity:se,field:"cert",message:o("certificates.copy.success_brief")})},O=async j=>{var me;await((me=n.canRetrieve)==null?void 0:me.call(n,j))&&c.push(n.config.getViewRoute(j.id))},B=j=>({label:o("certificates.actions.view"),to:n.config.getViewRoute(j)}),Y=j=>({label:o("certificates.actions.edit"),to:n.config.getEditRoute(j)}),W=j=>{if(n.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:n.config.getCreateSniRoute(j)}},M=i.ref(void 0),J=i.ref(!1),re=i.ref(!1),de=i.ref(""),fe=Gf(n.config,w.value),{certificateDataCache:ke,getCertificateData:he}=kt.useCertificate(),ye=j=>{M.value=j,J.value=!0},Be=()=>{J.value=!1},zt=async()=>{var j,se,me;if((j=M.value)!=null&&j.id){re.value=!0;try{await l.delete(fe(M.value.id)),re.value=!1,J.value=!1,d.value++,r("delete:success",M.value)}catch(Pe){de.value=((me=(se=Pe.response)==null?void 0:se.data)==null?void 0:me.message)||Pe.message||o("certificates.errors.delete"),r("error",Pe)}finally{re.value=!1}}},X=i.ref(!0);i.watch(m,j=>{var se,me,Pe,Mt;if(Array.isArray((se=j==null?void 0:j.response)==null?void 0:se.data)&&(X.value=j.response.data.length>0),j.status===Ft.Error){S.value={title:o("certificates.errors.general")},(Mt=(Pe=(me=j.error)==null?void 0:me.response)==null?void 0:Pe.data)!=null&&Mt.message&&(S.value.message=j.error.response.data.message),r("error",j.error);return}ke.value={},S.value=null});const ee=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:o("certificates.list.empty_state.description"),title:o("certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(ee.value.title=o("certificates.list.empty_state.title"),ee.value.ctaText=o("certificates.actions.create"))}),(j,se)=>{const me=i.resolveComponent("KButton"),Pe=i.resolveComponent("KBadge"),Mt=i.resolveComponent("KTruncate"),te=i.resolveComponent("KDropdownItem"),Oe=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",J1,[i.createVNode(i.unref(Ff),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ee.value,"enable-entity-actions":"","error-message":S.value,fetcher:i.unref(v),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":i.unref(E),"use-action-outside":e.useActionOutside,onClearSearchInput:C,"onClick:row":se[2]||(se[2]=z=>O(z)),onSort:A},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(zf),{modelValue:h.value,"onUpdate:modelValue":se[0]||(se[0]=z=>h.value=z),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:i.withCtx(()=>[i.createVNode(i.unref(Dt),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(me,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[i.vShow,X.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:i.withCtx(({row:z})=>{var Ce;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Y1,i.toDisplayString((Ce=z==null?void 0:z.metadata)!=null&&Ce.subject?z.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",Z1,i.toDisplayString(i.unref(he)(z).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:z})=>{var Ce;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Q1,i.toDisplayString((Ce=z==null?void 0:z.metadata)!=null&&Ce.expiry?i.unref(s)(z.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",X1,i.toDisplayString(i.unref(he)(z).schemaExpiry?i.unref(s)(i.unref(he)(z).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:z})=>{var Ce;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",eb,i.toDisplayString((Ce=z==null?void 0:z.metadata)!=null&&Ce.dns_names?`dns=${z.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",tb,i.toDisplayString(i.unref(he)(z).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:z})=>[z!=null&&z.cert?(i.openBlock(),i.createBlock(i.unref(gy),{key:0,"data-testid":"copy-certificate-cert",notify:Ce=>Q(Ce,z),truncated:!0,uuid:z.cert},null,8,["notify","uuid"])):(i.openBlock(),i.createElementBlock("span",rb,"-"))]),tags:i.withCtx(({row:z})=>{var Ce;return[((Ce=z==null?void 0:z.tags)==null?void 0:Ce.length)>0?(i.openBlock(),i.createBlock(Mt,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(z==null?void 0:z.tags,zr=>(i.openBlock(),i.createBlock(Pe,{key:zr,onClick:se[1]||(se[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(zr),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",ib,"-"))]}),actions:i.withCtx(({row:z})=>[i.createVNode(Oe,null,{default:i.withCtx(({copyToClipboard:Ce})=>[i.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:zr=>I(z,Ce)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(Oe,null,{default:i.withCtx(({copyToClipboard:Ce})=>[i.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:zr=>T(z,Ce)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canRetrieve(z)},{default:i.withCtx(()=>[i.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:B(z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canEdit(z)},{default:i.withCtx(()=>[i.createVNode(te,{"data-testid":"action-entity-edit",item:Y(z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(i.openBlock(),i.createBlock(i.unref(Dt),{key:0,"auth-function":()=>e.canCreateSni()},{default:i.withCtx(()=>[i.createVNode(te,{"data-testid":"action-entity-add-sni",item:W(z.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canDelete(z)},{default:i.withCtx(()=>[i.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>ye(z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.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"]),i.createVNode(i.unref(qf),{"action-pending":re.value,"entity-type":i.unref(Oa).Certificate,error:de.value,title:i.unref(o)("certificates.delete.title"),visible:J.value,onCancel:Be,onProceed:zt},{description:i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(o)("certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.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[n,o]of t)r[n]=o;return r},ob=Kr(nb,[["__scopeId","data-v-fa23e672"]]),sb={class:"kong-ui-entities-certificates-form"},ab=Kr(i.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 S;const r=t,n=e,o=Gr.useRouter(),{i18nT:s,i18n:{t:a}}=kt.useI18n(),{getMessageFromError:c}=Wf(),{axiosInstance:l}=ho({headers:(S=n.config)==null?void 0:S.requestHeaders}),d=i.computed(()=>Bi.form[n.config.app].edit),y=i.computed(()=>n.certificateId?dr.Edit:dr.Create),p=i.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),E=i.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),w=i.computed(()=>(y.value===dr.Create||JSON.stringify(p.fields)!==JSON.stringify(E))&&!!p.fields.cert&&!!p.fields.key),h=I=>{var T;p.fields.cert=(I==null?void 0:I.cert)||"",p.fields.key=(I==null?void 0:I.key)||"",p.fields.certAlt=(I==null?void 0:I.cert_alt)||"",p.fields.keyAlt=(I==null?void 0:I.key_alt)||"",p.fields.tags=((T=I==null?void 0:I.tags)==null?void 0:T.join(", "))||"",Object.assign(E,p.fields)},g=()=>{o.push(n.config.cancelRoute)},v=i.computed(()=>{var T,Q;let I=`${n.config.apiBaseUrl}${Bi.form[n.config.app].validate}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(Q=n.config)!=null&&Q.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.certificateId),I}),m=i.computed(()=>{var T,Q;let I=`${n.config.apiBaseUrl}${Bi.form[n.config.app][y.value]}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(Q=n.config)!=null&&Q.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.certificateId),I}),C=i.computed(()=>{var I,T;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(T=(I=p.fields.tags.split(","))==null?void 0:I.map(Q=>String(Q||"").trim()))==null?void 0:T.filter(Q=>Q!=="")}}),A=async()=>{var I,T,Q,O,B,Y,W;try{p.isReadonly=!0;let M;await l.post(v.value,C.value),y.value==="create"?M=await l.post(m.value,C.value):y.value==="edit"&&(M=((I=n.config)==null?void 0:I.app)==="konnect"?await l.put(m.value,C.value):await l.patch(m.value,C.value)),p.fields.cert=((T=M==null?void 0:M.data)==null?void 0:T.cert)||"",p.fields.key=((Q=M==null?void 0:M.data)==null?void 0:Q.key)||"",p.fields.certAlt=((O=M==null?void 0:M.data)==null?void 0:O.cert_alt)||"",p.fields.keyAlt=((B=M==null?void 0:M.data)==null?void 0:B.key_alt)||"",p.fields.tags=((W=(Y=M==null?void 0:M.data)==null?void 0:Y.tags)==null?void 0:W.join(", "))||"",Object.assign(E,p.fields),r("update",M==null?void 0:M.data)}catch(M){p.errorMessage=c(M),r("error",M)}finally{p.isReadonly=!1}};return(I,T)=>{const Q=i.resolveComponent("KTextArea"),O=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",sb,[i.createVNode(i.unref(Hf),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":C.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":T[5]||(T[5]=B=>I.$emit("error",B)),"onFetch:success":h,onLoading:T[6]||(T[6]=B=>I.$emit("loading",B)),onSubmit:A},{default:i.withCtx(()=>[i.createVNode(i.unref(po),{description:i.unref(a)("certificates.form.sections.ssl.description"),title:i.unref(a)("certificates.form.sections.ssl.title")},{default:i.withCtx(()=>[i.createVNode(Q,{modelValue:p.fields.cert,"onUpdate:modelValue":T[0]||(T[0]=B=>p.fields.cert=B),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:i.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(Q,{modelValue:p.fields.key,"onUpdate:modelValue":T[1]||(T[1]=B=>p.fields.key=B),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:i.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(Q,{modelValue:p.fields.certAlt,"onUpdate:modelValue":T[2]||(T[2]=B=>p.fields.certAlt=B),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:i.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(Q,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":T[3]||(T[3]=B=>p.fields.keyAlt=B),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:i.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(po),{description:i.unref(a)("certificates.form.sections.general.description"),title:i.unref(a)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(O,{modelValue:p.fields.tags,"onUpdate:modelValue":T[4]||(T[4]=B=>p.fields.tags=B),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:i.unref(a)("certificates.form.fields.tags.help"),label:i.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:i.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-2c3ed6cc"]]),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"}}},cb={class:"kong-ui-ca-certificate-entity-config-card"},lb={key:0},ub=Kr(i.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"],n=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=kt.useI18n(),{convertKeyToTitle:c}=Yf(),{getPropValue:l}=Zf(),{getCertificateData:d}=kt.useCertificate(),y=i.computed(()=>Vi.form[o.config.app].edit),p=i.ref(),E=i.computed(()=>{if(p.value)return d(p.value)}),w=i.computed(()=>{var A;return((A=E.value)==null?void 0:A.schemaIssuer)||""}),h=i.computed(()=>{var A,S;return(A=E.value)!=null&&A.schemaExpiry?a((S=E.value)==null?void 0:S.schemaExpiry):""}),g=i.computed(()=>{var A;return((A=E.value)==null?void 0:A.schemaKeyUsages)||[]}),v=(A,S)=>{const I=l("rowValue",S);if(A==="expiry")return h.value;if(A==="key_usages")return g.value;if(I)return I[A]},m=A=>{p.value=A,n("fetch:success",A)},C=i.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:ce.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(A,S)=>{const I=i.resolveComponent("KCodeBlock"),T=i.resolveComponent("KLabel"),Q=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",cb,[i.createVNode(i.unref(Lf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":C.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":S[0]||(S[0]=O=>A.$emit("copy:success",O)),"onFetch:error":S[1]||(S[1]=O=>A.$emit("fetch:error",O)),"onFetch:success":m,onLoading:S[2]||(S[2]=O=>A.$emit("loading",O))},{cert:i.withCtx(O=>[i.unref(l)("rowValue",O)?(i.openBlock(),i.createBlock(I,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:i.unref(l)("rowValue",O),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):i.createCommentVNode("",!0)]),"metadata-label":i.withCtx(()=>[i.createVNode(T,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(O=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(l)("rowValue",O)).filter(B=>!r.includes(B)),B=>(i.openBlock(),i.createBlock(i.unref(Ii),{key:B,"data-testid":`ca-cert-metadata-${B}`,item:{key:B,label:i.unref(c)(B),value:v(B,O),type:B==="key_usages"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(w.value||"–"),1)]),key_usages:i.withCtx(()=>[g.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",lb,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(g.value,(O,B)=>(i.openBlock(),i.createBlock(Q,{key:`key_usages-badge-tag-${B}`,class:"config-badge","data-testid":`key_usages-badge-tag-${B}`,tooltip:O,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(O),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),db={class:"kong-ui-entities-ca-certificates-list"},fb={key:0},pb={key:1},hb={key:0},yb={key:1},gb={key:1},mb=Kr(i.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,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=ho({headers:(X=n.config)==null?void 0:X.requestHeaders}),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),E={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}},w=i.computed(()=>{var ge,j;let ee=`${n.config.apiBaseUrl}${Vi.list[n.config.app]}`;return n.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((ge=n.config)==null?void 0:ge.controlPlaneId)||""):n.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(j=n.config)!=null&&j.workspace?`/${n.config.workspace}`:"")),ee}),h=i.ref(""),g=i.computed(()=>{const ee=n.config.app==="konnect"||n.config.isExactMatch;return ee?{isExactMatch:ee,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:ee,schema:n.config.filterSchema}}),{fetcher:v,fetcherState:m}=Jf(n.config,w.value),C=()=>{h.value=""},A=()=>{d.value++},S=i.ref(null),I=(ee,ge)=>{const j=ee.id;if(!ge(j)){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:j})})},T=(ee,ge)=>{const j=JSON.stringify(ee);if(!ge(j)){r("copy:error",{entity:ee,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:o("ca-certificates.copy.success_brief")})},Q=async ee=>{var j;await((j=n.canRetrieve)==null?void 0:j.call(n,ee))&&c.push(n.config.getViewRoute(ee.id))},O=ee=>({label:o("ca-certificates.actions.view"),to:n.config.getViewRoute(ee)}),B=ee=>({label:o("ca-certificates.actions.edit"),to:n.config.getEditRoute(ee)}),Y=i.ref(void 0),W=i.ref(!1),M=i.ref(!1),J=i.ref(""),re=Gf(n.config,w.value),{certificateDataCache:de,getCertificateData:fe}=kt.useCertificate(),ke=ee=>{Y.value=ee,W.value=!0},he=()=>{W.value=!1},ye=async()=>{var ee,ge,j;if((ee=Y.value)!=null&&ee.id){M.value=!0;try{await l.delete(re(Y.value.id)),M.value=!1,W.value=!1,d.value++,r("delete:success",Y.value)}catch(se){J.value=((j=(ge=se.response)==null?void 0:ge.data)==null?void 0:j.message)||se.message||o("ca-certificates.errors.delete"),r("error",se)}finally{M.value=!1}}},Be=i.ref(!0);i.watch(m,ee=>{var ge,j,se,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){S.value={title:o("ca-certificates.errors.general")},(me=(se=(j=ee.error)==null?void 0:j.response)==null?void 0:se.data)!=null&&me.message&&(S.value.message=ee.error.response.data.message),r("error",ee.error);return}de.value={},S.value=null});const zt=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:o("ca-certificates.list.empty_state.description"),title:o("ca-certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(zt.value.title=o("ca-certificates.list.empty_state.title"),zt.value.ctaText=o("ca-certificates.actions.create"))}),(ee,ge)=>{const j=i.resolveComponent("KButton"),se=i.resolveComponent("KBadge"),me=i.resolveComponent("KTruncate"),Pe=i.resolveComponent("KDropdownItem"),Mt=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",db,[i.createVNode(i.unref(Ff),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":zt.value,"enable-entity-actions":"","error-message":S.value,fetcher:i.unref(v),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":i.unref(E),"use-action-outside":e.useActionOutside,onClearSearchInput:C,"onClick:row":ge[2]||(ge[2]=te=>Q(te)),onSort:A},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(zf),{modelValue:h.value,"onUpdate:modelValue":ge[0]||(ge[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:i.withCtx(()=>[i.createVNode(i.unref(Dt),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(j,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[i.vShow,Be.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:i.withCtx(({row:te})=>{var Oe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",fb,i.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.issuer?te.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",pb,i.toDisplayString(i.unref(fe)(te).schemaIssuer||"-"),1))]}),expiry:i.withCtx(({row:te})=>{var Oe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",hb,i.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.expiry?i.unref(s)(te.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",yb,i.toDisplayString(i.unref(fe)(te).schemaExpiry?i.unref(s)(i.unref(fe)(te).schemaExpiry):"-"),1))]}),tags:i.withCtx(({row:te})=>{var Oe;return[((Oe=te==null?void 0:te.tags)==null?void 0:Oe.length)>0?(i.openBlock(),i.createBlock(me,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(te==null?void 0:te.tags,z=>(i.openBlock(),i.createBlock(se,{key:z,onClick:ge[1]||(ge[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",gb,"-"))]}),actions:i.withCtx(({row:te})=>[i.createVNode(Mt,null,{default:i.withCtx(({copyToClipboard:Oe})=>[i.createVNode(Pe,{"data-testid":"action-entity-copy-id",onClick:z=>I(te,Oe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(Mt,null,{default:i.withCtx(({copyToClipboard:Oe})=>[i.createVNode(Pe,{"data-testid":"action-entity-copy-json",onClick:z=>T(te,Oe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canRetrieve(te)},{default:i.withCtx(()=>[i.createVNode(Pe,{"data-testid":"action-entity-view","has-divider":"",item:O(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canEdit(te)},{default:i.withCtx(()=>[i.createVNode(Pe,{"data-testid":"action-entity-edit",item:B(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canDelete(te)},{default:i.withCtx(()=>[i.createVNode(Pe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Oe=>ke(te)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.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"]),i.createVNode(i.unref(qf),{"action-pending":M.value,"entity-type":i.unref(Oa).CACertificate,error:J.value,title:i.unref(o)("ca-certificates.delete.title"),visible:W.value,onCancel:he,onProceed:ye},{description:i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f25a63b4"]]),bb={class:"kong-ui-entities-ca-certificates-form"},wb=Kr(i.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 A;const r=t,n=e,o=Gr.useRouter(),{i18n:{t:s}}=kt.useI18n(),{getMessageFromError:a}=Wf(),{axiosInstance:c}=ho({headers:(A=n.config)==null?void 0:A.requestHeaders}),l=i.computed(()=>Vi.form[n.config.app].edit),d=i.computed(()=>n.certificateId?dr.Edit:dr.Create),y=i.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=i.reactive({cert:"",certDigest:"",tags:""}),E=i.computed(()=>(d.value===dr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=S=>{var I;y.fields.cert=(S==null?void 0:S.cert)||"",y.fields.certDigest=(S==null?void 0:S.cert_digest)||"",y.fields.tags=((I=S==null?void 0:S.tags)==null?void 0:I.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(n.config.cancelRoute)},g=i.computed(()=>{var I,T;let S=`${n.config.apiBaseUrl}${Vi.form[n.config.app].validate}`;return n.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((I=n.config)==null?void 0:I.controlPlaneId)||""):n.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(T=n.config)!=null&&T.workspace?`/${n.config.workspace}`:"")),S=S.replace(/{id}/gi,n.certificateId),S}),v=i.computed(()=>{var I,T;let S=`${n.config.apiBaseUrl}${Vi.form[n.config.app][d.value]}`;return n.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((I=n.config)==null?void 0:I.controlPlaneId)||""):n.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(T=n.config)!=null&&T.workspace?`/${n.config.workspace}`:"")),S=S.replace(/{id}/gi,n.certificateId),S}),m=i.computed(()=>{var S,I;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(I=(S=y.fields.tags.split(","))==null?void 0:S.map(T=>String(T||"").trim()))==null?void 0:I.filter(T=>T!=="")}}),C=async()=>{var S,I,T,Q,O;try{y.isReadonly=!0;let B;await c.post(g.value,m.value),d.value==="create"?B=await c.post(v.value,m.value):d.value==="edit"&&(B=((S=n.config)==null?void 0:S.app)==="konnect"?await c.put(v.value,m.value):await c.patch(v.value,m.value)),y.fields.cert=((I=B==null?void 0:B.data)==null?void 0:I.cert)||"",y.fields.certDigest=((T=B==null?void 0:B.data)==null?void 0:T.cert_digest)||"",y.fields.tags=((O=(Q=B==null?void 0:B.data)==null?void 0:Q.tags)==null?void 0:O.join(", "))||"",Object.assign(p,y.fields),r("update",B==null?void 0:B.data)}catch(B){y.errorMessage=a(B),r("error",B)}finally{y.isReadonly=!1}};return(S,I)=>{const T=i.resolveComponent("KTextArea"),Q=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",bb,[i.createVNode(i.unref(Hf),{"can-submit":E.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"form-fields":m.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":I[3]||(I[3]=O=>S.$emit("error",O)),"onFetch:success":w,onLoading:I[4]||(I[4]=O=>S.$emit("loading",O)),onSubmit:C},{default:i.withCtx(()=>[i.createVNode(i.unref(po),{description:i.unref(s)("ca-certificates.form.sections.cert.description"),title:i.unref(s)("ca-certificates.form.sections.cert.title")},{default:i.withCtx(()=>[i.createVNode(T,{modelValue:y.fields.cert,"onUpdate:modelValue":I[0]||(I[0]=O=>y.fields.cert=O),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:i.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:i.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),i.createVNode(Q,{modelValue:y.fields.certDigest,"onUpdate:modelValue":I[1]||(I[1]=O=>y.fields.certDigest=O),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:i.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(po),{description:i.unref(s)("ca-certificates.form.sections.general.description"),title:i.unref(s)("ca-certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(Q,{modelValue:y.fields.tags,"onUpdate:modelValue":I[2]||(I[2]=O=>y.fields.tags=O),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:i.unref(s)("ca-certificates.form.fields.tags.help"),label:i.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:i.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-6316d5b5"]]),vb={class:"kong-ui-certificate-entity-config-card"},kb={key:0},Cb=Kr(i.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,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),{convertKeyToTitle:c}=Yf(),{getPropValue:l}=Zf(),{getCertificateData:d}=kt.useCertificate(),y=i.computed(()=>Bi.form[n.config.app].edit),p=i.ref(),E=i.ref({id:{},cert:{section:pe.Basic},key:{section:pe.Basic,type:ce.Redacted},metadata:{section:pe.Basic,type:ce.Json},snis:{section:pe.Basic,type:ce.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...n.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:ce.Redacted}}),w=O=>{p.value=O,r("fetch:success",O)},h=(O,B)=>{const Y=l("rowValue",B);if(O==="expiry")return v.value;if(O==="key_usages")return S.value;if(O==="san_names")return C.value;if(Y)return Y[O]},g=i.computed(()=>{if(p.value)return d(p.value)}),v=i.computed(()=>{var O,B;return(O=g.value)!=null&&O.schemaExpiry?s((B=g.value)==null?void 0:B.schemaExpiry):""}),m=i.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaIssuer)||""}),C=i.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaSanNames)||""}),A=i.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaSubject)||""}),S=i.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaKeyUsages)||[]}),I=i.computed(()=>{var O,B;return((B=(O=p==null?void 0:p.value)==null?void 0:O.snis)==null?void 0:B.length)>0}),T=i.computed(()=>{var O;return!!((O=p==null?void 0:p.value)!=null&&O.cert_alt)}),Q=O=>{var B,Y;return O==="san_names"?o("certificates.list.table_headers.san"):((Y=(B=E.value)==null?void 0:B[O])==null?void 0:Y.label)||c(O)};return(O,B)=>{const Y=i.resolveComponent("KCodeBlock"),W=i.resolveComponent("KLabel"),M=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",vb,[i.createVNode(i.unref(Lf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":E.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":B[0]||(B[0]=J=>O.$emit("copy:success",J)),"onFetch:error":B[1]||(B[1]=J=>O.$emit("fetch:error",J)),"onFetch:success":w,onLoading:B[2]||(B[2]=J=>O.$emit("loading",J))},i.createSlots({"cert-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:i.withCtx(J=>[i.unref(l)("rowValue",J)?(i.openBlock(),i.createBlock(Y,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:i.unref(l)("rowValue",J),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):i.createCommentVNode("",!0)]),"key-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":i.withCtx(()=>[i.createVNode(W,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(J=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(l)("rowValue",J)),re=>(i.openBlock(),i.createBlock(i.unref(Ii),{key:re,item:{key:re,value:h(re,J),label:Q(re),type:re==="key_usages"||re==="snis"||re==="dns_names"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(v.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(A.value||"–"),1)]),"cert_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:i.withCtx(()=>[S.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",kb,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(S.value,(J,re)=>(i.openBlock(),i.createBlock(M,{key:`key_usages-badge-tag-${re}`,class:"config-badge","data-testid":`key_usages-badge-tag-${re}`,tooltip:J,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(J),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[I.value?void 0:{name:"snis",fn:i.withCtx(()=>[i.createTextVNode(" – ")]),key:"0"},T.value?{name:"cert_alt",fn:i.withCtx(J=>[i.createTextVNode(" > "),i.unref(l)("rowValue",J)?(i.openBlock(),i.createBlock(Y,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:i.unref(l)("rowValue",J),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-920043bf"]]);$e.CACertificateConfigCard=ub,$e.CACertificateForm=wb,$e.CACertificateList=mb,$e.CertificateConfigCard=Cb,$e.CertificateForm=ab,$e.CertificateList=ob,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});
147
+ `+e.slice(a+1):l+=e.slice(o),l.slice(1)}function I0(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||b0(r);return t}function E0(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 Pf(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 N0(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 O0(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),c,l,d,y,p,E;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)E="",(!i||o!=="")&&(E+=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)?E+="?":E+="? "),E+=e.dump,p&&(E+=qa(e,t)),jt(e,t+1,y,!0,p)&&(e.dump&&Ni===e.dump.charCodeAt(0)?E+=":":E+=": ",E+=e.dump,o+=E));e.tag=s,e.dump=o||"{}"}function $f(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,vf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(kf.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,$f(e,r,!1)||$f(e,r,!0);var c=vf.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var y=c==="[object Object]"||c==="[object Array]",p,E;if(y&&(p=e.duplicates.indexOf(r),E=p!==-1),(e.tag!==null&&e.tag!=="?"||E||e.indent!==2&&t>0)&&(o=!1),E&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&E&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(O0(e,t,e.dump,o),E&&(e.dump="&ref_"+p+e.dump)):(N0(e,t,e.dump),E&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Pf(e,t-1,e.dump,o):Pf(e,t,e.dump,o),E&&(e.dump="&ref_"+p+e.dump)):(E0(e,t,e.dump),E&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&A0(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 _0(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 T0(e,t){t=t||{};var r=new v0(t);r.noRefs||_0(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),jt(r,0,i,!0,!0)?r.dump+`
148
+ `:""}var V0=T0,j0={dump:V0};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 D0=Me,M0=Rd,P0=Fd,$0=Wd,R0=Jd,U0=$a,L0=wf.load,H0=wf.loadAll,F0=j0.dump,q0=Fe,K0={binary:ef,float:Gd,map:Hd,null:qd,pairs:rf,set:nf,timestamp:Qd,bool:Kd,int:zd,merge:Xd,omap:tf,seq:Ld,str:Ud},z0=Ga("safeLoad","load"),G0=Ga("safeLoadAll","loadAll"),W0=Ga("safeDump","dump"),J0={Type:D0,Schema:M0,FAILSAFE_SCHEMA:P0,JSON_SCHEMA:$0,CORE_SCHEMA:R0,DEFAULT_SCHEMA:U0,load:L0,loadAll:H0,dump:F0,YAMLException:q0,types:K0,safeLoad:z0,safeLoadAll:G0,safeDump:W0};const Y0={class:"yaml-config"},Rf=n.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=n.computed(()=>{const i=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,o])=>o&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(i).length===0&&i.constructor===Object?"":J0.dump(i).trim()});return(i,o)=>{const s=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",Y0,[t.yamlRecord?(n.openBlock(),n.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):n.createCommentVNode("",!0)])}}}),Z0={key:0,class:"config-card-display-form"},Q0=["data-testid"],X0={key:0,class:"config-card-prop-section-title"},e1=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",Z0,[(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",X0,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,Q0))),128))])):n.createCommentVNode("",!0),e.format==="json"&&t.record?(n.openBlock(),n.createBlock(Dd,{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(Rf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):n.createCommentVNode("",!0)],64))}}),t1=dt(e1,[["__scopeId","data-v-2b74ac63"]]),Uf="24px",r1=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},i1=e=>(n.pushScopeId("data-v-40a7f387"),e=e(),n.popScopeId(),e),n1=["aria-hidden"],o1={key:0,"data-testid":"kui-icon-svg-title"},s1=i1(()=>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)),a1=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:Uf,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 Uf}),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",o1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),s1],8,n1))]),_:1},8,["aria-hidden","style"]))}}),c1=r1(a1,[["__scopeId","data-v-40a7f387"]]),l1={"data-testid":"config-card-title"},u1={class:"config-card-actions"},d1=["href"],f1={key:2,class:"config-card-details-section"},p1={key:3,class:"config-card-details-section"},h1=["data-testid"],y1={key:0,class:"config-card-prop-section-title"},g1=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"),E=B=>{p.value=B==null?void 0:B.value},w={id:{type:ce.ID,label:a("baseConfigCard.commonFields.id_label"),order:0,section:pe.Basic},name:{order:1,section:pe.Basic},enabled:{type:ce.BadgeStatus,order:2,section:pe.Basic},updated_at:{type:ce.Date,label:a("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:ce.Date,label:a("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:ce.BadgeTag,order:-1,section:pe.Basic}},h=n.ref(!1),g=n.ref(!1),v=n.ref(""),m=n.ref({}),C=n.computed(()=>{var B,Y,W;if(!m.value)return[];const M=[],J=Object.keys(m.value).length;for(const re in m.value){const de=(Y=(B=o.configSchema)==null?void 0:B[re])==null?void 0:Y.order,fe=(W=w[re])==null?void 0:W.order;let ke=J;(fe||fe===0)&&(ke=fe===-1?J+1:fe),de&&(ke=de===-1?J+1:de),M.push([re,ke])}return M.sort(function(re,de){return re[1]-de[1]}),M.map(re=>{var de,fe;const ke=re[0],he=(de=m.value)==null?void 0:de[ke],ye=((fe=o.configSchema)==null?void 0:fe[ke])||{},Be=w[ke];return{key:ke,value:he,hidden:ye.hidden||!1,type:ye.type??((Be==null?void 0:Be.type)||ce.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(re=>!re.hidden&&re.key!==o.pluginConfigKey)}),A=n.computed(()=>{var B,Y;if(!m.value||!o.pluginConfigKey)return[];const W=m.value[o.pluginConfigKey]||{},M=Object.keys(W).length,J=[];for(const re in W){const de=(Y=(B=o.pluginConfigSchema)==null?void 0:B[re])==null?void 0:Y.order,fe=W[re];let ke=fe!=null&&fe!==""?M-1:M;de&&(ke=de===-1?M+1:de),J.push([re,ke])}return J.sort(function(re,de){return re[1]-de[1]}),J.map(re=>{var de;const fe=re[0],ke=W[fe],he=((de=o.pluginConfigSchema)==null?void 0:de[fe])||{};return{key:fe,value:ke,hidden:he.hidden||!1,type:he.type??ce.Text,label:he.label??l(fe),tooltip:he.tooltip??void 0,section:pe.Plugin}}).filter(re=>!re.hidden)}),S=n.computed(()=>{var B,Y,W,M;return{basic:(B=C.value)==null?void 0:B.filter(J=>J.section===pe.Basic),advanced:(Y=C.value)==null?void 0:Y.filter(J=>J.section===pe.Advanced),plugin:(M=A.value)==null?void 0:M.concat((W=C.value)==null?void 0:W.filter(J=>J.section===pe.Plugin))}}),I=n.computed(()=>{const B=[];return S.value.basic.length&&B.push("basic"),S.value.advanced.length&&B.push("advanced"),S.value.plugin.length&&B.push("plugin"),B}),T=B=>!!(B.tooltip||s[`${B.key}-label-tooltip`]),Q=n.computed(()=>{var B,Y;let W=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?W=W.replace(/{controlPlaneId}/gi,((B=o.config)==null?void 0:B.controlPlaneId)||""):o.config.app==="kongManager"&&(W=W.replace(/\/{workspace}/gi,(Y=o.config)!=null&&Y.workspace?`/${o.config.workspace}`:"")),W=W.replace(/{id}/gi,o.config.entityId),W}),O=B=>{m.value&&B(JSON.stringify(m.value))?i("copy:success",m.value):i("copy:error")};return n.watch(h,B=>{i("loading",B)},{immediate:!0}),n.onBeforeMount(async()=>{g.value=!1,h.value=!0;try{const{data:B}=await d.get(Q.value);if(o.dataKey)if(typeof B[o.dataKey]<"u")m.value={...B[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else m.value={...B};Object.keys(o.configSchema).filter(Y=>o.configSchema[Y].forceShow).forEach(Y=>{m.value&&typeof m.value[Y]>"u"&&(m.value[Y]=null)}),i("fetch:success",B)}catch(B){const Y=c(B);v.value=Y.startsWith("code")?a("baseConfigCard.errors.load"):Y,g.value=!0,i("fetch:error",B)}finally{h.value=!1}}),(B,Y)=>{const W=n.resolveComponent("KLabel"),M=n.resolveComponent("KSelect"),J=n.resolveComponent("KButton"),re=n.resolveComponent("KClipboardProvider"),de=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",u1,[n.renderSlot(B.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(W,{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(M,{key:1,"data-testid":"select-config-format",items:y,onChange:E})):n.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(J,{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(c1),{size:n.unref(yg)},null,8,["size"])],8,d1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(re,{key:3},{default:n.withCtx(({copyToClipboard:he})=>[!h.value&&!g.value?(n.openBlock(),n.createBlock(J,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:ye=>O(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(de,{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(v.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",f1,[n.createVNode(t1,{config:e.config,"fetcher-url":Q.value,format:p.value,"prop-list-types":I.value,"property-collections":S.value,record:m.value},n.createSlots({_:2},[n.renderList(Object.keys(B.$slots),he=>({name:he,fn:n.withCtx(({row:ye,rowValue:Be})=>[n.renderSlot(B.$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",p1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(I.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",y1,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(S.value[he],ye=>(n.openBlock(),n.createBlock(Ii,{key:ye.key,item:ye},n.createSlots({label:n.withCtx(()=>[n.renderSlot(B.$slots,`${ye.key}-label`,{row:ye},void 0,!0)]),[ye.key]:n.withCtx(({rowValue:Be})=>[n.renderSlot(B.$slots,ye.key,{row:ye,rowValue:Be},void 0,!0)]),_:2},[T(ye)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(B.$slots,`${ye.key}-label-tooltip`,{row:ye},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,h1))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",l1,[n.renderSlot(B.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Lf=dt(g1,[["__scopeId","data-v-3fd4a3a4"]]),m1={class:"form-actions","data-testid":"form-actions"},b1={key:0},w1=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(""),E=n.computed(()=>o.canSubmit===!1||o.isReadonly),w=n.ref(!1),h=n.computed(()=>{var S,I;let T=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?T=T.replace(/{controlPlaneId}/gi,((S=o.config)==null?void 0:S.controlPlaneId)||""):o.config.app==="kongManager"&&(T=T.replace(/\/{workspace}/gi,(I=o.config)!=null&&I.workspace?`/${o.config.workspace}`:"")),o.editId?(T=T.replace(/{id}/gi,o.editId),T):(T=T.replace(/\/{id}/gi,""),T)}),g=()=>{w.value=!w.value},v=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):m()},m=()=>{i("cancel")},C=()=>{E.value||i("submit")},A=n.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return n.watch(()=>d.value,S=>{i("loading",S)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:S}=await l.get(h.value);i("fetch:success",S)}catch(S){const I=c(S);p.value=I.startsWith("code")?a("baseForm.errors.edit"):I,y.value=!0,i("fetch:error",S)}finally{d.value=!1}}),(S,I)=>{const T=n.resolveComponent("KSkeleton"),Q=n.resolveComponent("KEmptyState"),O=n.resolveComponent("KAlert"),B=n.resolveComponent("KButton"),Y=n.resolveComponent("KTabs"),W=n.resolveComponent("KSlideout"),M=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(M,{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(T,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(Q,{key:1,"cta-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":v,"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(C,["prevent"])},[n.renderSlot(S.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(O,{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(S.$slots,"form-actions",{},()=>[e.config.jsonYamlFormsEnabled?(n.openBlock(),n.createElementBlock("div",b1,[n.createVNode(B,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:I[0]||(I[0]=J=>g())},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(B,{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(B,{appearance:"primary","data-testid":"form-submit",disabled:E.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),n.createVNode(W,{"close-button-alignment":"end","data-testid":"form-view-configuration-slideout","has-overlay":!1,"is-visible":w.value,"prevent-close-on-blur":"",title:n.unref(a)("baseForm.configuration.title"),onClose:I[1]||(I[1]=J=>g())},{default:n.withCtx(()=>[n.createElementVNode("div",null,n.toDisplayString(n.unref(a)("baseForm.configuration.message")),1),n.createVNode(Y,{"data-testid":"form-view-configuration-slideout-tabs",tabs:A.value},{json:n.withCtx(()=>[n.createVNode(Dd,{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(Rf,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["is-visible","title"])]),_:3})}}}),Hf=dt(w1,[["__scopeId","data-v-4ef70725"]]),v1={key:0,"data-testid":"first-col"},k1=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,v;const m=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return m?((v=m[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,v,m;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,y.value=((v=r.value)==null?void 0:v.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(""),E=n.computed(()=>[i.value,r.value]),w=n.watch(E,g=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of g)v&&s.observe(v)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>y.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{w()}),(g,v)=>{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",v1,[n.createVNode(m,{"max-width":"300",placement:"bottomStart",text:h.value?p.value:""},{default:n.withCtx(()=>[n.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):n.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),C1=dt(k1,[["__scopeId","data-v-c4379fd4"]]),S1={class:"toolbar-container"},x1={key:0,class:"toolbar-button-container"},A1=["data-testid"],B1=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 I,T;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(I=r.errorMessage)==null?void 0:I.title,message:(T=r.errorMessage)==null?void 0:T.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=I=>I.hasData||!!r.query,l=n.computed(()=>{const I=[];return Object.keys(r.tableHeaders).forEach(T=>{const Q=r.tableHeaders[T];I.push({label:Q.label??T,key:T,sortable:Q.sortable??!1})}),r.enableEntityActions&&I.push({key:"actions",hideLabel:!0}),I}),d=I=>({"data-rowid":I.id,"data-testid":I.name,...r.rowAttributes(I)}),y=n.ref({}),p=I=>{var T;return(T=y.value)==null?void 0:T.$el.querySelector(`[data-rowid="${I.id}"]`)},E=I=>{const T={"data-testid":I.headerKey,...r.cellAttributes(I)};return I.colIndex===0&&(T.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),T},w=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=n.computed(()=>r.disableRowClick?void 0:(I,T)=>{i("click:row",T)}),v=I=>{i("sort",I)},{setTablePreferences:m,getTablePreferences:C}=vy(),A=n.computed(()=>{const I=C(r.preferencesStorageKey);return{...r.initialFetcherParams,...I}}),S=I=>{r.preferencesStorageKey&&m(r.preferencesStorageKey,I)};return(I,T)=>{const Q=n.resolveComponent("KIcon"),O=n.resolveComponent("KButton"),B=n.resolveComponent("KDropdown"),Y=n.resolveComponent("KTable"),W=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(W,{class:"kong-ui-entity-base-table",title:e.title},{default:n.withCtx(()=>[n.createVNode(Y,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":E,"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":A.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:w,"onRow:click":g.value,onSort:T[0]||(T[0]=M=>v(M)),"onUpdate:tablePreferences":S},n.createSlots({toolbar:n.withCtx(({state:M})=>[n.withDirectives(n.createElementVNode("div",S1,[n.renderSlot(I.$slots,"toolbar-filter",{},void 0,!0),I.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",x1,[n.renderSlot(I.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,c(M)]])]),actions:n.withCtx(({row:M,rowKey:J,rowValue:re})=>[n.createElementVNode("div",{class:"actions-container","data-testid":M.name},[n.createVNode(B,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(I.$slots,"actions",{row:M,rowKey:J,rowValue:re},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(O,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(Q,{color:n.unref(pg),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,A1)]),_:2},[n.renderList(e.tableHeaders,(M,J)=>({name:J,fn:n.withCtx(({row:re,rowKey:de,rowValue:fe})=>[n.createVNode(C1,{"key-name":String(J),"row-el":p(re)},{default:n.withCtx(()=>[n.renderSlot(I.$slots,J,{row:re,rowKey:de,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"])}}}),Ff=dt(B1,[["__scopeId","data-v-ecfaa7cf"]]),I1={key:0,class:"kong-ui-entity-delete-error"},E1={key:1,class:"description"},N1=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-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:c},{default:n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",I1,[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",E1,[n.renderSlot(l.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),qf=dt(N1,[["__scopeId","data-v-efe8f34b"]]),O1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},_1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},T1=["fill"],V1={mask:"url(#mask0_180_20349)"},j1=["fill"],Kf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${dg})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",O1,[n.createElementVNode("mask",_1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,T1)]),n.createElementVNode("g",V1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,j1)])]))}}),D1={key:1,class:"kong-ui-entity-filter"},M1={class:"menu-item-title"},P1={class:"menu-item-indicator"},$1={class:"menu-item-body"},R1=["for"],U1={class:"menu-item-buttons"},L1={class:"filter-clear-button-container"},H1=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((C,A)=>{C!==""&&m.push(A)}),m}),l=n.computed(()=>{const m=i.config.fields;return Object.keys(m).filter(C=>m[C].searchable).map(C=>({label:m[C].label||C,value:C}))});n.watch(()=>i.modelValue,m=>{a.value={},new URLSearchParams(m).forEach((C,A)=>{a.value[A]=C})});const d=()=>{s.value=!s.value},y=m=>{o("update:modelValue",m)},p=m=>`filter-${m}`,E=m=>{var C,A;return(((A=(C=i.config.schema)==null?void 0:C[m])==null?void 0:A.values)??[]).map(S=>({value:S,label:S}))},w=m=>{var C,A;return((A=(C=i.config.schema)==null?void 0:C[m])==null?void 0:A.type)??"text"},h=m=>{a.value={...a.value,[m]:""},v()},g=()=>{a.value={},v(!0)},v=(m=!1)=>{const C=Object.keys(a.value).reduce((A,S)=>(a.value[S]&&(A[S]=`${a.value[S]}`),A),{});m&&(s.value=!1),o("update:modelValue",new URLSearchParams(C).toString())};return(m,C)=>{const A=n.resolveComponent("KInput"),S=n.resolveComponent("KButton"),I=n.resolveComponent("KSelect"),T=n.resolveComponent("KMenuItem"),Q=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(A,{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(Kf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",D1,[n.createVNode(S,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:n.withCtx(()=>[n.createVNode(Kf),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(Q,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(O,B)=>(n.openBlock(),n.createBlock(T,{key:O.value,"data-testid":O.value,expandable:"","last-menu-item":B===l.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",M1,[n.createTextVNode(n.toDisplayString(O.label)+" ",1),n.withDirectives(n.createElementVNode("span",P1,null,512),[[n.vShow,c.value.includes(O.value)]])])]),itemBody:n.withCtx(()=>{var Y,W;return[n.createElementVNode("div",$1,[n.createElementVNode("label",{class:"menu-item-label",for:p(O.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,R1),((W=(Y=e.config.schema)==null?void 0:Y[O.value])==null?void 0:W.type)==="select"?(n.openBlock(),n.createBlock(I,{key:0,id:p(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":M=>a.value[O.value]=M,items:E(O.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(A,{key:1,id:p(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":M=>a.value[O.value]=M,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:w(O.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",U1,[n.createVNode(S,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:C[0]||(C[0]=M=>v(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(S,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:M=>h(O.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",L1,[n.createVNode(S,{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]])]))}}}),zf=dt(H1,[["__scopeId","data-v-e9512e8f"]]),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)}}),F1={class:"form-section-wrapper"},q1={key:0,class:"form-section-title"},K1={key:1,class:"form-section-description"},z1={key:2,class:"form-section-footer"},G1={class:"form-section-content"},W1=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",F1,[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",q1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",K1,[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",z1,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",G1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),po=dt(W1,[["__scopeId","data-v-3565daa7"]]),{useAxios:ho,useDeleteUrlBuilder:Gf,useErrors:Wf,useExternalLinkCreator:Mb,useFetchUrlBuilder:Pb,useFetcher:Jf,useDebouncedFilter:$b,useStringHelpers:Yf,useHelpers:Zf,useGatewayFeatureSupported:Rb,useTruncationDetector:Ub}=Te,J1={class:"kong-ui-entities-certificates-list"},Y1={key:0},Z1={key:1},Q1={key:0},X1={key:1},eb={key:0},tb={key:1},rb={key:1},ib={key:1},nb=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),E={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}},w=n.computed(()=>{var se,me;let j=`${i.config.apiBaseUrl}${Bi.list[i.config.app]}`;return i.config.app==="konnect"?j=j.replace(/{controlPlaneId}/gi,((se=i.config)==null?void 0:se.controlPlaneId)||""):i.config.app==="kongManager"&&(j=j.replace(/\/{workspace}/gi,(me=i.config)!=null&&me.workspace?`/${i.config.workspace}`:"")),j}),h=n.ref(""),g=n.computed(()=>{const j=i.config.app==="konnect"||i.config.isExactMatch;return j?{isExactMatch:j,placeholder:o("certificates.search.placeholder")}:{isExactMatch:j,schema:i.config.filterSchema}}),{fetcher:v,fetcherState:m}=Jf(i.config,w.value),C=()=>{h.value=""},A=()=>{d.value++},S=n.ref(null),I=(j,se)=>{const me=j.id;if(!se(me)){r("copy:error",{entity:j,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:j,field:"id",message:o("certificates.copy.success",{val:me})})},T=(j,se)=>{const me=JSON.stringify(j);if(!se(me)){r("copy:error",{entity:j,message:o("certificates.errors.copy")});return}r("copy:success",{entity:j,message:o("certificates.copy.success_brief")})},Q=(j,se)=>{j.type==="error"?r("copy:error",{entity:se,field:"cert",message:o("certificates.errors.copy")}):r("copy:success",{entity:se,field:"cert",message:o("certificates.copy.success_brief")})},O=async j=>{var me;await((me=i.canRetrieve)==null?void 0:me.call(i,j))&&c.push(i.config.getViewRoute(j.id))},B=j=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(j)}),Y=j=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(j)}),W=j=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(j)}},M=n.ref(void 0),J=n.ref(!1),re=n.ref(!1),de=n.ref(""),fe=Gf(i.config,w.value),{certificateDataCache:ke,getCertificateData:he}=kt.useCertificate(),ye=j=>{M.value=j,J.value=!0},Be=()=>{J.value=!1},zt=async()=>{var j,se,me;if((j=M.value)!=null&&j.id){re.value=!0;try{await l.delete(fe(M.value.id)),re.value=!1,J.value=!1,d.value++,r("delete:success",M.value)}catch(Pe){de.value=((me=(se=Pe.response)==null?void 0:se.data)==null?void 0:me.message)||Pe.message||o("certificates.errors.delete"),r("error",Pe)}finally{re.value=!1}}},X=n.ref(!0);n.watch(m,j=>{var se,me,Pe,Mt;if(Array.isArray((se=j==null?void 0:j.response)==null?void 0:se.data)&&(X.value=j.response.data.length>0),j.status===Ft.Error){S.value={title:o("certificates.errors.general")},(Mt=(Pe=(me=j.error)==null?void 0:me.response)==null?void 0:Pe.data)!=null&&Mt.message&&(S.value.message=j.error.response.data.message),r("error",j.error);return}ke.value={},S.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"))}),(j,se)=>{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",J1,[n.createVNode(n.unref(Ff),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ee.value,"enable-entity-actions":"","error-message":S.value,fetcher:n.unref(v),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(E),"use-action-outside":e.useActionOutside,onClearSearchInput:C,"onClick:row":se[2]||(se[2]=z=>O(z)),onSort:A},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(zf),{modelValue:h.value,"onUpdate:modelValue":se[0]||(se[0]=z=>h.value=z),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:z})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",Y1,n.toDisplayString((Ce=z==null?void 0:z.metadata)!=null&&Ce.subject?z.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",Z1,n.toDisplayString(n.unref(he)(z).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:z})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",Q1,n.toDisplayString((Ce=z==null?void 0:z.metadata)!=null&&Ce.expiry?n.unref(s)(z.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",X1,n.toDisplayString(n.unref(he)(z).schemaExpiry?n.unref(s)(n.unref(he)(z).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:z})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",eb,n.toDisplayString((Ce=z==null?void 0:z.metadata)!=null&&Ce.dns_names?`dns=${z.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",tb,n.toDisplayString(n.unref(he)(z).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:z})=>[z!=null&&z.cert?(n.openBlock(),n.createBlock(n.unref(gy),{key:0,"data-testid":"copy-certificate-cert",notify:Ce=>Q(Ce,z),truncated:!0,uuid:z.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",rb,"-"))]),tags:n.withCtx(({row:z})=>{var Ce;return[((Ce=z==null?void 0:z.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(z==null?void 0:z.tags,zr=>(n.openBlock(),n.createBlock(Pe,{key:zr,onClick:se[1]||(se[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(zr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",ib,"-"))]}),actions:n.withCtx(({row:z})=>[n.createVNode(Oe,null,{default:n.withCtx(({copyToClipboard:Ce})=>[n.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:zr=>I(z,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=>T(z,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(z)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:B(z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canEdit(z)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-edit",item:Y(z.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:W(z.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canDelete(z)},{default:n.withCtx(()=>[n.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>ye(z)},{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(qf),{"action-pending":re.value,"entity-type":n.unref(Oa).Certificate,error:de.value,title:n.unref(o)("certificates.delete.title"),visible:J.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},ob=Kr(nb,[["__scopeId","data-v-fa23e672"]]),sb={class:"kong-ui-entities-certificates-form"},ab=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 S;const r=t,i=e,o=Gr.useRouter(),{i18nT:s,i18n:{t:a}}=kt.useI18n(),{getMessageFromError:c}=Wf(),{axiosInstance:l}=ho({headers:(S=i.config)==null?void 0:S.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:""}),E=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),w=n.computed(()=>(y.value===dr.Create||JSON.stringify(p.fields)!==JSON.stringify(E))&&!!p.fields.cert&&!!p.fields.key),h=I=>{var T;p.fields.cert=(I==null?void 0:I.cert)||"",p.fields.key=(I==null?void 0:I.key)||"",p.fields.certAlt=(I==null?void 0:I.cert_alt)||"",p.fields.keyAlt=(I==null?void 0:I.key_alt)||"",p.fields.tags=((T=I==null?void 0:I.tags)==null?void 0:T.join(", "))||"",Object.assign(E,p.fields)},g=()=>{o.push(i.config.cancelRoute)},v=n.computed(()=>{var T,Q;let I=`${i.config.apiBaseUrl}${Bi.form[i.config.app].validate}`;return i.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((T=i.config)==null?void 0:T.controlPlaneId)||""):i.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(Q=i.config)!=null&&Q.workspace?`/${i.config.workspace}`:"")),I=I.replace(/{id}/gi,i.certificateId),I}),m=n.computed(()=>{var T,Q;let I=`${i.config.apiBaseUrl}${Bi.form[i.config.app][y.value]}`;return i.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((T=i.config)==null?void 0:T.controlPlaneId)||""):i.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(Q=i.config)!=null&&Q.workspace?`/${i.config.workspace}`:"")),I=I.replace(/{id}/gi,i.certificateId),I}),C=n.computed(()=>{var I,T;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(T=(I=p.fields.tags.split(","))==null?void 0:I.map(Q=>String(Q||"").trim()))==null?void 0:T.filter(Q=>Q!=="")}}),A=async()=>{var I,T,Q,O,B,Y,W;try{p.isReadonly=!0;let M;await l.post(v.value,C.value),y.value==="create"?M=await l.post(m.value,C.value):y.value==="edit"&&(M=((I=i.config)==null?void 0:I.app)==="konnect"?await l.put(m.value,C.value):await l.patch(m.value,C.value)),p.fields.cert=((T=M==null?void 0:M.data)==null?void 0:T.cert)||"",p.fields.key=((Q=M==null?void 0:M.data)==null?void 0:Q.key)||"",p.fields.certAlt=((O=M==null?void 0:M.data)==null?void 0:O.cert_alt)||"",p.fields.keyAlt=((B=M==null?void 0:M.data)==null?void 0:B.key_alt)||"",p.fields.tags=((W=(Y=M==null?void 0:M.data)==null?void 0:Y.tags)==null?void 0:W.join(", "))||"",Object.assign(E,p.fields),r("update",M==null?void 0:M.data)}catch(M){p.errorMessage=c(M),r("error",M)}finally{p.isReadonly=!1}};return(I,T)=>{const Q=n.resolveComponent("KTextArea"),O=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",sb,[n.createVNode(n.unref(Hf),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":C.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":T[5]||(T[5]=B=>I.$emit("error",B)),"onFetch:success":h,onLoading:T[6]||(T[6]=B=>I.$emit("loading",B)),onSubmit:A},{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(Q,{modelValue:p.fields.cert,"onUpdate:modelValue":T[0]||(T[0]=B=>p.fields.cert=B),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(Q,{modelValue:p.fields.key,"onUpdate:modelValue":T[1]||(T[1]=B=>p.fields.key=B),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(Q,{modelValue:p.fields.certAlt,"onUpdate:modelValue":T[2]||(T[2]=B=>p.fields.certAlt=B),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(Q,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":T[3]||(T[3]=B=>p.fields.keyAlt=B),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(O,{modelValue:p.fields.tags,"onUpdate:modelValue":T[4]||(T[4]=B=>p.fields.tags=B),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-2c3ed6cc"]]),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"}}},cb={class:"kong-ui-ca-certificate-entity-config-card"},lb={key:0},ub=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}=Yf(),{getPropValue:l}=Zf(),{getCertificateData:d}=kt.useCertificate(),y=n.computed(()=>Vi.form[o.config.app].edit),p=n.ref(),E=n.computed(()=>{if(p.value)return d(p.value)}),w=n.computed(()=>{var A;return((A=E.value)==null?void 0:A.schemaIssuer)||""}),h=n.computed(()=>{var A,S;return(A=E.value)!=null&&A.schemaExpiry?a((S=E.value)==null?void 0:S.schemaExpiry):""}),g=n.computed(()=>{var A;return((A=E.value)==null?void 0:A.schemaKeyUsages)||[]}),v=(A,S)=>{const I=l("rowValue",S);if(A==="expiry")return h.value;if(A==="key_usages")return g.value;if(I)return I[A]},m=A=>{p.value=A,i("fetch:success",A)},C=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:ce.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(A,S)=>{const I=n.resolveComponent("KCodeBlock"),T=n.resolveComponent("KLabel"),Q=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",cb,[n.createVNode(n.unref(Lf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":C.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":S[0]||(S[0]=O=>A.$emit("copy:success",O)),"onFetch:error":S[1]||(S[1]=O=>A.$emit("fetch:error",O)),"onFetch:success":m,onLoading:S[2]||(S[2]=O=>A.$emit("loading",O))},{cert:n.withCtx(O=>[n.unref(l)("rowValue",O)?(n.openBlock(),n.createBlock(I,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",O),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(T,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(O=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",O)).filter(B=>!r.includes(B)),B=>(n.openBlock(),n.createBlock(n.unref(Ii),{key:B,"data-testid":`ca-cert-metadata-${B}`,item:{key:B,label:n.unref(c)(B),value:v(B,O),type:B==="key_usages"?n.unref(ce).BadgeTag:n.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value||"–"),1)]),key_usages:n.withCtx(()=>[g.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",lb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(O,B)=>(n.openBlock(),n.createBlock(Q,{key:`key_usages-badge-tag-${B}`,class:"config-badge","data-testid":`key_usages-badge-tag-${B}`,tooltip:O,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(O),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),db={class:"kong-ui-entities-ca-certificates-list"},fb={key:0},pb={key:1},hb={key:0},yb={key:1},gb={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),E={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}},w=n.computed(()=>{var ge,j;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,(j=i.config)!=null&&j.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:v,fetcherState:m}=Jf(i.config,w.value),C=()=>{h.value=""},A=()=>{d.value++},S=n.ref(null),I=(ee,ge)=>{const j=ee.id;if(!ge(j)){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:j})})},T=(ee,ge)=>{const j=JSON.stringify(ee);if(!ge(j)){r("copy:error",{entity:ee,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:o("ca-certificates.copy.success_brief")})},Q=async ee=>{var j;await((j=i.canRetrieve)==null?void 0:j.call(i,ee))&&c.push(i.config.getViewRoute(ee.id))},O=ee=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),B=ee=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),Y=n.ref(void 0),W=n.ref(!1),M=n.ref(!1),J=n.ref(""),re=Gf(i.config,w.value),{certificateDataCache:de,getCertificateData:fe}=kt.useCertificate(),ke=ee=>{Y.value=ee,W.value=!0},he=()=>{W.value=!1},ye=async()=>{var ee,ge,j;if((ee=Y.value)!=null&&ee.id){M.value=!0;try{await l.delete(re(Y.value.id)),M.value=!1,W.value=!1,d.value++,r("delete:success",Y.value)}catch(se){J.value=((j=(ge=se.response)==null?void 0:ge.data)==null?void 0:j.message)||se.message||o("ca-certificates.errors.delete"),r("error",se)}finally{M.value=!1}}},Be=n.ref(!0);n.watch(m,ee=>{var ge,j,se,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){S.value={title:o("ca-certificates.errors.general")},(me=(se=(j=ee.error)==null?void 0:j.response)==null?void 0:se.data)!=null&&me.message&&(S.value.message=ee.error.response.data.message),r("error",ee.error);return}de.value={},S.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 j=n.resolveComponent("KButton"),se=n.resolveComponent("KBadge"),me=n.resolveComponent("KTruncate"),Pe=n.resolveComponent("KDropdownItem"),Mt=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",db,[n.createVNode(n.unref(Ff),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":zt.value,"enable-entity-actions":"","error-message":S.value,fetcher:n.unref(v),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(E),"use-action-outside":e.useActionOutside,onClearSearchInput:C,"onClick:row":ge[2]||(ge[2]=te=>Q(te)),onSort:A},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(zf),{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(j,{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",fb,n.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.issuer?te.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",pb,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",hb,n.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.expiry?n.unref(s)(te.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",yb,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,z=>(n.openBlock(),n.createBlock(se,{key:z,onClick:ge[1]||(ge[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",gb,"-"))]}),actions:n.withCtx(({row:te})=>[n.createVNode(Mt,null,{default:n.withCtx(({copyToClipboard:Oe})=>[n.createVNode(Pe,{"data-testid":"action-entity-copy-id",onClick:z=>I(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:z=>T(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:O(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:B(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(qf),{"action-pending":M.value,"entity-type":n.unref(Oa).CACertificate,error:J.value,title:n.unref(o)("ca-certificates.delete.title"),visible:W.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"]]),bb={class:"kong-ui-entities-ca-certificates-form"},wb=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 A;const r=t,i=e,o=Gr.useRouter(),{i18n:{t:s}}=kt.useI18n(),{getMessageFromError:a}=Wf(),{axiosInstance:c}=ho({headers:(A=i.config)==null?void 0:A.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:""}),E=n.computed(()=>(d.value===dr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=S=>{var I;y.fields.cert=(S==null?void 0:S.cert)||"",y.fields.certDigest=(S==null?void 0:S.cert_digest)||"",y.fields.tags=((I=S==null?void 0:S.tags)==null?void 0:I.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},g=n.computed(()=>{var I,T;let S=`${i.config.apiBaseUrl}${Vi.form[i.config.app].validate}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((I=i.config)==null?void 0:I.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(T=i.config)!=null&&T.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),v=n.computed(()=>{var I,T;let S=`${i.config.apiBaseUrl}${Vi.form[i.config.app][d.value]}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((I=i.config)==null?void 0:I.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(T=i.config)!=null&&T.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),m=n.computed(()=>{var S,I;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(I=(S=y.fields.tags.split(","))==null?void 0:S.map(T=>String(T||"").trim()))==null?void 0:I.filter(T=>T!=="")}}),C=async()=>{var S,I,T,Q,O;try{y.isReadonly=!0;let B;await c.post(g.value,m.value),d.value==="create"?B=await c.post(v.value,m.value):d.value==="edit"&&(B=((S=i.config)==null?void 0:S.app)==="konnect"?await c.put(v.value,m.value):await c.patch(v.value,m.value)),y.fields.cert=((I=B==null?void 0:B.data)==null?void 0:I.cert)||"",y.fields.certDigest=((T=B==null?void 0:B.data)==null?void 0:T.cert_digest)||"",y.fields.tags=((O=(Q=B==null?void 0:B.data)==null?void 0:Q.tags)==null?void 0:O.join(", "))||"",Object.assign(p,y.fields),r("update",B==null?void 0:B.data)}catch(B){y.errorMessage=a(B),r("error",B)}finally{y.isReadonly=!1}};return(S,I)=>{const T=n.resolveComponent("KTextArea"),Q=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",bb,[n.createVNode(n.unref(Hf),{"can-submit":E.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"form-fields":m.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":I[3]||(I[3]=O=>S.$emit("error",O)),"onFetch:success":w,onLoading:I[4]||(I[4]=O=>S.$emit("loading",O)),onSubmit:C},{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(T,{modelValue:y.fields.cert,"onUpdate:modelValue":I[0]||(I[0]=O=>y.fields.cert=O),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(Q,{modelValue:y.fields.certDigest,"onUpdate:modelValue":I[1]||(I[1]=O=>y.fields.certDigest=O),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(Q,{modelValue:y.fields.tags,"onUpdate:modelValue":I[2]||(I[2]=O=>y.fields.tags=O),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-6316d5b5"]]),vb={class:"kong-ui-certificate-entity-config-card"},kb={key:0},Cb=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}=Yf(),{getPropValue:l}=Zf(),{getCertificateData:d}=kt.useCertificate(),y=n.computed(()=>Bi.form[i.config.app].edit),p=n.ref(),E=n.ref({id:{},cert:{section:pe.Basic},key:{section:pe.Basic,type:ce.Redacted},metadata:{section:pe.Basic,type:ce.Json},snis:{section:pe.Basic,type:ce.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:ce.Redacted}}),w=O=>{p.value=O,r("fetch:success",O)},h=(O,B)=>{const Y=l("rowValue",B);if(O==="expiry")return v.value;if(O==="key_usages")return S.value;if(O==="san_names")return C.value;if(Y)return Y[O]},g=n.computed(()=>{if(p.value)return d(p.value)}),v=n.computed(()=>{var O,B;return(O=g.value)!=null&&O.schemaExpiry?s((B=g.value)==null?void 0:B.schemaExpiry):""}),m=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaIssuer)||""}),C=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaSanNames)||""}),A=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaSubject)||""}),S=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaKeyUsages)||[]}),I=n.computed(()=>{var O,B;return((B=(O=p==null?void 0:p.value)==null?void 0:O.snis)==null?void 0:B.length)>0}),T=n.computed(()=>{var O;return!!((O=p==null?void 0:p.value)!=null&&O.cert_alt)}),Q=O=>{var B,Y;return O==="san_names"?o("certificates.list.table_headers.san"):((Y=(B=E.value)==null?void 0:B[O])==null?void 0:Y.label)||c(O)};return(O,B)=>{const Y=n.resolveComponent("KCodeBlock"),W=n.resolveComponent("KLabel"),M=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",vb,[n.createVNode(n.unref(Lf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":E.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":B[0]||(B[0]=J=>O.$emit("copy:success",J)),"onFetch:error":B[1]||(B[1]=J=>O.$emit("fetch:error",J)),"onFetch:success":w,onLoading:B[2]||(B[2]=J=>O.$emit("loading",J))},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(J=>[n.unref(l)("rowValue",J)?(n.openBlock(),n.createBlock(Y,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",J),"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(W,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(J=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",J)),re=>(n.openBlock(),n.createBlock(n.unref(Ii),{key:re,item:{key:re,value:h(re,J),label:Q(re),type:re==="key_usages"||re==="snis"||re==="dns_names"?n.unref(ce).BadgeTag:n.unref(ce).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(m.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(A.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(()=>[S.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",kb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(S.value,(J,re)=>(n.openBlock(),n.createBlock(M,{key:`key_usages-badge-tag-${re}`,class:"config-badge","data-testid":`key_usages-badge-tag-${re}`,tooltip:J,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(J),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[I.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},T.value?{name:"cert_alt",fn:n.withCtx(J=>[n.createTextVNode(" > "),n.unref(l)("rowValue",J)?(n.openBlock(),n.createBlock(Y,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(l)("rowValue",J),"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=ub,$e.CACertificateForm=wb,$e.CACertificateList=mb,$e.CertificateConfigCard=Cb,$e.CertificateForm=ab,$e.CertificateList=ob,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});