@kong-ui-public/entities-certificates 2.3.28 → 2.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities-certificates.es.js +3501 -3392
- package/dist/entities-certificates.umd.js +36 -36
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Pe,
|
|
1
|
+
(function(Pe,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):(Pe=typeof globalThis<"u"?globalThis:Pe||self,i(Pe["kong-ui-public-entities-certificates"]={},Pe.Vue,Pe.VueRouter,Pe["kong-ui-public-i18n"],Pe.axios,Pe.Kongponents))})(this,function(Pe,i,Gr,pr,Qa,ap){"use strict";var mo=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(),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:$e(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,$=N;ne<$.length;ne++){var F=$[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 $e(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:$,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 $(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=$(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:$};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:$e(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 $(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($,F){var L=_e.get($);return X(L)?Z($,F).length?(X(L)&&(L=new w,_e.set($,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($,F,L){this._index=0,this._keys=$,this._values=F,this._selector=L}return ne.prototype["@@iterator"]=function(){return this},ne.prototype[a]=function(){return this},ne.prototype.next=function(){var $=this._index;if($>=0&&$<this._keys.length){var F=this._selector(this._keys[$],this._values[$]);return $+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($){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),$},ne.prototype.return=function($){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:$,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($){return this._find($,!1)>=0},ne.prototype.get=function($){var F=this._find($,!1);return F>=0?this._values[F]:void 0},ne.prototype.set=function($,F){var L=this._find($,!0);return this._values[L]=F,this},ne.prototype.delete=function($){var F=this._find($,!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($,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($,F){if(!Wa(this._cacheKey,$)){this._cacheIndex=-1;for(var L=0;L<this._keys.length;L++)if(Wa(this._keys[L],$)){this._cacheIndex=L;break}}return this._cacheIndex<0&&F&&(this._cacheIndex=this._keys.length,this._keys.push($),this._values.push(void 0)),this._cacheIndex},ne}();return D;function Z(ne,$){return ne}function Se(ne,$){return $}function _e(ne,$){return[ne,$]}}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 $(){this._key=D()}return $.prototype.has=function(F){var L=Z(F,!1);return L!==void 0?y.has(L,this._key):!1},$.prototype.get=function(F){var L=Z(F,!1);return L!==void 0?y.get(L,this._key):void 0},$.prototype.set=function(F,L){var K=Z(F,!0);return K[this._key]=L,this},$.prototype.delete=function(F){var L=Z(F,!1);return L!==void 0?delete L[this._key]:!1},$.prototype.clear=function(){this._key=D()},$}();function D(){var $;do $="@@WeakMap@@"+ne();while(y.has(x,$));return x[$]=!0,$}function Z($,F){if(!i.call($,N)){if(!F)return;Object.defineProperty($,N,{value:y.create()})}return $[N]}function Se($,F){for(var L=0;L<F;++L)$[L]=Math.random()*255|0;return $}function _e($){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array($)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array($)):Se(new Uint8Array($),$):Se(new Array($),$)}function ne(){var $=_e(k);$[6]=$[6]&79|64,$[8]=$[8]&191|128;for(var F="",L=0;L<k;++L){var K=$[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 Xa;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof mo=="object"?mo: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 Za(Object.create(null))}:l?function(){return Za({__proto__:null})}:function(){return Za({})},has:d?function(k,B){return n.call(k,B)}:function(k,B){return B in k},get:d?function(k,B){return n.call(k,B)?k[B]:void 0}:function(k,B){return k[B]}},p=Object.getPrototypeOf(Function),E=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Vb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:jb(),h=typeof WeakMap=="function"?WeakMap:Db(),m=o?Symbol.for("@reflect-metadata:registry"):void 0,v=Ob(),g=_b(v);function S(k,B,N,D){if(X(N)){if(!Oe(k))throw new TypeError;if(!Ce(B))throw new TypeError;return P(k,B)}else{if(!Oe(k))throw new TypeError;if(!j(B))throw new TypeError;if(!j(D)&&!X(D)&&!ee(D))throw new TypeError;return ee(D)&&(D=void 0),N=te(N),H(k,B,N,D)}}t("decorate",S);function x(k,B){function N(D,Y){if(!j(D))throw new TypeError;if(!X(Y)&&!zr(Y))throw new TypeError;he(k,B,D,Y)}return N}t("metadata",x);function C(k,B,N,D){if(!j(N))throw new TypeError;return X(D)||(D=te(D)),he(k,B,N,D)}t("defineMetadata",C);function I(k,B,N){if(!j(B))throw new TypeError;return X(N)||(N=te(N)),re(k,B,N)}t("hasMetadata",I);function T(k,B,N){if(!j(B))throw new TypeError;return X(N)||(N=te(N)),de(k,B,N)}t("hasOwnMetadata",T);function Q(k,B,N){if(!j(B))throw new TypeError;return X(N)||(N=te(N)),fe(k,B,N)}t("getMetadata",Q);function _(k,B,N){if(!j(B))throw new TypeError;return X(N)||(N=te(N)),ke(k,B,N)}t("getOwnMetadata",_);function A(k,B){if(!j(k))throw new TypeError;return X(B)||(B=te(B)),ye(k,B)}t("getMetadataKeys",A);function Z(k,B){if(!j(k))throw new TypeError;return X(B)||(B=te(B)),Be(k,B)}t("getOwnMetadataKeys",Z);function J(k,B,N){if(!j(B))throw new TypeError;if(X(N)||(N=te(N)),!j(B))throw new TypeError;X(N)||(N=te(N));var D=ji(B,N,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(k,B,N)}t("deleteMetadata",J);function P(k,B){for(var N=k.length-1;N>=0;--N){var D=k[N],Y=D(B);if(!X(Y)&&!ee(Y)){if(!Ce(Y))throw new TypeError;B=Y}}return B}function H(k,B,N,D){for(var Y=k.length-1;Y>=0;--Y){var Se=k[Y],_e=Se(B,N,D);if(!X(_e)&&!ee(_e)){if(!j(_e))throw new TypeError;D=_e}}return D}function re(k,B,N){var D=de(k,B,N);if(D)return!0;var Y=Ya(B);return ee(Y)?!1:re(k,Y,N)}function de(k,B,N){var D=ji(B,N,!1);return X(D)?!1:Me(D.OrdinaryHasOwnMetadata(k,B,N))}function fe(k,B,N){var D=de(k,B,N);if(D)return ke(k,B,N);var Y=Ya(B);if(!ee(Y))return fe(k,Y,N)}function ke(k,B,N){var D=ji(B,N,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(k,B,N)}function he(k,B,N,D){var Y=ji(N,D,!0);Y.OrdinaryDefineOwnMetadata(k,B,N,D)}function ye(k,B){var N=Be(k,B),D=Ya(k);if(D===null)return N;var Y=ye(D,B);if(Y.length<=0)return N;if(N.length<=0)return Y;for(var Se=new w,_e=[],ne=0,$=N;ne<$.length;ne++){var q=$[ne],L=Se.has(q);L||(Se.add(q),_e.push(q))}for(var z=0,oe=Y;z<oe.length;z++){var q=oe[z],L=Se.has(q);L||(Se.add(q),_e.push(q))}return _e}function Be(k,B){var N=ji(k,B,!1);return N?N.OrdinaryOwnMetadataKeys(k,B):[]}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 me(k){return typeof k=="symbol"}function j(k){return typeof k=="object"?k!==null:typeof k=="function"}function se(k,B){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=B===3?"string":B===5?"number":"default",D=Xf(k,s);if(D!==void 0){var Y=D.call(k,N);if(j(Y))throw new TypeError;return Y}return ge(k,N==="default"?"number":N)}function ge(k,B){if(B==="string"){var N=k.toString;if(G(N)){var D=N.call(k);if(!j(D))return D}var Y=k.valueOf;if(G(Y)){var D=Y.call(k);if(!j(D))return D}}else{var Y=k.valueOf;if(G(Y)){var D=Y.call(k);if(!j(D))return D}var Se=k.toString;if(G(Se)){var D=Se.call(k);if(!j(D))return D}}throw new TypeError}function Me(k){return!!k}function $t(k){return""+k}function te(k){var B=se(k,3);return me(B)?B:$t(B)}function Oe(k){return Array.isArray?Array.isArray(k):k instanceof Object?k instanceof Array:Object.prototype.toString.call(k)==="[object Array]"}function G(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 Ja(k,B){return k===B||k!==k&&B!==B}function Xf(k,B){var N=k[B];if(N!=null){if(!G(N))throw new TypeError;return N}}function ep(k){var B=Xf(k,a);if(!G(B))throw new TypeError;var N=B.call(k);if(!j(N))throw new TypeError;return N}function tp(k){return k.value}function rp(k){var B=k.next();return B.done?!1:B}function ip(k){var B=k.return;B&&B.call(k)}function Ya(k){var B=Object.getPrototypeOf(k);if(typeof k!="function"||k===p||B!==p)return B;var N=k.prototype,D=N&&Object.getPrototypeOf(N);if(D==null||D===Object.prototype)return B;var Y=D.constructor;return typeof Y!="function"||Y===k?B:Y}function Nb(){var k;!X(m)&&typeof r.Reflect<"u"&&!(m in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(k=Tb(r.Reflect));var B,N,D,Y=new h,Se={registerProvider:_e,getProvider:$,setProvider:L};return Se;function _e(z){if(!Object.isExtensible(Se))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case k===z:break;case X(B):B=z;break;case B===z:break;case X(N):N=z;break;case N===z:break;default:D===void 0&&(D=new w),D.add(z);break}}function ne(z,oe){if(!X(B)){if(B.isProviderFor(z,oe))return B;if(!X(N)){if(N.isProviderFor(z,oe))return B;if(!X(D))for(var be=ep(D);;){var xe=rp(be);if(!xe)return;var ft=tp(xe);if(ft.isProviderFor(z,oe))return ip(be),ft}}}if(!X(k)&&k.isProviderFor(z,oe))return k}function $(z,oe){var be=Y.get(z),xe;return X(be)||(xe=be.get(oe)),X(xe)&&(xe=ne(z,oe),X(xe)||(X(be)&&(be=new E,Y.set(z,be)),be.set(oe,xe))),xe}function q(z){if(X(z))throw new TypeError;return B===z||N===z||!X(D)&&D.has(z)}function L(z,oe,be){if(!q(be))throw new Error("Metadata provider not registered.");var xe=$(z,oe);if(xe!==be){if(!X(xe))return!1;var ft=Y.get(z);X(ft)&&(ft=new E,Y.set(z,ft)),ft.set(oe,be)}return!0}}function Ob(){var k;return!X(m)&&j(r.Reflect)&&Object.isExtensible(r.Reflect)&&(k=r.Reflect[m]),X(k)&&(k=Nb()),!X(m)&&j(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,m,{enumerable:!1,configurable:!1,writable:!1,value:k}),k}function _b(k){var B=new h,N={isProviderFor:function(q,L){var z=B.get(q);return X(z)?!1:z.has(L)},OrdinaryDefineOwnMetadata:_e,OrdinaryHasOwnMetadata:Y,OrdinaryGetOwnMetadata:Se,OrdinaryOwnMetadataKeys:ne,OrdinaryDeleteMetadata:$};return v.registerProvider(N),N;function D(q,L,z){var oe=B.get(q),be=!1;if(X(oe)){if(!z)return;oe=new E,B.set(q,oe),be=!0}var xe=oe.get(L);if(X(xe)){if(!z)return;if(xe=new E,oe.set(L,xe),!k.setProvider(q,L,N))throw oe.delete(L),be&&B.delete(q),new Error("Wrong provider for target.")}return xe}function Y(q,L,z){var oe=D(L,z,!1);return X(oe)?!1:Me(oe.has(q))}function Se(q,L,z){var oe=D(L,z,!1);if(!X(oe))return oe.get(q)}function _e(q,L,z,oe){var be=D(z,oe,!0);be.set(q,L)}function ne(q,L){var z=[],oe=D(q,L,!1);if(X(oe))return z;for(var be=oe.keys(),xe=ep(be),ft=0;;){var np=rp(xe);if(!np)return z.length=ft,z;var $b=tp(np);try{z[ft]=$b}catch(Mb){try{ip(xe)}finally{throw Mb}}ft++}}function $(q,L,z){var oe=D(L,z,!1);if(X(oe)||!oe.delete(q))return!1;if(oe.size===0){var be=B.get(L);X(be)||(be.delete(z),be.size===0&&B.delete(be))}return!0}}function Tb(k){var B=k.defineMetadata,N=k.hasOwnMetadata,D=k.getOwnMetadata,Y=k.getOwnMetadataKeys,Se=k.deleteMetadata,_e=new h,ne={isProviderFor:function($,q){var L=_e.get($);return X(L)?Y($,q).length?(X(L)&&(L=new w,_e.set($,L)),L.add(q),!0):!1:L.has(q)},OrdinaryDefineOwnMetadata:B,OrdinaryHasOwnMetadata:N,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Y,OrdinaryDeleteMetadata:Se};return ne}function ji(k,B,N){var D=v.getProvider(k,B);if(!X(D))return D;if(N){if(v.setProvider(k,B,g))return g;throw new Error("Illegal state.")}}function Vb(){var k={},B=[],N=function(){function ne($,q,L){this._index=0,this._keys=$,this._values=q,this._selector=L}return ne.prototype["@@iterator"]=function(){return this},ne.prototype[a]=function(){return this},ne.prototype.next=function(){var $=this._index;if($>=0&&$<this._keys.length){var q=this._selector(this._keys[$],this._values[$]);return $+1>=this._keys.length?(this._index=-1,this._keys=B,this._values=B):this._index++,{value:q,done:!1}}return{value:void 0,done:!0}},ne.prototype.throw=function($){throw this._index>=0&&(this._index=-1,this._keys=B,this._values=B),$},ne.prototype.return=function($){return this._index>=0&&(this._index=-1,this._keys=B,this._values=B),{value:$,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($){return this._find($,!1)>=0},ne.prototype.get=function($){var q=this._find($,!1);return q>=0?this._values[q]:void 0},ne.prototype.set=function($,q){var L=this._find($,!0);return this._values[L]=q,this},ne.prototype.delete=function($){var q=this._find($,!1);if(q>=0){for(var L=this._keys.length,z=q+1;z<L;z++)this._keys[z-1]=this._keys[z],this._values[z-1]=this._values[z];return this._keys.length--,this._values.length--,Ja($,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,Y)},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($,q){if(!Ja(this._cacheKey,$)){this._cacheIndex=-1;for(var L=0;L<this._keys.length;L++)if(Ja(this._keys[L],$)){this._cacheIndex=L;break}}return this._cacheIndex<0&&q&&(this._cacheIndex=this._keys.length,this._keys.push($),this._values.push(void 0)),this._cacheIndex},ne}();return D;function Y(ne,$){return ne}function Se(ne,$){return $}function _e(ne,$){return[ne,$]}}function jb(){var k=function(){function B(){this._map=new E}return Object.defineProperty(B.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),B.prototype.has=function(N){return this._map.has(N)},B.prototype.add=function(N){return this._map.set(N,N),this},B.prototype.delete=function(N){return this._map.delete(N)},B.prototype.clear=function(){this._map.clear()},B.prototype.keys=function(){return this._map.keys()},B.prototype.values=function(){return this._map.keys()},B.prototype.entries=function(){return this._map.entries()},B.prototype["@@iterator"]=function(){return this.keys()},B.prototype[a]=function(){return this.keys()},B}();return k}function Db(){var k=16,B=y.create(),N=D();return function(){function $(){this._key=D()}return $.prototype.has=function(q){var L=Y(q,!1);return L!==void 0?y.has(L,this._key):!1},$.prototype.get=function(q){var L=Y(q,!1);return L!==void 0?y.get(L,this._key):void 0},$.prototype.set=function(q,L){var z=Y(q,!0);return z[this._key]=L,this},$.prototype.delete=function(q){var L=Y(q,!1);return L!==void 0?delete L[this._key]:!1},$.prototype.clear=function(){this._key=D()},$}();function D(){var $;do $="@@WeakMap@@"+ne();while(y.has(B,$));return B[$]=!0,$}function Y($,q){if(!n.call($,N)){if(!q)return;Object.defineProperty($,N,{value:y.create()})}return $[N]}function Se($,q){for(var L=0;L<q;++L)$[L]=Math.random()*255|0;return $}function _e($){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array($)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array($)):Se(new Uint8Array($),$):Se(new Array($),$)}function ne(){var $=_e(k);$[6]=$[6]&79|64,$[8]=$[8]&191|128;for(var q="",L=0;L<k;++L){var z=$[L];(L===4||L===6||L===8)&&(q+="-"),z<16&&(q+="0"),q+=z.toString(16).toLowerCase()}return q}}function Za(k){return k.__=void 0,delete k.__,k}})})(Xa||(Xa={}));/*!
|
|
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
|
|
37
|
+
*/const cp="[object ArrayBuffer]";class M{static isArrayBuffer(t){return Object.prototype.toString.call(t)===cp}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=M.toUint8Array(t),o=M.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",lp=/^[0-9a-f]+$/i,up=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,dp=/^[a-zA-Z0-9-_]+$/;class ec{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=M.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=M.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&&lp.test(t)}static isBase64(t){return typeof t===go&&up.test(t)}static isBase64Url(t){return typeof t===go&&dp.test(t)}static ToString(t,r="utf8"){const n=M.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=M.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 ec.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 ec.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=M.toUint8Array(t);let n="";for(let o=0;o<r.length;o++)n+=String.fromCharCode(r[o]);return n}static ToHex(t){const r=M.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 fp(...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 tc(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}/*!
|
|
38
38
|
Copyright (c) Peculiar Ventures, LLC
|
|
39
|
-
*/function hr(e,t){let r=0;if(e.length===1)return e[0];for(let
|
|
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 bo(...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 rc(){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 pp(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 hp(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)}/*!
|
|
40
40
|
* Copyright (c) 2014, GMO GlobalSign
|
|
41
41
|
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
42
42
|
* All rights reserved.
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
69
69
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
70
70
|
*
|
|
71
|
-
*/function Di(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function bo(e){let t=0,r=0;for(let o=0;o<e.length;o++){const s=e[o];t+=s.byteLength}const i=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function St(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class Mi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return bo(this.items)}}const Wr=[new Uint8Array([1])],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),$i=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?P.toUint8Array(s.valueHex):$i}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=$i}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=P.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?P.toUint8Array(t.valueHex):$i,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=P.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=P.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(P.toUint8Array(e).slice(),0,e.byteLength)}function Sp(e,t){return e?1:t}class $t extends Le{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=P.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}}$t.NAME="ConstructedValueBlock";var dc;class Ke extends Ve{constructor(t={}){super(t,$t),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){const t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
71
|
+
*/function Di(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function wo(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 $i{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return wo(this.items)}}const Wr=[new Uint8Array([1])],ic="0123456789",vo="name",nc="valueHexView",yp="isHexOnly",mp="idBlock",gp="tagClass",bp="tagNumber",wp="isConstructed",vp="fromBER",kp="toBER",Cp="local",qe="",st=new ArrayBuffer(0),Mi=new Uint8Array(0),Jr="EndOfContent",oc="OCTET STRING",sc="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?M.toUint8Array(s.valueHex):Mi}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=Mi}={}){this.blockLength=t,this.error=r,this.warnings=n,this.valueBeforeDecodeView=M.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode: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 ac 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?M.toUint8Array(t.valueHex):Mi,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=M.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}}}ac.NAME="identificationBlock";class cc 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=M.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}}}cc.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 ac(o),this.lenBlock=new cc(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 $i;r||lc(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 hp(r,n)}}Ve.NAME="BaseBlock";function lc(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)lc(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class ko 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}'`}}ko.NAME="BaseStringBlock";class uc extends ht(Le){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}uc.NAME="PrimitiveValueBlock";var dc;class Yr extends Ve{constructor(t={}){super(t,uc),this.idBlock.isConstructed=!1}}dc=Yr,R.Primitive=dc,Yr.NAME="PRIMITIVE";function Sp(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=Sp(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 mr(e){if(!e.byteLength){const t=new Ve({},Le);return t.error="Input buffer has zero length",{offset:-1,result:t}}return yr(M.toUint8Array(e).slice(),0,e.byteLength)}function xp(e,t){return e?1:t}class Mt extends Le{constructor({value:t=[],isIndefiniteForm:r=!1,...n}={}){super(n),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,n){const o=M.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(;xp(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 $i;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}}Mt.NAME="ConstructedValueBlock";var fc;class Ke extends Ve{constructor(t={}){super(t,Mt),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(`
|
|
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,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=P.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=P.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 Pi=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=Pi,R.Boolean=gc,Pi.NAME="BOOLEAN";class mc extends ht($t){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=$t.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?$t.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 P.concat(t)}};bc=Yt,R.OctetString=bc,Yt.NAME=nc;class wc extends ht($t){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=$t.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=P.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 $t.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=P.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=P.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=P.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,P.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=P.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=P.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 $c 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}}$c.NAME="UniversalStringValueBlock";var Pc;class Hi extends $c{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Pc=Hi,R.UniversalString=Pc,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,P.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=$i}={}){this.dataView=P.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=P.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=P.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(P.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:Pi,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(P.isBufferSource(t))this.unusedBits=r,this.value=P.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):P.isBufferSource(t)?this.buffer=P.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 Pi({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),$p=tt(Fi),Pp=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 $p;case b.ObjectIdentifier:return Tp;case b.OctetString:return en;case b.PrintableString:return Pp;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=P.isBufferSource(t)?P.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 $o=Do=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};$o=Do=u([V({type:_.Sequence,itemType:br})],$o);let Ie=Mo=class extends $o{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 Po{constructor(t={}){this.partyName=new je,Object.assign(this,t)}}u([f({type:je,optional:!0,context:0,implicit:!0})],Po.prototype,"nameAssigner",void 0),u([f({type:je,context:1,implicit:!0})],Po.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:Po,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 Pt 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:Pt,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 Pt,Object.assign(this,t)}}u([f({type:Pt})],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:Pt,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:Pt,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 $s;let _n=$s=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};_n=$s=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",Ps="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",$l="1.3.132.0.35";function gi(e){return new H({algorithm:e})}const sh=gi(Ps);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`,Pl=`${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(Pl),Ee(Rl),Ee(Dn),Ee(Mn),Ee(Pl),Ee(Rl);class $n{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})],$n.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Kl})],$n.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:zl})],$n.prototype,"pSourceAlgorithm",void 0),new H({algorithm:uh,parameters:q.serialize(new $n)});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 Pn{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],Pn.prototype,"digestAlgorithm",void 0),u([f({type:ae})],Pn.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} :`}}fc=Ke,R.Constructed=fc,Ke.NAME="CONSTRUCTED";class pc extends Le{fromBER(t,r,n){return r}toBER(t){return st}}pc.override="EndOfContentValueBlock";var hc;class Co extends Ve{constructor(t={}){super(t,pc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}hc=Co,R.EndOfContent=hc,Co.NAME=Jr;var yc;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}`}}yc=Jt,R.Null=yc,Jt.NAME="NULL";class mc extends ht(Le){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=M.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,n){const o=M.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,rc.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}mc.NAME="BooleanValueBlock";var gc;let Pi=class extends Ve{constructor(t={}){super(t,mc),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=Pi,R.Boolean=gc,Pi.NAME="BOOLEAN";class bc extends ht(Mt){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=Mt.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!==oc)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?Mt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}bc.NAME="OctetStringValueBlock";var wc;let Yt=class op 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},bc),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 op&&t.push(r.valueBlock.valueHexView);return M.concat(t)}};wc=Yt,R.OctetString=wc,Yt.NAME=oc;class vc extends ht(Mt){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=Mt.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!==sc)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return o}const s=M.toUint8Array(t);if(!St(this,s,r,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 Mt.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}}}vc.NAME="BitStringValueBlock";var kc;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},vc),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)}`}}};kc=Zt,R.BitString=kc,Zt.NAME=sc;var Cc;function Ap(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=bo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=bo(r,s)),s}function Sc(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=bo(r,n)),Wr.push(n)}return Wr[e]}function Bp(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 So 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=rc.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(pp(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=Bp(Sc(n),r),a="-";break;default:r=Ap(r,Sc(n))}n++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=ic.charAt(r[l]));return c===!1&&(a+=ic.charAt(0)),a}}Cc=So,So.NAME="IntegerValueBlock",Object.defineProperty(Cc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var xc;class yt extends Ve{constructor(t={}){super(t,So),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 $i,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=M.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()}`}}xc=yt,R.Integer=xc,yt.NAME="INTEGER";var Ac;class Ri extends yt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ac=Ri,R.Enumerated=Ac,Ri.NAME="ENUMERATED";class xo 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=M.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}}}xo.NAME="sidBlock";class Bc 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.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 wo(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 xo;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}}Bc.NAME="ObjectIdentifierValueBlock";var Ic;class Ui extends Ve{constructor(t={}){super(t,Bc),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()}}}Ic=Ui,R.ObjectIdentifier=Ic,Ui.NAME="OBJECT IDENTIFIER";class Ao extends ht(Wt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,n){if(n===0)return r;const o=M.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}}}Ao.NAME="relativeSidBlock";class Ec 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 Ao;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 wo(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 Ao;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}}Ec.NAME="RelativeObjectIdentifierValueBlock";var Nc;class Bo extends Ve{constructor(t={}){super(t,Ec),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()}}}Nc=Bo,R.RelativeObjectIdentifier=Nc,Bo.NAME="RelativeObjectIdentifier";var Oc;class xt extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Oc=xt,R.Sequence=Oc,xt.NAME="SEQUENCE";var _c;let At=class extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};_c=At,R.Set=_c,At.NAME="SET";class Tc extends ht(Le){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=qe}toJSON(){return{...super.toJSON(),value:this.value}}}Tc.NAME="StringValueBlock";class Vc extends Tc{}Vc.NAME="SimpleStringValueBlock";class Qe extends ko{constructor({...t}={}){super(t,Vc)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,M.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 jc extends Qe{fromBuffer(t){this.valueBlock.valueHexView=M.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}}jc.NAME="Utf8StringValueBlock";var Dc;class Bt extends jc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Dc=Bt,R.Utf8String=Dc,Bt.NAME="UTF8String";class $c extends Qe{fromBuffer(t){this.valueBlock.value=U.ToUtf16String(t),this.valueBlock.valueHexView=M.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(U.FromUtf16String(t))}}$c.NAME="BmpStringValueBlock";var Mc;class Li extends $c{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 Rc;class Hi extends Pc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Rc=Hi,R.UniversalString=Rc,Hi.NAME="UniversalString";var Uc;class Fi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Uc=Fi,R.NumericString=Uc,Fi.NAME="NumericString";var Lc;class qi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Lc=qi,R.PrintableString=Lc,qi.NAME="PrintableString";var Hc;class Ki extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Hc=Ki,R.TeletexString=Hc,Ki.NAME="TeletexString";var Fc;class zi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Fc=zi,R.VideotexString=Fc,zi.NAME="VideotexString";var qc;class Gi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}qc=Gi,R.IA5String=qc,Gi.NAME="IA5String";var Kc;class Wi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Kc=Wi,R.GraphicString=Kc,Wi.NAME="GraphicString";var zc;class Zr extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}zc=Zr,R.VisibleString=zc,Zr.NAME="VisibleString";var Gc;class Ji extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Gc=Ji,R.GeneralString=Gc,Ji.NAME="GeneralString";var Wc;class Yi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Wc=Yi,R.CharacterString=Wc,Yi.NAME="CharacterString";var Jc;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,M.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}}}Jc=Qr,R.UTCTime=Jc,Qr.NAME="UTCTime";var Yc;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}}}Yc=Zi,R.GeneralizedTime=Yc,Zi.NAME="GeneralizedTime";var Zc;class Io extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Zc=Io,R.DATE=Zc,Io.NAME="DATE";var Qc;class Eo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Qc=Eo,R.TimeOfDay=Qc,Eo.NAME="TimeOfDay";var Xc;class No extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Xc=No,R.DateTime=Xc,No.NAME="DateTime";var el;class Oo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}el=Oo,R.Duration=el,Oo.NAME="Duration";var tl;class _o extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}tl=_o,R.TIME=tl,_o.NAME="TIME";class Qt{constructor({name:t=qe,optional:r=!1}={}){this.name=t,this.optional=r}}class To 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 Ip{constructor({data:t=Mi}={}){this.dataView=M.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=M.toUint8Array(t)}fromBER(t,r,n){const o=r+n;return this.dataView=M.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Xt(e,t,r){if(r instanceof To){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(vo)&&(s.name=r.name),s}}if(r instanceof Qt)return r.hasOwnProperty(vo)&&(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(!(mp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(vp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(kp 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(bp)===!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(wp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(yp 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(!(nc 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(vo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};Cp 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&&nc 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 Ep(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=yr(M.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Xt(r.result,r.result,t)}const rl=Object.freeze(Object.defineProperty({__proto__:null,Any:Qt,BaseBlock:Ve,BaseStringBlock:ko,BitString:Zt,BmpString:Li,Boolean:Pi,CharacterString:Yi,Choice:To,Constructed:Ke,DATE:Io,DateTime:No,Duration:Oo,EndOfContent:Co,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:Ip,RelativeObjectIdentifier:Bo,Repeated:Qi,Sequence:xt,Set:At,TIME:_o,TeletexString:Ki,TimeOfDay:Eo,UTCTime:Qr,UniversalString:Hi,Utf8String:Bt,ValueBlock:Le,VideotexString:zi,ViewWriter:$i,VisibleString:Zr,compareSchema:Xt,fromBER:mr,verifySchema:Ep},Symbol.toStringTag,{value:"Module"}));var O;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(O||(O={}));var b;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(b||(b={}));class Xi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(M.isBufferSource(t))this.unusedBits=r,this.value=M.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Zt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new Zt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Zt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const 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):M.isBufferSource(t)?this.buffer=M.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Yt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Yt({valueHex:this.buffer})}toSchema(t){return new Yt({name:t})}}const Np={fromASN:e=>e instanceof Jt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Jt;const t=mr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Op={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new yt({value:+e})},_p={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ri({value:e})},we={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new yt({valueHex:e})},Tp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Zt({valueHex:e})},Vp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Ui({value:e})},jp={fromASN:e=>e.valueBlock.value,toASN:e=>new Pi({value:e})},en={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},Dp={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 il=tt(Bt),$p=tt(Li),Mp=tt(Hi),Pp=tt(Fi),Rp=tt(qi),Up=tt(Ki),Lp=tt(zi),Hp=tt(Gi),Fp=tt(Wi),qp=tt(Zr),Kp=tt(Ji),zp=tt(Yi),Gp={fromASN:e=>e.toDate(),toASN:e=>new Qr({valueDate:e})},Wp={fromASN:e=>e.toDate(),toASN:e=>new Zi({valueDate:e})},Jp={fromASN:()=>null,toASN:()=>new Jt};function Vo(e){switch(e){case b.Any:return Np;case b.BitString:return Tp;case b.BmpString:return $p;case b.Boolean:return jp;case b.CharacterString:return zp;case b.Enumerated:return _p;case b.GeneralString:return Kp;case b.GeneralizedTime:return Wp;case b.GraphicString:return Fp;case b.IA5String:return Hp;case b.Integer:return Op;case b.Null:return Jp;case b.NumericString:return Pp;case b.ObjectIdentifier:return Vp;case b.OctetString:return en;case b.PrintableString:return Rp;case b.TeletexString:return Up;case b.UTCTime:return Gp;case b.UniversalString:return Mp;case b.Utf8String:return il;case b.VideotexString:return Lp;case b.VisibleString:return qp;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 nl(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:nl(r)}return!1}function Yp(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 Zp{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:O.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=rl[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===O.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 O.Sequence:return new xt({value:o,name:""});case O.Set:return new At({value:o,name:""});case O.Choice:return new To({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 Zp,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=Vo(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 ol extends Error{constructor(){super(...arguments),this.schemas=[]}}class Qp{static parse(t,r){const n=mr(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!==O.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 ol(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(nl(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=Vo(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 m=mr(h.toBER(!1));if(m.offset===-1)throw new Error(`Cannot parse the child item. ${m.result.error}`);if(!("value"in m.result.valueBlock&&Array.isArray(m.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const v=m.result.valueBlock.value;c[l]=Array.from(v,g=>E.fromASN(g))}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 m=b[p],v=rl[m];if(!v)throw new Error(`Cannot get '${m}' class from asn1js module`);h=new v}h.valueBlock=w.valueBlock,w=mr(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 ol&&o.schemas.push(r.name),o}}}class jo{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=Vo(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"&&Yp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=jo.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 O.Sequence:s=new xt({value:o});break;case O.Set:s=new At({value:o});break;case O.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 K{static serialize(t){return jo.serialize(t)}static parse(t,r){return Qp.parse(t,r)}static toString(t){const r=M.isBufferSource(t)?M.toArrayBuffer(t):K.serialize(t),n=mr(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 sl={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,m){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let v=0,g=-1,S=(h.match(l.zoneIndex)||[])[0],x,C;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)v++;if(h.substr(0,2)==="::"&&v--,h.substr(-2,2)==="::"&&v--,v>m)return null;for(C=m-v,x=":";C--;)x+="0:";return h=h.replace("::",x),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),m=function(){const I=h.split(":"),T=[];for(let Q=0;Q<I.length;Q++)T.push(parseInt(I[Q],16));return T}(),{parts:m,zoneId:S}}function y(h,m,v,g){if(h.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,x;for(;g>0;){if(x=v-g,x<0&&(x=0),h[S]>>x!==m[S]>>x)return!1;g-=v,S+=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,m){for(;h.length<m;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,g;for(v=0;v<m.length;v++)if(g=m[v],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(m,v){let g;if(v===void 0&&(g=m,m=g[0],v=g[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,m.octets,8,v)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,v=!1;const g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let S,x,C;for(S=3;S>=0;S-=1)if(x=this.octets[S],x in g){if(C=g[x],v&&C!==0)return null;C!==8&&(v=!0),m+=C}else return null;return 32-m},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 m=this.parseCIDR(h),v=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[];let x=0;for(;x<4;)S.push(parseInt(v[x],10)|parseInt(g[x],10)^255),x++;return new this(S)}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 m,v,g,S,x;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),x=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[],v=0;v<4;)S.push(parseInt(g[v],10)&parseInt(x[v],10)),v++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.parse=function(h){const m=this.parser(h);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},w.IPv4.parseCIDR=function(h){let m;if(m=h.match(/^(.+)\/(\d+)$/)){const v=parseInt(m[2]);if(v>=0&&v<=32){const g=[this.parse(m[1]),v];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let m,v,g;if(m=h.match(n.fourOctet))return function(){const S=m.slice(1,6),x=[];for(let C=0;C<S.length;C++)v=S[C],x.push(p(v));return x}();if(m=h.match(n.longValue)){if(g=p(m[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){const S=[];let x;for(x=0;x<=24;x+=8)S.push(g>>x&255);return S}().reverse()}else return(m=h.match(n.twoOctet))?function(){const S=m.slice(1,4),x=[];if(g=p(S[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return x.push(p(S[0])),x.push(g>>16&255),x.push(g>>8&255),x.push(g&255),x}():(m=h.match(n.threeOctet))?function(){const S=m.slice(1,5),x=[];if(g=p(S[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return x.push(p(S[0])),x.push(p(S[1])),x.push(g>>8&255),x.push(g&255),x}():null},w.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const m=[0,0,0,0];let v=0;const g=Math.floor(h/8);for(;v<g;)m[v]=255,v++;return g<4&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},w.IPv6=function(){function h(m,v){let g,S;if(m.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(m[g]<<8|m[g+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(S=this.parts[g],!(0<=S&&S<=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(m,v){let g;if(v===void 0&&(g=m,m=g[0],v=g[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,m.parts,16,v)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,v=!1;const g={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let S,x;for(let C=7;C>=0;C-=1)if(S=this.parts[C],S in g){if(x=g[S],v&&x!==0)return null;x!==16&&(v=!0),m+=x}else return null;return 128-m},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let m;const v=[],g=this.parts;for(let S=0;S<g.length;S++)m=g[S],v.push(m>>8),v.push(m&255);return v},h.prototype.toFixedLengthString=function(){const m=(function(){const g=[];for(let S=0;S<this.parts.length;S++)g.push(E(this.parts[S].toString(16),4));return g}).call(this).join(":");let v="";return this.zoneId&&(v=`%${this.zoneId}`),m+v},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const m=this.parts.slice(-2),v=m[0],g=m[1];return new w.IPv4([v>>8,v&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){const m=(function(){const g=[];for(let S=0;S<this.parts.length;S++)g.push(this.parts[S].toString(16));return g}).call(this).join(":");let v="";return this.zoneId&&(v=`%${this.zoneId}`),m+v},h.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString();let g=0,S=-1,x;for(;x=m.exec(v);)x[0].length>S&&(g=x.index,S=x[0].length);return S<0?v:`${v.substring(0,g)}::${v.substring(g+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),v=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[];let x=0;for(;x<16;)S.push(parseInt(v[x],10)|parseInt(g[x],10)^255),x++;return new this(S)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},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 m=this.parser(h);return new this(m.parts,m.zoneId),!0}catch{return!1}},w.IPv6.networkAddressFromCIDR=function(h){let m,v,g,S,x;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),x=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[],v=0;v<16;)S.push(parseInt(g[v],10)&parseInt(x[v],10)),v++;return new this(S)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},w.IPv6.parse=function(h){const m=this.parser(h);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},w.IPv6.parseCIDR=function(h){let m,v,g;if((v=h.match(/^(.+)\/(\d+)$/))&&(m=parseInt(v[2]),m>=0&&m<=128))return g=[this.parse(v[1]),m],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let m,v,g,S,x,C;if(g=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(l.native.test(h))return d(h,8);if((g=h.match(l.transitional))&&(C=g[6]||"",m=d(g[1].slice(0,-1)+C,6),m.parts)){for(x=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],v=0;v<x.length;v++)if(S=x[v],!(0<=S&&S<=255))return null;return m.parts.push(x[0]<<8|x[1]),m.parts.push(x[2]<<8|x[3]),{parts:m.parts,zoneId:m.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 m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let v=0;const g=Math.floor(h/8);for(;v<g;)m[v]=255,v++;return g<16&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},w.fromByteArray=function(h){const m=h.length;if(m===4)return new w.IPv4(h);if(m===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 m=this.parse(h);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},w.subnetMatch=function(h,m,v){let g,S,x,C;v==null&&(v="unicast");for(S in m)if(Object.prototype.hasOwnProperty.call(m,S)){for(x=m[S],x[0]&&!(x[0]instanceof Array)&&(x=[x]),g=0;g<x.length;g++)if(C=x[g],h.kind()===C[0].kind()&&h.match.apply(h,C))return S}return v},e.exports?e.exports=w:t.ipaddr=w})(mo)})(sl);var al=sl.exports;class cl{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 al.fromByteArray(Array.from(r)).toString()}return this.decodeIP(U.ToHex(t))}static fromString(t){const r=al.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Do,$o,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:O.Choice})],je);let gr=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})],gr.prototype,"ia5String",void 0),u([f({type:b.Any})],gr.prototype,"anyValue",void 0),gr=u([V({type:O.Choice})],gr);class Xr{constructor(t={}){this.type="",this.value=new gr,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Xr.prototype,"type",void 0),u([f({type:gr})],Xr.prototype,"value",void 0);let br=Do=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};br=Do=u([V({type:O.Set,itemType:Xr})],br);let Po=$o=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};Po=$o=u([V({type:O.Sequence,itemType:br})],Po);let Ie=Mo=class extends Po{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};Ie=Mo=u([V({type:O.Sequence})],Ie);const Xp={fromASN:e=>cl.toString(en.fromASN(e)),toASN:e=>en.toASN(cl.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 Ro{constructor(t={}){this.partyName=new je,Object.assign(this,t)}}u([f({type:je,optional:!0,context:0,implicit:!0})],Ro.prototype,"nameAssigner",void 0),u([f({type:je,context:1,implicit:!0})],Ro.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:Ro,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:Xp})],ie.prototype,"iPAddress",void 0),u([f({type:b.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([V({type:O.Choice})],ie);const wr="1.3.6.1.5.5.7.3",er="2.5.29";var Uo;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 ll=Uo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Uo.prototype)}};ll=Uo=u([V({type:O.Sequence,itemType:tn})],ll);const Lo=`${er}.35`;class Ho extends ae{}class tr{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Ho,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 ul=`${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 Fo;let He=Fo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};He=Fo=u([V({type:O.Sequence,itemType:ie})],He);var qo;let dl=qo=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};dl=qo=u([V({type:O.Sequence})],dl);var Ko;const fl=`${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:O.Choice})],Et);class zo{constructor(t={}){this.organization=new Et,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:Et})],zo.prototype,"organization",void 0),u([f({type:b.Integer,repeated:"sequence"})],zo.prototype,"noticeNumbers",void 0);class Go{constructor(t={}){Object.assign(this,t)}}u([f({type:zo,optional:!0})],Go.prototype,"noticeRef",void 0),u([f({type:Et,optional:!0})],Go.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:Go})],nn.prototype,"userNotice",void 0),nn=u([V({type:O.Choice})],nn);class Wo{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Wo.prototype,"policyQualifierId",void 0),u([f({type:b.Any})],Wo.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:Wo,repeated:"sequence",optional:!0})],on.prototype,"policyQualifiers",void 0);let sn=Ko=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};sn=Ko=u([V({type:O.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:O.Choice})],an);let pl=class extends an{};pl=u([V({type:O.Choice})],pl);var Jo,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 hl 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:O.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:hl,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 Yo=Jo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Jo.prototype)}};Yo=Jo=u([V({type:O.Sequence,itemType:ti})],Yo);var Zo;let yl=Zo=class extends Yo{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};yl=Zo=u([V({type:O.Sequence,itemType:ti})],yl);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:hl,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 Qo=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})],Qo.prototype,"reason",void 0),Qo=u([V({type:O.Choice})],Qo);var Xo;const ml=`${er}.37`;let cn=Xo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};cn=Xo=u([V({type:O.Sequence,itemType:b.ObjectIdentifier})],cn);const eh=`${wr}.1`,th=`${wr}.2`,rh=`${wr}.3`,ih=`${wr}.4`,nh=`${wr}.8`,oh=`${wr}.9`;let es=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:b.Integer,converter:we})],es.prototype,"value",void 0),es=u([V({type:O.Choice})],es);let ts=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:b.GeneralizedTime})],ts.prototype,"value",void 0),ts=u([V({type:O.Choice})],ts);var rs;let gl=rs=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,rs.prototype)}};gl=rs=u([V({type:O.Sequence})],gl);const bl=`${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 is 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 ns;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=ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};un=ns=u([V({type:O.Sequence,itemType:ln})],un);class wl{constructor(t={}){Object.assign(this,t)}}u([f({type:un,context:0,optional:!0,implicit:!0})],wl.prototype,"permittedSubtrees",void 0),u([f({type:un,context:1,optional:!0,implicit:!0})],wl.prototype,"excludedSubtrees",void 0);class vl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.Integer,context:0,implicit:!0,optional:!0,converter:we})],vl.prototype,"requireExplicitPolicy",void 0),u([f({type:b.Integer,context:1,implicit:!0,optional:!0,converter:we})],vl.prototype,"inhibitPolicyMapping",void 0);var os;class ss{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ss.prototype,"issuerDomainPolicy",void 0),u([f({type:b.ObjectIdentifier})],ss.prototype,"subjectDomainPolicy",void 0);let kl=os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};kl=os=u([V({type:O.Sequence,itemType:ss})],kl);var as;const Cl=`${er}.17`;let cs=as=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};cs=as=u([V({type:O.Sequence})],cs);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 ls;let Sl=ls=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};Sl=ls=u([V({type:O.Sequence,itemType:Nt})],Sl);const xl=`${er}.14`;class Pt extends Ho{}class Al{constructor(t={}){Object.assign(this,t)}}u([f({type:b.GeneralizedTime,context:0,implicit:!0,optional:!0})],Al.prototype,"notBefore",void 0),u([f({type:b.GeneralizedTime,context:1,implicit:!0,optional:!0})],Al.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 Bl 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 Il{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Bl,Object.assign(this,t)}}u([f({type:b.GeneralString})],Il.prototype,"entrustVers",void 0),u([f({type:Bl})],Il.prototype,"entrustInfoFlags",void 0);var us;let El=us=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};El=us=u([V({type:O.Sequence,itemType:tn})],El);class F{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof F&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&tc(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:b.ObjectIdentifier})],F.prototype,"algorithm",void 0),u([f({type:b.Any,optional:!0})],F.prototype,"parameters",void 0);class Ot{constructor(t={}){this.algorithm=new F,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],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:O.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 ds;let lt=class sp{constructor(t={}){this.extnID="",this.critical=sp.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=ds=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ds.prototype)}};rr=ds=u([V({type:O.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 F,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:F})],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 F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:it})],Cr.prototype,"tbsCertificate",void 0),u([f({type:F})],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 F,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:F})],_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 fs=class{constructor(t={}){this.tbsCertList=new _t,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:_t})],fs.prototype,"tbsCertList",void 0),u([f({type:F})],fs.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],fs.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:Pt,context:0,implicit:!0})],xr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],xr.prototype,"issuerAndSerialNumber",void 0),xr=u([V({type:O.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 F{};ni=u([V({type:O.Sequence})],ni);let pn=class extends F{};pn=u([V({type:O.Sequence})],pn);let mt=class extends F{};mt=u([V({type:O.Sequence})],mt);let hn=class extends F{};hn=u([V({type:O.Sequence})],hn);let Nl=class extends F{};Nl=u([V({type:O.Sequence})],Nl);let ps=class extends F{};ps=u([V({type:O.Sequence})],ps);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 hs;class gt{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})],gt.prototype,"version",void 0),u([f({type:xr})],gt.prototype,"sid",void 0),u([f({type:ni})],gt.prototype,"digestAlgorithm",void 0),u([f({type:Ar,repeated:"set",context:0,implicit:!0,optional:!0})],gt.prototype,"signedAttrs",void 0),u([f({type:pn})],gt.prototype,"signatureAlgorithm",void 0),u([f({type:ae})],gt.prototype,"signature",void 0),u([f({type:Ar,repeated:"set",context:1,implicit:!0,optional:!0})],gt.prototype,"unsignedAttrs",void 0);let yn=hs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};yn=hs=u([V({type:O.Set,itemType:gt})],yn);let Ol=class extends De{};Ol=u([V({type:O.Choice})],Ol);let _l=class extends gt{};_l=u([V({type:O.Sequence})],_l);class ys{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],ys.prototype,"acIssuer",void 0),u([f({type:b.Integer})],ys.prototype,"acSerial",void 0),u([f({type:Nt,repeated:"sequence"})],ys.prototype,"attrs",void 0);var ms;let mn=ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};mn=ms=u([V({type:O.Sequence,itemType:b.ObjectIdentifier})],mn);class gn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:b.Integer,optional:!0})],gn.prototype,"pathLenConstraint",void 0),u([f({type:mn,implicit:!0,context:0,optional:!0})],gn.prototype,"permittedAttrs",void 0),u([f({type:mn,implicit:!0,context:1,optional:!0})],gn.prototype,"excludedAttrs",void 0),u([f({type:b.Boolean,defaultValue:!0})],gn.prototype,"permitUnSpecified",void 0);class ir{constructor(t={}){this.issuer=new He,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:He})],ir.prototype,"issuer",void 0),u([f({type:b.Integer,converter:we})],ir.prototype,"serial",void 0),u([f({type:b.BitString,optional:!0})],ir.prototype,"issuerUID",void 0);var 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 F,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:F})],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:O.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 bs;(function(e){e[e.v2=1]="v2"})(bs||(bs={}));class ut{constructor(t={}){this.version=bs.v2,this.holder=new oi,this.issuer=new Br,this.signature=new F,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:F})],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 F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ut})],vn.prototype,"acinfo",void 0),u([f({type:F})],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 ws extends Xi{}class vs{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier,implicit:!0,context:0})],vs.prototype,"type",void 0),u([f({type:b.Any,implicit:!0,context:1})],vs.prototype,"value",void 0);class ks{constructor(t={}){this.policyId="",this.classList=new ws(kn.unclassified),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ks.prototype,"policyId",void 0),u([f({type:ws,defaultValue:new ws(kn.unclassified)})],ks.prototype,"classList",void 0),u([f({type:vs,repeated:"set"})],ks.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 Tl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Tl.prototype,"policyAuthority",void 0),u([f({type:Cn,repeated:"sequence"})],Tl.prototype,"values",void 0);var Cs;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:O.Choice})],Ir);let Ss=Cs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Cs.prototype)}};Ss=Cs=u([V({type:O.Sequence,itemType:Ir})],Ss);var xs;let Vl=xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};Vl=xs=u([V({type:O.Sequence,itemType:Ss})],Vl);class jl{constructor(t={}){Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],jl.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],jl.prototype,"roleName",void 0);class As{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],As.prototype,"service",void 0),u([f({type:ie})],As.prototype,"ident",void 0),u([f({type:ae,optional:!0})],As.prototype,"authInfo",void 0);var Bs;class Is{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Is.prototype,"otherCertFormat",void 0),u([f({type:b.Any})],Is.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:Is,context:3,implicit:!0})],Er.prototype,"other",void 0),Er=u([V({type:O.Choice})],Er);let xn=Bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Bs.prototype)}};xn=Bs=u([V({type:O.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:O.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:Dp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ai.prototype,"constructedValue",void 0),ai=u([V({type:O.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 Es;class In{constructor(t={}){this.subjectKeyIdentifier=new Pt,Object.assign(this,t)}}u([f({type:Pt})],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:O.Choice})],Or);class Ns{constructor(t={}){this.rid=new Or,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Or})],Ns.prototype,"rid",void 0),u([f({type:ae})],Ns.prototype,"encryptedKey",void 0);let En=Es=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Es.prototype)}};En=Es=u([V({type:O.Sequence,itemType:Ns})],En);class Os{constructor(t={}){this.algorithm=new F,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Os.prototype,"algorithm",void 0),u([f({type:b.BitString})],Os.prototype,"publicKey",void 0);let or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Pt,context:0,implicit:!0,optional:!0})],or.prototype,"subjectKeyIdentifier",void 0),u([f({type:Os,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:O.Choice})],or);class _r{constructor(t={}){this.version=Tt.v3,this.originator=new or,this.keyEncryptionAlgorithm=new mt,this.recipientEncryptedKeys=new En,Object.assign(this,t)}}u([f({type:b.Integer})],_r.prototype,"version",void 0),u([f({type:or,context:0})],_r.prototype,"originator",void 0),u([f({type:ae,context:1,optional:!0})],_r.prototype,"ukm",void 0),u([f({type:mt})],_r.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:En})],_r.prototype,"recipientEncryptedKeys",void 0);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Pt,context:0,implicit:!0})],Tr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],Tr.prototype,"issuerAndSerialNumber",void 0),Tr=u([V({type:O.Choice})],Tr);class li{constructor(t={}){this.version=Tt.v0,this.rid=new Tr,this.keyEncryptionAlgorithm=new mt,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:mt})],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 mt,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:mt})],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 mt,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:b.Integer})],fi.prototype,"version",void 0),u([f({type:ps,context:0,optional:!0})],fi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:mt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],fi.prototype,"encryptedKey",void 0);class _s{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],_s.prototype,"oriType",void 0),u([f({type:b.Any})],_s.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:_s,context:4,implicit:!0,optional:!0})],Rt.prototype,"ori",void 0),Rt=u([V({type:O.Choice})],Rt);var Ts;let Nn=Ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Nn=Ts=u([V({type:O.Set,itemType:Rt})],Nn);var Vs;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:O.Choice})],pi);let js=Vs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Vs.prototype)}};js=Vs=u([V({type:O.Set,itemType:pi})],js);class Ds{constructor(t={}){Object.assign(this,t)}}u([f({type:xn,context:0,implicit:!0,optional:!0})],Ds.prototype,"certs",void 0),u([f({type:js,context:1,implicit:!0,optional:!0})],Ds.prototype,"crls",void 0);var $s;let Ms=$s=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};Ms=$s=u([V({type:O.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:Ds,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 sh="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:O.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",Rs="1.2.840.10045.4.1",Dl="1.2.840.10045.4.3.1",Us="1.2.840.10045.4.3.2",Ls="1.2.840.10045.4.3.3",Hs="1.2.840.10045.4.3.4",$l="1.2.840.10045.3.1.7",Ml="1.3.132.0.34",Pl="1.3.132.0.35";function mi(e){return new F({algorithm:e})}const ah=mi(Rs);mi(Dl);const ch=mi(Us),lh=mi(Ls),uh=mi(Hs);let jr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],jr.prototype,"namedCurve",void 0),jr=u([V({type:O.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`,dh=`${ze}.7`,fh=`${ze}.9`,ph=`${ze}.10`,hh=`${ze}.2`,yh=`${ze}.4`,jn=`${ze}.5`,mh=`${ze}.14`,Fs=`${ze}.11`,Dn=`${ze}.12`,$n=`${ze}.13`,Rl=`${ze}.15`,Ul=`${ze}.16`,Ll="1.3.14.3.2.26",Hl="2.16.840.1.101.3.4.2.4",Fl="2.16.840.1.101.3.4.2.1",ql="2.16.840.1.101.3.4.2.2",Kl="2.16.840.1.101.3.4.2.3",gh="2.16.840.1.101.3.4.2.5",bh="2.16.840.1.101.3.4.2.6",wh="1.2.840.113549.2.2",vh="1.2.840.113549.2.5",qs=`${ze}.8`;function Ee(e){return new F({algorithm:e,parameters:null})}Ee(wh),Ee(vh);const sr=Ee(Ll);Ee(Hl),Ee(Fl),Ee(ql),Ee(Kl),Ee(gh),Ee(bh);const zl=new F({algorithm:qs,parameters:K.serialize(sr)}),Gl=new F({algorithm:fh,parameters:K.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(hh),Ee(yh),Ee(jn),Ee(Rl),Ee(Ul),Ee(Dn),Ee($n),Ee(Rl),Ee(Ul);class Mn{constructor(t={}){this.hashAlgorithm=new F(sr),this.maskGenAlgorithm=new F({algorithm:qs,parameters:K.serialize(sr)}),this.pSourceAlgorithm=new F(Gl),Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:sr})],Mn.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:zl})],Mn.prototype,"maskGenAlgorithm",void 0),u([f({type:F,context:2,defaultValue:Gl})],Mn.prototype,"pSourceAlgorithm",void 0),new F({algorithm:dh,parameters:K.serialize(new Mn)});class gi{constructor(t={}){this.hashAlgorithm=new F(sr),this.maskGenAlgorithm=new F({algorithm:qs,parameters:K.serialize(sr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:sr})],gi.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:zl})],gi.prototype,"maskGenAlgorithm",void 0),u([f({type:b.Integer,context:2,defaultValue:20})],gi.prototype,"saltLength",void 0),u([f({type:b.Integer,context:3,defaultValue:1})],gi.prototype,"trailerField",void 0),new F({algorithm:ph,parameters:K.serialize(new gi)});class Pn{constructor(t={}){this.digestAlgorithm=new F,this.digest=new ae,Object.assign(this,t)}}u([f({type:F})],Pn.prototype,"digestAlgorithm",void 0),u([f({type:ae})],Pn.prototype,"digest",void 0);var Ks;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 zs=Ks=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ks.prototype)}};zs=Ks=u([V({type:O.Sequence,itemType:Rn})],zs);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:zs,optional:!0})],bt.prototype,"otherPrimeInfos",void 0);class Gs{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:we})],Gs.prototype,"modulus",void 0),u([f({type:b.Integer,converter:we})],Gs.prototype,"publicExponent",void 0);var Ws;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Ws||(Ws={}));const Ge=Ws;/*! *****************************************************************************
|
|
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
|
|
89
|
-
`).map(function(
|
|
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 Pn,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:Pn})],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 $r{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})],$r.prototype,"version",void 0),u([f({type:Ie})],$r.prototype,"subject",void 0),u([f({type:Ot})],$r.prototype,"subjectPKInfo",void 0),u([f({type:Zn,implicit:!0,context:0})],$r.prototype,"attributes",void 0);class vi{constructor(t={}){this.certificationRequestInfo=new $r,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:$r})],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 Js=function(e,t){return Js=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])},Js(e,t)};function Ys(e,t){Js(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function kh(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 Ch(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 Sh="injectionTokens";function xh(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(Sh,e)||{};return Object.keys(r).forEach(function(n){t[+n]=r[n]}),t}function Wl(e){return!!e.useClass}function Zs(e){return!!e.useFactory}var Jl=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 $r(e){return typeof e=="string"||typeof e=="symbol"}function Ah(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function Yl(e){return typeof e=="object"&&"token"in e&&"transform"in e}function Bh(e){return typeof e=="function"||e instanceof Jl}function Hn(e){return!!e.useToken}function Fn(e){return e.useValue!=null}function Ih(e){return Wl(e)||Fn(e)||Hn(e)||Zs(e)}var Qs=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}(),Eh=function(e){Ys(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Qs),Zl=function(){function e(){this.scopedResolutions=new Map}return e}();function Nh(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function Oh(e,t,r){return r===void 0&&(r=" "),ar([e],t.message.split(`
|
|
89
|
+
`).map(function(n){return r+n})).join(`
|
|
90
|
+
`)}function _h(e,t,r){var n=Ln(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=n[1],s=o===void 0?null:o,a=Nh(s,t);return Oh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function Th(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Vh=function(e){Ys(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Qs),jh=function(e){Ys(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Qs),Dh=function(){function e(){this.preResolution=new Vh,this.postResolution=new jh}return e}(),Ql=new Map,$h=function(){function e(t){this.parent=t,this._registry=new Eh,this.interceptors=new Dh,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(Ih(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)||Zs(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(),$r(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(),$r(t)){if($r(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&&!$r(r)&&(n=r),this.register(t,{useClass:n},{lifecycle:Ge.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Zl),this.ensureNotDisposed();var n=this.getRegistration(t);if(!n&&$r(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(Bh(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):Wl(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Zs(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 Zl),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&$r(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 kh(this,void 0,void 0,function(){var t;return Ch(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 Jl)return t.createProxy(function(s){return n.resolve(s,r)});var o=function(){var s=Ql.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 Th(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 Ah(o)?Yl(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):Yl(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(_h(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 $h;function Xs(){return function(e){Ql.set(e,xh(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 ea;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 Xl=ea=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};Xl=ea=u([V({type:O.Sequence,itemType:qn})],Xl);var ta;let eu=ta=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};eu=ta=u([V({type:O.Sequence,itemType:Nr})],eu);class tu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],tu.prototype,"certId",void 0),u([f({type:b.Any,context:0})],tu.prototype,"certValue",void 0);class ru{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ru.prototype,"crlId",void 0),u([f({type:b.Any,context:0})],ru.prototype,"crltValue",void 0);class iu extends ae{}let Kn=class{constructor(t={}){this.encryptionAlgorithm=new F,this.encryptedData=new iu,Object.assign(this,t)}};u([f({type:F})],Kn.prototype,"encryptionAlgorithm",void 0),u([f({type:iu})],Kn.prototype,"encryptedData",void 0);var ra,ia;(function(e){e[e.v1=0]="v1"})(ia||(ia={}));class nu extends ae{}let na=ra=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ra.prototype)}};na=ra=u([V({type:O.Sequence,itemType:Nt})],na);class bi{constructor(t={}){this.version=ia.v1,this.privateKeyAlgorithm=new F,this.privateKey=new nu,Object.assign(this,t)}}u([f({type:b.Integer})],bi.prototype,"version",void 0),u([f({type:F})],bi.prototype,"privateKeyAlgorithm",void 0),u([f({type:nu})],bi.prototype,"privateKey",void 0),u([f({type:na,implicit:!0,context:0,optional:!0})],bi.prototype,"attributes",void 0);let ou=class extends bi{};ou=u([V({type:O.Sequence})],ou);let su=class extends Kn{};su=u([V({type:O.Sequence})],su);class au{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],au.prototype,"secretTypeId",void 0),u([f({type:b.Any,context:0})],au.prototype,"secretValue",void 0);class wi{constructor(t={}){this.mac=new Pn,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:Pn})],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 oa;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 cu=oa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,oa.prototype)}};cu=oa=u([V({type:O.Sequence,itemType:Gn})],cu);var sa,aa,ca;const lu="1.2.840.113549.1.9",uu=`${lu}.7`,la=`${lu}.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:O.Choice})],Wn);let du=class extends Nr{};du=u([V({type:O.Sequence})],du);let fu=class extends zn{};fu=u([V({type:O.Sequence})],fu);let pu=class extends Kn{};pu=u([V({type:O.Sequence})],pu);let ua=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.IA5String})],ua.prototype,"value",void 0),ua=u([V({type:O.Choice})],ua);let hu=class extends Wn{};hu=u([V({type:O.Choice})],hu);let yu=class extends je{};yu=u([V({type:O.Choice})],yu);let da=class{constructor(t=new Date){this.value=t}};u([f({type:b.GeneralizedTime})],da.prototype,"value",void 0),da=u([V({type:O.Choice})],da);let mu=class extends je{};mu=u([V({type:O.Choice})],mu);let fa=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:b.PrintableString})],fa.prototype,"value",void 0),fa=u([V({type:O.Choice})],fa);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:O.Choice})],Jn);let gu=class extends Jn{};gu=u([V({type:O.Choice})],gu);let bu=class extends je{};bu=u([V({type:O.Choice})],bu);let pa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.ObjectIdentifier})],pa.prototype,"value",void 0),pa=u([V({type:O.Choice})],pa);let wu=class extends De{};wu=u([V({type:O.Choice})],wu);let ha=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:b.Integer})],ha.prototype,"value",void 0),ha=u([V({type:O.Choice})],ha);let vu=class extends gt{};vu=u([V({type:O.Sequence})],vu);let Yn=class extends je{};Yn=u([V({type:O.Choice})],Yn);let ku=sa=class extends rr{constructor(t){super(t),Object.setPrototypeOf(this,sa.prototype)}};ku=sa=u([V({type:O.Sequence})],ku);let Cu=aa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}};Cu=aa=u([V({type:O.Set,itemType:Ar})],Cu);let ya=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.BmpString})],ya.prototype,"value",void 0),ya=u([V({type:O.Choice})],ya);let ma=class extends F{};ma=u([V({type:O.Sequence})],ma);let Su=ca=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ca.prototype)}};Su=ca=u([V({type:O.Sequence,itemType:ma})],Su);var ga;let Zn=ga=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Zn=ga=u([V({type:O.Sequence,itemType:Nt})],Zn);class Mr{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})],Mr.prototype,"version",void 0),u([f({type:Ie})],Mr.prototype,"subject",void 0),u([f({type:Ot})],Mr.prototype,"subjectPKInfo",void 0),u([f({type:Zn,implicit:!0,context:0})],Mr.prototype,"attributes",void 0);class vi{constructor(t={}){this.certificationRequestInfo=new Mr,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Mr})],vi.prototype,"certificationRequestInfo",void 0),u([f({type:F})],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
|
|
114
|
-
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Ht.isPrintableString(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
|
|
116
|
-
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:
|
|
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 P.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):P.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=P.toUint8Array(o.modulus);i.publicExponent=P.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 P.toArrayBuffer(r)}toWebSignature(t,r){return P.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(P.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(P.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(P.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(P.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(P.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:P.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(P.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,Pt);this.keyId=U.ToHex(r)}else{const r=typeof t[0]=="string"?U.FromHex(t[0]):t[0],i=new Pt(r);super(Sl,t[1],q.serialize(i)),this.keyId=U.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.parse(this.value,Pt);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ba extends wt{constructor(...t){P.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(P.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(P.isBufferSource(t[0]))r=P.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>P.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(P.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(P.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=P.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=P.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=P.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",void 0);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},$y=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Py=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,i]=$y(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=Py(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,$g=_g,Pg=Vg,Rg=jg,Ug=Tg,Ne={isNothing:Dg,isObject:Mg,toArray:$g,repeat:Pg,isNegativeZero:Rg,extend:Ug};function $d(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+=`
|
|
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 F({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",xu=`${We}.1`,Au=`${We}.2`,Bu=`${We}.3`,Iu=`${We}.4`,Eu=`${We}.5`,Nu=`${We}.6`,Ou=`${We}.7`,_u=`${We}.8`,Tu=`${We}.9`,Vu=`${We}.10`,ju=`${We}.11`,Du=`${We}.12`,$u=`${We}.13`,Mu=`${We}.14`,Pu="brainpoolP160r1",Ru="brainpoolP160t1",Uu="brainpoolP192r1",Lu="brainpoolP192t1",Hu="brainpoolP224r1",Fu="brainpoolP224t1",qu="brainpoolP256r1",Ku="brainpoolP256t1",zu="brainpoolP320r1",Gu="brainpoolP320t1",Wu="brainpoolP384r1",Ju="brainpoolP384t1",Yu="brainpoolP512r1",Zu="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 ah;case"sha-256":return ch;case"sha-384":return lh;case"sha-512":return uh}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=$l;break;case"K-256":r=eo.SECP256K1;break;case"P-384":r=Ml;break;case"P-521":r=Pl;break;case Pu: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=$u;break;case Zu:r=Mu;break}if(r)return new F({algorithm:yi,parameters:K.serialize(new jr({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Rs:return{name:ve,hash:{name:"SHA-1"}};case Us:return{name:ve,hash:{name:"SHA-256"}};case Ls:return{name:ve,hash:{name:"SHA-384"}};case Hs:return{name:ve,hash:{name:"SHA-512"}};case yi:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(K.parse(t.parameters,jr).namedCurve){case $l: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 xu:return{name:ve,namedCurve:Pu};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 $u:return{name:ve,namedCurve:Yu};case Mu:return{name:ve,namedCurve:Zu}}}}return null}};ki.SECP256K1="1.3.132.0.10",ki=eo=u([Xs()],ki),nt.registerSingleton(Qn,ki);const Qu=Symbol("name"),Xu=Symbol("value");class ue{constructor(t,r={},n=""){this[Qu]=t,this[Xu]=n;for(const o in r)this[o]=r[o]}}ue.NAME=Qu,ue.VALUE=Xu;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={[Ll]:"sha1",[Hl]:"sha224",[Fl]:"sha256",[ql]:"sha384",[Kl]:"sha512",[Dr]:"rsaEncryption",[jn]:"sha1WithRSAEncryption",[mh]:"sha224WithRSAEncryption",[Fs]:"sha256WithRSAEncryption",[Dn]:"sha384WithRSAEncryption",[$n]:"sha512WithRSAEncryption",[yi]:"ecPublicKey",[Rs]:"ecdsaWithSHA1",[Dl]:"ecdsaWithSHA224",[Us]:"ecdsaWithSHA256",[Ls]:"ecdsaWithSHA384",[Hs]:"ecdsaWithSHA512",[eh]:"TLS WWW server authentication",[th]:"TLS WWW client authentication",[rh]:"Code Signing",[ih]:"E-mail Protection",[nh]:"Time Stamping",[oh]:"OCSP Signing",[sh]:"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(M.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=M.toUint8Array(t),s=[];for(let a=0;a<o.length;){const c=[];for(let l=0;l<16&&a<o.length;l++){l===8&&c.push("");const d=o[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${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=K.serialize(r),this.onInit(r)}else{const r=K.parse(t[0],t[1]);this.rawData=M.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Lt?tc(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return K.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;M.isBufferSource(t[0])?r=M.toArrayBuffer(t[0]):r=K.serialize(new lt({extnID:t[0],critical:t[1],extnValue:new ae(M.toArrayBuffer(t[2]))})),super(r,lt)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[ue.NAME]===wt.NAME&&(t[ue.NAME]=Ut.toString(this.type)),t}}var ed;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[ed]="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}}ed=Symbol.toStringTag,lr.DEFAULT="default";const Xe=new lr,Rh=/^[0-2](?:\.[1-9][0-9]*)+$/;function Uh(e){return new RegExp(Rh).test(e)}class td{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Uh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Je=new td;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 Lh(e,t){return`\\${U.ToHex(U.FromUtf8String(t)).toUpperCase()}`}function Hh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Lh)}class Ht{static isASCII(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return!1;return!0}static isPrintableString(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(t)}constructor(t,r={}){this.extraNames=new td,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:M.isBufferSource(t)?this.asn=K.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)}`:Hh(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.isPrintableString(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 K.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 rd="Cannot initialize GeneralName from ASN.1 data.",id=`${rd} Unsupported string format in use.`,Fh=`${rd} Value doesn't match to GUID regular expression.`,nd=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,od="1.3.6.1.4.1.311.25.1",sd="1.3.6.1.4.1.311.20.2.3",ba="dns",wa="dn",va="email",ka="ip",Ca="url",Sa="guid",xa="upn",to="id";class ad extends Lt{constructor(...t){let r;if(t.length===2)switch(t[0]){case wa:{const n=new Ht(t[1]).toArrayBuffer(),o=K.parse(n,Ie);r=new ie({directoryName:o});break}case ba:r=new ie({dNSName:t[1]});break;case va:r=new ie({rfc822Name:t[1]});break;case Sa:{const n=new RegExp(nd,"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:od,value:K.serialize(new ae(U.FromHex(o)))})});break}case ka:r=new ie({iPAddress:t[1]});break;case to:r=new ie({registeredID:t[1]});break;case xa:{r=new ie({otherName:new ei({typeId:sd,value:K.serialize(il.toASN(t[1]))})});break}case Ca:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else M.isBufferSource(t[0])?r=K.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=ba,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=va,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=ka,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=Ca,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=to,this.value=t.registeredID;else if(t.directoryName!=null)this.type=wa,this.value=new Ht(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===od){this.type=Sa;const r=K.parse(t.otherName.value,ae),n=new RegExp(nd,"i").exec(U.ToHex(r));if(!n)throw new Error(Fh);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===sd)this.type=xa,this.value=K.parse(t.otherName.value,je).toString();else throw new Error(id);else throw new Error(id)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case wa:case ba:case Sa:case ka:case to:case xa:case Ca:t=this.type.toUpperCase();break;case va: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=K.parse(new ad(o.type,o.value).rawData,ie);n.push(s)}r=new He(n)}else if(M.isBufferSource(t))r=K.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 ad(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",qh=`[^${xi}]+`,Kh=`${Si}BEGIN (${qh}(?=${Si}))${Si}`,zh=`${Si}END \\1${Si}`,Pr="\\n",Gh=`[^:${xi}]+`,Wh=`(?:[^${xi}]+${Pr}(?: +[^${xi}]+${Pr})*)`,Jh=`(?:[a-zA-Z0-9=+/]+${Pr})+`,cd=`${Kh}${Pr}(?:((?:${Gh}: ${Wh})+))?${Pr}?(${Jh})${zh}`;class et{static isPem(t){return typeof t=="string"&&new RegExp(cd,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(cd,"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(Pr,"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(!M.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:M.toArrayBuffer(o)}))}):t.forEach(o=>{if(!("type"in o))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");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:M.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 M.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):M.toArrayBuffer(t)}}constructor(...t){Vt.isAsnEncoded(t[0])?super(Vt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return et.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ur extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Ot):super(t),this.tag=et.PublicKeyTag}async export(...t){let r,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=K.parse(t.subjectPublicKey,Gs),s=M.toUint8Array(o.modulus);n.publicExponent=M.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=K.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=K.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 Yh{toAsnSignature(t,r){return M.toArrayBuffer(r)}toWebSignature(t,r){return M.toArrayBuffer(r)}}class io extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Cr):super(t),this.tag=et.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=K.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(K.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(M.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=K.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(M.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new Ho(U.FromHex(t[0]))});super(Lo,t[1],K.serialize(r))}else{const r=t[0],n=r.name instanceof Ci?K.parse(r.name.rawData,He):r.name,o=new tr({authorityCertIssuer:n,authorityCertSerialNumber:U.FromHex(r.serialNumber)});super(Lo,t[1],K.serialize(o))}}onInit(t){super.onInit(t);const r=K.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=K.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 ld extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=K.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(ul,t[2],K.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}}ld.NAME="Basic Constraints";var ud;(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"})(ud||(ud={}));class dd extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=K.parse(this.value,cn);this.usages=r.map(n=>n)}else{const r=new cn(t[0]);super(ml,t[1],K.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}dd.NAME="Extended Key Usages";var Aa;(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"})(Aa||(Aa={}));class Ba extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=K.parse(this.value,is);this.usages=r.toNumber()}else{const r=new is(t[0]);super(bl,t[1],K.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=K.parse(this.value,is);return t[""]=r.toJSON().join(", "),t}}Ba.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:M.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(M.isBufferSource(t[0])){super(t[0]);const r=K.parse(this.value,Pt);this.keyId=U.ToHex(r)}else{const r=typeof t[0]=="string"?U.FromHex(t[0]):t[0],n=new Pt(r);super(xl,t[1],K.serialize(n)),this.keyId=U.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=K.parse(this.value,Pt);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ia extends wt{constructor(...t){M.isBufferSource(t[0])?super(t[0]):super(Cl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=K.parse(t.extnValue,cs);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}}Ia.NAME="Subject Alternative Name";class fd extends wt{constructor(...t){var r;if(M.isBufferSource(t[0])){super(t[0]);const n=K.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(fl,o,K.serialize(s)),this.policies=n}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Ut.toString(r))),t}}fd.NAME="Certificate Policies",vt.register(fl,fd);class Rr extends Lt{constructor(...t){let r;if(M.isBufferSource(t[0]))r=M.toArrayBuffer(t[0]);else{const n=t[0],o=Array.isArray(t[1])?t[1].map(s=>M.toArrayBuffer(s)):[];r=K.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 pd extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=new Yn({printableString:t[0]});super(uu,[K.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=K.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}pd.NAME="Challenge Password";class Ea extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=t[0],o=new rr;for(const s of n)o.push(K.parse(s.rawData,lt));super(la,[K.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=K.parse(this.values[0],rr);this.items=r.map(n=>vt.create(K.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}}Ea.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 Na=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 F({algorithm:jn,parameters:null});case"sha-256":return new F({algorithm:Fs,parameters:null});case"sha-384":return new F({algorithm:Dn,parameters:null});case"sha-512":return new F({algorithm:$n,parameters:null})}}else return new F({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 Fs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case $n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Na=u([Xs()],Na),nt.registerSingleton(Qn,Na);class ot{addPadding(t,r){const n=M.toUint8Array(r),o=new Uint8Array(t);return o.set(n,t-n.length),o}removePadding(t,r=!1){let n=M.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=M.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),K.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const n=K.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 fp(a,c)}return null}}ot.namedCurveSize=new Map,ot.defaultNamedCurveSize=32;const hd="1.3.101.110",yd="1.3.101.111",md="1.3.101.112",gd="1.3.101.113";let Oa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=md;break;case"ed448":r=gd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=hd;break;case"x448":r=yd;break}}return r?new F({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case md:return{name:"EdDSA",namedCurve:"Ed25519"};case gd:return{name:"EdDSA",namedCurve:"Ed448"};case hd:return{name:"ECDH-ES",namedCurve:"X25519"};case yd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Oa=u([Xs()],Oa),nt.registerSingleton(Qn,Oa);class Zh extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,vi):super(t),this.tag=et.CertificateRequestTag}onInit(t){this.tbs=K.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(K.serialize(o)));const n=this.getAttribute(la);this.extensions=[],n instanceof Ea&&(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=K.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}}Zh.NAME="PKCS#10 Certificate Request";var bd;(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"})(bd||(bd={})),vt.register(ul,ld),vt.register(ml,dd),vt.register(bl,Ba),vt.register(xl,no),vt.register(Lo,Ai),vt.register(Cl,Ia),oo.register(uu,pd),oo.register(la,Ea),nt.registerSingleton(ro,Yh),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 wd(){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 Ia){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 Ba){const s=Object.values(Aa),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 Qh(){const e=wd(),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 Xh={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 ey(){const e=pr.createI18n("en-us",Xh);return{i18n:e,i18nT:pr.i18nTComponent(e)}}const kt={useCertificate:Qh,useI18n:ey,useX509:wd},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"}}},ty={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},ry="Copy to clipboard",iy={message:ty,iconTitle:ry},ny="kong-ui-copy-uuid-notify",vd="24px",oy=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},sy=e=>(i.pushScopeId("data-v-13f41aa3"),e=e(),i.popScopeId(),e),ay=["aria-hidden"],cy={key:0,"data-testid":"kui-icon-svg-title"},ly=sy(()=>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)),uy=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:vd,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 vd}),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",cy,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),ly],8,ay))]),_:1},8,["aria-hidden","style"]))}}),dy=oy(uy,[["__scopeId","data-v-13f41aa3"]]),fy="16px",py={class:"kong-ui-copy-uuid"},hy=["onClick"],kd=15,yy=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",iy),n=e,o=t,s=n.notify||i.inject(ny,()=>{}),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,m;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)>kd,g=n.format==="hidden"||n.format==="redacted"?r("message.success.prefix"):`"${((m=n.uuid)==null?void 0:m.substring(0,kd))+(v?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(n.successTooltip):o("success",n.uuid)};return(w,h)=>{const m=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",py,[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(m,null,{default:i.withCtx(({copyToClipboard:v})=>[i.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:i.withModifiers(g=>E(v),["stop"])},[i.createVNode(i.unref(dy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:i.unref(fy),title:i.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,hy)]),_:1})]),_:1},16))])}}}),my=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},gy=my(yy,[["__scopeId","data-v-0c07874b"]]);var _a=(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))(_a||{}),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 by(){return{getAxiosInstance:(e={})=>{try{const t=i.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):Qa.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Qa.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 wy(){return{debounce:(e,t)=>{let r;return(...n)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...n)},t)}}}}const Ta="khcp-user-table-preferences",vy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ky(){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(Ta));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(Ta,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||vy},deleteAllTablePreferences:()=>{localStorage.removeItem(Ta)}}}function Va(e={}){const{getAxiosInstance:t}=by();return{axiosInstance:t(e)}}const Cy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Sy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},xy={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."}},Ay={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},By={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"}},Iy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Ey={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ny={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Oy={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"}},_y={global:Cy,deleteModal:Sy,baseForm:xy,baseTable:Ay,baseConfigCard:By,filter:Iy,debouncedFilter:Ey,errors:Ny,toggleModal:Oy};function ja(){const e=pr.createI18n("en-us",_y);return{i18n:e,i18nT:pr.i18nTComponent(e)}}function Cd(){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 Ty(e,t,r,n={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=Va({headers:e.requestHeaders}),{i18n:{t:s}}=ja(),{debounce:a}=wy(),c=a(async C=>{await x(C)},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 m=`${e.apiBaseUrl}${h}`;e.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:v}=Cd(),g=async()=>{try{l.value=!0;const{data:C}=await o.get(`${m}?size=${r}`);C!=null&&C.next||(w.value=n.fetchedItemsKey in C?C[n.fetchedItemsKey]:[]),E.value=n.fetchedItemsKey in C?C[n.fetchedItemsKey]:[],p.value=E.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},S=i.ref(""),x=async C=>{var I,T,Q;if(S.value!==C)if(S.value=C||"",w.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let _=m+"";C&&(_+=`/${C}`);const{data:A}=await o.get(`${_}?size=${r}`);n.fetchedItemsKey in A?p.value=A[n.fetchedItemsKey]:A!=null&&A.id?p.value=[A]:p.value=[]}else if(C){const _=[];v(C)&&n.searchKeys.includes("id")?_.push((async()=>{const{data:J}=await o.get(`${m}/${C}`);return[J[n.fetchedItemsKey]??J]})()):_.push(...n.searchKeys.filter(J=>J!=="id").map(async J=>{const{data:P}=await o.get(`${m}?${J}=${C}`);return P[n.fetchedItemsKey]}));const A=await Promise.all(_),Z=new Set;p.value=[],(I=A==null?void 0:A.forEach)==null||I.call(A,J=>{var P;(P=J==null?void 0:J.forEach)==null||P.call(J,H=>{Z.has(H.id)||(Z.add(H.id),p.value.push(H))})})}else p.value=E.value}catch(_){((T=_==null?void 0:_.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="",C?(p.value=(Q=w.value)==null?void 0:Q.filter(_=>{var A;let Z=!1;for(const J of n.searchKeys){const P=typeof _[J]=="string"?(A=_[J])==null?void 0:A.toLowerCase():_[J];P!=null&&P.includes(C.toLowerCase())&&(Z=!0)}return Z}),(!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:g,debouncedQueryChange:c}}function Vy(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 jy(){const{i18n:{t:e}}=ja();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 Dy(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 Sd(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,m)=>{w.searchParams.append(m,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 $y(e,t,r="data"){const n=i.unref(t),{axiosInstance:o}=Va({headers:e.requestHeaders}),s=Sd(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 xd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ad=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(xd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Bd=e=>e==="*"||e==="x"||e==="X",Id=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Py=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Ry=(e,t)=>{if(Bd(e)||Bd(t))return 0;const[r,n]=Py(Id(e),Id(t));return r>n?1:r<n?-1:0},Ed=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=Ry(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0},Uy=(e,t)=>{const r=Ad(e),n=Ad(t),o=r.pop(),s=n.pop(),a=Ed(r,n);return a!==0?a:o&&s?Ed(o.split("."),s.split(".")):o||s?o?-1:1:0},Nd=(e,t,r)=>{Ly(r);const n=Uy(e,t);return Od[r].includes(n)},Od={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},_d=Object.keys(Od),Ly=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(_d.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${_d.join("|")}`)},Hy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&xd.test(e);function Fy(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:n,version:o}=t;if(!Hy(o))return console.error("Invalid version"),!1;const s=r[n];if(!s)return!1;const[a,c]=s;return!(a&&Nd(o,a,"<")||c&&Nd(o,c,">"))}function qy(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:Va,useDebouncedFilter:Ty,useDeleteUrlBuilder:Vy,useErrors:jy,useExternalLinkCreator:Dy,useFetcher:$y,useFetchUrlBuilder:Sd,useHelpers:Cd,useStringHelpers:My,useI18n:ja,useGatewayFeatureSupported:Fy,useTruncationDetector:qy},Ky={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},zy="Copy to clipboard",Gy={message:Ky,iconTitle:zy},Wy="kong-ui-copy-uuid-notify",Td="24px",Jy=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},Yy=e=>(i.pushScopeId("data-v-13f41aa3"),e=e(),i.popScopeId(),e),Zy=["aria-hidden"],Qy={key:0,"data-testid":"kui-icon-svg-title"},Xy=Yy(()=>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)),em=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:Td,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 Td}),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",Qy,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),Xy],8,Zy))]),_:1},8,["aria-hidden","style"]))}}),tm=Jy(em,[["__scopeId","data-v-13f41aa3"]]),rm="16px",im={class:"kong-ui-copy-uuid"},nm=["onClick"],Vd=15,om=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",Gy),n=e,o=t,s=n.notify||i.inject(Wy,()=>{}),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,m;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,g=n.format==="hidden"||n.format==="redacted"?r("message.success.prefix"):`"${((m=n.uuid)==null?void 0:m.substring(0,Vd))+(v?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(n.successTooltip):o("success",n.uuid)};return(w,h)=>{const m=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",im,[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(m,null,{default:i.withCtx(({copyToClipboard:v})=>[i.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:i.withModifiers(g=>E(v),["stop"])},[i.createVNode(i.unref(tm),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:i.unref(rm),title:i.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,nm)]),_:1})]),_:1},16))])}}}),sm=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},jd=sm(om,[["__scopeId","data-v-0c07874b"]]),am={key:0,class:"config-card-fieldset-title"},cm=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",am,[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},Dd=dt(cm,[["__scopeId","data-v-68ca83ec"]]),lm=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})])}}}),um=dt(lm,[["__scopeId","data-v-c96811e5"]]),dm=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"])}}}),fm="#0044f4",pm="#e0e4ea",hm="#3a3f51",ym="1px",mm="20px",gm={class:"config-card-details-row"},bm=["data-testid"],wm=["data-testid"],vm=["data-testid"],km=["data-testid"],Cm={key:1},Sm=["data-testid"],xm=["data-testid"],Am=["data-testid"],Bm=["data-testid"],Im={name:"ConfigCardItem",components:{CopyUuid:jd,JsonCardItem:Dd,StatusBadge:dm,InternalLinkItem:um}},Em=i.defineComponent({...Im,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(ym)} ${i.unref(pm)}`,"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,m)=>{const v=i.resolveComponent("KLabel"),g=i.resolveComponent("KBadge"),S=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("div",gm,[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,wm)]),key:"0"}:void 0]),1024)],!0)],8,bm),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",Cm,[(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,(x,C)=>(i.openBlock(),i.createBlock(g,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:x,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Sm)):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,(x,C)=>(i.openBlock(),i.createBlock(i.unref(jd),i.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,uuid:x}),null,16,["data-testid","uuid"]))),128))],8,xm)):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,(x,C)=>(i.openBlock(),i.createBlock(g,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(i.unref(ap.BadgeMethodAppearances)).includes(x.toLowerCase())?x.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Am)):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,(x,C)=>(i.openBlock(),i.createBlock(Dd,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:x},null,8,["index","item"]))),128))],8,Bm)):(i.openBlock(),i.createBlock(S,{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,km))],!0)],8,vm)])}}}),Ii=dt(Em,[["__scopeId","data-v-f65fc52c"]]),Nm={class:"json-config"},Om={key:0,class:"json-endpoint"},$d=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",Nm,[t.fetcherUrl&&(a=t.config)!=null&&a.jsonYamlFormsEnabled?(i.openBlock(),i.createElementBlock("div",Om,[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 _m(e){return typeof e=="object"&&e!==null}function Tm(e){return Array.isArray(e)?e:Md(e)?[]:[e]}function Vm(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 jm(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Dm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var $m=Md,Mm=_m,Pm=Tm,Rm=jm,Um=Dm,Lm=Vm,Ne={isNothing:$m,isObject:Mm,toArray:Pm,repeat:Rm,isNegativeZero:Um,extend:Lm};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+=`
|
|
118
118
|
|
|
119
|
-
`+e.mark.snippet),
|
|
120
|
-
`+c;for(d=
|
|
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 Da(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 $a(e,t){return Ne.repeat(" ",t-e.length)+e}function Hm(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=Da(e.buffer,n[a-l],o[a-l],e.position-(n[a]-n[a-l]),p),c=Ne.repeat(" ",t.indent)+$a((e.line-l+1).toString(),y)+" | "+d.str+`
|
|
120
|
+
`+c;for(d=Da(e.buffer,n[a],o[a],e.position,p),c+=Ne.repeat(" ",t.indent)+$a((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=
|
|
123
|
-
`;return c.replace(/\n$/,"")}var
|
|
124
|
-
\r`;function
|
|
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
|
|
126
|
-
`,t-1))}function
|
|
127
|
-
`,s?1+l:l):o===
|
|
128
|
-
`);break}for(
|
|
122
|
+
`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)d=Da(e.buffer,n[a+l],o[a+l],e.position-(n[a]-n[a+l]),p),c+=Ne.repeat(" ",t.indent)+$a((e.line+l+1).toString(),y)+" | "+d.str+`
|
|
123
|
+
`;return c.replace(/\n$/,"")}var Fm=Hm,qm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Km=["scalar","sequence","mapping"];function zm(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Gm(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(qm.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=zm(t.styleAliases||null),Km.indexOf(this.kind)===-1)throw new Fe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var $e=Gm;function Rd(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 Wm(){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 $e)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 $e))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 $e))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=Rd(n,"implicit"),n.compiledExplicit=Rd(n,"explicit"),n.compiledTypeMap=Wm(n.compiledImplicit,n.compiledExplicit),n};var Ud=Ma,Ld=new $e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Hd=new $e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Fd=new $e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),qd=new Ud({explicit:[Ld,Hd,Fd]});function Jm(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Ym(){return null}function Zm(e){return e===null}var Kd=new $e("tag:yaml.org,2002:null",{kind:"scalar",resolve:Jm,construct:Ym,predicate:Zm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Qm(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 Xm(e){return e==="true"||e==="True"||e==="TRUE"}function eg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var zd=new $e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Qm,construct:Xm,predicate:eg,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 tg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function rg(e){return 48<=e&&e<=55}function ig(e){return 48<=e&&e<=57}function ng(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(!tg(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!rg(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!ig(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function og(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 sg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ne.isNegativeZero(e)}var Gd=new $e("tag:yaml.org,2002:int",{kind:"scalar",resolve:ng,construct:og,predicate:sg,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"]}}),ag=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function cg(e){return!(e===null||!ag.test(e)||e[e.length-1]==="_")}function lg(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 ug=/^[-+]?[0-9]+e/;function dg(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),ug.test(r)?r.replace("e",".e"):r}function fg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ne.isNegativeZero(e))}var Wd=new $e("tag:yaml.org,2002:float",{kind:"scalar",resolve:cg,construct:lg,predicate:fg,represent:dg,defaultStyle:"lowercase"}),Jd=qd.extend({implicit:[Kd,zd,Gd,Wd]}),Yd=Jd,Zd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Qd=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 pg(e){return e===null?!1:Zd.exec(e)!==null||Qd.exec(e)!==null}function hg(e){var t,r,n,o,s,a,c,l=0,d=null,y,p,E;if(t=Zd.exec(e),t===null&&(t=Qd.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 yg(e){return e.toISOString()}var Xd=new $e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:pg,construct:hg,instanceOf:Date,represent:yg});function mg(e){return e==="<<"||e===null}var ef=new $e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:mg}),Pa=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
124
|
+
\r`;function gg(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 bg(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 wg(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 vg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var tf=new $e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:gg,construct:bg,predicate:vg,represent:wg}),kg=Object.prototype.hasOwnProperty,Cg=Object.prototype.toString;function Sg(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,Cg.call(o)!=="[object Object]")return!1;for(s in o)if(kg.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 xg(e){return e!==null?e:[]}var rf=new $e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Sg,construct:xg}),Ag=Object.prototype.toString;function Bg(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],Ag.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;s[t]=[o[0],n[o[0]]]}return!0}function Ig(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 nf=new $e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Bg,construct:Ig}),Eg=Object.prototype.hasOwnProperty;function Ng(e){if(e===null)return!0;var t,r=e;for(t in r)if(Eg.call(r,t)&&r[t]!==null)return!1;return!0}function Og(e){return e!==null?e:{}}var of=new $e("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ng,construct:Og}),Ra=Yd.extend({implicit:[Xd,ef],explicit:[tf,rf,nf,of]}),qt=Object.prototype.hasOwnProperty,so=1,sf=2,af=3,ao=4,Ua=1,_g=2,cf=3,Tg=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Vg=/[\x85\u2028\u2029]/,jg=/[,\[\]\{\}]/,lf=/^(?:!|!!|![a-z\-]+!)$/i,uf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function df(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 Dg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function $g(e){return e===120?2:e===117?4:e===85?8:0}function Mg(e){return 48<=e&&e<=57?e-48:-1}function ff(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 Pg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var pf=new Array(256),hf=new Array(256),Lr=0;Lr<256;Lr++)pf[Lr]=ff(Lr)?1:0,hf[Lr]=ff(Lr);function Rg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ra,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 yf(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=Fm(r),new Fe(t,r)}function W(e,t){throw yf(e,t)}function co(e,t){e.onWarning&&e.onWarning.call(null,yf(e,t))}var mf={YAML:function(e,t,r){var n,o,s;e.version!==null&&W(e,"duplication of %YAML directive"),r.length!==1&&W(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),n===null&&W(e,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),s=parseInt(n[2],10),o!==1&&W(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&&W(e,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],lf.test(n)||W(e,"ill-formed tag handle (first argument) of the TAG directive"),qt.call(e.tagMap,n)&&W(e,'there is a previously declared suffix for "'+n+'" tag handle'),uf.test(o)||W(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{W(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||W(e,"expected valid JSON character");else Tg.test(c)&&W(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)||W(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])&&W(e,"nested arrays are not supported inside keys"),typeof o=="object"&&df(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&df(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,W(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 La(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++):W(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(La(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 Ha(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ne.repeat(`
|
|
126
|
+
`,t-1))}function Ug(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),Ha(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 Lg(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),Ha(e,Ae(e,!1,t)),n=o=e.position):e.position===e.lineStart&&lo(e)?W(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);W(e,"unexpected end of the stream within a single quoted scalar")}function Hg(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&&pf[c])e.result+=hf[c],e.position++;else if((a=$g(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=Dg(c))>=0?s=(s<<4)+a:W(e,"expected hexadecimal character");e.result+=Pg(s),e.position++}else W(e,"unknown escape sequence");r=n=e.position}else Ct(c)?(Kt(e,r,n,!0),Ha(e,Ae(e,!1,t)),r=n=e.position):e.position===e.lineStart&&lo(e)?W(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}W(e,"unexpected end of the stream within a double quoted scalar")}function Fg(e,t){var r=!0,n,o,s,a=e.tag,c,l=e.anchor,d,y,p,E,w,h=Object.create(null),m,v,g,S;if(S=e.input.charCodeAt(e.position),S===91)y=93,w=!1,c=[];else if(S===123)y=125,w=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),S=e.input.charCodeAt(++e.position);S!==0;){if(Ae(e,!0,t),S=e.input.charCodeAt(e.position),S===y)return e.position++,e.tag=a,e.anchor=l,e.kind=w?"mapping":"sequence",e.result=c,!0;r?S===44&&W(e,"expected the node content, but found ','"):W(e,"missed comma between flow collection entries"),v=m=g=null,p=E=!1,S===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,m=e.result,Ae(e,!0,t),S=e.input.charCodeAt(e.position),(E||e.line===n)&&S===58&&(p=!0,S=e.input.charCodeAt(++e.position),Ae(e,!0,t),Fr(e,t,so,!1,!0),g=e.result),w?Hr(e,c,h,v,m,g,n,o,s):p?c.push(Hr(e,null,h,v,m,g,n,o,s)):c.push(m),Ae(e,!0,t),S=e.input.charCodeAt(e.position),S===44?(r=!0,S=e.input.charCodeAt(++e.position)):r=!1}W(e,"unexpected end of the stream within a flow collection")}function qg(e,t){var r,n,o=Ua,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)Ua===o?o=p===43?cf:_g:W(e,"repeat of a chomping mode identifier");else if((y=Mg(p))>=0)y===0?W(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?W(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(La(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===cf?e.result+=Ne.repeat(`
|
|
127
|
+
`,s?1+l:l):o===Ua&&s&&(e.result+=`
|
|
128
|
+
`);break}for(n?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
|
|
133
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
134
|
-
`,
|
|
135
|
-
`&&(s+=r),s+=a;return s}function
|
|
136
|
-
`+Ne.repeat(" ",e.indent*t)}function
|
|
137
|
-
`,o=
|
|
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 bf(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,W(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,af,!1,!0),s.push(e.result),Ae(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)W(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 Kg(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,m=null,v=!1,g=!1,S;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),S=e.input.charCodeAt(e.position);S!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,W(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,(S===63||S===58)&&Ye(n))S===63?(v&&(Hr(e,p,E,w,h,null,a,c,l),w=h=m=null),g=!0,v=!0,o=!0):v?(v=!1,o=!0):W(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,S=n;else{if(a=e.line,c=e.lineStart,l=e.position,!Fr(e,r,sf,!1,!0))break;if(e.line===s){for(S=e.input.charCodeAt(e.position);fr(S);)S=e.input.charCodeAt(++e.position);if(S===58)S=e.input.charCodeAt(++e.position),Ye(S)||W(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=m=null),g=!0,v=!1,o=!1,w=e.tag,h=e.result;else if(g)W(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(g)W(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:m=e.result),v||(Hr(e,p,E,w,h,m,a,c,l),w=h=m=null),Ae(e,!0,-1),S=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&S!==0)W(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),g&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),g}function zg(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&&W(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)):W(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ye(a);)a===33&&(n?W(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),lf.test(o)||W(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),jg.test(s)&&W(e,"tag suffix cannot contain flow indicator characters")}s&&!uf.test(s)&&W(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{W(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:W(e,'undeclared tag handle "'+o+'"'),!0}function Gg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&W(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&&W(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Wg(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&&W(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),qt.call(e.anchorMap,r)||W(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,m,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||af===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(;zg(e)||Gg(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||sf===r?m=t:m=t+1,v=e.position-e.lineStart,l===1?c&&(bf(e,v)||Kg(e,v,m))||Fg(e,m)?y=!0:(a&&qg(e,m)||Lg(e,m)||Hg(e,m)?y=!0:Wg(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&W(e,"alias node should not have any properties")):Ug(e,m,so===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&bf(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"&&W(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||W(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&W(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)):W(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 Jg(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&&W(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&&La(e),qt.call(mf,n)?mf[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&&W(e,"directives end mark is expected"),Fr(e,e.lineIndent-1,ao,!1,!0),Ae(e,!0,-1),e.checkLineBreaks&&Vg.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)W(e,"end of the stream or a document separator is expected");else return}function wf(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 Rg(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,W(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;)Jg(r);return r.documents}function Yg(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=wf(e,r);if(typeof t!="function")return n;for(var o=0,s=n.length;o<s;o+=1)t(n[o])}function Zg(e,t){var r=wf(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 Qg=Yg,Xg=Zg,vf={loadAll:Qg,load:Xg},kf=Object.prototype.toString,Cf=Object.prototype.hasOwnProperty,Fa=65279,e0=9,Ni=10,t0=13,r0=32,i0=33,n0=34,qa=35,o0=37,s0=38,a0=39,c0=42,Sf=44,l0=45,uo=58,u0=61,d0=62,f0=63,p0=64,xf=91,Af=93,h0=96,Bf=123,y0=124,If=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 m0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],g0=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function b0(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&&Cf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function w0(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 v0=1,Oi=2;function k0(e){this.schema=e.schema||Ra,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=b0(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:v0,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 Ef(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!==`
|
|
135
|
+
`&&(s+=r),s+=a;return s}function Ka(e,t){return`
|
|
136
|
+
`+Ne.repeat(" ",e.indent*t)}function C0(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===r0||e===e0}function _i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Fa||65536<=e&&e<=1114111}function Nf(e){return _i(e)&&e!==Fa&&e!==t0&&e!==Ni}function Of(e,t,r){var n=Nf(e),o=n&&!fo(e);return(r?n:n&&e!==Sf&&e!==xf&&e!==Af&&e!==Bf&&e!==If)&&e!==qa&&!(t===uo&&!o)||Nf(t)&&!fo(t)&&e===qa||t===uo&&o}function S0(e){return _i(e)&&e!==Fa&&!fo(e)&&e!==l0&&e!==f0&&e!==uo&&e!==Sf&&e!==xf&&e!==Af&&e!==Bf&&e!==If&&e!==qa&&e!==s0&&e!==c0&&e!==i0&&e!==y0&&e!==u0&&e!==d0&&e!==a0&&e!==n0&&e!==o0&&e!==p0&&e!==h0}function x0(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 _f(e){var t=/^\n* /;return t.test(e)}var Tf=1,za=2,Vf=3,jf=4,qr=5;function A0(e,t,r,n,o,s,a,c){var l,d=0,y=null,p=!1,E=!1,w=n!==-1,h=-1,m=S0(Ti(e,0))&&x0(Ti(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ti(e,l),!_i(d))return qr;m=m&&Of(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;m=m&&Of(d,y,c),y=d}E=E||w&&l-h-1>n&&e[h+1]!==" "}return!p&&!E?m&&!a&&!o(e)?Tf:s===Oi?qr:za:r>9&&_f(e)?qr:a?s===Oi?qr:za:E?jf:Vf}function B0(e,t,r,n,o){e.dump=function(){if(t.length===0)return e.quotingType===Oi?'""':"''";if(!e.noCompatMode&&(m0.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 C0(e,d)}switch(A0(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!n,o)){case Tf:return t;case za:return"'"+t.replace(/'/g,"''")+"'";case Vf:return"|"+Df(t,e.indent)+$f(Ef(t,s));case jf:return">"+Df(t,e.indent)+$f(Ef(I0(t,a),s));case qr:return'"'+E0(t)+'"';default:throw new Fe("impossible error: invalid scalar style")}}()}function Df(e,t){var r=_f(e)?String(t):"",n=e[e.length-1]===`
|
|
137
|
+
`,o=n&&(e[e.length-2]===`
|
|
138
138
|
`||e===`
|
|
139
|
-
`),s=o?"+":
|
|
140
|
-
`}function
|
|
141
|
-
`?e.slice(0,-1):e}function
|
|
139
|
+
`),s=o?"+":n?"":"-";return r+s+`
|
|
140
|
+
`}function $f(e){return e[e.length-1]===`
|
|
141
|
+
`?e.slice(0,-1):e}function I0(e,t){for(var r=/(\n+)([^\n]*)/g,n=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]===" ",
|
|
144
|
-
`:"")+Mf(l,t),o=s}return
|
|
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+=`
|
|
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
|
|
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,$0=Fd,P0=Wd,R0=Jd,U0=Pa,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:$0,JSON_SCHEMA:P0,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-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:n.unref(a)("baseForm.configuration.title"),visible:w.value,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,["title","visible"])]),_:3})}}}),Hf=dt(w1,[["__scopeId","data-v-2e2d1350"]]),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"},$1={class:"menu-item-indicator"},P1={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",$1,null,512),[[n.vShow,c.value.includes(O.value)]])])]),itemBody:n.withCtx(()=>{var Y,W;return[n.createElementVNode("div",P1,[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:$b,useFetcher:Jf,useDebouncedFilter:Pb,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($e){de.value=((me=(se=$e.response)==null?void 0:se.data)==null?void 0:me.message)||$e.message||o("certificates.errors.delete"),r("error",$e)}finally{re.value=!1}}},X=n.ref(!0);n.watch(m,j=>{var se,me,$e,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=($e=(me=j.error)==null?void 0:me.response)==null?void 0:$e.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"),$e=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",size:"large",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($e,{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-885f61d5"]]),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"),$e=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",size:"large",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($e,{"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($e,{"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($e,{"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($e,{"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($e,{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-7199c5b2"]]),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"]]);Pe.CACertificateConfigCard=ub,Pe.CACertificateForm=wb,Pe.CACertificateList=mb,Pe.CertificateConfigCard=Cb,Pe.CertificateForm=ab,Pe.CertificateList=ob,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
|
|
147
|
+
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}function E0(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||w0(r);return t}function N0(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+=Ka(e,t)),e.dump&&Ni===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function O0(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 _0(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+=Ka(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+=Ka(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 Rf(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,kf.call(c.represent)==="[object Function]")n=c.represent(t,l);else if(Cf.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,Rf(e,r,!1)||Rf(e,r,!0);var c=kf.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?(_0(e,t,e.dump,o),E&&(e.dump="&ref_"+p+e.dump)):(O0(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)):(N0(e,t,e.dump),E&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&B0(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 T0(e,t){var r=[],n=[],o,s;for(Ga(e,r,n),o=0,s=n.length;o<s;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(s)}function Ga(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)Ga(e[o],t,r);else for(n=Object.keys(e),o=0,s=n.length;o<s;o+=1)Ga(e[n[o]],t,r)}function V0(e,t){t=t||{};var r=new k0(t);r.noRefs||T0(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),jt(r,0,n,!0,!0)?r.dump+`
|
|
148
|
+
`:""}var j0=V0,D0={dump:j0};function Wa(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 $0=$e,M0=Ud,P0=qd,R0=Jd,U0=Yd,L0=Ra,H0=vf.load,F0=vf.loadAll,q0=D0.dump,K0=Fe,z0={binary:tf,float:Wd,map:Fd,null:Kd,pairs:nf,set:of,timestamp:Xd,bool:zd,int:Gd,merge:ef,omap:rf,seq:Hd,str:Ld},G0=Wa("safeLoad","load"),W0=Wa("safeLoadAll","loadAll"),J0=Wa("safeDump","dump"),Y0={Type:$0,Schema:M0,FAILSAFE_SCHEMA:P0,JSON_SCHEMA:R0,CORE_SCHEMA:U0,DEFAULT_SCHEMA:L0,load:H0,loadAll:F0,dump:q0,YAMLException:K0,types:z0,safeLoad:G0,safeLoadAll:W0,safeDump:J0};const Z0={class:"yaml-config"},Uf=i.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=i.computed(()=>{const n=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,o])=>o&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(n).length===0&&n.constructor===Object?"":Y0.dump(n).trim()});return(n,o)=>{const s=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",Z0,[t.yamlRecord?(i.openBlock(),i.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):i.createCommentVNode("",!0)])}}}),Q0={key:0,class:"config-card-display-form"},X0=["data-testid"],e1={key:0,class:"config-card-prop-section-title"},t1=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",Q0,[(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",e1,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,X0))),128))])):i.createCommentVNode("",!0),e.format==="json"&&t.record?(i.openBlock(),i.createBlock($d,{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(Uf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):i.createCommentVNode("",!0)],64))}}),r1=dt(t1,[["__scopeId","data-v-2b74ac63"]]),po="24px",Lf=(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:po,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 po}),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=Lf(a1,[["__scopeId","data-v-40a7f387"]]),l1=e=>(i.pushScopeId("data-v-19f4cbbe"),e=e(),i.popScopeId(),e),u1=["aria-hidden"],d1={key:0,"data-testid":"kui-icon-svg-title"},f1=l1(()=>i.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),p1=i.defineComponent({__name:"CloseIcon",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:po,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 po}),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 close-icon","data-testid":"kui-icon-wrapper-close-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-close-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",d1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),f1],8,u1))]),_:1},8,["aria-hidden","style"]))}}),h1=Lf(p1,[["__scopeId","data-v-19f4cbbe"]]),y1={"data-testid":"config-card-title"},m1={class:"config-card-actions"},g1=["href"],b1={key:2,class:"config-card-details-section"},w1={key:3,class:"config-card-details-section"},v1=["data-testid"],k1={key:0,class:"config-card-prop-section-title"},C1=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=A=>{p.value=A==null?void 0:A.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),m=i.ref(!1),v=i.ref(""),g=i.ref({}),S=i.computed(()=>{var A,Z,J;if(!g.value)return[];const P=[],H=Object.keys(g.value).length;for(const re in g.value){const de=(Z=(A=o.configSchema)==null?void 0:A[re])==null?void 0:Z.order,fe=(J=w[re])==null?void 0:J.order;let ke=H;(fe||fe===0)&&(ke=fe===-1?H+1:fe),de&&(ke=de===-1?H+1:de),P.push([re,ke])}return P.sort(function(re,de){return re[1]-de[1]}),P.map(re=>{var de,fe;const ke=re[0],he=(de=g.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)}),x=i.computed(()=>{var A,Z;if(!g.value||!o.pluginConfigKey)return[];const J=g.value[o.pluginConfigKey]||{},P=Object.keys(J).length,H=[];for(const re in J){const de=(Z=(A=o.pluginConfigSchema)==null?void 0:A[re])==null?void 0:Z.order,fe=J[re];let ke=fe!=null&&fe!==""?P-1:P;de&&(ke=de===-1?P+1:de),H.push([re,ke])}return H.sort(function(re,de){return re[1]-de[1]}),H.map(re=>{var de;const fe=re[0],ke=J[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)}),C=i.computed(()=>{var A,Z,J,P;return{basic:(A=S.value)==null?void 0:A.filter(H=>H.section===pe.Basic),advanced:(Z=S.value)==null?void 0:Z.filter(H=>H.section===pe.Advanced),plugin:(P=x.value)==null?void 0:P.concat((J=S.value)==null?void 0:J.filter(H=>H.section===pe.Plugin))}}),I=i.computed(()=>{const A=[];return C.value.basic.length&&A.push("basic"),C.value.advanced.length&&A.push("advanced"),C.value.plugin.length&&A.push("plugin"),A}),T=A=>!!(A.tooltip||s[`${A.key}-label-tooltip`]),Q=i.computed(()=>{var A,Z;let J=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?J=J.replace(/{controlPlaneId}/gi,((A=o.config)==null?void 0:A.controlPlaneId)||""):o.config.app==="kongManager"&&(J=J.replace(/\/{workspace}/gi,(Z=o.config)!=null&&Z.workspace?`/${o.config.workspace}`:"")),J=J.replace(/{id}/gi,o.config.entityId),J}),_=A=>{g.value&&A(JSON.stringify(g.value))?n("copy:success",g.value):n("copy:error")};return i.watch(h,A=>{n("loading",A)},{immediate:!0}),i.onBeforeMount(async()=>{m.value=!1,h.value=!0;try{const{data:A}=await d.get(Q.value);if(o.dataKey)if(typeof A[o.dataKey]<"u")g.value={...A[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else g.value={...A};Object.keys(o.configSchema).filter(Z=>o.configSchema[Z].forceShow).forEach(Z=>{g.value&&typeof g.value[Z]>"u"&&(g.value[Z]=null)}),n("fetch:success",A)}catch(A){const Z=c(A);v.value=Z.startsWith("code")?a("baseConfigCard.errors.load"):Z,m.value=!0,n("fetch:error",A)}finally{h.value=!1}}),(A,Z)=>{const J=i.resolveComponent("KLabel"),P=i.resolveComponent("KSelect"),H=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",m1,[i.renderSlot(A.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(i.openBlock(),i.createBlock(J,{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(P,{key:1,"data-testid":"select-config-format",items:y,onChange:E})):i.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(i.openBlock(),i.createBlock(H,{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(mm)},null,8,["size"])],8,g1)]),_:1})):i.createCommentVNode("",!0),e.config.jsonYamlEnabled?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(re,{key:3},{default:i.withCtx(({copyToClipboard:he})=>[!h.value&&!m.value?(i.openBlock(),i.createBlock(H,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:ye=>_(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"})):m.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",b1,[i.createVNode(r1,{config:e.config,"fetcher-url":Q.value,format:p.value,"prop-list-types":I.value,"property-collections":C.value,record:g.value},i.createSlots({_:2},[i.renderList(Object.keys(A.$slots),he=>({name:he,fn:i.withCtx(({row:ye,rowValue:Be})=>[i.renderSlot(A.$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",w1,[(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",k1,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(C.value[he],ye=>(i.openBlock(),i.createBlock(Ii,{key:ye.key,item:ye},i.createSlots({label:i.withCtx(()=>[i.renderSlot(A.$slots,`${ye.key}-label`,{row:ye},void 0,!0)]),[ye.key]:i.withCtx(({rowValue:Be})=>[i.renderSlot(A.$slots,ye.key,{row:ye,rowValue:Be},void 0,!0)]),_:2},[T(ye)?{name:"label-tooltip",fn:i.withCtx(()=>[i.renderSlot(A.$slots,`${ye.key}-label-tooltip`,{row:ye},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,v1))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("div",y1,[i.renderSlot(A.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Hf=dt(C1,[["__scopeId","data-v-3fd4a3a4"]]),S1={class:"form-actions","data-testid":"form-actions"},x1={key:0},A1=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 C,I;let T=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?T=T.replace(/{controlPlaneId}/gi,((C=o.config)==null?void 0:C.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)}),m=()=>{w.value=!w.value},v=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):g()},g=()=>{n("cancel")},S=()=>{E.value||n("submit")},x=i.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return i.watch(()=>d.value,C=>{n("loading",C)},{immediate:!0}),i.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:C}=await l.get(h.value);n("fetch:success",C)}catch(C){const I=c(C);p.value=I.startsWith("code")?a("baseForm.errors.edit"):I,y.value=!0,n("fetch:error",C)}finally{d.value=!1}}),(C,I)=>{const T=i.resolveComponent("KSkeleton"),Q=i.resolveComponent("KEmptyState"),_=i.resolveComponent("KAlert"),A=i.resolveComponent("KButton"),Z=i.resolveComponent("KTabs"),J=i.resolveComponent("KSlideout"),P=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(P,{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(g,["prevent"]),onSubmit:i.withModifiers(S,["prevent"])},[i.renderSlot(C.$slots,"default",{},void 0,!0),e.errorMessage?(i.openBlock(),i.createBlock(_,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):i.createCommentVNode("",!0),i.createElementVNode("div",S1,[i.renderSlot(C.$slots,"form-actions",{},()=>[e.config.jsonYamlFormsEnabled?(i.openBlock(),i.createElementBlock("div",x1,[i.createVNode(A,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:I[0]||(I[0]=H=>m())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(A,{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(A,{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(J,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:i.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:I[1]||(I[1]=H=>m())},{default:i.withCtx(()=>[i.createElementVNode("div",null,i.toDisplayString(i.unref(a)("baseForm.configuration.message")),1),i.createVNode(Z,{"data-testid":"form-view-configuration-slideout-tabs",tabs:x.value},{json:i.withCtx(()=>[i.createVNode($d,{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(Uf,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Ff=dt(A1,[["__scopeId","data-v-2e2d1350"]]),B1={key:0,"data-testid":"first-col"},I1=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 m;return((m=t.rowEl)==null?void 0:m.querySelector(`[data-testid="${t.keyName}"]`))||null}),n=i.computed(()=>{var m;return((m=r.value)==null?void 0:m.querySelector('[data-testid="first-col"]'))||null}),o=i.computed(()=>{var m,v;const g=(m=t.rowEl)==null?void 0:m.querySelectorAll("td");return g?((v=g[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var m,v,g;d.value=((m=n.value)==null?void 0:m.getBoundingClientRect().width)||0,y.value=((v=r.value)==null?void 0:v.clientWidth)||0,p.value=((g=l.value)==null?void 0:g.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,m=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of m)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()}),(m,v)=>{const g=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(i.openBlock(),i.createElementBlock("span",B1,[i.createVNode(g,{"max-width":"300",placement:"bottomStart",text:h.value?p.value:""},{default:i.withCtx(()=>[i.renderSlot(m.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):i.renderSlot(m.$slots,"default",{key:1},void 0,!0)],512)}}}),E1=dt(I1,[["__scopeId","data-v-c4379fd4"]]),N1={class:"toolbar-container"},O1={key:0,class:"toolbar-button-container"},_1=["data-testid"],T1=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")},m=i.computed(()=>r.disableRowClick?void 0:(I,T)=>{n("click:row",T)}),v=I=>{n("sort",I)},{setTablePreferences:g,getTablePreferences:S}=ky(),x=i.computed(()=>{const I=S(r.preferencesStorageKey);return{...r.initialFetcherParams,...I}}),C=I=>{r.preferencesStorageKey&&g(r.preferencesStorageKey,I)};return(I,T)=>{const Q=i.resolveComponent("KIcon"),_=i.resolveComponent("KButton"),A=i.resolveComponent("KDropdown"),Z=i.resolveComponent("KTable"),J=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(J,{class:"kong-ui-entity-base-table",title:e.title},{default:i.withCtx(()=>[i.createVNode(Z,{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":x.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:w,"onRow:click":m.value,onSort:T[0]||(T[0]=P=>v(P)),"onUpdate:tablePreferences":C},i.createSlots({toolbar:i.withCtx(({state:P})=>[i.withDirectives(i.createElementVNode("div",N1,[i.renderSlot(I.$slots,"toolbar-filter",{},void 0,!0),I.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",O1,[i.renderSlot(I.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,c(P)]])]),actions:i.withCtx(({row:P,rowKey:H,rowValue:re})=>[i.createElementVNode("div",{class:"actions-container","data-testid":P.name},[i.createVNode(A,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(I.$slots,"actions",{row:P,rowKey:H,rowValue:re},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(_,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:i.withCtx(()=>[i.createVNode(Q,{color:i.unref(hm),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,_1)]),_:2},[i.renderList(e.tableHeaders,(P,H)=>({name:H,fn:i.withCtx(({row:re,rowKey:de,rowValue:fe})=>[i.createVNode(E1,{"key-name":String(H),"row-el":p(re)},{default:i.withCtx(()=>[i.renderSlot(I.$slots,H,{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"])}}}),qf=dt(T1,[["__scopeId","data-v-ecfaa7cf"]]),V1={key:0,class:"kong-ui-entity-delete-error"},j1={key:1,class:"description"},D1=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",V1,[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",j1,[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"])}}}),Kf=dt(D1,[["__scopeId","data-v-efe8f34b"]]),$1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},M1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},P1=["fill"],R1={mask:"url(#mask0_180_20349)"},U1=["fill"],zf=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${fm})`}},setup(e){return(t,r)=>(i.openBlock(),i.createElementBlock("svg",$1,[i.createElementVNode("mask",M1,[i.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,P1)]),i.createElementVNode("g",R1,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,U1)])]))}}),L1={key:1,class:"kong-ui-entity-filter"},H1={class:"menu-item-title"},F1={class:"menu-item-indicator"},q1={class:"menu-item-body"},K1=["for"],z1={class:"menu-item-buttons"},G1={class:"filter-clear-button-container"},W1=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 S=[];return new URLSearchParams(n.modelValue).forEach((x,C)=>{x!==""&&S.push(C)}),S}),l=i.computed(()=>{const S=n.config.fields;return Object.keys(S).filter(x=>S[x].searchable).map(x=>({label:S[x].label||x,value:x}))});i.watch(()=>n.modelValue,S=>{a.value={},new URLSearchParams(S).forEach((x,C)=>{a.value[C]=x})});const d=()=>{s.value=!s.value},y=S=>{o("update:modelValue",S)},p=()=>{y("")},E=S=>`filter-${S}`,w=S=>{var x,C;return(((C=(x=n.config.schema)==null?void 0:x[S])==null?void 0:C.values)??[]).map(I=>({value:I,label:I}))},h=S=>{var x,C;return((C=(x=n.config.schema)==null?void 0:x[S])==null?void 0:C.type)??"text"},m=S=>{a.value={...a.value,[S]:""},g()},v=()=>{a.value={},g(!0)},g=(S=!1)=>{const x=Object.keys(a.value).reduce((C,I)=>(a.value[I]&&(C[I]=`${a.value[I]}`),C),{});S&&(s.value=!1),o("update:modelValue",new URLSearchParams(x).toString())};return(S,x)=>{const C=i.resolveComponent("KInput"),I=i.resolveComponent("KButton"),T=i.resolveComponent("KSelect"),Q=i.resolveComponent("KMenuItem"),_=i.resolveComponent("KMenu");return e.config.isExactMatch?(i.openBlock(),i.createBlock(C,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":y},{before:i.withCtx(()=>[i.createVNode(zf)]),after:i.withCtx(()=>[i.withDirectives(i.createVNode(i.unref(h1),{class:"kong-ui-entity-filter-clear",onClick:p},null,512),[[i.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",L1,[i.createVNode(I,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:i.withCtx(()=>[i.createVNode(zf),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(_,{class:"kong-ui-entity-filter-menu"},{body:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(A,Z)=>(i.openBlock(),i.createBlock(Q,{key:A.value,"data-testid":A.value,expandable:"","last-menu-item":Z===l.value.length-1},{itemTitle:i.withCtx(()=>[i.createElementVNode("span",H1,[i.createTextVNode(i.toDisplayString(A.label)+" ",1),i.withDirectives(i.createElementVNode("span",F1,null,512),[[i.vShow,c.value.includes(A.value)]])])]),itemBody:i.withCtx(()=>{var J,P;return[i.createElementVNode("div",q1,[i.createElementVNode("label",{class:"menu-item-label",for:E(A.value)},i.toDisplayString(i.unref(r)("filter.fieldLabel")),9,K1),((P=(J=e.config.schema)==null?void 0:J[A.value])==null?void 0:P.type)==="select"?(i.openBlock(),i.createBlock(T,{key:0,id:E(A.value),modelValue:a.value[A.value],"onUpdate:modelValue":H=>a.value[A.value]=H,items:w(A.value),placeholder:i.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(C,{key:1,id:E(A.value),modelValue:a.value[A.value],"onUpdate:modelValue":H=>a.value[A.value]=H,autocomplete:"off",placeholder:i.unref(r)("filter.inputPlaceholder"),type:h(A.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),i.createElementVNode("div",z1,[i.createVNode(I,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:x[0]||(x[0]=H=>g(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.applyButtonText")),1)]),_:1}),i.createVNode(I,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:H=>m(A.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",G1,[i.createVNode(I,{appearance:"tertiary",size:"small",onClick:v},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[i.vShow,s.value]])]))}}}),Gf=dt(W1,[["__scopeId","data-v-206cc415"]]),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)}}),J1={class:"form-section-wrapper"},Y1={key:0,class:"form-section-title"},Z1={key:1,class:"form-section-description"},Q1={key:2,class:"form-section-footer"},X1={class:"form-section-content"},eb=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",J1,[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",Y1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),e.description||i.unref(t).description?(i.openBlock(),i.createElementBlock("div",Z1,[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",Q1,[i.renderSlot(r.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",X1,[i.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),ho=dt(eb,[["__scopeId","data-v-3565daa7"]]),{useAxios:yo,useDeleteUrlBuilder:Wf,useErrors:Jf,useExternalLinkCreator:Hb,useFetchUrlBuilder:Fb,useFetcher:Yf,useDebouncedFilter:qb,useStringHelpers:Zf,useHelpers:Qf,useGatewayFeatureSupported:Kb,useTruncationDetector:zb}=Te,tb={class:"kong-ui-entities-certificates-list"},rb={key:0},ib={key:1},nb={key:0},ob={key:1},sb={key:0},ab={key:1},cb={key:1},lb={key:1},ub=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 me;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=yo({headers:(me=n.config)==null?void 0:me.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,ge;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,(ge=n.config)!=null&&ge.workspace?`/${n.config.workspace}`:"")),j}),h=i.ref(""),m=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:g}=Yf(n.config,w.value),S=()=>{h.value=""},x=()=>{d.value++},C=i.ref(null),I=(j,se)=>{const ge=j.id;if(!se(ge)){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:ge})})},T=(j,se)=>{const ge=JSON.stringify(j);if(!se(ge)){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")})},_=async j=>{var ge;await((ge=n.canRetrieve)==null?void 0:ge.call(n,j))&&c.push(n.config.getViewRoute(j.id))},A=j=>({label:o("certificates.actions.view"),to:n.config.getViewRoute(j)}),Z=j=>({label:o("certificates.actions.edit"),to:n.config.getEditRoute(j)}),J=j=>{if(n.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:n.config.getCreateSniRoute(j)}},P=i.ref(void 0),H=i.ref(!1),re=i.ref(!1),de=i.ref(""),fe=Wf(n.config,w.value),{certificateDataCache:ke,getCertificateData:he}=kt.useCertificate(),ye=j=>{P.value=j,H.value=!0},Be=()=>{H.value=!1},zt=async()=>{var j,se,ge;if((j=P.value)!=null&&j.id){re.value=!0;try{await l.delete(fe(P.value.id)),re.value=!1,H.value=!1,d.value++,r("delete:success",P.value)}catch(Me){de.value=((ge=(se=Me.response)==null?void 0:se.data)==null?void 0:ge.message)||Me.message||o("certificates.errors.delete"),r("error",Me)}finally{re.value=!1}}},X=i.ref(!0);i.watch(g,j=>{var se,ge,Me,$t;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){C.value={title:o("certificates.errors.general")},($t=(Me=(ge=j.error)==null?void 0:ge.response)==null?void 0:Me.data)!=null&&$t.message&&(C.value.message=j.error.response.data.message),r("error",j.error);return}ke.value={},C.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 ge=i.resolveComponent("KButton"),Me=i.resolveComponent("KBadge"),$t=i.resolveComponent("KTruncate"),te=i.resolveComponent("KDropdownItem"),Oe=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",tb,[i.createVNode(i.unref(qf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ee.value,"enable-entity-actions":"","error-message":C.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:S,"onClick:row":se[2]||(se[2]=G=>_(G)),onSort:x},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(Gf),{modelValue:h.value,"onUpdate:modelValue":se[0]||(se[0]=G=>h.value=G),config:m.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(ge,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",size:"large",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:G})=>{var Ce;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",rb,i.toDisplayString((Ce=G==null?void 0:G.metadata)!=null&&Ce.subject?G.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",ib,i.toDisplayString(i.unref(he)(G).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:G})=>{var Ce;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",nb,i.toDisplayString((Ce=G==null?void 0:G.metadata)!=null&&Ce.expiry?i.unref(s)(G.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",ob,i.toDisplayString(i.unref(he)(G).schemaExpiry?i.unref(s)(i.unref(he)(G).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:G})=>{var Ce;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",sb,i.toDisplayString((Ce=G==null?void 0:G.metadata)!=null&&Ce.dns_names?`dns=${G.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",ab,i.toDisplayString(i.unref(he)(G).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:G})=>[G!=null&&G.cert?(i.openBlock(),i.createBlock(i.unref(gy),{key:0,"data-testid":"copy-certificate-cert",notify:Ce=>Q(Ce,G),truncated:!0,uuid:G.cert},null,8,["notify","uuid"])):(i.openBlock(),i.createElementBlock("span",cb,"-"))]),tags:i.withCtx(({row:G})=>{var Ce;return[((Ce=G==null?void 0:G.tags)==null?void 0:Ce.length)>0?(i.openBlock(),i.createBlock($t,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(G==null?void 0:G.tags,zr=>(i.openBlock(),i.createBlock(Me,{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",lb,"-"))]}),actions:i.withCtx(({row:G})=>[i.createVNode(Oe,null,{default:i.withCtx(({copyToClipboard:Ce})=>[i.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:zr=>I(G,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(G,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(G)},{default:i.withCtx(()=>[i.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:A(G.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canEdit(G)},{default:i.withCtx(()=>[i.createVNode(te,{"data-testid":"action-entity-edit",item:Z(G.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:J(G.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canDelete(G)},{default:i.withCtx(()=>[i.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>ye(G)},{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(Kf),{"action-pending":re.value,"entity-type":i.unref(_a).Certificate,error:de.value,title:i.unref(o)("certificates.delete.title"),visible:H.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},db=Kr(ub,[["__scopeId","data-v-885f61d5"]]),fb={class:"kong-ui-entities-certificates-form"},pb=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 C;const r=t,n=e,o=Gr.useRouter(),{i18nT:s,i18n:{t:a}}=kt.useI18n(),{getMessageFromError:c}=Jf(),{axiosInstance:l}=yo({headers:(C=n.config)==null?void 0:C.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)},m=()=>{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}),g=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}),S=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!=="")}}),x=async()=>{var I,T,Q,_,A,Z,J;try{p.isReadonly=!0;let P;await l.post(v.value,S.value),y.value==="create"?P=await l.post(g.value,S.value):y.value==="edit"&&(P=((I=n.config)==null?void 0:I.app)==="konnect"?await l.put(g.value,S.value):await l.patch(g.value,S.value)),p.fields.cert=((T=P==null?void 0:P.data)==null?void 0:T.cert)||"",p.fields.key=((Q=P==null?void 0:P.data)==null?void 0:Q.key)||"",p.fields.certAlt=((_=P==null?void 0:P.data)==null?void 0:_.cert_alt)||"",p.fields.keyAlt=((A=P==null?void 0:P.data)==null?void 0:A.key_alt)||"",p.fields.tags=((J=(Z=P==null?void 0:P.data)==null?void 0:Z.tags)==null?void 0:J.join(", "))||"",Object.assign(E,p.fields),r("update",P==null?void 0:P.data)}catch(P){p.errorMessage=c(P),r("error",P)}finally{p.isReadonly=!1}};return(I,T)=>{const Q=i.resolveComponent("KTextArea"),_=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",fb,[i.createVNode(i.unref(Ff),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":S.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":T[5]||(T[5]=A=>I.$emit("error",A)),"onFetch:success":h,onLoading:T[6]||(T[6]=A=>I.$emit("loading",A)),onSubmit:x},{default:i.withCtx(()=>[i.createVNode(i.unref(ho),{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]=A=>p.fields.cert=A),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]=A=>p.fields.key=A),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]=A=>p.fields.certAlt=A),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]=A=>p.fields.keyAlt=A),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(ho),{description:i.unref(a)("certificates.form.sections.general.description"),title:i.unref(a)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(_,{modelValue:p.fields.tags,"onUpdate:modelValue":T[4]||(T[4]=A=>p.fields.tags=A),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"}}},hb={class:"kong-ui-ca-certificate-entity-config-card"},yb={key:0},mb=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}=Zf(),{getPropValue:l}=Qf(),{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 x;return((x=E.value)==null?void 0:x.schemaIssuer)||""}),h=i.computed(()=>{var x,C;return(x=E.value)!=null&&x.schemaExpiry?a((C=E.value)==null?void 0:C.schemaExpiry):""}),m=i.computed(()=>{var x;return((x=E.value)==null?void 0:x.schemaKeyUsages)||[]}),v=(x,C)=>{const I=l("rowValue",C);if(x==="expiry")return h.value;if(x==="key_usages")return m.value;if(I)return I[x]},g=x=>{p.value=x,n("fetch:success",x)},S=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(x,C)=>{const I=i.resolveComponent("KCodeBlock"),T=i.resolveComponent("KLabel"),Q=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",hb,[i.createVNode(i.unref(Hf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":S.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":C[0]||(C[0]=_=>x.$emit("copy:success",_)),"onFetch:error":C[1]||(C[1]=_=>x.$emit("fetch:error",_)),"onFetch:success":g,onLoading:C[2]||(C[2]=_=>x.$emit("loading",_))},{cert:i.withCtx(_=>[i.unref(l)("rowValue",_)?(i.openBlock(),i.createBlock(I,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:i.unref(l)("rowValue",_),"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(_=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(l)("rowValue",_)).filter(A=>!r.includes(A)),A=>(i.openBlock(),i.createBlock(i.unref(Ii),{key:A,"data-testid":`ca-cert-metadata-${A}`,item:{key:A,label:i.unref(c)(A),value:v(A,_),type:A==="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(()=>[m.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",yb,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(m.value,(_,A)=>(i.openBlock(),i.createBlock(Q,{key:`key_usages-badge-tag-${A}`,class:"config-badge","data-testid":`key_usages-badge-tag-${A}`,tooltip:_,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(_),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),gb={class:"kong-ui-entities-ca-certificates-list"},bb={key:0},wb={key:1},vb={key:0},kb={key:1},Cb={key:1},Sb=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}=yo({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 me,j;let ee=`${n.config.apiBaseUrl}${Vi.list[n.config.app]}`;return n.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((me=n.config)==null?void 0:me.controlPlaneId)||""):n.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(j=n.config)!=null&&j.workspace?`/${n.config.workspace}`:"")),ee}),h=i.ref(""),m=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:g}=Yf(n.config,w.value),S=()=>{h.value=""},x=()=>{d.value++},C=i.ref(null),I=(ee,me)=>{const j=ee.id;if(!me(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,me)=>{const j=JSON.stringify(ee);if(!me(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))},_=ee=>({label:o("ca-certificates.actions.view"),to:n.config.getViewRoute(ee)}),A=ee=>({label:o("ca-certificates.actions.edit"),to:n.config.getEditRoute(ee)}),Z=i.ref(void 0),J=i.ref(!1),P=i.ref(!1),H=i.ref(""),re=Wf(n.config,w.value),{certificateDataCache:de,getCertificateData:fe}=kt.useCertificate(),ke=ee=>{Z.value=ee,J.value=!0},he=()=>{J.value=!1},ye=async()=>{var ee,me,j;if((ee=Z.value)!=null&&ee.id){P.value=!0;try{await l.delete(re(Z.value.id)),P.value=!1,J.value=!1,d.value++,r("delete:success",Z.value)}catch(se){H.value=((j=(me=se.response)==null?void 0:me.data)==null?void 0:j.message)||se.message||o("ca-certificates.errors.delete"),r("error",se)}finally{P.value=!1}}},Be=i.ref(!0);i.watch(g,ee=>{var me,j,se,ge;if(Array.isArray((me=ee==null?void 0:ee.response)==null?void 0:me.data)&&(Be.value=ee.response.data.length>0),ee.status===Ft.Error){C.value={title:o("ca-certificates.errors.general")},(ge=(se=(j=ee.error)==null?void 0:j.response)==null?void 0:se.data)!=null&&ge.message&&(C.value.message=ee.error.response.data.message),r("error",ee.error);return}de.value={},C.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,me)=>{const j=i.resolveComponent("KButton"),se=i.resolveComponent("KBadge"),ge=i.resolveComponent("KTruncate"),Me=i.resolveComponent("KDropdownItem"),$t=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",gb,[i.createVNode(i.unref(qf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":zt.value,"enable-entity-actions":"","error-message":C.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:S,"onClick:row":me[2]||(me[2]=te=>Q(te)),onSort:x},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(Gf),{modelValue:h.value,"onUpdate:modelValue":me[0]||(me[0]=te=>h.value=te),config:m.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",size:"large",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",bb,i.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.issuer?te.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",wb,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",vb,i.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.expiry?i.unref(s)(te.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",kb,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(ge,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(te==null?void 0:te.tags,G=>(i.openBlock(),i.createBlock(se,{key:G,onClick:me[1]||(me[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(G),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Cb,"-"))]}),actions:i.withCtx(({row:te})=>[i.createVNode($t,null,{default:i.withCtx(({copyToClipboard:Oe})=>[i.createVNode(Me,{"data-testid":"action-entity-copy-id",onClick:G=>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($t,null,{default:i.withCtx(({copyToClipboard:Oe})=>[i.createVNode(Me,{"data-testid":"action-entity-copy-json",onClick:G=>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(Me,{"data-testid":"action-entity-view","has-divider":"",item:_(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canEdit(te)},{default:i.withCtx(()=>[i.createVNode(Me,{"data-testid":"action-entity-edit",item:A(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(Dt),{"auth-function":()=>e.canDelete(te)},{default:i.withCtx(()=>[i.createVNode(Me,{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(Kf),{"action-pending":P.value,"entity-type":i.unref(_a).CACertificate,error:H.value,title:i.unref(o)("ca-certificates.delete.title"),visible:J.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-7199c5b2"]]),xb={class:"kong-ui-entities-ca-certificates-form"},Ab=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 x;const r=t,n=e,o=Gr.useRouter(),{i18n:{t:s}}=kt.useI18n(),{getMessageFromError:a}=Jf(),{axiosInstance:c}=yo({headers:(x=n.config)==null?void 0:x.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=C=>{var I;y.fields.cert=(C==null?void 0:C.cert)||"",y.fields.certDigest=(C==null?void 0:C.cert_digest)||"",y.fields.tags=((I=C==null?void 0:C.tags)==null?void 0:I.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(n.config.cancelRoute)},m=i.computed(()=>{var I,T;let C=`${n.config.apiBaseUrl}${Vi.form[n.config.app].validate}`;return n.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((I=n.config)==null?void 0:I.controlPlaneId)||""):n.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(T=n.config)!=null&&T.workspace?`/${n.config.workspace}`:"")),C=C.replace(/{id}/gi,n.certificateId),C}),v=i.computed(()=>{var I,T;let C=`${n.config.apiBaseUrl}${Vi.form[n.config.app][d.value]}`;return n.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((I=n.config)==null?void 0:I.controlPlaneId)||""):n.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(T=n.config)!=null&&T.workspace?`/${n.config.workspace}`:"")),C=C.replace(/{id}/gi,n.certificateId),C}),g=i.computed(()=>{var C,I;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(I=(C=y.fields.tags.split(","))==null?void 0:C.map(T=>String(T||"").trim()))==null?void 0:I.filter(T=>T!=="")}}),S=async()=>{var C,I,T,Q,_;try{y.isReadonly=!0;let A;await c.post(m.value,g.value),d.value==="create"?A=await c.post(v.value,g.value):d.value==="edit"&&(A=((C=n.config)==null?void 0:C.app)==="konnect"?await c.put(v.value,g.value):await c.patch(v.value,g.value)),y.fields.cert=((I=A==null?void 0:A.data)==null?void 0:I.cert)||"",y.fields.certDigest=((T=A==null?void 0:A.data)==null?void 0:T.cert_digest)||"",y.fields.tags=((_=(Q=A==null?void 0:A.data)==null?void 0:Q.tags)==null?void 0:_.join(", "))||"",Object.assign(p,y.fields),r("update",A==null?void 0:A.data)}catch(A){y.errorMessage=a(A),r("error",A)}finally{y.isReadonly=!1}};return(C,I)=>{const T=i.resolveComponent("KTextArea"),Q=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",xb,[i.createVNode(i.unref(Ff),{"can-submit":E.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"form-fields":g.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":I[3]||(I[3]=_=>C.$emit("error",_)),"onFetch:success":w,onLoading:I[4]||(I[4]=_=>C.$emit("loading",_)),onSubmit:S},{default:i.withCtx(()=>[i.createVNode(i.unref(ho),{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]=_=>y.fields.cert=_),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]=_=>y.fields.certDigest=_),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(ho),{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]=_=>y.fields.tags=_),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"]]),Bb={class:"kong-ui-certificate-entity-config-card"},Ib={key:0},Eb=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}=Zf(),{getPropValue:l}=Qf(),{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=_=>{p.value=_,r("fetch:success",_)},h=(_,A)=>{const Z=l("rowValue",A);if(_==="expiry")return v.value;if(_==="key_usages")return C.value;if(_==="san_names")return S.value;if(Z)return Z[_]},m=i.computed(()=>{if(p.value)return d(p.value)}),v=i.computed(()=>{var _,A;return(_=m.value)!=null&&_.schemaExpiry?s((A=m.value)==null?void 0:A.schemaExpiry):""}),g=i.computed(()=>{var _;return((_=m.value)==null?void 0:_.schemaIssuer)||""}),S=i.computed(()=>{var _;return((_=m.value)==null?void 0:_.schemaSanNames)||""}),x=i.computed(()=>{var _;return((_=m.value)==null?void 0:_.schemaSubject)||""}),C=i.computed(()=>{var _;return((_=m.value)==null?void 0:_.schemaKeyUsages)||[]}),I=i.computed(()=>{var _,A;return((A=(_=p==null?void 0:p.value)==null?void 0:_.snis)==null?void 0:A.length)>0}),T=i.computed(()=>{var _;return!!((_=p==null?void 0:p.value)!=null&&_.cert_alt)}),Q=_=>{var A,Z;return _==="san_names"?o("certificates.list.table_headers.san"):((Z=(A=E.value)==null?void 0:A[_])==null?void 0:Z.label)||c(_)};return(_,A)=>{const Z=i.resolveComponent("KCodeBlock"),J=i.resolveComponent("KLabel"),P=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",Bb,[i.createVNode(i.unref(Hf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":E.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":A[0]||(A[0]=H=>_.$emit("copy:success",H)),"onFetch:error":A[1]||(A[1]=H=>_.$emit("fetch:error",H)),"onFetch:success":w,onLoading:A[2]||(A[2]=H=>_.$emit("loading",H))},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(H=>[i.unref(l)("rowValue",H)?(i.openBlock(),i.createBlock(Z,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:i.unref(l)("rowValue",H),"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(J,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(H=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(l)("rowValue",H)),re=>(i.openBlock(),i.createBlock(i.unref(Ii),{key:re,item:{key:re,value:h(re,H),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(g.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.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(()=>[C.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ib,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(C.value,(H,re)=>(i.openBlock(),i.createBlock(P,{key:`key_usages-badge-tag-${re}`,class:"config-badge","data-testid":`key_usages-badge-tag-${re}`,tooltip:H,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(H),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(H=>[i.createTextVNode(" > "),i.unref(l)("rowValue",H)?(i.openBlock(),i.createBlock(Z,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:i.unref(l)("rowValue",H),"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"]]);Pe.CACertificateConfigCard=mb,Pe.CACertificateForm=Ab,Pe.CACertificateList=Sb,Pe.CertificateConfigCard=Eb,Pe.CertificateForm=pb,Pe.CertificateList=db,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
|