@kong-ui-public/entities-certificates 3.4.8 → 3.5.0
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 +4824 -4632
- package/dist/entities-certificates.umd.js +50 -32
- package/dist/style.css +1 -1
- package/dist/types/components/CACertificateConfigCard.vue.d.ts +17 -0
- package/dist/types/components/CACertificateConfigCard.vue.d.ts.map +1 -1
- package/dist/types/components/CACertificateForm.vue.d.ts +17 -0
- package/dist/types/components/CACertificateForm.vue.d.ts.map +1 -1
- package/dist/types/components/CertificateConfigCard.vue.d.ts +17 -0
- package/dist/types/components/CertificateConfigCard.vue.d.ts.map +1 -1
- package/dist/types/components/CertificateForm.vue.d.ts +17 -0
- package/dist/types/components/CertificateForm.vue.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(je,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):(je=typeof globalThis<"u"?globalThis:je||self,i(je["kong-ui-public-entities-certificates"]={},je.Vue,je.VueRouter,je["kong-ui-public-i18n"],je.axios,je.Kongponents))})(this,function(je,i,
|
|
1
|
+
(function(je,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):(je=typeof globalThis<"u"?globalThis:je||self,i(je["kong-ui-public-entities-certificates"]={},je.Vue,je.VueRouter,je["kong-ui-public-i18n"],je.axios,je.Kongponents))})(this,function(je,i,Yr,Mi,ul,gp){"use strict";const Pi="24px",dl=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},mp=e=>(i.pushScopeId("data-v-c1f7c39c"),e=e(),i.popScopeId(),e),bp=["aria-hidden"],wp={key:0,"data-testid":"kui-icon-svg-title"},vp=mp(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Eo=dl(i.defineComponent({__name:"AddIcon",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:Pi,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 Pi}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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 add-icon","data-testid":"kui-icon-wrapper-add-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-add-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",wp,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),vp],8,bp))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c1f7c39c"]]),kp=e=>(i.pushScopeId("data-v-c73ebbaa"),e=e(),i.popScopeId(),e),Cp=["aria-hidden"],Sp={key:0,"data-testid":"kui-icon-svg-title"},xp=kp(()=>i.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Ap=dl(i.defineComponent({__name:"TrashIcon",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:Pi,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 Pi}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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 trash-icon","data-testid":"kui-icon-wrapper-trash-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-trash-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",Sp,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),xp],8,Cp))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c73ebbaa"]]);var No=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 cl;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof Bo=="object"?Bo:typeof self=="object"?self:typeof this=="object"?this:l(),n=o(e);typeof r.Reflect<"u"&&(n=o(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(c,d){return function(y,p){Object.defineProperty(c,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 l(){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",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,y={create:l?function(){return sl(Object.create(null))}:c?function(){return sl({__proto__:null})}:function(){return sl({})},has:d?function(k,A){return n.call(k,A)}:function(k,A){return A in k},get:d?function(k,A){return n.call(k,A)?k[A]:void 0}:function(k,A){return k[A]}},p=Object.getPrototypeOf(Function),I=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Fb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:qb(),h=typeof WeakMap=="function"?WeakMap:Kb(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,b=Ub(),v=Lb(b);function B(k,A,_,$){if(X(_)){if(!xe(k))throw new TypeError;if(!Ae(A))throw new TypeError;return J(k,A)}else{if(!xe(k))throw new TypeError;if(!q(A))throw new TypeError;if(!q($)&&!X($)&&!te($))throw new TypeError;return te($)&&($=void 0),_=re(_),ee(k,A,_,$)}}t("decorate",B);function S(k,A){function _($,Q){if(!q($))throw new TypeError;if(!X(Q)&&!Gr(Q))throw new TypeError;qr(k,A,$,Q)}return _}t("metadata",S);function C(k,A,_,$){if(!q(_))throw new TypeError;return X($)||($=re($)),qr(k,A,_,$)}t("defineMetadata",C);function T(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),ne(k,A,_)}t("hasMetadata",T);function N(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),me(k,A,_)}t("hasOwnMetadata",N);function E(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),ie(k,A,_)}t("getMetadata",E);function x(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),Ee(k,A,_)}t("getOwnMetadata",x);function O(k,A){if(!q(k))throw new TypeError;return X(A)||(A=re(A)),Kr(k,A)}t("getMetadataKeys",O);function G(k,A){if(!q(k))throw new TypeError;return X(A)||(A=re(A)),fr(k,A)}t("getOwnMetadataKeys",G);function R(k,A,_){if(!q(A))throw new TypeError;if(X(_)||(_=re(_)),!q(A))throw new TypeError;X(_)||(_=re(_));var $=$i(A,_,!1);return X($)?!1:$.OrdinaryDeleteMetadata(k,A,_)}t("deleteMetadata",R);function J(k,A){for(var _=k.length-1;_>=0;--_){var $=k[_],Q=$(A);if(!X(Q)&&!te(Q)){if(!Ae(Q))throw new TypeError;A=Q}}return A}function ee(k,A,_,$){for(var Q=k.length-1;Q>=0;--Q){var be=k[Q],Be=be(A,_,$);if(!X(Be)&&!te(Be)){if(!q(Be))throw new TypeError;$=Be}}return $}function ne(k,A,_){var $=me(k,A,_);if($)return!0;var Q=ol(A);return te(Q)?!1:ne(k,Q,_)}function me(k,A,_){var $=$i(A,_,!1);return X($)?!1:Qe($.OrdinaryHasOwnMetadata(k,A,_))}function ie(k,A,_){var $=me(k,A,_);if($)return Ee(k,A,_);var Q=ol(A);if(!te(Q))return ie(k,Q,_)}function Ee(k,A,_){var $=$i(A,_,!1);if(!X($))return $.OrdinaryGetOwnMetadata(k,A,_)}function qr(k,A,_,$){var Q=$i(_,$,!0);Q.OrdinaryDefineOwnMetadata(k,A,_,$)}function Kr(k,A){var _=fr(k,A),$=ol(k);if($===null)return _;var Q=Kr($,A);if(Q.length<=0)return _;if(_.length<=0)return Q;for(var be=new w,Be=[],se=0,D=_;se<D.length;se++){var K=D[se],H=be.has(K);H||(be.add(K),Be.push(K))}for(var W=0,ae=Q;W<ae.length;W++){var K=ae[W],H=be.has(K);H||(be.add(K),Be.push(K))}return Be}function fr(k,A){var _=$i(k,A,!1);return _?_.OrdinaryOwnMetadataKeys(k,A):[]}function $t(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 te(k){return k===null}function U(k){return typeof k=="symbol"}function q(k){return typeof k=="object"?k!==null:typeof k=="function"}function fe(k,A){switch($t(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 _=A===3?"string":A===5?"number":"default",$=np(k,s);if($!==void 0){var Q=$.call(k,_);if(q(Q))throw new TypeError;return Q}return Ue(k,_==="default"?"number":_)}function Ue(k,A){if(A==="string"){var _=k.toString;if(Z(_)){var $=_.call(k);if(!q($))return $}var Q=k.valueOf;if(Z(Q)){var $=Q.call(k);if(!q($))return $}}else{var Q=k.valueOf;if(Z(Q)){var $=Q.call(k);if(!q($))return $}var be=k.toString;if(Z(be)){var $=be.call(k);if(!q($))return $}}throw new TypeError}function Qe(k){return!!k}function zr(k){return""+k}function re(k){var A=fe(k,3);return U(A)?A:zr(A)}function xe(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 Ae(k){return typeof k=="function"}function Gr(k){switch($t(k)){case 3:return!0;case 4:return!0;default:return!1}}function nl(k,A){return k===A||k!==k&&A!==A}function np(k,A){var _=k[A];if(_!=null){if(!Z(_))throw new TypeError;return _}}function op(k){var A=np(k,a);if(!Z(A))throw new TypeError;var _=A.call(k);if(!q(_))throw new TypeError;return _}function sp(k){return k.value}function ap(k){var A=k.next();return A.done?!1:A}function lp(k){var A=k.return;A&&A.call(k)}function ol(k){var A=Object.getPrototypeOf(k);if(typeof k!="function"||k===p||A!==p)return A;var _=k.prototype,$=_&&Object.getPrototypeOf(_);if($==null||$===Object.prototype)return A;var Q=$.constructor;return typeof Q!="function"||Q===k?A:Q}function Pb(){var k;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(k=Hb(r.Reflect));var A,_,$,Q=new h,be={registerProvider:Be,getProvider:D,setProvider:H};return be;function Be(W){if(!Object.isExtensible(be))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case k===W:break;case X(A):A=W;break;case A===W:break;case X(_):_=W;break;case _===W:break;default:$===void 0&&($=new w),$.add(W);break}}function se(W,ae){if(!X(A)){if(A.isProviderFor(W,ae))return A;if(!X(_)){if(_.isProviderFor(W,ae))return A;if(!X($))for(var he=op($);;){var we=ap(he);if(!we)return;var dt=sp(we);if(dt.isProviderFor(W,ae))return lp(he),dt}}}if(!X(k)&&k.isProviderFor(W,ae))return k}function D(W,ae){var he=Q.get(W),we;return X(he)||(we=he.get(ae)),X(we)&&(we=se(W,ae),X(we)||(X(he)&&(he=new I,Q.set(W,he)),he.set(ae,we))),we}function K(W){if(X(W))throw new TypeError;return A===W||_===W||!X($)&&$.has(W)}function H(W,ae,he){if(!K(he))throw new Error("Metadata provider not registered.");var we=D(W,ae);if(we!==he){if(!X(we))return!1;var dt=Q.get(W);X(dt)&&(dt=new I,Q.set(W,dt)),dt.set(ae,he)}return!0}}function Ub(){var k;return!X(g)&&q(r.Reflect)&&Object.isExtensible(r.Reflect)&&(k=r.Reflect[g]),X(k)&&(k=Pb()),!X(g)&&q(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:k}),k}function Lb(k){var A=new h,_={isProviderFor:function(K,H){var W=A.get(K);return X(W)?!1:W.has(H)},OrdinaryDefineOwnMetadata:Be,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:be,OrdinaryOwnMetadataKeys:se,OrdinaryDeleteMetadata:D};return b.registerProvider(_),_;function $(K,H,W){var ae=A.get(K),he=!1;if(X(ae)){if(!W)return;ae=new I,A.set(K,ae),he=!0}var we=ae.get(H);if(X(we)){if(!W)return;if(we=new I,ae.set(H,we),!k.setProvider(K,H,_))throw ae.delete(H),he&&A.delete(K),new Error("Wrong provider for target.")}return we}function Q(K,H,W){var ae=$(H,W,!1);return X(ae)?!1:Qe(ae.has(K))}function be(K,H,W){var ae=$(H,W,!1);if(!X(ae))return ae.get(K)}function Be(K,H,W,ae){var he=$(W,ae,!0);he.set(K,H)}function se(K,H){var W=[],ae=$(K,H,!1);if(X(ae))return W;for(var he=ae.keys(),we=op(he),dt=0;;){var cp=ap(we);if(!cp)return W.length=dt,W;var zb=sp(cp);try{W[dt]=zb}catch(Gb){try{lp(we)}finally{throw Gb}}dt++}}function D(K,H,W){var ae=$(H,W,!1);if(X(ae)||!ae.delete(K))return!1;if(ae.size===0){var he=A.get(H);X(he)||(he.delete(W),he.size===0&&A.delete(he))}return!0}}function Hb(k){var A=k.defineMetadata,_=k.hasOwnMetadata,$=k.getOwnMetadata,Q=k.getOwnMetadataKeys,be=k.deleteMetadata,Be=new h,se={isProviderFor:function(D,K){var H=Be.get(D);return X(H)?Q(D,K).length?(X(H)&&(H=new w,Be.set(D,H)),H.add(K),!0):!1:H.has(K)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:_,OrdinaryGetOwnMetadata:$,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:be};return se}function $i(k,A,_){var $=b.getProvider(k,A);if(!X($))return $;if(_){if(b.setProvider(k,A,v))return v;throw new Error("Illegal state.")}}function Fb(){var k={},A=[],_=function(){function se(D,K,H){this._index=0,this._keys=D,this._values=K,this._selector=H}return se.prototype["@@iterator"]=function(){return this},se.prototype[a]=function(){return this},se.prototype.next=function(){var D=this._index;if(D>=0&&D<this._keys.length){var K=this._selector(this._keys[D],this._values[D]);return D+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:K,done:!1}}return{value:void 0,done:!0}},se.prototype.throw=function(D){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),D},se.prototype.return=function(D){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:D,done:!0}},se}(),$=function(){function se(){this._keys=[],this._values=[],this._cacheKey=k,this._cacheIndex=-2}return Object.defineProperty(se.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),se.prototype.has=function(D){return this._find(D,!1)>=0},se.prototype.get=function(D){var K=this._find(D,!1);return K>=0?this._values[K]:void 0},se.prototype.set=function(D,K){var H=this._find(D,!0);return this._values[H]=K,this},se.prototype.delete=function(D){var K=this._find(D,!1);if(K>=0){for(var H=this._keys.length,W=K+1;W<H;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,nl(D,this._cacheKey)&&(this._cacheKey=k,this._cacheIndex=-2),!0}return!1},se.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=k,this._cacheIndex=-2},se.prototype.keys=function(){return new _(this._keys,this._values,Q)},se.prototype.values=function(){return new _(this._keys,this._values,be)},se.prototype.entries=function(){return new _(this._keys,this._values,Be)},se.prototype["@@iterator"]=function(){return this.entries()},se.prototype[a]=function(){return this.entries()},se.prototype._find=function(D,K){if(!nl(this._cacheKey,D)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(nl(this._keys[H],D)){this._cacheIndex=H;break}}return this._cacheIndex<0&&K&&(this._cacheIndex=this._keys.length,this._keys.push(D),this._values.push(void 0)),this._cacheIndex},se}();return $;function Q(se,D){return se}function be(se,D){return D}function Be(se,D){return[se,D]}}function qb(){var k=function(){function A(){this._map=new I}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(_){return this._map.has(_)},A.prototype.add=function(_){return this._map.set(_,_),this},A.prototype.delete=function(_){return this._map.delete(_)},A.prototype.clear=function(){this._map.clear()},A.prototype.keys=function(){return this._map.keys()},A.prototype.values=function(){return this._map.keys()},A.prototype.entries=function(){return this._map.entries()},A.prototype["@@iterator"]=function(){return this.keys()},A.prototype[a]=function(){return this.keys()},A}();return k}function Kb(){var k=16,A=y.create(),_=$();return function(){function D(){this._key=$()}return D.prototype.has=function(K){var H=Q(K,!1);return H!==void 0?y.has(H,this._key):!1},D.prototype.get=function(K){var H=Q(K,!1);return H!==void 0?y.get(H,this._key):void 0},D.prototype.set=function(K,H){var W=Q(K,!0);return W[this._key]=H,this},D.prototype.delete=function(K){var H=Q(K,!1);return H!==void 0?delete H[this._key]:!1},D.prototype.clear=function(){this._key=$()},D}();function $(){var D;do D="@@WeakMap@@"+se();while(y.has(A,D));return A[D]=!0,D}function Q(D,K){if(!n.call(D,_)){if(!K)return;Object.defineProperty(D,_,{value:y.create()})}return D[_]}function be(D,K){for(var H=0;H<K;++H)D[H]=Math.random()*255|0;return D}function Be(D){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(D)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(D)):be(new Uint8Array(D),D):be(new Array(D),D)}function se(){var D=Be(k);D[6]=D[6]&79|64,D[8]=D[8]&191|128;for(var K="",H=0;H<k;++H){var W=D[H];(H===4||H===6||H===8)&&(K+="-"),W<16&&(K+="0"),K+=W.toString(16).toLowerCase()}return K}}function sl(k){return k.__=void 0,delete k.__,k}})})(cl||(cl={}));/*!
|
|
14
|
+
***************************************************************************** */var fl;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof No=="object"?No:typeof self=="object"?self:typeof this=="object"?this:l(),n=o(e);typeof r.Reflect<"u"&&(n=o(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(c,d){return function(y,f){Object.defineProperty(c,y,{configurable:!0,writable:!0,value:f}),d&&d(y,f)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function l(){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",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,y={create:l?function(){return cl(Object.create(null))}:c?function(){return cl({__proto__:null})}:function(){return cl({})},has:d?function(k,I){return n.call(k,I)}:function(k,I){return I in k},get:d?function(k,I){return n.call(k,I)?k[I]:void 0}:function(k,I){return k[I]}},f=Object.getPrototypeOf(Function),x=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Wb(),m=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Jb(),h=typeof WeakMap=="function"?WeakMap:Yb(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,b=Kb(),v=zb(b);function A(k,I,_,$){if(X(_)){if(!xe(k))throw new TypeError;if(!Ae(I))throw new TypeError;return J(k,I)}else{if(!xe(k))throw new TypeError;if(!q(I))throw new TypeError;if(!q($)&&!X($)&&!te($))throw new TypeError;return te($)&&($=void 0),_=re(_),ee(k,I,_,$)}}t("decorate",A);function C(k,I){function _($,Q){if(!q($))throw new TypeError;if(!X(Q)&&!Jr(Q))throw new TypeError;zr(k,I,$,Q)}return _}t("metadata",C);function S(k,I,_,$){if(!q(_))throw new TypeError;return X($)||($=re($)),zr(k,I,_,$)}t("defineMetadata",S);function T(k,I,_){if(!q(I))throw new TypeError;return X(_)||(_=re(_)),ne(k,I,_)}t("hasMetadata",T);function N(k,I,_){if(!q(I))throw new TypeError;return X(_)||(_=re(_)),me(k,I,_)}t("hasOwnMetadata",N);function E(k,I,_){if(!q(I))throw new TypeError;return X(_)||(_=re(_)),ie(k,I,_)}t("getMetadata",E);function B(k,I,_){if(!q(I))throw new TypeError;return X(_)||(_=re(_)),Ee(k,I,_)}t("getOwnMetadata",B);function O(k,I){if(!q(k))throw new TypeError;return X(I)||(I=re(I)),Gr(k,I)}t("getMetadataKeys",O);function G(k,I){if(!q(k))throw new TypeError;return X(I)||(I=re(I)),pr(k,I)}t("getOwnMetadataKeys",G);function M(k,I,_){if(!q(I))throw new TypeError;if(X(_)||(_=re(_)),!q(I))throw new TypeError;X(_)||(_=re(_));var $=Ri(I,_,!1);return X($)?!1:$.OrdinaryDeleteMetadata(k,I,_)}t("deleteMetadata",M);function J(k,I){for(var _=k.length-1;_>=0;--_){var $=k[_],Q=$(I);if(!X(Q)&&!te(Q)){if(!Ae(Q))throw new TypeError;I=Q}}return I}function ee(k,I,_,$){for(var Q=k.length-1;Q>=0;--Q){var be=k[Q],Be=be(I,_,$);if(!X(Be)&&!te(Be)){if(!q(Be))throw new TypeError;$=Be}}return $}function ne(k,I,_){var $=me(k,I,_);if($)return!0;var Q=ll(I);return te(Q)?!1:ne(k,Q,_)}function me(k,I,_){var $=Ri(I,_,!1);return X($)?!1:Xe($.OrdinaryHasOwnMetadata(k,I,_))}function ie(k,I,_){var $=me(k,I,_);if($)return Ee(k,I,_);var Q=ll(I);if(!te(Q))return ie(k,Q,_)}function Ee(k,I,_){var $=Ri(I,_,!1);if(!X($))return $.OrdinaryGetOwnMetadata(k,I,_)}function zr(k,I,_,$){var Q=Ri(_,$,!0);Q.OrdinaryDefineOwnMetadata(k,I,_,$)}function Gr(k,I){var _=pr(k,I),$=ll(k);if($===null)return _;var Q=Gr($,I);if(Q.length<=0)return _;if(_.length<=0)return Q;for(var be=new m,Be=[],se=0,D=_;se<D.length;se++){var K=D[se],H=be.has(K);H||(be.add(K),Be.push(K))}for(var W=0,ae=Q;W<ae.length;W++){var K=ae[W],H=be.has(K);H||(be.add(K),Be.push(K))}return Be}function pr(k,I){var _=Ri(k,I,!1);return _?_.OrdinaryOwnMetadataKeys(k,I):[]}function Dt(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 te(k){return k===null}function U(k){return typeof k=="symbol"}function q(k){return typeof k=="object"?k!==null:typeof k=="function"}function fe(k,I){switch(Dt(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 _=I===3?"string":I===5?"number":"default",$=lp(k,s);if($!==void 0){var Q=$.call(k,_);if(q(Q))throw new TypeError;return Q}return Le(k,_==="default"?"number":_)}function Le(k,I){if(I==="string"){var _=k.toString;if(Z(_)){var $=_.call(k);if(!q($))return $}var Q=k.valueOf;if(Z(Q)){var $=Q.call(k);if(!q($))return $}}else{var Q=k.valueOf;if(Z(Q)){var $=Q.call(k);if(!q($))return $}var be=k.toString;if(Z(be)){var $=be.call(k);if(!q($))return $}}throw new TypeError}function Xe(k){return!!k}function Wr(k){return""+k}function re(k){var I=fe(k,3);return U(I)?I:Wr(I)}function xe(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 Ae(k){return typeof k=="function"}function Jr(k){switch(Dt(k)){case 3:return!0;case 4:return!0;default:return!1}}function al(k,I){return k===I||k!==k&&I!==I}function lp(k,I){var _=k[I];if(_!=null){if(!Z(_))throw new TypeError;return _}}function cp(k){var I=lp(k,a);if(!Z(I))throw new TypeError;var _=I.call(k);if(!q(_))throw new TypeError;return _}function up(k){return k.value}function dp(k){var I=k.next();return I.done?!1:I}function fp(k){var I=k.return;I&&I.call(k)}function ll(k){var I=Object.getPrototypeOf(k);if(typeof k!="function"||k===f||I!==f)return I;var _=k.prototype,$=_&&Object.getPrototypeOf(_);if($==null||$===Object.prototype)return I;var Q=$.constructor;return typeof Q!="function"||Q===k?I:Q}function qb(){var k;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(k=Gb(r.Reflect));var I,_,$,Q=new h,be={registerProvider:Be,getProvider:D,setProvider:H};return be;function Be(W){if(!Object.isExtensible(be))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case k===W:break;case X(I):I=W;break;case I===W:break;case X(_):_=W;break;case _===W:break;default:$===void 0&&($=new m),$.add(W);break}}function se(W,ae){if(!X(I)){if(I.isProviderFor(W,ae))return I;if(!X(_)){if(_.isProviderFor(W,ae))return I;if(!X($))for(var he=cp($);;){var we=dp(he);if(!we)return;var ft=up(we);if(ft.isProviderFor(W,ae))return fp(he),ft}}}if(!X(k)&&k.isProviderFor(W,ae))return k}function D(W,ae){var he=Q.get(W),we;return X(he)||(we=he.get(ae)),X(we)&&(we=se(W,ae),X(we)||(X(he)&&(he=new x,Q.set(W,he)),he.set(ae,we))),we}function K(W){if(X(W))throw new TypeError;return I===W||_===W||!X($)&&$.has(W)}function H(W,ae,he){if(!K(he))throw new Error("Metadata provider not registered.");var we=D(W,ae);if(we!==he){if(!X(we))return!1;var ft=Q.get(W);X(ft)&&(ft=new x,Q.set(W,ft)),ft.set(ae,he)}return!0}}function Kb(){var k;return!X(g)&&q(r.Reflect)&&Object.isExtensible(r.Reflect)&&(k=r.Reflect[g]),X(k)&&(k=qb()),!X(g)&&q(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:k}),k}function zb(k){var I=new h,_={isProviderFor:function(K,H){var W=I.get(K);return X(W)?!1:W.has(H)},OrdinaryDefineOwnMetadata:Be,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:be,OrdinaryOwnMetadataKeys:se,OrdinaryDeleteMetadata:D};return b.registerProvider(_),_;function $(K,H,W){var ae=I.get(K),he=!1;if(X(ae)){if(!W)return;ae=new x,I.set(K,ae),he=!0}var we=ae.get(H);if(X(we)){if(!W)return;if(we=new x,ae.set(H,we),!k.setProvider(K,H,_))throw ae.delete(H),he&&I.delete(K),new Error("Wrong provider for target.")}return we}function Q(K,H,W){var ae=$(H,W,!1);return X(ae)?!1:Xe(ae.has(K))}function be(K,H,W){var ae=$(H,W,!1);if(!X(ae))return ae.get(K)}function Be(K,H,W,ae){var he=$(W,ae,!0);he.set(K,H)}function se(K,H){var W=[],ae=$(K,H,!1);if(X(ae))return W;for(var he=ae.keys(),we=cp(he),ft=0;;){var pp=dp(we);if(!pp)return W.length=ft,W;var Zb=up(pp);try{W[ft]=Zb}catch(Qb){try{fp(we)}finally{throw Qb}}ft++}}function D(K,H,W){var ae=$(H,W,!1);if(X(ae)||!ae.delete(K))return!1;if(ae.size===0){var he=I.get(H);X(he)||(he.delete(W),he.size===0&&I.delete(he))}return!0}}function Gb(k){var I=k.defineMetadata,_=k.hasOwnMetadata,$=k.getOwnMetadata,Q=k.getOwnMetadataKeys,be=k.deleteMetadata,Be=new h,se={isProviderFor:function(D,K){var H=Be.get(D);return X(H)?Q(D,K).length?(X(H)&&(H=new m,Be.set(D,H)),H.add(K),!0):!1:H.has(K)},OrdinaryDefineOwnMetadata:I,OrdinaryHasOwnMetadata:_,OrdinaryGetOwnMetadata:$,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:be};return se}function Ri(k,I,_){var $=b.getProvider(k,I);if(!X($))return $;if(_){if(b.setProvider(k,I,v))return v;throw new Error("Illegal state.")}}function Wb(){var k={},I=[],_=function(){function se(D,K,H){this._index=0,this._keys=D,this._values=K,this._selector=H}return se.prototype["@@iterator"]=function(){return this},se.prototype[a]=function(){return this},se.prototype.next=function(){var D=this._index;if(D>=0&&D<this._keys.length){var K=this._selector(this._keys[D],this._values[D]);return D+1>=this._keys.length?(this._index=-1,this._keys=I,this._values=I):this._index++,{value:K,done:!1}}return{value:void 0,done:!0}},se.prototype.throw=function(D){throw this._index>=0&&(this._index=-1,this._keys=I,this._values=I),D},se.prototype.return=function(D){return this._index>=0&&(this._index=-1,this._keys=I,this._values=I),{value:D,done:!0}},se}(),$=function(){function se(){this._keys=[],this._values=[],this._cacheKey=k,this._cacheIndex=-2}return Object.defineProperty(se.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),se.prototype.has=function(D){return this._find(D,!1)>=0},se.prototype.get=function(D){var K=this._find(D,!1);return K>=0?this._values[K]:void 0},se.prototype.set=function(D,K){var H=this._find(D,!0);return this._values[H]=K,this},se.prototype.delete=function(D){var K=this._find(D,!1);if(K>=0){for(var H=this._keys.length,W=K+1;W<H;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,al(D,this._cacheKey)&&(this._cacheKey=k,this._cacheIndex=-2),!0}return!1},se.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=k,this._cacheIndex=-2},se.prototype.keys=function(){return new _(this._keys,this._values,Q)},se.prototype.values=function(){return new _(this._keys,this._values,be)},se.prototype.entries=function(){return new _(this._keys,this._values,Be)},se.prototype["@@iterator"]=function(){return this.entries()},se.prototype[a]=function(){return this.entries()},se.prototype._find=function(D,K){if(!al(this._cacheKey,D)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(al(this._keys[H],D)){this._cacheIndex=H;break}}return this._cacheIndex<0&&K&&(this._cacheIndex=this._keys.length,this._keys.push(D),this._values.push(void 0)),this._cacheIndex},se}();return $;function Q(se,D){return se}function be(se,D){return D}function Be(se,D){return[se,D]}}function Jb(){var k=function(){function I(){this._map=new x}return Object.defineProperty(I.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),I.prototype.has=function(_){return this._map.has(_)},I.prototype.add=function(_){return this._map.set(_,_),this},I.prototype.delete=function(_){return this._map.delete(_)},I.prototype.clear=function(){this._map.clear()},I.prototype.keys=function(){return this._map.keys()},I.prototype.values=function(){return this._map.keys()},I.prototype.entries=function(){return this._map.entries()},I.prototype["@@iterator"]=function(){return this.keys()},I.prototype[a]=function(){return this.keys()},I}();return k}function Yb(){var k=16,I=y.create(),_=$();return function(){function D(){this._key=$()}return D.prototype.has=function(K){var H=Q(K,!1);return H!==void 0?y.has(H,this._key):!1},D.prototype.get=function(K){var H=Q(K,!1);return H!==void 0?y.get(H,this._key):void 0},D.prototype.set=function(K,H){var W=Q(K,!0);return W[this._key]=H,this},D.prototype.delete=function(K){var H=Q(K,!1);return H!==void 0?delete H[this._key]:!1},D.prototype.clear=function(){this._key=$()},D}();function $(){var D;do D="@@WeakMap@@"+se();while(y.has(I,D));return I[D]=!0,D}function Q(D,K){if(!n.call(D,_)){if(!K)return;Object.defineProperty(D,_,{value:y.create()})}return D[_]}function be(D,K){for(var H=0;H<K;++H)D[H]=Math.random()*255|0;return D}function Be(D){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(D)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(D)):be(new Uint8Array(D),D):be(new Array(D),D)}function se(){var D=Be(k);D[6]=D[6]&79|64,D[8]=D[8]&191|128;for(var K="",H=0;H<k;++H){var W=D[H];(H===4||H===6||H===8)&&(K+="-"),W<16&&(K+="0"),K+=W.toString(16).toLowerCase()}return K}}function cl(k){return k.__=void 0,delete k.__,k}})})(fl||(fl={}));/*!
|
|
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 Bp="[object ArrayBuffer]";class R{static isArrayBuffer(t){return Object.prototype.toString.call(t)===Bp}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=R.toUint8Array(t),o=R.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 l=this.toUint8Array(a);o.set(l,s),s+=l.length}return t[t.length-1]instanceof Function?this.toView(o,t[t.length-1]):o.buffer}}const Oo="string",Ip=/^[0-9a-f]+$/i,Ep=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Np=/^[a-zA-Z0-9-_]+$/;class pl{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=R.toUint8Array(t);let n="";for(let s=0;s<r.length;s++)n+=String.fromCharCode(r[s]);return decodeURIComponent(escape(n))}}class pt{static toString(t,r=!1){const n=R.toArrayBuffer(t),o=new DataView(n);let s="";for(let a=0;a<n.byteLength;a+=2){const l=o.getUint16(a,r);s+=String.fromCharCode(l)}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 L{static isHex(t){return typeof t===Oo&&Ip.test(t)}static isBase64(t){return typeof t===Oo&&Ep.test(t)}static isBase64Url(t){return typeof t===Oo&&Np.test(t)}static ToString(t,r="utf8"){const n=R.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=R.toUint8Array(t);if(typeof btoa<"u"){const n=this.ToString(r,"binary");return btoa(n)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return pl.fromString(t);case"utf16":case"utf16be":return pt.fromString(t);case"utf16le":case"usc2":return pt.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return pl.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=R.toUint8Array(t);let n="";for(let o=0;o<r.length;o++)n+=String.fromCharCode(r[o]);return n}static ToHex(t){const r=R.toUint8Array(t);let n="";const o=r.length;for(let s=0;s<o;s++){const a=r[s];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.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,""))||""}}L.DEFAULT_UTF8_ENCODING="utf8";function Op(...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 hl(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
|
|
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 l=1;l<8;l++){if(e<a){let c;if(n<0)c=new ArrayBuffer(l),s=l;else{if(n<l)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}const d=new Uint8Array(c);for(let y=l-1;y>=0;y--){const f=Math.pow(2,y*t);d[s-y-1]=Math.floor(o/f),o-=d[s-y-1]*f}return c}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function _o(...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 yl(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const l=e[0]===255&&e[1]&128,c=e[0]===0&&(e[1]&128)===0;(l||c)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let l=0;l<this.valueHex.byteLength;l++)r[l]=0;r[0]=e[0]&128;const n=hr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let l=0;l<this.valueHex.byteLength;l++)s[l]=e[l];return s[0]&=127,hr(s,8)-n}function _p(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,l=Gt(a,8,n),c=new Uint8Array(l);return c[0]|=128,l}let o=Gt(t,8,n),s=new Uint8Array(o);if(s[0]&128){const a=o.slice(0),l=new Uint8Array(a);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let c=0;c<a.byteLength;c++)s[c+1]=l[c];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function Vp(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 Je(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 Ri(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function No(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 Ct(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 Pi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return No(this.items)}}const Jr=[new Uint8Array([1])],pl="0123456789",Oo="name",hl="valueHexView",Np="isHexOnly",Op="idBlock",_p="tagClass",Vp="tagNumber",Tp="isConstructed",jp="fromBER",$p="toBER",Dp="local",Le="",nt=new ArrayBuffer(0),Ui=new Uint8Array(0),Yr="EndOfContent",yl="OCTET STRING",gl="BIT STRING";function pt(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):Ui}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(!Ct(this,a,o,s))return-1;const l=o+s;return this.valueHexView=a.subarray(o,l),this.valueHexView.length?(this.blockLength=s,l):(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",nt)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Gt{constructor({blockLength:t=0,error:r=Le,warnings:n=[],valueBeforeDecode:o=Ui}={}){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:L.ToHex(this.valueBeforeDecodeView)}}}Gt.NAME="baseBlock";class Me extends Gt{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'")}}Me.NAME="valueBlock";class ml extends pt(Gt){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):Ui,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",nt}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=zt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,l=new Uint8Array(a+1);if(l[0]=r|31,!t){for(let c=0;c<a-1;c++)l[c+1]=s[c]|128;l[a]=s[a-1]}return l.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(!Ct(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 l=s[0]&31;if(l!==31)this.tagNumber=l,this.blockLength=1;else{let c=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[c]&128;){if(d[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===y){y+=255;const I=new Uint8Array(y);for(let w=0;w<d.length;w++)I[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=c+1,d[c-1]=s[c]&127;const p=new Uint8Array(c);for(let I=0;I<c;I++)p[I]=d[I];d=this.valueHexView=new Uint8Array(c),d.set(p),this.blockLength<=9?this.tagNumber=pr(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}}}ml.NAME="identificationBlock";class bl extends Gt{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(!Ct(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 l=r+1,c=o.subarray(l,l+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=pr(c,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=zt(this.length,8);if(o.byteLength>127)return this.error="Too big length",nt;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}}}bl.NAME="lengthBlock";const P={};class Ne extends Gt{constructor({name:t=Le,optional:r=!1,primitiveSchema:n,...o}={},s){super(o),this.name=t,this.optional=r,n&&(this.primitiveSchema=n),this.idBlock=new ml(o),this.lenBlock=new bl(o),this.valueBlock=s?new s(o):new Me(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 Pi;r||wl(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?nt: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():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),n=t.toBER();return Ep(r,n)}}Ne.NAME="BaseBlock";function wl(e){if(e instanceof P.Constructed)for(const t of e.valueBlock.value)wl(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class _o extends Ne{constructor({value:t=Le,...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}'`}}_o.NAME="BaseStringBlock";class vl extends pt(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}vl.NAME="PrimitiveValueBlock";var kl;class Zr extends Ne{constructor(t={}){super(t,vl),this.idBlock.isConstructed=!1}}kl=Zr,P.Primitive=kl,Zr.NAME="PRIMITIVE";function Mp(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 hr(e,t=0,r=e.length){const n=t;let o=new Ne({},Me);const s=new Gt;if(!Ct(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 l=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),l===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=l,r-=o.idBlock.blockLength,l=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),l===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=l,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 c=Ne;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};c=P.EndOfContent;break;case 1:c=P.Boolean;break;case 2:c=P.Integer;break;case 3:c=P.BitString;break;case 4:c=P.OctetString;break;case 5:c=P.Null;break;case 6:c=P.ObjectIdentifier;break;case 10:c=P.Enumerated;break;case 12:c=P.Utf8String;break;case 13:c=P.RelativeObjectIdentifier;break;case 14:c=P.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=P.Sequence;break;case 17:c=P.Set;break;case 18:c=P.NumericString;break;case 19:c=P.PrintableString;break;case 20:c=P.TeletexString;break;case 21:c=P.VideotexString;break;case 22:c=P.IA5String;break;case 23:c=P.UTCTime;break;case 24:c=P.GeneralizedTime;break;case 25:c=P.GraphicString;break;case 26:c=P.VisibleString;break;case 27:c=P.GeneralString;break;case 28:c=P.UniversalString;break;case 29:c=P.CharacterString;break;case 30:c=P.BmpString;break;case 31:c=P.DATE;break;case 32:c=P.TimeOfDay;break;case 33:c=P.DateTime;break;case 34:c=P.Duration;break;default:{const d=o.idBlock.isConstructed?new P.Constructed:new P.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:c=o.idBlock.isConstructed?P.Constructed:P.Primitive}return o=Mp(o,c),l=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(n,n+o.blockLength),{offset:l,result:o}}function yr(e){if(!e.byteLength){const t=new Ne({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return hr(M.toUint8Array(e).slice(),0,e.byteLength)}function Rp(e,t){return e?1:t}class Dt extends Me{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(!Ct(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(;Rp(this.isIndefiniteForm,n)>0;){const a=hr(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===Yr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Yr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const n=r||new Pi;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,n);return r?nt:n.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Dt.NAME="ConstructedValueBlock";var Cl;class He extends Ne{constructor(t={}){super(t,Dt),this.idBlock.isConstructed=!0}fromBER(t,r,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){const t=[];for(const n of this.valueBlock.value)t.push(n.toString("ascii").split(`
|
|
71
|
+
*/function Ui(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Vo(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 Li{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return Vo(this.items)}}const Zr=[new Uint8Array([1])],gl="0123456789",To="name",ml="valueHexView",Tp="isHexOnly",jp="idBlock",$p="tagClass",Dp="tagNumber",Rp="isConstructed",Mp="fromBER",Pp="toBER",Up="local",He="",ot=new ArrayBuffer(0),Hi=new Uint8Array(0),Qr="EndOfContent",bl="OCTET STRING",wl="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?R.toUint8Array(s.valueHex):Hi}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 l=o+s;return this.valueHexView=a.subarray(o,l),this.valueHexView.length?(this.blockLength=s,l):(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",ot)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Wt{constructor({blockLength:t=0,error:r=He,warnings:n=[],valueBeforeDecode:o=Hi}={}){this.blockLength=t,this.error=r,this.warnings=n,this.valueBeforeDecodeView=R.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:L.ToHex(this.valueBeforeDecodeView)}}}Wt.NAME="baseBlock";class Re 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'")}}Re.NAME="valueBlock";class vl 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?R.toUint8Array(t.valueHex):Hi,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",ot}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,l=new Uint8Array(a+1);if(l[0]=r|31,!t){for(let c=0;c<a-1;c++)l[c+1]=s[c]|128;l[a]=s[a-1]}return l.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=R.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 l=s[0]&31;if(l!==31)this.tagNumber=l,this.blockLength=1;else{let c=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[c]&128;){if(d[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===y){y+=255;const x=new Uint8Array(y);for(let m=0;m<d.length;m++)x[m]=d[m];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=c+1,d[c-1]=s[c]&127;const f=new Uint8Array(c);for(let x=0;x<c;x++)f[x]=d[x];d=this.valueHexView=new Uint8Array(c),d.set(f),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}}}vl.NAME="identificationBlock";class kl 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=R.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 l=r+1,c=o.subarray(l,l+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=hr(c,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",ot;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}}}kl.NAME="lengthBlock";const P={};class Ne extends Wt{constructor({name:t=He,optional:r=!1,primitiveSchema:n,...o}={},s){super(o),this.name=t,this.optional=r,n&&(this.primitiveSchema=n),this.idBlock=new vl(o),this.lenBlock=new kl(o),this.valueBlock=s?new s(o):new Re(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 Li;r||Cl(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?ot: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():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),n=t.toBER();return Vp(r,n)}}Ne.NAME="BaseBlock";function Cl(e){if(e instanceof P.Constructed)for(const t of e.valueBlock.value)Cl(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class jo extends Ne{constructor({value:t=He,...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}'`}}jo.NAME="BaseStringBlock";class Sl extends ht(Re){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}Sl.NAME="PrimitiveValueBlock";var xl;class Xr extends Ne{constructor(t={}){super(t,Sl),this.idBlock.isConstructed=!1}}xl=Xr,P.Primitive=xl,Xr.NAME="PRIMITIVE";function Lp(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 Ne({},Re);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 l=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),l===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=l,r-=o.idBlock.blockLength,l=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),l===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=l,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 c=Ne;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};c=P.EndOfContent;break;case 1:c=P.Boolean;break;case 2:c=P.Integer;break;case 3:c=P.BitString;break;case 4:c=P.OctetString;break;case 5:c=P.Null;break;case 6:c=P.ObjectIdentifier;break;case 10:c=P.Enumerated;break;case 12:c=P.Utf8String;break;case 13:c=P.RelativeObjectIdentifier;break;case 14:c=P.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=P.Sequence;break;case 17:c=P.Set;break;case 18:c=P.NumericString;break;case 19:c=P.PrintableString;break;case 20:c=P.TeletexString;break;case 21:c=P.VideotexString;break;case 22:c=P.IA5String;break;case 23:c=P.UTCTime;break;case 24:c=P.GeneralizedTime;break;case 25:c=P.GraphicString;break;case 26:c=P.VisibleString;break;case 27:c=P.GeneralString;break;case 28:c=P.UniversalString;break;case 29:c=P.CharacterString;break;case 30:c=P.BmpString;break;case 31:c=P.DATE;break;case 32:c=P.TimeOfDay;break;case 33:c=P.DateTime;break;case 34:c=P.Duration;break;default:{const d=o.idBlock.isConstructed?new P.Constructed:new P.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:c=o.idBlock.isConstructed?P.Constructed:P.Primitive}return o=Lp(o,c),l=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(n,n+o.blockLength),{offset:l,result:o}}function gr(e){if(!e.byteLength){const t=new Ne({},Re);return t.error="Input buffer has zero length",{offset:-1,result:t}}return yr(R.toUint8Array(e).slice(),0,e.byteLength)}function Hp(e,t){return e?1:t}class Rt extends Re{constructor({value:t=[],isIndefiniteForm:r=!1,...n}={}){super(n),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,n){const o=R.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(;Hp(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===Qr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Qr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const n=r||new Li;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,n);return r?ot:n.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Rt.NAME="ConstructedValueBlock";var Al;class Fe extends Ne{constructor(t={}){super(t,Rt),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} :`}}Cl=He,P.Constructed=Cl,He.NAME="CONSTRUCTED";class Sl extends Me{fromBER(t,r,n){return r}toBER(t){return nt}}Sl.override="EndOfContentValueBlock";var xl;class Vo extends Ne{constructor(t={}){super(t,Sl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}xl=Vo,P.EndOfContent=xl,Vo.NAME=Yr;var Al;class Wt extends Ne{constructor(t={}){super(t,Me),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}`}}Al=Wt,P.Null=Al,Wt.NAME="NULL";class Bl extends pt(Me){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 Ct(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,fl.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Bl.NAME="BooleanValueBlock";var Il;let Li=class extends Ne{constructor(t={}){super(t,Bl),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}`}};Il=Li,P.Boolean=Il,Li.NAME="BOOLEAN";class El extends pt(Dt){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=Dt.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===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==yl)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?Dt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}El.NAME="OctetStringValueBlock";var Nl;let Jt=class up extends Ne{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},El),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=hr(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?He.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof up&&t.push(r.valueBlock.valueHexView);return M.concat(t)}};Nl=Jt,P.OctetString=Nl,Jt.NAME=yl;class Ol extends pt(Dt){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=Dt.prototype.fromBER.call(this,t,r,n),o===-1)return o;for(const l of this.value){const c=l.constructor.NAME;if(c===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==gl)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=l.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(!Ct(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 l=a.subarray(1);try{if(l.byteLength){const c=hr(l,0,l.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+n}toBER(t,r){if(this.isConstructed)return Dt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return nt;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}}}Ol.NAME="BitStringValueBlock";var _l;let Yt=class extends Ne{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},Ol),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 He.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)}`}}};_l=Yt,P.BitString=_l,Yt.NAME=gl;var Vl;function Pp(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,l=o.slice(0),c=l.length-1;let d=0;const y=c<a?a:c;let p=0;for(let I=y;I>=0;I--,p++){switch(!0){case p<l.length:d=s[a-p]+l[c-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=Eo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=Eo(r,s)),s}function Tl(e){if(e>=Jr.length)for(let t=Jr.length;t<=e;t++){const r=new Uint8Array([0]);let n=Jr[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=Eo(r,n)),Jr.push(n)}return Jr[e]}function Up(e,t){let r=0;const n=new Uint8Array(e),o=new Uint8Array(t),s=n.slice(0),a=s.length-1,l=o.slice(0),c=l.length-1;let d,y=0;for(let p=c;p>=0;p--,y++)switch(d=s[a-y]-l[c-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-c+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 To extends pt(Me){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=fl.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Ip(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="",l=!1;for(let c=s.byteLength-1;c>=0;c--){o=s[c];for(let d=0;d<8;d++){if((o&1)===1)switch(n){case t:r=Up(Tl(n),r),a="-";break;default:r=Pp(r,Tl(n))}n++,o>>=1}}for(let c=0;c<r.length;c++)r[c]&&(l=!0),l&&(a+=pl.charAt(r[c]));return l===!1&&(a+=pl.charAt(0)),a}}Vl=To,To.NAME="IntegerValueBlock",Object.defineProperty(Vl.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var jl;class ht extends Ne{constructor(t={}){super(t,To),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ri(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Ri();const r=BigInt(t),n=new Pi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const l=new Uint8Array(s.length+(s[0]&128?1:0));l[0]|=128;const d=BigInt(`0x${L.ToHex(l)}`)+r,y=M.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,n.write(y)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new ht({valueHex:n.final()})}convertToDER(){const t=new ht({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ht({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}jl=ht,P.Integer=jl,ht.NAME="INTEGER";var $l;class Hi extends ht{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}$l=Hi,P.Enumerated=$l,Hi.NAME="ENUMERATED";class jo extends pt(Me){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(!Ct(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=pr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Ri();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=zt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;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=L.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}jo.NAME="sidBlock";class Dl extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new jo;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,nt;r.push(o)}return No(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 l=0;switch(a.valueDec){case 0:break;case 1:l=40;break;case 2:l=80;break;default:this.value=[];return}const c=parseInt(o,10);if(isNaN(c))return;a.valueDec=c+l,s=!1}else{const a=new jo;if(o>Number.MAX_SAFE_INTEGER){Ri();const l=BigInt(o);a.valueBigInt=l}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}}Dl.NAME="ObjectIdentifierValueBlock";var Ml;class Fi extends Ne{constructor(t={}){super(t,Dl),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()}}}Ml=Fi,P.ObjectIdentifier=Ml,Fi.NAME="OBJECT IDENTIFIER";class $o extends pt(Gt){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(!Ct(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=pr(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=zt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;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=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}$o.NAME="relativeSidBlock";class Rl extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new $o;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,nt;n.push(s)}return No(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 $o;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}}Rl.NAME="RelativeObjectIdentifierValueBlock";var Pl;class Do extends Ne{constructor(t={}){super(t,Rl),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()}}}Pl=Do,P.RelativeObjectIdentifier=Pl,Do.NAME="RelativeObjectIdentifier";var Ul;class St extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ul=St,P.Sequence=Ul,St.NAME="SEQUENCE";var Ll;let xt=class extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Ll=xt,P.Set=Ll,xt.NAME="SET";class Hl extends pt(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}Hl.NAME="StringValueBlock";class Fl extends Hl{}Fl.NAME="SimpleStringValueBlock";class Je extends _o{constructor({...t}={}){super(t,Fl)}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}}Je.NAME="SIMPLE STRING";class ql extends Je{fromBuffer(t){this.valueBlock.valueHexView=M.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}ql.NAME="Utf8StringValueBlock";var Kl;class At extends ql{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Kl=At,P.Utf8String=Kl,At.NAME="UTF8String";class zl extends Je{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=M.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}zl.NAME="BmpStringValueBlock";var Gl;class qi extends zl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Gl=qi,P.BmpString=Gl,qi.NAME="BMPString";class Wl extends Je{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=zt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const l=4-a.length;for(let c=a.length-1;c>=0;c--)n[o*4+c+l]=a[c]}this.valueBlock.value=t}}Wl.NAME="UniversalStringValueBlock";var Jl;class Ki extends Wl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Jl=Ki,P.UniversalString=Jl,Ki.NAME="UniversalString";var Yl;class zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Yl=zi,P.NumericString=Yl,zi.NAME="NumericString";var Zl;class Gi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Zl=Gi,P.PrintableString=Zl,Gi.NAME="PrintableString";var Ql;class Wi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Ql=Wi,P.TeletexString=Ql,Wi.NAME="TeletexString";var Xl;class Ji extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Xl=Ji,P.VideotexString=Xl,Ji.NAME="VideotexString";var ec;class Yi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}ec=Yi,P.IA5String=ec,Yi.NAME="IA5String";var tc;class Zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}tc=Zi,P.GraphicString=tc,Zi.NAME="GraphicString";var rc;class Qr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}rc=Qr,P.VisibleString=rc,Qr.NAME="VisibleString";var ic;class Qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}ic=Qi,P.GeneralString=ic,Qi.NAME="GeneralString";var nc;class Xi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}nc=Xi,P.CharacterString=nc,Xi.NAME="CharacterString";var oc;class Xr extends Qr{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]=We(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=We(this.month,2),r[2]=We(this.day,2),r[3]=We(this.hour,2),r[4]=We(this.minute,2),r[5]=We(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}}}oc=Xr,P.UTCTime=oc,Xr.NAME="UTCTime";var sc;class en extends Xr{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,l=0,c=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,I=n.indexOf("+"),w="";if(I===-1&&(I=n.indexOf("-"),p=-1),I!==-1){if(w=n.substring(I+1),n=n.substring(0,I),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(l=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");c=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)+l;break;case 5:this.minute=parseInt(y[p],10)+c;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(We(this.year,4)),r.push(We(this.month,2)),r.push(We(this.day,2)),r.push(We(this.hour,2)),r.push(We(this.minute,2)),r.push(We(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(We(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}sc=en,P.GeneralizedTime=sc,en.NAME="GeneralizedTime";var ac;class Mo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}ac=Mo,P.DATE=ac,Mo.NAME="DATE";var lc;class Ro extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}lc=Ro,P.TimeOfDay=lc,Ro.NAME="TimeOfDay";var cc;class Po extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}cc=Po,P.DateTime=cc,Po.NAME="DateTime";var uc;class Uo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}uc=Uo,P.Duration=uc,Uo.NAME="Duration";var dc;class Lo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}dc=Lo,P.TIME=dc,Lo.NAME="TIME";class Zt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Ho extends Zt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class tn extends Zt{constructor({value:t=new Zt,local:r=!1,...n}={}){super(n),this.value=t,this.local=r}}class Lp{constructor({data:t=Ui}={}){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 Qt(e,t,r){if(r instanceof Ho){for(let s=0;s<r.value.length;s++)if(Qt(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(Oo)&&(s.name=r.name),s}}if(r instanceof Zt)return r.hasOwnProperty(Oo)&&(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(!(Op in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(jp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!($p 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(_p)===!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(Vp)===!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(Tp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Np 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(!(hl 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 l=0;l<s.length;l++)if(s[l]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},l=r.valueBlock.value.length;if(l>0&&r.valueBlock.value[0]instanceof tn&&(l=t.valueBlock.value.length),l===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let c=0;c<l;c++)if(c-s>=t.valueBlock.value.length){if(r.valueBlock.value[c].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,Le),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof tn){if(a=Qt(e,t.valueBlock.value[c],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,Le),r.name&&delete e[r.name]),a;if(Oo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};Dp 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[c])}}else if(a=Qt(e,t.valueBlock.value[c-s],r.valueBlock.value[c]),a.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(a.verified===!1){const c={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],c.name=r.name)),c}return{verified:!0,result:e}}if(r.primitiveSchema&&hl in t.valueBlock){const s=hr(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,Le),r.name&&(delete e[r.name],a.name=r.name)),a}return Qt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Hp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=hr(M.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Qt(r.result,r.result,t)}const fc=Object.freeze(Object.defineProperty({__proto__:null,Any:Zt,BaseBlock:Ne,BaseStringBlock:_o,BitString:Yt,BmpString:qi,Boolean:Li,CharacterString:Xi,Choice:Ho,Constructed:He,DATE:Mo,DateTime:Po,Duration:Uo,EndOfContent:Vo,Enumerated:Hi,GeneralString:Qi,GeneralizedTime:en,GraphicString:Zi,HexBlock:pt,IA5String:Yi,Integer:ht,Null:Wt,NumericString:zi,ObjectIdentifier:Fi,OctetString:Jt,Primitive:Zr,PrintableString:Gi,RawData:Lp,RelativeObjectIdentifier:Do,Repeated:tn,Sequence:St,Set:xt,TIME:Lo,TeletexString:Wi,TimeOfDay:Ro,UTCTime:Xr,UniversalString:Ki,Utf8String:At,ValueBlock:Me,VideotexString:Ji,ViewWriter:Pi,VisibleString:Qr,compareSchema:Qt,fromBER:yr,verifySchema:Hp},Symbol.toStringTag,{value:"Module"}));var V;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(V||(V={}));var m;(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"})(m||(m={}));class rn{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 Yt))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 Yt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Yt({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 le{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 Jt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Jt({valueHex:this.buffer})}toSchema(t){return new Jt({name:t})}}const Fp={fromASN:e=>e instanceof Wt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Wt;const t=yr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},qp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ht({value:+e})},Kp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Hi({value:e})},ye={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ht({valueHex:e})},zp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},Gp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Fi({value:e})},Wp={fromASN:e=>e.valueBlock.value,toASN:e=>new Li({value:e})},nn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Jt({valueHex:e})},Jp={fromASN:e=>new le(e.getValue()),toASN:e=>e.toASN()};function Xe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const pc=Xe(At),Yp=Xe(qi),Zp=Xe(Ki),Qp=Xe(zi),Xp=Xe(Gi),eh=Xe(Wi),th=Xe(Ji),rh=Xe(Yi),ih=Xe(Zi),nh=Xe(Qr),oh=Xe(Qi),sh=Xe(Xi),ah={fromASN:e=>e.toDate(),toASN:e=>new Xr({valueDate:e})},lh={fromASN:e=>e.toDate(),toASN:e=>new en({valueDate:e})},ch={fromASN:()=>null,toASN:()=>new Wt};function Fo(e){switch(e){case m.Any:return Fp;case m.BitString:return zp;case m.BmpString:return Yp;case m.Boolean:return Wp;case m.CharacterString:return sh;case m.Enumerated:return Kp;case m.GeneralString:return oh;case m.GeneralizedTime:return lh;case m.GraphicString:return ih;case m.IA5String:return rh;case m.Integer:return qp;case m.Null:return ch;case m.NumericString:return Qp;case m.ObjectIdentifier:return Gp;case m.OctetString:return nn;case m.PrintableString:return Xp;case m.TeletexString:return eh;case m.UTCTime:return ah;case m.UniversalString:return Zp;case m.Utf8String:return pc;case m.VideotexString:return th;case m.VisibleString:return nh;default:return null}}function Bt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:Bt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function hc(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:hc(r)}return!1}function uh(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 dh{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:V.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],l=r?s:"";let c;if(typeof a.type=="number"){const y=m[a.type],p=fc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);c=new p({name:l})}else Bt(a.type)?c=new a.type().toSchema(l):a.optional?this.get(a.type).type===V.Choice?c=new Zt({name:l}):(c=this.create(a.type,!1),c.name=l):c=new Zt({name:l});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){c.name="";const y=a.repeated==="set"?xt:St;c=new y({name:"",value:[new tn({name:l,value:c})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||Bt(a.type)){const y=a.repeated?He:Zr;o.push(new y({name:l,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?c:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new He({name:y?"":l,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new He({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else c.optional=d,o.push(c)}switch(n.type){case V.Sequence:return new St({value:o,name:""});case V.Set:return new xt({value:o,name:""});case V.Choice:return new Ho({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 et=new dh,j=e=>t=>{let r;et.has(t)?r=et.get(t):(r=et.createDefault(t),et.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let n;et.has(t.constructor)?n=et.get(t.constructor):(n=et.createDefault(t.constructor),et.set(t.constructor,n));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Fo(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 yc extends Error{constructor(){super(...arguments),this.schemas=[]}}class fh{static parse(t,r){const n=yr(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(Bt(r))return new r().fromASN(t);const o=et.get(r);et.cache(r);let s=o.schema;if(t.constructor===He&&o.type!==V.Choice){s=new He({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const c in o.items)delete t[c]}const a=Qt({},t,s);if(!a.verified)throw new yc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const l=new r;if(hc(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 c=o.itemType;if(typeof c=="number"){const d=Fo(c);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,c))}for(const c in o.items){const d=a.result[c];if(!d)continue;const y=o.items[c],p=y.type;if(typeof p=="number"||Bt(p)){const I=(n=y.converter)!==null&&n!==void 0?n:Bt(p)?new p:null;if(!I)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?St:xt,h=new w;h.valueBlock=d.valueBlock;const g=yr(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 b=g.result.valueBlock.value;l[c]=Array.from(b,v=>I.fromASN(v))}else l[c]=Array.from(d,w=>I.fromASN(w));else{let w=d;if(y.implicit){let h;if(Bt(p))h=new p().toSchema("");else{const g=m[p],b=fc[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=yr(h.toBER(!1)).result}l[c]=I.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.");l[c]=Array.from(d,I=>this.fromASN(I,p))}else l[c]=this.fromASN(d,p)}return l}catch(o){throw o instanceof yc&&o.schemas.push(r.name),o}}}class qo{static serialize(t){return t instanceof Ne?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&Bt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,n=et.get(r);et.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=Fo(n.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(l=>a.toASN(l))}else o=t.map(a=>this.toAsnItem({type:n.itemType},"[]",r,a))}else for(const a in n.items){const l=n.items[a],c=t[a];if(c===void 0||l.defaultValue===c||typeof l.defaultValue=="object"&&typeof c=="object"&&uh(this.serialize(l.defaultValue),this.serialize(c)))continue;const d=qo.toAsnItem(l,a,r,c);if(typeof l.context=="number")if(l.implicit)if(!l.repeated&&(typeof l.type=="number"||Bt(l.type))){const y={};y.valueHex=d instanceof Wt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Zr({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},...y}))}else o.push(new He({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:d.valueBlock.value}));else o.push(new He({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:[d]}));else l.repeated?o=o.concat(d):o.push(d)}let s;switch(n.type){case V.Sequence:s=new St({value:o});break;case V.Set:s=new xt({value:o});break;case V.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 ${m[t.type]} in schema '${n.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,d=>a.toASN(d)),c=t.repeated==="sequence"?St:xt;s=new c({value:l})}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,c=>this.toASN(c)),l=t.repeated==="sequence"?St:xt;s=new l({value:a})}else s=this.toASN(o);return s}}class ue extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class z{static serialize(t){return qo.serialize(t)}static parse(t,r){return fh.parse(t,r)}static toString(t){const r=M.isBufferSource(t)?M.toArrayBuffer(t):z.serialize(t),n=yr(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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 gc={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,}",l="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,B=(h.match(c.zoneIndex)||[])[0],S,C;for(B&&(B=B.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(C=g-b,S=":";C--;)S+="0:";return h=h.replace("::",S),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const T=h.split(":"),N=[];for(let E=0;E<T.length;E++)N.push(parseInt(T[E],16));return N}(),{parts:g,zoneId:B}}function y(h,g,b,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let B=0,S;for(;v>0;){if(S=b-v,S<0&&(S=0),h[B]>>S!==g[B]>>S)return!1;v-=b,B+=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 I(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 b,v;for(b=0;b<g.length;b++)if(v=g[b],!(0<=v&&v<=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,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let B,S,C;for(B=3;B>=0;B-=1)if(S=this.octets[B],S in v){if(C=v[S],b&&C!==0)return null;C!==8&&(b=!0),g+=C}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),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let S=0;for(;S<4;)B.push(parseInt(b[S],10)|parseInt(v[S],10)^255),S++;return new this(B)}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,b,v,B,S;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),S=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<4;)B.push(parseInt(v[b],10)&parseInt(S[b],10)),b++;return new this(B)}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 b=parseInt(g[2]);if(b>=0&&b<=32){const v=[this.parse(g[1]),b];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,v;if(g=h.match(n.fourOctet))return function(){const B=g.slice(1,6),S=[];for(let C=0;C<B.length;C++)b=B[C],S.push(p(b));return S}();if(g=h.match(n.longValue)){if(v=p(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const B=[];let S;for(S=0;S<=24;S+=8)B.push(v>>S&255);return B}().reverse()}else return(g=h.match(n.twoOctet))?function(){const B=g.slice(1,4),S=[];if(v=p(B[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return S.push(p(B[0])),S.push(v>>16&255),S.push(v>>8&255),S.push(v&255),S}():(g=h.match(n.threeOctet))?function(){const B=g.slice(1,5),S=[];if(v=p(B[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return S.push(p(B[0])),S.push(p(B[1])),S.push(v>>8&255),S.push(v&255),S}():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 b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let v,B;if(g.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(g[v]<<8|g[v+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(B=this.parts[v],!(0<=B&&B<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}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,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={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 B,S;for(let C=7;C>=0;C-=1)if(B=this.parts[C],B in v){if(S=v[B],b&&S!==0)return null;S!==16&&(b=!0),g+=S}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let B=0;B<v.length;B++)g=v[B],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let B=0;B<this.parts.length;B++)v.push(I(this.parts[B].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},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),b=g[0],v=g[1];return new w.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let B=0;B<this.parts.length;B++)v.push(this.parts[B].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,B=-1,S;for(;S=g.exec(b);)S[0].length>B&&(v=S.index,B=S[0].length);return B<0?b:`${b.substring(0,v)}::${b.substring(v+B)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let S=0;for(;S<16;)B.push(parseInt(b[S],10)|parseInt(v[S],10)^255),S++;return new this(B)}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,b,v,B,S;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),S=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<16;)B.push(parseInt(v[b],10)&parseInt(S[b],10)),b++;return new this(B)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},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,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return v=[this.parse(b[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,v,B,S,C;if(v=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(c.native.test(h))return d(h,8);if((v=h.match(c.transitional))&&(C=v[6]||"",g=d(v[1].slice(0,-1)+C,6),g.parts)){for(S=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<S.length;b++)if(B=S[b],!(0<=B&&B<=255))return null;return g.parts.push(S[0]<<8|S[1]),g.parts.push(S[2]<<8|S[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 b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<16&&(g[v]=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,b){let v,B,S,C;b==null&&(b="unicast");for(B in g)if(Object.prototype.hasOwnProperty.call(g,B)){for(S=g[B],S[0]&&!(S[0]instanceof Array)&&(S=[S]),v=0;v<S.length;v++)if(C=S[v],h.kind()===C[0].kind()&&h.match.apply(h,C))return B}return b},e.exports?e.exports=w:t.ipaddr=w})(Bo)})(gc);var mc=gc.exports;class bc{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 mc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=mc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Ko,zo,Go;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:m.TeletexString})],Oe.prototype,"teletexString",void 0),u([f({type:m.PrintableString})],Oe.prototype,"printableString",void 0),u([f({type:m.UniversalString})],Oe.prototype,"universalString",void 0),u([f({type:m.Utf8String})],Oe.prototype,"utf8String",void 0),u([f({type:m.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([j({type:V.Choice})],Oe);let gr=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:m.IA5String})],gr.prototype,"ia5String",void 0),u([f({type:m.Any})],gr.prototype,"anyValue",void 0),gr=u([j({type:V.Choice})],gr);class ei{constructor(t={}){this.type="",this.value=new gr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"type",void 0),u([f({type:gr})],ei.prototype,"value",void 0);let mr=Ko=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};mr=Ko=u([j({type:V.Set,itemType:ei})],mr);let Wo=zo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,zo.prototype)}};Wo=zo=u([j({type:V.Sequence,itemType:mr})],Wo);let ke=Go=class extends Wo{constructor(t){super(t),Object.setPrototypeOf(this,Go.prototype)}};ke=Go=u([j({type:V.Sequence})],ke);const ph={fromASN:e=>bc.toString(nn.fromASN(e)),toASN:e=>nn.toASN(bc.fromString(e))};class ti{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ti.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ti.prototype,"value",void 0);class Jo{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Jo.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Jo.prototype,"partyName",void 0);let oe=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ti,context:0,implicit:!0})],oe.prototype,"otherName",void 0),u([f({type:m.IA5String,context:1,implicit:!0})],oe.prototype,"rfc822Name",void 0),u([f({type:m.IA5String,context:2,implicit:!0})],oe.prototype,"dNSName",void 0),u([f({type:m.Any,context:3,implicit:!0})],oe.prototype,"x400Address",void 0),u([f({type:ke,context:4,implicit:!1})],oe.prototype,"directoryName",void 0),u([f({type:Jo,context:5})],oe.prototype,"ediPartyName",void 0),u([f({type:m.IA5String,context:6,implicit:!0})],oe.prototype,"uniformResourceIdentifier",void 0),u([f({type:m.OctetString,context:7,implicit:!0,converter:ph})],oe.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],oe.prototype,"registeredID",void 0),oe=u([j({type:V.Choice})],oe);const br="1.3.6.1.5.5.7.3",Xt="2.5.29";var Yo;class on{constructor(t={}){this.accessMethod="",this.accessLocation=new oe,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],on.prototype,"accessMethod",void 0),u([f({type:oe})],on.prototype,"accessLocation",void 0);let wc=Yo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};wc=Yo=u([j({type:V.Sequence,itemType:on})],wc);const Zo=`${Xt}.35`;class Qo extends le{}class er{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Qo,context:0,optional:!0,implicit:!0})],er.prototype,"keyIdentifier",void 0),u([f({type:oe,context:1,optional:!0,implicit:!0,repeated:"sequence"})],er.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:ye})],er.prototype,"authorityCertSerialNumber",void 0);const vc=`${Xt}.19`;class sn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],sn.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],sn.prototype,"pathLenConstraint",void 0);var Xo;let Re=Xo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};Re=Xo=u([j({type:V.Sequence,itemType:oe})],Re);var es;let kc=es=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,es.prototype)}};kc=es=u([j({type:V.Sequence})],kc);var ts;const Cc=`${Xt}.32`;let It=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],It.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],It.prototype,"visibleString",void 0),u([f({type:m.BmpString})],It.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],It.prototype,"utf8String",void 0),It=u([j({type:V.Choice})],It);class rs{constructor(t={}){this.organization=new It,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:It})],rs.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],rs.prototype,"noticeNumbers",void 0);class is{constructor(t={}){Object.assign(this,t)}}u([f({type:rs,optional:!0})],is.prototype,"noticeRef",void 0),u([f({type:It,optional:!0})],is.prototype,"explicitText",void 0);let an=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],an.prototype,"cPSuri",void 0),u([f({type:is})],an.prototype,"userNotice",void 0),an=u([j({type:V.Choice})],an);class ns{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ns.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],ns.prototype,"qualifier",void 0);class ln{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ln.prototype,"policyIdentifier",void 0),u([f({type:ns,repeated:"sequence",optional:!0})],ln.prototype,"policyQualifiers",void 0);let cn=ts=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};cn=ts=u([j({type:V.Sequence,itemType:ln})],cn);let un=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],un.prototype,"value",void 0),un=u([j({type:V.Choice})],un);let Sc=class extends un{};Sc=u([j({type:V.Choice})],Sc);var os,ot;(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"})(ot||(ot={}));class xc extends rn{toJSON(){const t=[],r=this.toNumber();return r&ot.aACompromise&&t.push("aACompromise"),r&ot.affiliationChanged&&t.push("affiliationChanged"),r&ot.cACompromise&&t.push("cACompromise"),r&ot.certificateHold&&t.push("certificateHold"),r&ot.cessationOfOperation&&t.push("cessationOfOperation"),r&ot.keyCompromise&&t.push("keyCompromise"),r&ot.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&ot.superseded&&t.push("superseded"),r&ot.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let wr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,context:0,repeated:"sequence",implicit:!0})],wr.prototype,"fullName",void 0),u([f({type:mr,context:1,implicit:!0})],wr.prototype,"nameRelativeToCRLIssuer",void 0),wr=u([j({type:V.Choice})],wr);class ri{constructor(t={}){Object.assign(this,t)}}u([f({type:wr,context:0,optional:!0})],ri.prototype,"distributionPoint",void 0),u([f({type:xc,context:1,optional:!0,implicit:!0})],ri.prototype,"reasons",void 0),u([f({type:oe,context:2,optional:!0,repeated:"sequence",implicit:!0})],ri.prototype,"cRLIssuer",void 0);let ss=os=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};ss=os=u([j({type:V.Sequence,itemType:ri})],ss);var as;let Ac=as=class extends ss{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};Ac=as=u([j({type:V.Sequence,itemType:ri})],Ac);class $e{constructor(t={}){this.onlyContainsUserCerts=$e.ONLY,this.onlyContainsCACerts=$e.ONLY,this.indirectCRL=$e.ONLY,this.onlyContainsAttributeCerts=$e.ONLY,Object.assign(this,t)}}$e.ONLY=!1,u([f({type:wr,context:0,optional:!0})],$e.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsCACerts",void 0),u([f({type:xc,context:3,optional:!0,implicit:!0})],$e.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsAttributeCerts",void 0);var ii;(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"})(ii||(ii={}));let ls=class{constructor(t=ii.unspecified){this.reason=ii.unspecified,this.reason=t}toJSON(){return ii[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],ls.prototype,"reason",void 0),ls=u([j({type:V.Choice})],ls);var cs;const Bc=`${Xt}.37`;let dn=cs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};dn=cs=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],dn);const hh=`${br}.1`,yh=`${br}.2`,gh=`${br}.3`,mh=`${br}.4`,bh=`${br}.8`,wh=`${br}.9`;let us=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:ye})],us.prototype,"value",void 0),us=u([j({type:V.Choice})],us);let ds=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],ds.prototype,"value",void 0),ds=u([j({type:V.Choice})],ds);var fs;let Ic=fs=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};Ic=fs=u([j({type:V.Sequence})],Ic);const Ec=`${Xt}.15`;var st;(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"})(st||(st={}));class ps extends rn{toJSON(){const t=this.toNumber(),r=[];return t&st.cRLSign&&r.push("crlSign"),t&st.dataEncipherment&&r.push("dataEncipherment"),t&st.decipherOnly&&r.push("decipherOnly"),t&st.digitalSignature&&r.push("digitalSignature"),t&st.encipherOnly&&r.push("encipherOnly"),t&st.keyAgreement&&r.push("keyAgreement"),t&st.keyCertSign&&r.push("keyCertSign"),t&st.keyEncipherment&&r.push("keyEncipherment"),t&st.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var hs;class fn{constructor(t={}){this.base=new oe,this.minimum=0,Object.assign(this,t)}}u([f({type:oe})],fn.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],fn.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],fn.prototype,"maximum",void 0);let pn=hs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};pn=hs=u([j({type:V.Sequence,itemType:fn})],pn);class Nc{constructor(t={}){Object.assign(this,t)}}u([f({type:pn,context:0,optional:!0,implicit:!0})],Nc.prototype,"permittedSubtrees",void 0),u([f({type:pn,context:1,optional:!0,implicit:!0})],Nc.prototype,"excludedSubtrees",void 0);class Oc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:ye})],Oc.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:ye})],Oc.prototype,"inhibitPolicyMapping",void 0);var ys;class gs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],gs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],gs.prototype,"subjectDomainPolicy",void 0);let _c=ys=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};_c=ys=u([j({type:V.Sequence,itemType:gs})],_c);var ms;const Vc=`${Xt}.17`;let bs=ms=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};bs=ms=u([j({type:V.Sequence})],bs);let Et=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Et.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],Et.prototype,"values",void 0);var ws;let Tc=ws=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};Tc=ws=u([j({type:V.Sequence,itemType:Et})],Tc);const jc=`${Xt}.14`;class Mt extends Qo{}class $c{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],$c.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],$c.prototype,"notAfter",void 0);var ni;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ni||(ni={}));class Dc extends rn{toJSON(){const t=[],r=this.toNumber();return r&ni.pKIXCertificate&&t.push("pKIXCertificate"),r&ni.newExtensions&&t.push("newExtensions"),r&ni.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Mc{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Dc,Object.assign(this,t)}}u([f({type:m.GeneralString})],Mc.prototype,"entrustVers",void 0),u([f({type:Dc})],Mc.prototype,"entrustInfoFlags",void 0);var vs;let Rc=vs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,vs.prototype)}};Rc=vs=u([j({type:V.Sequence,itemType:on})],Rc);class F{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof F&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&dl(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],F.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],F.prototype,"parameters",void 0);class Nt{constructor(t={}){this.algorithm=new F,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Nt.prototype,"algorithm",void 0),u([f({type:m.BitString})],Nt.prototype,"subjectPublicKey",void 0);let _e=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:m.UTCTime})],_e.prototype,"utcTime",void 0),u([f({type:m.GeneralizedTime})],_e.prototype,"generalTime",void 0),_e=u([j({type:V.Choice})],_e);class hn{constructor(t){this.notBefore=new _e(new Date),this.notAfter=new _e(new Date),t&&(this.notBefore=new _e(t.notBefore),this.notAfter=new _e(t.notAfter))}}u([f({type:_e})],hn.prototype,"notBefore",void 0),u([f({type:_e})],hn.prototype,"notAfter",void 0);var ks;let at=class dp{constructor(t={}){this.extnID="",this.critical=dp.CRITICAL,this.extnValue=new le,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:le})],at.prototype,"extnValue",void 0);let tr=ks=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};tr=ks=u([j({type:V.Sequence,itemType:at})],tr);var vr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(vr||(vr={}));class tt{constructor(t={}){this.version=vr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new F,this.issuer=new ke,this.validity=new hn,this.subject=new ke,this.subjectPublicKeyInfo=new Nt,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:vr.v1})],tt.prototype,"version",void 0),u([f({type:m.Integer,converter:ye})],tt.prototype,"serialNumber",void 0),u([f({type:F})],tt.prototype,"signature",void 0),u([f({type:ke})],tt.prototype,"issuer",void 0),u([f({type:hn})],tt.prototype,"validity",void 0),u([f({type:ke})],tt.prototype,"subject",void 0),u([f({type:Nt})],tt.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],tt.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],tt.prototype,"subjectUniqueID",void 0),u([f({type:tr,context:3,optional:!0})],tt.prototype,"extensions",void 0);class kr{constructor(t={}){this.tbsCertificate=new tt,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:tt})],kr.prototype,"tbsCertificate",void 0),u([f({type:F})],kr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],kr.prototype,"signatureValue",void 0);class yn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],yn.prototype,"userCertificate",void 0),u([f({type:_e})],yn.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],yn.prototype,"crlEntryExtensions",void 0);class Ot{constructor(t={}){this.signature=new F,this.issuer=new ke,this.thisUpdate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],Ot.prototype,"version",void 0),u([f({type:F})],Ot.prototype,"signature",void 0),u([f({type:ke})],Ot.prototype,"issuer",void 0),u([f({type:_e})],Ot.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Ot.prototype,"nextUpdate",void 0),u([f({type:yn,repeated:"sequence",optional:!0})],Ot.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],Ot.prototype,"crlExtensions",void 0);let Cs=class{constructor(t={}){this.tbsCertList=new Ot,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Ot})],Cs.prototype,"tbsCertList",void 0),u([f({type:F})],Cs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],Cs.prototype,"signature",void 0);class Cr{constructor(t={}){this.issuer=new ke,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ke})],Cr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:ye})],Cr.prototype,"serialNumber",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Sr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],Sr.prototype,"issuerAndSerialNumber",void 0),Sr=u([j({type:V.Choice})],Sr);var _t;(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"})(_t||(_t={}));let oi=class extends F{};oi=u([j({type:V.Sequence})],oi);let gn=class extends F{};gn=u([j({type:V.Sequence})],gn);let yt=class extends F{};yt=u([j({type:V.Sequence})],yt);let mn=class extends F{};mn=u([j({type:V.Sequence})],mn);let Pc=class extends F{};Pc=u([j({type:V.Sequence})],Pc);let Ss=class extends F{};Ss=u([j({type:V.Sequence})],Ss);let xr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],xr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],xr.prototype,"attrValues",void 0);var xs;class gt{constructor(t={}){this.version=_t.v0,this.sid=new Sr,this.digestAlgorithm=new oi,this.signatureAlgorithm=new gn,this.signature=new le,Object.assign(this,t)}}u([f({type:m.Integer})],gt.prototype,"version",void 0),u([f({type:Sr})],gt.prototype,"sid",void 0),u([f({type:oi})],gt.prototype,"digestAlgorithm",void 0),u([f({type:xr,repeated:"set",context:0,implicit:!0,optional:!0})],gt.prototype,"signedAttrs",void 0),u([f({type:gn})],gt.prototype,"signatureAlgorithm",void 0),u([f({type:le})],gt.prototype,"signature",void 0),u([f({type:xr,repeated:"set",context:1,implicit:!0,optional:!0})],gt.prototype,"unsignedAttrs",void 0);let bn=xs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};bn=xs=u([j({type:V.Set,itemType:gt})],bn);let Uc=class extends _e{};Uc=u([j({type:V.Choice})],Uc);let Lc=class extends gt{};Lc=u([j({type:V.Sequence})],Lc);class As{constructor(t={}){this.acIssuer=new oe,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:oe})],As.prototype,"acIssuer",void 0),u([f({type:m.Integer})],As.prototype,"acSerial",void 0),u([f({type:Et,repeated:"sequence"})],As.prototype,"attrs",void 0);var Bs;let wn=Bs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Bs.prototype)}};wn=Bs=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],wn);class vn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],vn.prototype,"pathLenConstraint",void 0),u([f({type:wn,implicit:!0,context:0,optional:!0})],vn.prototype,"permittedAttrs",void 0),u([f({type:wn,implicit:!0,context:1,optional:!0})],vn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],vn.prototype,"permitUnSpecified",void 0);class rr{constructor(t={}){this.issuer=new Re,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Re})],rr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:ye})],rr.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],rr.prototype,"issuerUID",void 0);var Is;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(Is||(Is={}));class ir{constructor(t={}){this.digestedObjectType=Is.publicKey,this.digestAlgorithm=new F,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],ir.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],ir.prototype,"otherObjectTypeID",void 0),u([f({type:F})],ir.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],ir.prototype,"objectDigest",void 0);class kn{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,optional:!0})],kn.prototype,"issuerName",void 0),u([f({type:rr,context:0,implicit:!0,optional:!0})],kn.prototype,"baseCertificateID",void 0),u([f({type:ir,context:1,implicit:!0,optional:!0})],kn.prototype,"objectDigestInfo",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,repeated:"sequence"})],Ar.prototype,"v1Form",void 0),u([f({type:kn,context:0,implicit:!0})],Ar.prototype,"v2Form",void 0),Ar=u([j({type:V.Choice})],Ar);class Cn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],Cn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],Cn.prototype,"notAfterTime",void 0);class si{constructor(t={}){Object.assign(this,t)}}u([f({type:rr,implicit:!0,context:0,optional:!0})],si.prototype,"baseCertificateID",void 0),u([f({type:Re,implicit:!0,context:1,optional:!0})],si.prototype,"entityName",void 0),u([f({type:ir,implicit:!0,context:2,optional:!0})],si.prototype,"objectDigestInfo",void 0);var Es;(function(e){e[e.v2=1]="v2"})(Es||(Es={}));class lt{constructor(t={}){this.version=Es.v2,this.holder=new si,this.issuer=new Ar,this.signature=new F,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Cn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],lt.prototype,"version",void 0),u([f({type:si})],lt.prototype,"holder",void 0),u([f({type:Ar})],lt.prototype,"issuer",void 0),u([f({type:F})],lt.prototype,"signature",void 0),u([f({type:m.Integer,converter:ye})],lt.prototype,"serialNumber",void 0),u([f({type:Cn})],lt.prototype,"attrCertValidityPeriod",void 0),u([f({type:Et,repeated:"sequence"})],lt.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],lt.prototype,"issuerUniqueID",void 0),u([f({type:tr,optional:!0})],lt.prototype,"extensions",void 0);class Sn{constructor(t={}){this.acinfo=new lt,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:lt})],Sn.prototype,"acinfo",void 0),u([f({type:F})],Sn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],Sn.prototype,"signatureValue",void 0);var xn;(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"})(xn||(xn={}));class Ns extends rn{}class Os{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Os.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Os.prototype,"value",void 0);class _s{constructor(t={}){this.policyId="",this.classList=new Ns(xn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],_s.prototype,"policyId",void 0),u([f({type:Ns,defaultValue:new Ns(xn.unclassified)})],_s.prototype,"classList",void 0),u([f({type:Os,repeated:"set"})],_s.prototype,"securityCategories",void 0);class An{constructor(t={}){Object.assign(this,t)}}u([f({type:le})],An.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],An.prototype,"oid",void 0),u([f({type:m.Utf8String})],An.prototype,"string",void 0);class Hc{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],Hc.prototype,"policyAuthority",void 0),u([f({type:An,repeated:"sequence"})],Hc.prototype,"values",void 0);var Vs;class Bn{constructor(t={}){this.targetCertificate=new rr,Object.assign(this,t)}}u([f({type:rr})],Bn.prototype,"targetCertificate",void 0),u([f({type:oe,optional:!0})],Bn.prototype,"targetName",void 0),u([f({type:ir,optional:!0})],Bn.prototype,"certDigestInfo",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,context:0,implicit:!0})],Br.prototype,"targetName",void 0),u([f({type:oe,context:1,implicit:!0})],Br.prototype,"targetGroup",void 0),u([f({type:Bn,context:2,implicit:!0})],Br.prototype,"targetCert",void 0),Br=u([j({type:V.Choice})],Br);let Ts=Vs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Vs.prototype)}};Ts=Vs=u([j({type:V.Sequence,itemType:Br})],Ts);var js;let Fc=js=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};Fc=js=u([j({type:V.Sequence,itemType:Ts})],Fc);class qc{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],qc.prototype,"roleAuthority",void 0),u([f({type:oe,implicit:!0,context:1})],qc.prototype,"roleName",void 0);class $s{constructor(t={}){this.service=new oe,this.ident=new oe,Object.assign(this,t)}}u([f({type:oe})],$s.prototype,"service",void 0),u([f({type:oe})],$s.prototype,"ident",void 0),u([f({type:le,optional:!0})],$s.prototype,"authInfo",void 0);var Ds;class Ms{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ms.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Ms.prototype,"otherCert",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:kr})],Ir.prototype,"certificate",void 0),u([f({type:Sn,context:2,implicit:!0})],Ir.prototype,"v2AttrCert",void 0),u([f({type:Ms,context:3,implicit:!0})],Ir.prototype,"other",void 0),Ir=u([j({type:V.Choice})],Ir);let In=Ds=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ds.prototype)}};In=Ds=u([j({type:V.Set,itemType:Ir})],In);class Er{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Er.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Er.prototype,"content",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:le})],ai.prototype,"single",void 0),u([f({type:m.Any})],ai.prototype,"any",void 0),ai=u([j({type:V.Choice})],ai);class En{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],En.prototype,"eContentType",void 0),u([f({type:ai,context:0,optional:!0})],En.prototype,"eContent",void 0);let li=class{constructor(t={}){Object.assign(this,t)}};u([f({type:le,context:0,implicit:!0,optional:!0})],li.prototype,"value",void 0),u([f({type:le,converter:Jp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],li.prototype,"constructedValue",void 0),li=u([j({type:V.Choice})],li);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new mn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:mn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:li,optional:!0})],ci.prototype,"encryptedContent",void 0);class Nn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Nn.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],Nn.prototype,"keyAttr",void 0);var Rs;class On{constructor(t={}){this.subjectKeyIdentifier=new Mt,Object.assign(this,t)}}u([f({type:Mt})],On.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],On.prototype,"date",void 0),u([f({type:Nn,optional:!0})],On.prototype,"other",void 0);let Nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:On,context:0,implicit:!0,optional:!0})],Nr.prototype,"rKeyId",void 0),u([f({type:Cr,optional:!0})],Nr.prototype,"issuerAndSerialNumber",void 0),Nr=u([j({type:V.Choice})],Nr);class Ps{constructor(t={}){this.rid=new Nr,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:Nr})],Ps.prototype,"rid",void 0),u([f({type:le})],Ps.prototype,"encryptedKey",void 0);let _n=Rs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};_n=Rs=u([j({type:V.Sequence,itemType:Ps})],_n);class Us{constructor(t={}){this.algorithm=new F,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Us.prototype,"algorithm",void 0),u([f({type:m.BitString})],Us.prototype,"publicKey",void 0);let nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0,optional:!0})],nr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Us,context:1,implicit:!0,optional:!0})],nr.prototype,"originatorKey",void 0),u([f({type:Cr,optional:!0})],nr.prototype,"issuerAndSerialNumber",void 0),nr=u([j({type:V.Choice})],nr);class Or{constructor(t={}){this.version=_t.v3,this.originator=new nr,this.keyEncryptionAlgorithm=new yt,this.recipientEncryptedKeys=new _n,Object.assign(this,t)}}u([f({type:m.Integer})],Or.prototype,"version",void 0),u([f({type:nr,context:0})],Or.prototype,"originator",void 0),u([f({type:le,context:1,optional:!0})],Or.prototype,"ukm",void 0),u([f({type:yt})],Or.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:_n})],Or.prototype,"recipientEncryptedKeys",void 0);let _r=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],_r.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],_r.prototype,"issuerAndSerialNumber",void 0),_r=u([j({type:V.Choice})],_r);class ui{constructor(t={}){this.version=_t.v0,this.rid=new _r,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],ui.prototype,"version",void 0),u([f({type:_r})],ui.prototype,"rid",void 0),u([f({type:yt})],ui.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],ui.prototype,"encryptedKey",void 0);class di{constructor(t={}){this.keyIdentifier=new le,Object.assign(this,t)}}u([f({type:le})],di.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],di.prototype,"date",void 0),u([f({type:Nn,optional:!0})],di.prototype,"other",void 0);class fi{constructor(t={}){this.version=_t.v4,this.kekid=new di,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:di})],fi.prototype,"kekid",void 0),u([f({type:yt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.version=_t.v0,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],pi.prototype,"version",void 0),u([f({type:Ss,context:0,optional:!0})],pi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:yt})],pi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],pi.prototype,"encryptedKey",void 0);class Ls{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ls.prototype,"oriType",void 0),u([f({type:m.Any})],Ls.prototype,"oriValue",void 0);let Rt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ui,optional:!0})],Rt.prototype,"ktri",void 0),u([f({type:Or,context:1,implicit:!0,optional:!0})],Rt.prototype,"kari",void 0),u([f({type:fi,context:2,implicit:!0,optional:!0})],Rt.prototype,"kekri",void 0),u([f({type:pi,context:3,implicit:!0,optional:!0})],Rt.prototype,"pwri",void 0),u([f({type:Ls,context:4,implicit:!0,optional:!0})],Rt.prototype,"ori",void 0),Rt=u([j({type:V.Choice})],Rt);var Hs;let Vn=Hs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Hs.prototype)}};Vn=Hs=u([j({type:V.Set,itemType:Rt})],Vn);var Fs;class Tn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Tn.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],Tn.prototype,"otherRevInfo",void 0);let hi=class{constructor(t={}){this.other=new Tn,Object.assign(this,t)}};u([f({type:Tn,context:1,implicit:!0})],hi.prototype,"other",void 0),hi=u([j({type:V.Choice})],hi);let qs=Fs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Fs.prototype)}};qs=Fs=u([j({type:V.Set,itemType:hi})],qs);class Ks{constructor(t={}){Object.assign(this,t)}}u([f({type:In,context:0,implicit:!0,optional:!0})],Ks.prototype,"certs",void 0),u([f({type:qs,context:1,implicit:!0,optional:!0})],Ks.prototype,"crls",void 0);var zs;let Gs=zs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Gs=zs=u([j({type:V.Set,itemType:xr})],Gs);class yi{constructor(t={}){this.version=_t.v0,this.recipientInfos=new Vn,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:m.Integer})],yi.prototype,"version",void 0),u([f({type:Ks,context:0,implicit:!0,optional:!0})],yi.prototype,"originatorInfo",void 0),u([f({type:Vn})],yi.prototype,"recipientInfos",void 0),u([f({type:ci})],yi.prototype,"encryptedContentInfo",void 0),u([f({type:Gs,context:1,implicit:!0,optional:!0})],yi.prototype,"unprotectedAttrs",void 0);const vh="1.2.840.113549.1.7.2";var Ws;let jn=Ws=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};jn=Ws=u([j({type:V.Set,itemType:oi})],jn);class Vr{constructor(t={}){this.version=_t.v0,this.digestAlgorithms=new jn,this.encapContentInfo=new En,this.signerInfos=new bn,Object.assign(this,t)}}u([f({type:m.Integer})],Vr.prototype,"version",void 0),u([f({type:jn})],Vr.prototype,"digestAlgorithms",void 0),u([f({type:En})],Vr.prototype,"encapContentInfo",void 0),u([f({type:In,context:0,implicit:!0,optional:!0})],Vr.prototype,"certificates",void 0),u([f({type:hi,context:1,implicit:!0,optional:!0})],Vr.prototype,"crls",void 0),u([f({type:bn})],Vr.prototype,"signerInfos",void 0);const gi="1.2.840.10045.2.1",Js="1.2.840.10045.4.1",Kc="1.2.840.10045.4.3.1",Ys="1.2.840.10045.4.3.2",Zs="1.2.840.10045.4.3.3",Qs="1.2.840.10045.4.3.4",zc="1.2.840.10045.3.1.7",Gc="1.3.132.0.34",Wc="1.3.132.0.35";function mi(e){return new F({algorithm:e})}const kh=mi(Js);mi(Kc);const Ch=mi(Ys),Sh=mi(Zs),xh=mi(Qs);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Tr.prototype,"namedCurve",void 0),Tr=u([j({type:V.Choice})],Tr);class $n{constructor(t={}){this.version=1,this.privateKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],$n.prototype,"version",void 0),u([f({type:le})],$n.prototype,"privateKey",void 0),u([f({type:Tr,context:0,optional:!0})],$n.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],$n.prototype,"publicKey",void 0);class Dn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],Dn.prototype,"r",void 0),u([f({type:m.Integer,converter:ye})],Dn.prototype,"s",void 0);const Fe="1.2.840.113549.1.1",jr=`${Fe}.1`,Ah=`${Fe}.7`,Bh=`${Fe}.9`,Ih=`${Fe}.10`,Eh=`${Fe}.2`,Nh=`${Fe}.4`,Mn=`${Fe}.5`,Oh=`${Fe}.14`,Xs=`${Fe}.11`,Rn=`${Fe}.12`,Pn=`${Fe}.13`,Jc=`${Fe}.15`,Yc=`${Fe}.16`,Zc="1.3.14.3.2.26",Qc="2.16.840.1.101.3.4.2.4",Xc="2.16.840.1.101.3.4.2.1",eu="2.16.840.1.101.3.4.2.2",tu="2.16.840.1.101.3.4.2.3",_h="2.16.840.1.101.3.4.2.5",Vh="2.16.840.1.101.3.4.2.6",Th="1.2.840.113549.2.2",jh="1.2.840.113549.2.5",ea=`${Fe}.8`;function Ce(e){return new F({algorithm:e,parameters:null})}Ce(Th),Ce(jh);const or=Ce(Zc);Ce(Qc),Ce(Xc),Ce(eu),Ce(tu),Ce(_h),Ce(Vh);const ru=new F({algorithm:ea,parameters:z.serialize(or)}),iu=new F({algorithm:Bh,parameters:z.serialize(nn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ce(jr),Ce(Eh),Ce(Nh),Ce(Mn),Ce(Jc),Ce(Yc),Ce(Rn),Ce(Pn),Ce(Jc),Ce(Yc);class Un{constructor(t={}){this.hashAlgorithm=new F(or),this.maskGenAlgorithm=new F({algorithm:ea,parameters:z.serialize(or)}),this.pSourceAlgorithm=new F(iu),Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:or})],Un.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:ru})],Un.prototype,"maskGenAlgorithm",void 0),u([f({type:F,context:2,defaultValue:iu})],Un.prototype,"pSourceAlgorithm",void 0),new F({algorithm:Ah,parameters:z.serialize(new Un)});class bi{constructor(t={}){this.hashAlgorithm=new F(or),this.maskGenAlgorithm=new F({algorithm:ea,parameters:z.serialize(or)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:or})],bi.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:ru})],bi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],bi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],bi.prototype,"trailerField",void 0),new F({algorithm:Ih,parameters:z.serialize(new bi)});class Ln{constructor(t={}){this.digestAlgorithm=new F,this.digest=new le,Object.assign(this,t)}}u([f({type:F})],Ln.prototype,"digestAlgorithm",void 0),u([f({type:le})],Ln.prototype,"digest",void 0);var ta;class Hn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],Hn.prototype,"prime",void 0),u([f({type:m.Integer,converter:ye})],Hn.prototype,"exponent",void 0),u([f({type:m.Integer,converter:ye})],Hn.prototype,"coefficient",void 0);let ra=ta=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};ra=ta=u([j({type:V.Sequence,itemType:Hn})],ra);class mt{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:m.Integer})],mt.prototype,"version",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"coefficient",void 0),u([f({type:ra,optional:!0})],mt.prototype,"otherPrimeInfos",void 0);class ia{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],ia.prototype,"modulus",void 0),u([f({type:m.Integer,converter:ye})],ia.prototype,"publicExponent",void 0);var na;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(na||(na={}));const qe=na;/*! *****************************************************************************
|
|
75
|
+
`)}`:`${r} :`}}Al=Fe,P.Constructed=Al,Fe.NAME="CONSTRUCTED";class Bl extends Re{fromBER(t,r,n){return r}toBER(t){return ot}}Bl.override="EndOfContentValueBlock";var Il;class $o extends Ne{constructor(t={}){super(t,Bl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}Il=$o,P.EndOfContent=Il,$o.NAME=Qr;var El;class Jt extends Ne{constructor(t={}){super(t,Re),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}`}}El=Jt,P.Null=El,Jt.NAME="NULL";class Nl extends ht(Re){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=R.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=R.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,yl.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Nl.NAME="BooleanValueBlock";var Ol;let Fi=class extends Ne{constructor(t={}){super(t,Nl),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}`}};Ol=Fi,P.Boolean=Ol,Fi.NAME="BOOLEAN";class _l extends ht(Rt){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=Rt.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===Qr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==bl)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?Rt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}_l.NAME="OctetStringValueBlock";var Vl;let Yt=class hp extends Ne{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},_l),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?Fe.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof hp&&t.push(r.valueBlock.valueHexView);return R.concat(t)}};Vl=Yt,P.OctetString=Vl,Yt.NAME=bl;class Tl extends ht(Rt){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=Rt.prototype.fromBER.call(this,t,r,n),o===-1)return o;for(const l of this.value){const c=l.constructor.NAME;if(c===Qr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==wl)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=l.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=R.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 l=a.subarray(1);try{if(l.byteLength){const c=yr(l,0,l.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+n}toBER(t,r){if(this.isConstructed)return Rt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return ot;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}}}Tl.NAME="BitStringValueBlock";var jl;let Zt=class extends Ne{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},Tl),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 Fe.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)}`}}};jl=Zt,P.BitString=jl,Zt.NAME=wl;var $l;function Fp(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,l=o.slice(0),c=l.length-1;let d=0;const y=c<a?a:c;let f=0;for(let x=y;x>=0;x--,f++){switch(!0){case f<l.length:d=s[a-f]+l[c-f]+r[0];break;default:d=s[a-f]+r[0]}switch(r[0]=d/10,!0){case f>=s.length:s=_o(new Uint8Array([d%10]),s);break;default:s[a-f]=d%10}}return r[0]>0&&(s=_o(r,s)),s}function Dl(e){if(e>=Zr.length)for(let t=Zr.length;t<=e;t++){const r=new Uint8Array([0]);let n=Zr[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=_o(r,n)),Zr.push(n)}return Zr[e]}function qp(e,t){let r=0;const n=new Uint8Array(e),o=new Uint8Array(t),s=n.slice(0),a=s.length-1,l=o.slice(0),c=l.length-1;let d,y=0;for(let f=c;f>=0;f--,y++)switch(d=s[a-y]-l[c-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 f=a-c+1;f>=0;f--,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 Do extends ht(Re){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=yl.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(_p(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="",l=!1;for(let c=s.byteLength-1;c>=0;c--){o=s[c];for(let d=0;d<8;d++){if((o&1)===1)switch(n){case t:r=qp(Dl(n),r),a="-";break;default:r=Fp(r,Dl(n))}n++,o>>=1}}for(let c=0;c<r.length;c++)r[c]&&(l=!0),l&&(a+=gl.charAt(r[c]));return l===!1&&(a+=gl.charAt(0)),a}}$l=Do,Do.NAME="IntegerValueBlock",Object.defineProperty($l.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Rl;class yt extends Ne{constructor(t={}){super(t,Do),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ui(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Ui();const r=BigInt(t),n=new Li,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const l=new Uint8Array(s.length+(s[0]&128?1:0));l[0]|=128;const d=BigInt(`0x${L.ToHex(l)}`)+r,y=R.toUint8Array(L.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()}`}}Rl=yt,P.Integer=Rl,yt.NAME="INTEGER";var Ml;class qi extends yt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ml=qi,P.Enumerated=Ml,qi.NAME="ENUMERATED";class Ro extends ht(Re){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=R.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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){Ui();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",ot;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=L.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}Ro.NAME="sidBlock";class Pl extends Re{constructor({value:t=He,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new Ro;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,ot;r.push(o)}return Vo(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 l=0;switch(a.valueDec){case 0:break;case 1:l=40;break;case 2:l=80;break;default:this.value=[];return}const c=parseInt(o,10);if(isNaN(c))return;a.valueDec=c+l,s=!1}else{const a=new Ro;if(o>Number.MAX_SAFE_INTEGER){Ui();const l=BigInt(o);a.valueBigInt=l}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}}Pl.NAME="ObjectIdentifierValueBlock";var Ul;class Ki extends Ne{constructor(t={}){super(t,Pl),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()}}}Ul=Ki,P.ObjectIdentifier=Ul,Ki.NAME="OBJECT IDENTIFIER";class Mo extends ht(Wt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,n){if(n===0)return r;const o=R.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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",ot;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=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Mo.NAME="relativeSidBlock";class Ll extends Re{constructor({value:t=He,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new Mo;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,ot;n.push(s)}return Vo(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 Mo;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}}Ll.NAME="RelativeObjectIdentifierValueBlock";var Hl;class Po extends Ne{constructor(t={}){super(t,Ll),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()}}}Hl=Po,P.RelativeObjectIdentifier=Hl,Po.NAME="RelativeObjectIdentifier";var Fl;class xt extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Fl=xt,P.Sequence=Fl,xt.NAME="SEQUENCE";var ql;let At=class extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};ql=At,P.Set=ql,At.NAME="SET";class Kl extends ht(Re){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=He}toJSON(){return{...super.toJSON(),value:this.value}}}Kl.NAME="StringValueBlock";class zl extends Kl{}zl.NAME="SimpleStringValueBlock";class Ye extends jo{constructor({...t}={}){super(t,zl)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,R.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}}Ye.NAME="SIMPLE STRING";class Gl extends Ye{fromBuffer(t){this.valueBlock.valueHexView=R.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}Gl.NAME="Utf8StringValueBlock";var Wl;class Bt extends Gl{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Wl=Bt,P.Utf8String=Wl,Bt.NAME="UTF8String";class Jl extends Ye{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=R.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}Jl.NAME="BmpStringValueBlock";var Yl;class zi extends Jl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Yl=zi,P.BmpString=Yl,zi.NAME="BMPString";class Zl extends Ye{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 l=4-a.length;for(let c=a.length-1;c>=0;c--)n[o*4+c+l]=a[c]}this.valueBlock.value=t}}Zl.NAME="UniversalStringValueBlock";var Ql;class Gi extends Zl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Ql=Gi,P.UniversalString=Ql,Gi.NAME="UniversalString";var Xl;class Wi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Xl=Wi,P.NumericString=Xl,Wi.NAME="NumericString";var ec;class Ji extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}ec=Ji,P.PrintableString=ec,Ji.NAME="PrintableString";var tc;class Yi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}tc=Yi,P.TeletexString=tc,Yi.NAME="TeletexString";var rc;class Zi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}rc=Zi,P.VideotexString=rc,Zi.NAME="VideotexString";var ic;class Qi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}ic=Qi,P.IA5String=ic,Qi.NAME="IA5String";var nc;class Xi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}nc=Xi,P.GraphicString=nc,Xi.NAME="GraphicString";var oc;class ei extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}oc=ei,P.VisibleString=oc,ei.NAME="VisibleString";var sc;class en extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}sc=en,P.GeneralString=sc,en.NAME="GeneralString";var ac;class tn extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}ac=tn,P.CharacterString=ac,tn.NAME="CharacterString";var lc;class ti extends ei{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,R.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]=Je(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Je(this.month,2),r[2]=Je(this.day,2),r[3]=Je(this.hour,2),r[4]=Je(this.minute,2),r[5]=Je(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}}}lc=ti,P.UTCTime=lc,ti.NAME="UTCTime";var cc;class rn extends ti{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,l=0,c=0;if(t[t.length-1]==="Z")n=t.substring(0,t.length-1),r=!0;else{const f=new Number(t[t.length-1]);if(isNaN(f.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 f=1,x=n.indexOf("+"),m="";if(x===-1&&(x=n.indexOf("-"),f=-1),x!==-1){if(m=n.substring(x+1),n=n.substring(0,x),m.length!==2&&m.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(m.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(l=f*h,m.length===4){if(h=parseInt(m.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");c=f*h}}}let d=n.indexOf(".");if(d===-1&&(d=n.indexOf(",")),d!==-1){const f=new Number(`0${n.substring(d)}`);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");s=f.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 f=60*s;this.minute=Math.floor(f),f=60*(f-this.minute),this.second=Math.floor(f),f=1e3*(f-this.second),this.millisecond=Math.floor(f)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let f=60*s;this.second=Math.floor(f),f=1e3*(f-this.second),this.millisecond=Math.floor(f)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const f=1e3*s;this.millisecond=Math.floor(f)}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 f=1;f<y.length;f++)switch(f){case 1:this.year=parseInt(y[f],10);break;case 2:this.month=parseInt(y[f],10);break;case 3:this.day=parseInt(y[f],10);break;case 4:this.hour=parseInt(y[f],10)+l;break;case 5:this.minute=parseInt(y[f],10)+c;break;case 6:this.second=parseInt(y[f],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const f=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=f.getUTCFullYear(),this.month=f.getUTCMonth(),this.day=f.getUTCDay(),this.hour=f.getUTCHours(),this.minute=f.getUTCMinutes(),this.second=f.getUTCSeconds(),this.millisecond=f.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Je(this.year,4)),r.push(Je(this.month,2)),r.push(Je(this.day,2)),r.push(Je(this.hour,2)),r.push(Je(this.minute,2)),r.push(Je(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Je(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}cc=rn,P.GeneralizedTime=cc,rn.NAME="GeneralizedTime";var uc;class Uo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}uc=Uo,P.DATE=uc,Uo.NAME="DATE";var dc;class Lo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}dc=Lo,P.TimeOfDay=dc,Lo.NAME="TimeOfDay";var fc;class Ho extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}fc=Ho,P.DateTime=fc,Ho.NAME="DateTime";var pc;class Fo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}pc=Fo,P.Duration=pc,Fo.NAME="Duration";var hc;class qo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}hc=qo,P.TIME=hc,qo.NAME="TIME";class Qt{constructor({name:t=He,optional:r=!1}={}){this.name=t,this.optional=r}}class Ko extends Qt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class nn extends Qt{constructor({value:t=new Qt,local:r=!1,...n}={}){super(n),this.value=t,this.local=r}}class Kp{constructor({data:t=Hi}={}){this.dataView=R.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=R.toUint8Array(t)}fromBER(t,r,n){const o=r+n;return this.dataView=R.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Xt(e,t,r){if(r instanceof Ko){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(To)&&(s.name=r.name),s}}if(r instanceof Qt)return r.hasOwnProperty(To)&&(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(!(jp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Mp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Pp 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($p)===!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(Dp)===!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(Rp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Tp 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(!(ml 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 l=0;l<s.length;l++)if(s[l]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,He),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},l=r.valueBlock.value.length;if(l>0&&r.valueBlock.value[0]instanceof nn&&(l=t.valueBlock.value.length),l===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,He),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let c=0;c<l;c++)if(c-s>=t.valueBlock.value.length){if(r.valueBlock.value[c].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,He),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof nn){if(a=Xt(e,t.valueBlock.value[c],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,He),r.name&&delete e[r.name]),a;if(To in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};Up 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[c])}}else if(a=Xt(e,t.valueBlock.value[c-s],r.valueBlock.value[c]),a.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,He),r.name&&delete e[r.name]),a;if(a.verified===!1){const c={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,He),r.name&&(delete e[r.name],c.name=r.name)),c}return{verified:!0,result:e}}if(r.primitiveSchema&&ml 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,He),r.name&&(delete e[r.name],a.name=r.name)),a}return Xt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function zp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=yr(R.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Xt(r.result,r.result,t)}const yc=Object.freeze(Object.defineProperty({__proto__:null,Any:Qt,BaseBlock:Ne,BaseStringBlock:jo,BitString:Zt,BmpString:zi,Boolean:Fi,CharacterString:tn,Choice:Ko,Constructed:Fe,DATE:Uo,DateTime:Ho,Duration:Fo,EndOfContent:$o,Enumerated:qi,GeneralString:en,GeneralizedTime:rn,GraphicString:Xi,HexBlock:ht,IA5String:Qi,Integer:yt,Null:Jt,NumericString:Wi,ObjectIdentifier:Ki,OctetString:Yt,Primitive:Xr,PrintableString:Ji,RawData:Kp,RelativeObjectIdentifier:Po,Repeated:nn,Sequence:xt,Set:At,TIME:qo,TeletexString:Yi,TimeOfDay:Lo,UTCTime:ti,UniversalString:Gi,Utf8String:Bt,ValueBlock:Re,VideotexString:Zi,ViewWriter:Li,VisibleString:ei,compareSchema:Xt,fromBER:gr,verifySchema:zp},Symbol.toStringTag,{value:"Module"}));var V;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(V||(V={}));var w;(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"})(w||(w={}));class on{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(R.isBufferSource(t))this.unusedBits=r,this.value=R.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 le{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):R.isBufferSource(t)?this.buffer=R.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 Gp={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}},Wp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new yt({value:+e})},Jp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new qi({value:e})},ye={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new yt({valueHex:e})},Yp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Zt({valueHex:e})},Zp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Ki({value:e})},Qp={fromASN:e=>e.valueBlock.value,toASN:e=>new Fi({value:e})},sn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},Xp={fromASN:e=>new le(e.getValue()),toASN:e=>e.toASN()};function et(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const gc=et(Bt),eh=et(zi),th=et(Gi),rh=et(Wi),ih=et(Ji),nh=et(Yi),oh=et(Zi),sh=et(Qi),ah=et(Xi),lh=et(ei),ch=et(en),uh=et(tn),dh={fromASN:e=>e.toDate(),toASN:e=>new ti({valueDate:e})},fh={fromASN:e=>e.toDate(),toASN:e=>new rn({valueDate:e})},ph={fromASN:()=>null,toASN:()=>new Jt};function zo(e){switch(e){case w.Any:return Gp;case w.BitString:return Yp;case w.BmpString:return eh;case w.Boolean:return Qp;case w.CharacterString:return uh;case w.Enumerated:return Jp;case w.GeneralString:return ch;case w.GeneralizedTime:return fh;case w.GraphicString:return ah;case w.IA5String:return sh;case w.Integer:return Wp;case w.Null:return ph;case w.NumericString:return rh;case w.ObjectIdentifier:return Zp;case w.OctetString:return sn;case w.PrintableString:return ih;case w.TeletexString:return nh;case w.UTCTime:return dh;case w.UniversalString:return th;case w.Utf8String:return gc;case w.VideotexString:return oh;case w.VisibleString:return lh;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 mc(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:mc(r)}return!1}function hh(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 yh{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:V.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],l=r?s:"";let c;if(typeof a.type=="number"){const y=w[a.type],f=yc[y];if(!f)throw new Error(`Cannot get ASN1 class by name '${y}'`);c=new f({name:l})}else It(a.type)?c=new a.type().toSchema(l):a.optional?this.get(a.type).type===V.Choice?c=new Qt({name:l}):(c=this.create(a.type,!1),c.name=l):c=new Qt({name:l});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){c.name="";const y=a.repeated==="set"?At:xt;c=new y({name:"",value:[new nn({name:l,value:c})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||It(a.type)){const y=a.repeated?Fe:Xr;o.push(new y({name:l,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let f=y?c:this.get(a.type,!0).schema;f="valueBlock"in f?f.valueBlock.value:f.value,o.push(new Fe({name:y?"":l,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:f}))}else o.push(new Fe({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else c.optional=d,o.push(c)}switch(n.type){case V.Sequence:return new xt({value:o,name:""});case V.Set:return new At({value:o,name:""});case V.Choice:return new Ko({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 tt=new yh,j=e=>t=>{let r;tt.has(t)?r=tt.get(t):(r=tt.createDefault(t),tt.set(t,r)),Object.assign(r,e)},p=e=>(t,r)=>{let n;tt.has(t.constructor)?n=tt.get(t.constructor):(n=tt.createDefault(t.constructor),tt.set(t.constructor,n));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=zo(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 bc extends Error{constructor(){super(...arguments),this.schemas=[]}}class gh{static parse(t,r){const n=gr(t);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r)}static fromASN(t,r){var n;try{if(It(r))return new r().fromASN(t);const o=tt.get(r);tt.cache(r);let s=o.schema;if(t.constructor===Fe&&o.type!==V.Choice){s=new Fe({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const c in o.items)delete t[c]}const a=Xt({},t,s);if(!a.verified)throw new bc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const l=new r;if(mc(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 c=o.itemType;if(typeof c=="number"){const d=zo(c);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,c))}for(const c in o.items){const d=a.result[c];if(!d)continue;const y=o.items[c],f=y.type;if(typeof f=="number"||It(f)){const x=(n=y.converter)!==null&&n!==void 0?n:It(f)?new f:null;if(!x)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const m=y.repeated==="sequence"?xt:At,h=new m;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 b=g.result.valueBlock.value;l[c]=Array.from(b,v=>x.fromASN(v))}else l[c]=Array.from(d,m=>x.fromASN(m));else{let m=d;if(y.implicit){let h;if(It(f))h=new f().toSchema("");else{const g=w[f],b=yc[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=m.valueBlock,m=gr(h.toBER(!1)).result}l[c]=x.fromASN(m)}}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.");l[c]=Array.from(d,x=>this.fromASN(x,f))}else l[c]=this.fromASN(d,f)}return l}catch(o){throw o instanceof bc&&o.schemas.push(r.name),o}}}class Go{static serialize(t){return t instanceof Ne?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=tt.get(r);tt.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=zo(n.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(l=>a.toASN(l))}else o=t.map(a=>this.toAsnItem({type:n.itemType},"[]",r,a))}else for(const a in n.items){const l=n.items[a],c=t[a];if(c===void 0||l.defaultValue===c||typeof l.defaultValue=="object"&&typeof c=="object"&&hh(this.serialize(l.defaultValue),this.serialize(c)))continue;const d=Go.toAsnItem(l,a,r,c);if(typeof l.context=="number")if(l.implicit)if(!l.repeated&&(typeof l.type=="number"||It(l.type))){const y={};y.valueHex=d instanceof Jt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Xr({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},...y}))}else o.push(new Fe({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:d.valueBlock.value}));else o.push(new Fe({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:[d]}));else l.repeated?o=o.concat(d):o.push(d)}let s;switch(n.type){case V.Sequence:s=new xt({value:o});break;case V.Set:s=new At({value:o});break;case V.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 ${w[t.type]} in schema '${n.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,d=>a.toASN(d)),c=t.repeated==="sequence"?xt:At;s=new c({value:l})}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,c=>this.toASN(c)),l=t.repeated==="sequence"?xt:At;s=new l({value:a})}else s=this.toASN(o);return s}}class ue extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class z{static serialize(t){return Go.serialize(t)}static parse(t,r){return gh.parse(t,r)}static toString(t){const r=R.isBufferSource(t)?R.toArrayBuffer(t):z.serialize(t),n=gr(r);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}}function u(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(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 wc={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,}",l="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,A=(h.match(c.zoneIndex)||[])[0],C,S;for(A&&(A=A.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(S=g-b,C=":";S--;)C+="0:";return h=h.replace("::",C),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const T=h.split(":"),N=[];for(let E=0;E<T.length;E++)N.push(parseInt(T[E],16));return N}(),{parts:g,zoneId:A}}function y(h,g,b,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let A=0,C;for(;v>0;){if(C=b-v,C<0&&(C=0),h[A]>>C!==g[A]>>C)return!1;v-=b,A+=1}return!0}function f(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 x(h,g){for(;h.length<g;)h=`0${h}`;return h}const m={};m.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,v;for(b=0;b<g.length;b++)if(v=g[b],!(0<=v&&v<=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,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let A,C,S;for(A=3;A>=0;A-=1)if(C=this.octets[A],C in v){if(S=v[C],b&&S!==0)return null;S!==8&&(b=!0),g+=S}else return null;return 32-g},h.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return m.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),m.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),A=[];let C=0;for(;C<4;)A.push(parseInt(b[C],10)|parseInt(v[C],10)^255),C++;return new this(A)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.isIPv4=function(h){return this.parser(h)!==null},m.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},m.IPv4.isValidFourPartDecimal=function(h){return!!(m.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},m.IPv4.networkAddressFromCIDR=function(h){let g,b,v,A,C;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),A=[],b=0;b<4;)A.push(parseInt(v[b],10)&parseInt(C[b],10)),b++;return new this(A)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.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)},m.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(g[2]);if(b>=0&&b<=32){const v=[this.parse(g[1]),b];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},m.IPv4.parser=function(h){let g,b,v;if(g=h.match(n.fourOctet))return function(){const A=g.slice(1,6),C=[];for(let S=0;S<A.length;S++)b=A[S],C.push(f(b));return C}();if(g=h.match(n.longValue)){if(v=f(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const A=[];let C;for(C=0;C<=24;C+=8)A.push(v>>C&255);return A}().reverse()}else return(g=h.match(n.twoOctet))?function(){const A=g.slice(1,4),C=[];if(v=f(A[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return C.push(f(A[0])),C.push(v>>16&255),C.push(v>>8&255),C.push(v&255),C}():(g=h.match(n.threeOctet))?function(){const A=g.slice(1,5),C=[];if(v=f(A[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return C.push(f(A[0])),C.push(f(A[1])),C.push(v>>8&255),C.push(v&255),C}():null},m.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 b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},m.IPv6=function(){function h(g,b){let v,A;if(g.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(g[v]<<8|g[v+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(A=this.parts[v],!(0<=A&&A<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}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,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={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 A,C;for(let S=7;S>=0;S-=1)if(A=this.parts[S],A in v){if(C=v[A],b&&C!==0)return null;C!==16&&(b=!0),g+=C}else return null;return 128-g},h.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let A=0;A<v.length;A++)g=v[A],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let A=0;A<this.parts.length;A++)v.push(x(this.parts[A].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},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),b=g[0],v=g[1];return new m.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let A=0;A<this.parts.length;A++)v.push(this.parts[A].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,A=-1,C;for(;C=g.exec(b);)C[0].length>A&&(v=C.index,A=C[0].length);return A<0?b:`${b.substring(0,v)}::${b.substring(v+A)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),m.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),A=[];let C=0;for(;C<16;)A.push(parseInt(b[C],10)|parseInt(v[C],10)^255),C++;return new this(A)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},m.IPv6.isIPv6=function(h){return this.parser(h)!==null},m.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}},m.IPv6.networkAddressFromCIDR=function(h){let g,b,v,A,C;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),A=[],b=0;b<16;)A.push(parseInt(v[b],10)&parseInt(C[b],10)),b++;return new this(A)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},m.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)},m.IPv6.parseCIDR=function(h){let g,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return v=[this.parse(b[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},m.IPv6.parser=function(h){let g,b,v,A,C,S;if(v=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(c.native.test(h))return d(h,8);if((v=h.match(c.transitional))&&(S=v[6]||"",g=d(v[1].slice(0,-1)+S,6),g.parts)){for(C=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<C.length;b++)if(A=C[b],!(0<=A&&A<=255))return null;return g.parts.push(C[0]<<8|C[1]),g.parts.push(C[2]<<8|C[3]),{parts:g.parts,zoneId:g.zoneId}}return null},m.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 b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<16&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},m.fromByteArray=function(h){const g=h.length;if(g===4)return new m.IPv4(h);if(g===16)return new m.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},m.isValid=function(h){return m.IPv6.isValid(h)||m.IPv4.isValid(h)},m.parse=function(h){if(m.IPv6.isValid(h))return m.IPv6.parse(h);if(m.IPv4.isValid(h))return m.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},m.parseCIDR=function(h){try{return m.IPv6.parseCIDR(h)}catch{try{return m.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},m.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},m.subnetMatch=function(h,g,b){let v,A,C,S;b==null&&(b="unicast");for(A in g)if(Object.prototype.hasOwnProperty.call(g,A)){for(C=g[A],C[0]&&!(C[0]instanceof Array)&&(C=[C]),v=0;v<C.length;v++)if(S=C[v],h.kind()===S[0].kind()&&h.match.apply(h,S))return A}return b},e.exports?e.exports=m:t.ipaddr=m})(No)})(wc);var vc=wc.exports;class kc{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 vc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=vc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Wo,Jo,Yo;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([p({type:w.TeletexString})],Oe.prototype,"teletexString",void 0),u([p({type:w.PrintableString})],Oe.prototype,"printableString",void 0),u([p({type:w.UniversalString})],Oe.prototype,"universalString",void 0),u([p({type:w.Utf8String})],Oe.prototype,"utf8String",void 0),u([p({type:w.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([j({type:V.Choice})],Oe);let mr=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([p({type:w.IA5String})],mr.prototype,"ia5String",void 0),u([p({type:w.Any})],mr.prototype,"anyValue",void 0),mr=u([j({type:V.Choice})],mr);class ri{constructor(t={}){this.type="",this.value=new mr,Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],ri.prototype,"type",void 0),u([p({type:mr})],ri.prototype,"value",void 0);let br=Wo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};br=Wo=u([j({type:V.Set,itemType:ri})],br);let Zo=Jo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Jo.prototype)}};Zo=Jo=u([j({type:V.Sequence,itemType:br})],Zo);let ke=Yo=class extends Zo{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};ke=Yo=u([j({type:V.Sequence})],ke);const mh={fromASN:e=>kc.toString(sn.fromASN(e)),toASN:e=>sn.toASN(kc.fromString(e))};class ii{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],ii.prototype,"typeId",void 0),u([p({type:w.Any,context:0})],ii.prototype,"value",void 0);class Qo{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([p({type:Oe,optional:!0,context:0,implicit:!0})],Qo.prototype,"nameAssigner",void 0),u([p({type:Oe,context:1,implicit:!0})],Qo.prototype,"partyName",void 0);let oe=class{constructor(t={}){Object.assign(this,t)}};u([p({type:ii,context:0,implicit:!0})],oe.prototype,"otherName",void 0),u([p({type:w.IA5String,context:1,implicit:!0})],oe.prototype,"rfc822Name",void 0),u([p({type:w.IA5String,context:2,implicit:!0})],oe.prototype,"dNSName",void 0),u([p({type:w.Any,context:3,implicit:!0})],oe.prototype,"x400Address",void 0),u([p({type:ke,context:4,implicit:!1})],oe.prototype,"directoryName",void 0),u([p({type:Qo,context:5})],oe.prototype,"ediPartyName",void 0),u([p({type:w.IA5String,context:6,implicit:!0})],oe.prototype,"uniformResourceIdentifier",void 0),u([p({type:w.OctetString,context:7,implicit:!0,converter:mh})],oe.prototype,"iPAddress",void 0),u([p({type:w.ObjectIdentifier,context:8,implicit:!0})],oe.prototype,"registeredID",void 0),oe=u([j({type:V.Choice})],oe);const wr="1.3.6.1.5.5.7.3",er="2.5.29";var Xo;class an{constructor(t={}){this.accessMethod="",this.accessLocation=new oe,Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],an.prototype,"accessMethod",void 0),u([p({type:oe})],an.prototype,"accessLocation",void 0);let Cc=Xo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};Cc=Xo=u([j({type:V.Sequence,itemType:an})],Cc);const es=`${er}.35`;class ts extends le{}class tr{constructor(t={}){t&&Object.assign(this,t)}}u([p({type:ts,context:0,optional:!0,implicit:!0})],tr.prototype,"keyIdentifier",void 0),u([p({type:oe,context:1,optional:!0,implicit:!0,repeated:"sequence"})],tr.prototype,"authorityCertIssuer",void 0),u([p({type:w.Integer,context:2,optional:!0,implicit:!0,converter:ye})],tr.prototype,"authorityCertSerialNumber",void 0);const Sc=`${er}.19`;class ln{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([p({type:w.Boolean,defaultValue:!1})],ln.prototype,"cA",void 0),u([p({type:w.Integer,optional:!0})],ln.prototype,"pathLenConstraint",void 0);var rs;let Me=rs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,rs.prototype)}};Me=rs=u([j({type:V.Sequence,itemType:oe})],Me);var is;let xc=is=class extends Me{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};xc=is=u([j({type:V.Sequence})],xc);var ns;const Ac=`${er}.32`;let Et=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([p({type:w.IA5String})],Et.prototype,"ia5String",void 0),u([p({type:w.VisibleString})],Et.prototype,"visibleString",void 0),u([p({type:w.BmpString})],Et.prototype,"bmpString",void 0),u([p({type:w.Utf8String})],Et.prototype,"utf8String",void 0),Et=u([j({type:V.Choice})],Et);class os{constructor(t={}){this.organization=new Et,this.noticeNumbers=[],Object.assign(this,t)}}u([p({type:Et})],os.prototype,"organization",void 0),u([p({type:w.Integer,repeated:"sequence"})],os.prototype,"noticeNumbers",void 0);class ss{constructor(t={}){Object.assign(this,t)}}u([p({type:os,optional:!0})],ss.prototype,"noticeRef",void 0),u([p({type:Et,optional:!0})],ss.prototype,"explicitText",void 0);let cn=class{constructor(t={}){Object.assign(this,t)}};u([p({type:w.IA5String})],cn.prototype,"cPSuri",void 0),u([p({type:ss})],cn.prototype,"userNotice",void 0),cn=u([j({type:V.Choice})],cn);class as{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],as.prototype,"policyQualifierId",void 0),u([p({type:w.Any})],as.prototype,"qualifier",void 0);class un{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],un.prototype,"policyIdentifier",void 0),u([p({type:as,repeated:"sequence",optional:!0})],un.prototype,"policyQualifiers",void 0);let dn=ns=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};dn=ns=u([j({type:V.Sequence,itemType:un})],dn);let fn=class{constructor(t=0){this.value=t}};u([p({type:w.Integer})],fn.prototype,"value",void 0),fn=u([j({type:V.Choice})],fn);let Bc=class extends fn{};Bc=u([j({type:V.Choice})],Bc);var ls,st;(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"})(st||(st={}));class Ic extends on{toJSON(){const t=[],r=this.toNumber();return r&st.aACompromise&&t.push("aACompromise"),r&st.affiliationChanged&&t.push("affiliationChanged"),r&st.cACompromise&&t.push("cACompromise"),r&st.certificateHold&&t.push("certificateHold"),r&st.cessationOfOperation&&t.push("cessationOfOperation"),r&st.keyCompromise&&t.push("keyCompromise"),r&st.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&st.superseded&&t.push("superseded"),r&st.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let vr=class{constructor(t={}){Object.assign(this,t)}};u([p({type:oe,context:0,repeated:"sequence",implicit:!0})],vr.prototype,"fullName",void 0),u([p({type:br,context:1,implicit:!0})],vr.prototype,"nameRelativeToCRLIssuer",void 0),vr=u([j({type:V.Choice})],vr);class ni{constructor(t={}){Object.assign(this,t)}}u([p({type:vr,context:0,optional:!0})],ni.prototype,"distributionPoint",void 0),u([p({type:Ic,context:1,optional:!0,implicit:!0})],ni.prototype,"reasons",void 0),u([p({type:oe,context:2,optional:!0,repeated:"sequence",implicit:!0})],ni.prototype,"cRLIssuer",void 0);let cs=ls=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};cs=ls=u([j({type:V.Sequence,itemType:ni})],cs);var us;let Ec=us=class extends cs{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};Ec=us=u([j({type:V.Sequence,itemType:ni})],Ec);class $e{constructor(t={}){this.onlyContainsUserCerts=$e.ONLY,this.onlyContainsCACerts=$e.ONLY,this.indirectCRL=$e.ONLY,this.onlyContainsAttributeCerts=$e.ONLY,Object.assign(this,t)}}$e.ONLY=!1,u([p({type:vr,context:0,optional:!0})],$e.prototype,"distributionPoint",void 0),u([p({type:w.Boolean,context:1,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsUserCerts",void 0),u([p({type:w.Boolean,context:2,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsCACerts",void 0),u([p({type:Ic,context:3,optional:!0,implicit:!0})],$e.prototype,"onlySomeReasons",void 0),u([p({type:w.Boolean,context:4,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"indirectCRL",void 0),u([p({type:w.Boolean,context:5,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsAttributeCerts",void 0);var oi;(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"})(oi||(oi={}));let ds=class{constructor(t=oi.unspecified){this.reason=oi.unspecified,this.reason=t}toJSON(){return oi[this.reason]}toString(){return this.toJSON()}};u([p({type:w.Enumerated})],ds.prototype,"reason",void 0),ds=u([j({type:V.Choice})],ds);var fs;const Nc=`${er}.37`;let pn=fs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};pn=fs=u([j({type:V.Sequence,itemType:w.ObjectIdentifier})],pn);const bh=`${wr}.1`,wh=`${wr}.2`,vh=`${wr}.3`,kh=`${wr}.4`,Ch=`${wr}.8`,Sh=`${wr}.9`;let ps=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([p({type:w.Integer,converter:ye})],ps.prototype,"value",void 0),ps=u([j({type:V.Choice})],ps);let hs=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([p({type:w.GeneralizedTime})],hs.prototype,"value",void 0),hs=u([j({type:V.Choice})],hs);var ys;let Oc=ys=class extends Me{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};Oc=ys=u([j({type:V.Sequence})],Oc);const _c=`${er}.15`;var at;(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"})(at||(at={}));class gs extends on{toJSON(){const t=this.toNumber(),r=[];return t&at.cRLSign&&r.push("crlSign"),t&at.dataEncipherment&&r.push("dataEncipherment"),t&at.decipherOnly&&r.push("decipherOnly"),t&at.digitalSignature&&r.push("digitalSignature"),t&at.encipherOnly&&r.push("encipherOnly"),t&at.keyAgreement&&r.push("keyAgreement"),t&at.keyCertSign&&r.push("keyCertSign"),t&at.keyEncipherment&&r.push("keyEncipherment"),t&at.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var ms;class hn{constructor(t={}){this.base=new oe,this.minimum=0,Object.assign(this,t)}}u([p({type:oe})],hn.prototype,"base",void 0),u([p({type:w.Integer,context:0,defaultValue:0,implicit:!0})],hn.prototype,"minimum",void 0),u([p({type:w.Integer,context:1,optional:!0,implicit:!0})],hn.prototype,"maximum",void 0);let yn=ms=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};yn=ms=u([j({type:V.Sequence,itemType:hn})],yn);class Vc{constructor(t={}){Object.assign(this,t)}}u([p({type:yn,context:0,optional:!0,implicit:!0})],Vc.prototype,"permittedSubtrees",void 0),u([p({type:yn,context:1,optional:!0,implicit:!0})],Vc.prototype,"excludedSubtrees",void 0);class Tc{constructor(t={}){Object.assign(this,t)}}u([p({type:w.Integer,context:0,implicit:!0,optional:!0,converter:ye})],Tc.prototype,"requireExplicitPolicy",void 0),u([p({type:w.Integer,context:1,implicit:!0,optional:!0,converter:ye})],Tc.prototype,"inhibitPolicyMapping",void 0);var bs;class ws{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],ws.prototype,"issuerDomainPolicy",void 0),u([p({type:w.ObjectIdentifier})],ws.prototype,"subjectDomainPolicy",void 0);let jc=bs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};jc=bs=u([j({type:V.Sequence,itemType:ws})],jc);var vs;const $c=`${er}.17`;let ks=vs=class extends Me{constructor(t){super(t),Object.setPrototypeOf(this,vs.prototype)}};ks=vs=u([j({type:V.Sequence})],ks);let Nt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([p({type:w.ObjectIdentifier})],Nt.prototype,"type",void 0),u([p({type:w.Any,repeated:"set"})],Nt.prototype,"values",void 0);var Cs;let Dc=Cs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Cs.prototype)}};Dc=Cs=u([j({type:V.Sequence,itemType:Nt})],Dc);const Rc=`${er}.14`;class Mt extends ts{}class Mc{constructor(t={}){Object.assign(this,t)}}u([p({type:w.GeneralizedTime,context:0,implicit:!0,optional:!0})],Mc.prototype,"notBefore",void 0),u([p({type:w.GeneralizedTime,context:1,implicit:!0,optional:!0})],Mc.prototype,"notAfter",void 0);var si;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(si||(si={}));class Pc extends on{toJSON(){const t=[],r=this.toNumber();return r&si.pKIXCertificate&&t.push("pKIXCertificate"),r&si.newExtensions&&t.push("newExtensions"),r&si.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Uc{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Pc,Object.assign(this,t)}}u([p({type:w.GeneralString})],Uc.prototype,"entrustVers",void 0),u([p({type:Pc})],Uc.prototype,"entrustInfoFlags",void 0);var Ss;let Lc=Ss=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};Lc=Ss=u([j({type:V.Sequence,itemType:an})],Lc);class F{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof F&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&hl(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([p({type:w.ObjectIdentifier})],F.prototype,"algorithm",void 0),u([p({type:w.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([p({type:F})],Ot.prototype,"algorithm",void 0),u([p({type:w.BitString})],Ot.prototype,"subjectPublicKey",void 0);let _e=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([p({type:w.UTCTime})],_e.prototype,"utcTime",void 0),u([p({type:w.GeneralizedTime})],_e.prototype,"generalTime",void 0),_e=u([j({type:V.Choice})],_e);class gn{constructor(t){this.notBefore=new _e(new Date),this.notAfter=new _e(new Date),t&&(this.notBefore=new _e(t.notBefore),this.notAfter=new _e(t.notAfter))}}u([p({type:_e})],gn.prototype,"notBefore",void 0),u([p({type:_e})],gn.prototype,"notAfter",void 0);var xs;let lt=class yp{constructor(t={}){this.extnID="",this.critical=yp.CRITICAL,this.extnValue=new le,Object.assign(this,t)}};lt.CRITICAL=!1,u([p({type:w.ObjectIdentifier})],lt.prototype,"extnID",void 0),u([p({type:w.Boolean,defaultValue:lt.CRITICAL})],lt.prototype,"critical",void 0),u([p({type:le})],lt.prototype,"extnValue",void 0);let rr=xs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};rr=xs=u([j({type:V.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 rt{constructor(t={}){this.version=kr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new F,this.issuer=new ke,this.validity=new gn,this.subject=new ke,this.subjectPublicKeyInfo=new Ot,Object.assign(this,t)}}u([p({type:w.Integer,context:0,defaultValue:kr.v1})],rt.prototype,"version",void 0),u([p({type:w.Integer,converter:ye})],rt.prototype,"serialNumber",void 0),u([p({type:F})],rt.prototype,"signature",void 0),u([p({type:ke})],rt.prototype,"issuer",void 0),u([p({type:gn})],rt.prototype,"validity",void 0),u([p({type:ke})],rt.prototype,"subject",void 0),u([p({type:Ot})],rt.prototype,"subjectPublicKeyInfo",void 0),u([p({type:w.BitString,context:1,implicit:!0,optional:!0})],rt.prototype,"issuerUniqueID",void 0),u([p({type:w.BitString,context:2,implicit:!0,optional:!0})],rt.prototype,"subjectUniqueID",void 0),u([p({type:rr,context:3,optional:!0})],rt.prototype,"extensions",void 0);class Cr{constructor(t={}){this.tbsCertificate=new rt,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:rt})],Cr.prototype,"tbsCertificate",void 0),u([p({type:F})],Cr.prototype,"signatureAlgorithm",void 0),u([p({type:w.BitString})],Cr.prototype,"signatureValue",void 0);class mn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([p({type:w.Integer,converter:ye})],mn.prototype,"userCertificate",void 0),u([p({type:_e})],mn.prototype,"revocationDate",void 0),u([p({type:lt,optional:!0,repeated:"sequence"})],mn.prototype,"crlEntryExtensions",void 0);class _t{constructor(t={}){this.signature=new F,this.issuer=new ke,this.thisUpdate=new _e,Object.assign(this,t)}}u([p({type:w.Integer,optional:!0})],_t.prototype,"version",void 0),u([p({type:F})],_t.prototype,"signature",void 0),u([p({type:ke})],_t.prototype,"issuer",void 0),u([p({type:_e})],_t.prototype,"thisUpdate",void 0),u([p({type:_e,optional:!0})],_t.prototype,"nextUpdate",void 0),u([p({type:mn,repeated:"sequence",optional:!0})],_t.prototype,"revokedCertificates",void 0),u([p({type:lt,optional:!0,context:0,repeated:"sequence"})],_t.prototype,"crlExtensions",void 0);let As=class{constructor(t={}){this.tbsCertList=new _t,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([p({type:_t})],As.prototype,"tbsCertList",void 0),u([p({type:F})],As.prototype,"signatureAlgorithm",void 0),u([p({type:w.BitString})],As.prototype,"signature",void 0);class Sr{constructor(t={}){this.issuer=new ke,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:ke})],Sr.prototype,"issuer",void 0),u([p({type:w.Integer,converter:ye})],Sr.prototype,"serialNumber",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Mt,context:0,implicit:!0})],xr.prototype,"subjectKeyIdentifier",void 0),u([p({type:Sr})],xr.prototype,"issuerAndSerialNumber",void 0),xr=u([j({type:V.Choice})],xr);var Vt;(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"})(Vt||(Vt={}));let ai=class extends F{};ai=u([j({type:V.Sequence})],ai);let bn=class extends F{};bn=u([j({type:V.Sequence})],bn);let gt=class extends F{};gt=u([j({type:V.Sequence})],gt);let wn=class extends F{};wn=u([j({type:V.Sequence})],wn);let Hc=class extends F{};Hc=u([j({type:V.Sequence})],Hc);let Bs=class extends F{};Bs=u([j({type:V.Sequence})],Bs);let Ar=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([p({type:w.ObjectIdentifier})],Ar.prototype,"attrType",void 0),u([p({type:w.Any,repeated:"set"})],Ar.prototype,"attrValues",void 0);var Is;class mt{constructor(t={}){this.version=Vt.v0,this.sid=new xr,this.digestAlgorithm=new ai,this.signatureAlgorithm=new bn,this.signature=new le,Object.assign(this,t)}}u([p({type:w.Integer})],mt.prototype,"version",void 0),u([p({type:xr})],mt.prototype,"sid",void 0),u([p({type:ai})],mt.prototype,"digestAlgorithm",void 0),u([p({type:Ar,repeated:"set",context:0,implicit:!0,optional:!0})],mt.prototype,"signedAttrs",void 0),u([p({type:bn})],mt.prototype,"signatureAlgorithm",void 0),u([p({type:le})],mt.prototype,"signature",void 0),u([p({type:Ar,repeated:"set",context:1,implicit:!0,optional:!0})],mt.prototype,"unsignedAttrs",void 0);let vn=Is=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};vn=Is=u([j({type:V.Set,itemType:mt})],vn);let Fc=class extends _e{};Fc=u([j({type:V.Choice})],Fc);let qc=class extends mt{};qc=u([j({type:V.Sequence})],qc);class Es{constructor(t={}){this.acIssuer=new oe,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([p({type:oe})],Es.prototype,"acIssuer",void 0),u([p({type:w.Integer})],Es.prototype,"acSerial",void 0),u([p({type:Nt,repeated:"sequence"})],Es.prototype,"attrs",void 0);var Ns;let kn=Ns=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};kn=Ns=u([j({type:V.Sequence,itemType:w.ObjectIdentifier})],kn);class Cn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([p({type:w.Integer,optional:!0})],Cn.prototype,"pathLenConstraint",void 0),u([p({type:kn,implicit:!0,context:0,optional:!0})],Cn.prototype,"permittedAttrs",void 0),u([p({type:kn,implicit:!0,context:1,optional:!0})],Cn.prototype,"excludedAttrs",void 0),u([p({type:w.Boolean,defaultValue:!0})],Cn.prototype,"permitUnSpecified",void 0);class ir{constructor(t={}){this.issuer=new Me,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:Me})],ir.prototype,"issuer",void 0),u([p({type:w.Integer,converter:ye})],ir.prototype,"serial",void 0),u([p({type:w.BitString,optional:!0})],ir.prototype,"issuerUID",void 0);var Os;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(Os||(Os={}));class nr{constructor(t={}){this.digestedObjectType=Os.publicKey,this.digestAlgorithm=new F,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.Enumerated})],nr.prototype,"digestedObjectType",void 0),u([p({type:w.ObjectIdentifier,optional:!0})],nr.prototype,"otherObjectTypeID",void 0),u([p({type:F})],nr.prototype,"digestAlgorithm",void 0),u([p({type:w.BitString})],nr.prototype,"objectDigest",void 0);class Sn{constructor(t={}){Object.assign(this,t)}}u([p({type:Me,optional:!0})],Sn.prototype,"issuerName",void 0),u([p({type:ir,context:0,implicit:!0,optional:!0})],Sn.prototype,"baseCertificateID",void 0),u([p({type:nr,context:1,implicit:!0,optional:!0})],Sn.prototype,"objectDigestInfo",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([p({type:oe,repeated:"sequence"})],Br.prototype,"v1Form",void 0),u([p({type:Sn,context:0,implicit:!0})],Br.prototype,"v2Form",void 0),Br=u([j({type:V.Choice})],Br);class xn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([p({type:w.GeneralizedTime})],xn.prototype,"notBeforeTime",void 0),u([p({type:w.GeneralizedTime})],xn.prototype,"notAfterTime",void 0);class li{constructor(t={}){Object.assign(this,t)}}u([p({type:ir,implicit:!0,context:0,optional:!0})],li.prototype,"baseCertificateID",void 0),u([p({type:Me,implicit:!0,context:1,optional:!0})],li.prototype,"entityName",void 0),u([p({type:nr,implicit:!0,context:2,optional:!0})],li.prototype,"objectDigestInfo",void 0);var _s;(function(e){e[e.v2=1]="v2"})(_s||(_s={}));class ct{constructor(t={}){this.version=_s.v2,this.holder=new li,this.issuer=new Br,this.signature=new F,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new xn,this.attributes=[],Object.assign(this,t)}}u([p({type:w.Integer})],ct.prototype,"version",void 0),u([p({type:li})],ct.prototype,"holder",void 0),u([p({type:Br})],ct.prototype,"issuer",void 0),u([p({type:F})],ct.prototype,"signature",void 0),u([p({type:w.Integer,converter:ye})],ct.prototype,"serialNumber",void 0),u([p({type:xn})],ct.prototype,"attrCertValidityPeriod",void 0),u([p({type:Nt,repeated:"sequence"})],ct.prototype,"attributes",void 0),u([p({type:w.BitString,optional:!0})],ct.prototype,"issuerUniqueID",void 0),u([p({type:rr,optional:!0})],ct.prototype,"extensions",void 0);class An{constructor(t={}){this.acinfo=new ct,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:ct})],An.prototype,"acinfo",void 0),u([p({type:F})],An.prototype,"signatureAlgorithm",void 0),u([p({type:w.BitString})],An.prototype,"signatureValue",void 0);var Bn;(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"})(Bn||(Bn={}));class Vs extends on{}class Ts{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier,implicit:!0,context:0})],Ts.prototype,"type",void 0),u([p({type:w.Any,implicit:!0,context:1})],Ts.prototype,"value",void 0);class js{constructor(t={}){this.policyId="",this.classList=new Vs(Bn.unclassified),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],js.prototype,"policyId",void 0),u([p({type:Vs,defaultValue:new Vs(Bn.unclassified)})],js.prototype,"classList",void 0),u([p({type:Ts,repeated:"set"})],js.prototype,"securityCategories",void 0);class In{constructor(t={}){Object.assign(this,t)}}u([p({type:le})],In.prototype,"cotets",void 0),u([p({type:w.ObjectIdentifier})],In.prototype,"oid",void 0),u([p({type:w.Utf8String})],In.prototype,"string",void 0);class Kc{constructor(t={}){this.values=[],Object.assign(this,t)}}u([p({type:Me,implicit:!0,context:0,optional:!0})],Kc.prototype,"policyAuthority",void 0),u([p({type:In,repeated:"sequence"})],Kc.prototype,"values",void 0);var $s;class En{constructor(t={}){this.targetCertificate=new ir,Object.assign(this,t)}}u([p({type:ir})],En.prototype,"targetCertificate",void 0),u([p({type:oe,optional:!0})],En.prototype,"targetName",void 0),u([p({type:nr,optional:!0})],En.prototype,"certDigestInfo",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([p({type:oe,context:0,implicit:!0})],Ir.prototype,"targetName",void 0),u([p({type:oe,context:1,implicit:!0})],Ir.prototype,"targetGroup",void 0),u([p({type:En,context:2,implicit:!0})],Ir.prototype,"targetCert",void 0),Ir=u([j({type:V.Choice})],Ir);let Ds=$s=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};Ds=$s=u([j({type:V.Sequence,itemType:Ir})],Ds);var Rs;let zc=Rs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};zc=Rs=u([j({type:V.Sequence,itemType:Ds})],zc);class Gc{constructor(t={}){Object.assign(this,t)}}u([p({type:Me,implicit:!0,context:0,optional:!0})],Gc.prototype,"roleAuthority",void 0),u([p({type:oe,implicit:!0,context:1})],Gc.prototype,"roleName",void 0);class Ms{constructor(t={}){this.service=new oe,this.ident=new oe,Object.assign(this,t)}}u([p({type:oe})],Ms.prototype,"service",void 0),u([p({type:oe})],Ms.prototype,"ident",void 0),u([p({type:le,optional:!0})],Ms.prototype,"authInfo",void 0);var Ps;class Us{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],Us.prototype,"otherCertFormat",void 0),u([p({type:w.Any})],Us.prototype,"otherCert",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Cr})],Er.prototype,"certificate",void 0),u([p({type:An,context:2,implicit:!0})],Er.prototype,"v2AttrCert",void 0),u([p({type:Us,context:3,implicit:!0})],Er.prototype,"other",void 0),Er=u([j({type:V.Choice})],Er);let Nn=Ps=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};Nn=Ps=u([j({type:V.Set,itemType:Er})],Nn);class Nr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],Nr.prototype,"contentType",void 0),u([p({type:w.Any,context:0})],Nr.prototype,"content",void 0);let ci=class{constructor(t={}){Object.assign(this,t)}};u([p({type:le})],ci.prototype,"single",void 0),u([p({type:w.Any})],ci.prototype,"any",void 0),ci=u([j({type:V.Choice})],ci);class On{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],On.prototype,"eContentType",void 0),u([p({type:ci,context:0,optional:!0})],On.prototype,"eContent",void 0);let ui=class{constructor(t={}){Object.assign(this,t)}};u([p({type:le,context:0,implicit:!0,optional:!0})],ui.prototype,"value",void 0),u([p({type:le,converter:Xp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ui.prototype,"constructedValue",void 0),ui=u([j({type:V.Choice})],ui);class di{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new wn,Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],di.prototype,"contentType",void 0),u([p({type:wn})],di.prototype,"contentEncryptionAlgorithm",void 0),u([p({type:ui,optional:!0})],di.prototype,"encryptedContent",void 0);class _n{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],_n.prototype,"keyAttrId",void 0),u([p({type:w.Any,optional:!0})],_n.prototype,"keyAttr",void 0);var Ls;class Vn{constructor(t={}){this.subjectKeyIdentifier=new Mt,Object.assign(this,t)}}u([p({type:Mt})],Vn.prototype,"subjectKeyIdentifier",void 0),u([p({type:w.GeneralizedTime,optional:!0})],Vn.prototype,"date",void 0),u([p({type:_n,optional:!0})],Vn.prototype,"other",void 0);let Or=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Vn,context:0,implicit:!0,optional:!0})],Or.prototype,"rKeyId",void 0),u([p({type:Sr,optional:!0})],Or.prototype,"issuerAndSerialNumber",void 0),Or=u([j({type:V.Choice})],Or);class Hs{constructor(t={}){this.rid=new Or,this.encryptedKey=new le,Object.assign(this,t)}}u([p({type:Or})],Hs.prototype,"rid",void 0),u([p({type:le})],Hs.prototype,"encryptedKey",void 0);let Tn=Ls=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ls.prototype)}};Tn=Ls=u([j({type:V.Sequence,itemType:Hs})],Tn);class Fs{constructor(t={}){this.algorithm=new F,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:F})],Fs.prototype,"algorithm",void 0),u([p({type:w.BitString})],Fs.prototype,"publicKey",void 0);let or=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Mt,context:0,implicit:!0,optional:!0})],or.prototype,"subjectKeyIdentifier",void 0),u([p({type:Fs,context:1,implicit:!0,optional:!0})],or.prototype,"originatorKey",void 0),u([p({type:Sr,optional:!0})],or.prototype,"issuerAndSerialNumber",void 0),or=u([j({type:V.Choice})],or);class _r{constructor(t={}){this.version=Vt.v3,this.originator=new or,this.keyEncryptionAlgorithm=new gt,this.recipientEncryptedKeys=new Tn,Object.assign(this,t)}}u([p({type:w.Integer})],_r.prototype,"version",void 0),u([p({type:or,context:0})],_r.prototype,"originator",void 0),u([p({type:le,context:1,optional:!0})],_r.prototype,"ukm",void 0),u([p({type:gt})],_r.prototype,"keyEncryptionAlgorithm",void 0),u([p({type:Tn})],_r.prototype,"recipientEncryptedKeys",void 0);let Vr=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Mt,context:0,implicit:!0})],Vr.prototype,"subjectKeyIdentifier",void 0),u([p({type:Sr})],Vr.prototype,"issuerAndSerialNumber",void 0),Vr=u([j({type:V.Choice})],Vr);class fi{constructor(t={}){this.version=Vt.v0,this.rid=new Vr,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new le,Object.assign(this,t)}}u([p({type:w.Integer})],fi.prototype,"version",void 0),u([p({type:Vr})],fi.prototype,"rid",void 0),u([p({type:gt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([p({type:le})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.keyIdentifier=new le,Object.assign(this,t)}}u([p({type:le})],pi.prototype,"keyIdentifier",void 0),u([p({type:w.GeneralizedTime,optional:!0})],pi.prototype,"date",void 0),u([p({type:_n,optional:!0})],pi.prototype,"other",void 0);class hi{constructor(t={}){this.version=Vt.v4,this.kekid=new pi,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new le,Object.assign(this,t)}}u([p({type:w.Integer})],hi.prototype,"version",void 0),u([p({type:pi})],hi.prototype,"kekid",void 0),u([p({type:gt})],hi.prototype,"keyEncryptionAlgorithm",void 0),u([p({type:le})],hi.prototype,"encryptedKey",void 0);class yi{constructor(t={}){this.version=Vt.v0,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new le,Object.assign(this,t)}}u([p({type:w.Integer})],yi.prototype,"version",void 0),u([p({type:Bs,context:0,optional:!0})],yi.prototype,"keyDerivationAlgorithm",void 0),u([p({type:gt})],yi.prototype,"keyEncryptionAlgorithm",void 0),u([p({type:le})],yi.prototype,"encryptedKey",void 0);class qs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],qs.prototype,"oriType",void 0),u([p({type:w.Any})],qs.prototype,"oriValue",void 0);let Pt=class{constructor(t={}){Object.assign(this,t)}};u([p({type:fi,optional:!0})],Pt.prototype,"ktri",void 0),u([p({type:_r,context:1,implicit:!0,optional:!0})],Pt.prototype,"kari",void 0),u([p({type:hi,context:2,implicit:!0,optional:!0})],Pt.prototype,"kekri",void 0),u([p({type:yi,context:3,implicit:!0,optional:!0})],Pt.prototype,"pwri",void 0),u([p({type:qs,context:4,implicit:!0,optional:!0})],Pt.prototype,"ori",void 0),Pt=u([j({type:V.Choice})],Pt);var Ks;let jn=Ks=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ks.prototype)}};jn=Ks=u([j({type:V.Set,itemType:Pt})],jn);var zs;class $n{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],$n.prototype,"otherRevInfoFormat",void 0),u([p({type:w.Any})],$n.prototype,"otherRevInfo",void 0);let gi=class{constructor(t={}){this.other=new $n,Object.assign(this,t)}};u([p({type:$n,context:1,implicit:!0})],gi.prototype,"other",void 0),gi=u([j({type:V.Choice})],gi);let Gs=zs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Gs=zs=u([j({type:V.Set,itemType:gi})],Gs);class Ws{constructor(t={}){Object.assign(this,t)}}u([p({type:Nn,context:0,implicit:!0,optional:!0})],Ws.prototype,"certs",void 0),u([p({type:Gs,context:1,implicit:!0,optional:!0})],Ws.prototype,"crls",void 0);var Js;let Ys=Js=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Js.prototype)}};Ys=Js=u([j({type:V.Set,itemType:Ar})],Ys);class mi{constructor(t={}){this.version=Vt.v0,this.recipientInfos=new jn,this.encryptedContentInfo=new di,Object.assign(this,t)}}u([p({type:w.Integer})],mi.prototype,"version",void 0),u([p({type:Ws,context:0,implicit:!0,optional:!0})],mi.prototype,"originatorInfo",void 0),u([p({type:jn})],mi.prototype,"recipientInfos",void 0),u([p({type:di})],mi.prototype,"encryptedContentInfo",void 0),u([p({type:Ys,context:1,implicit:!0,optional:!0})],mi.prototype,"unprotectedAttrs",void 0);const xh="1.2.840.113549.1.7.2";var Zs;let Dn=Zs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Zs.prototype)}};Dn=Zs=u([j({type:V.Set,itemType:ai})],Dn);class Tr{constructor(t={}){this.version=Vt.v0,this.digestAlgorithms=new Dn,this.encapContentInfo=new On,this.signerInfos=new vn,Object.assign(this,t)}}u([p({type:w.Integer})],Tr.prototype,"version",void 0),u([p({type:Dn})],Tr.prototype,"digestAlgorithms",void 0),u([p({type:On})],Tr.prototype,"encapContentInfo",void 0),u([p({type:Nn,context:0,implicit:!0,optional:!0})],Tr.prototype,"certificates",void 0),u([p({type:gi,context:1,implicit:!0,optional:!0})],Tr.prototype,"crls",void 0),u([p({type:vn})],Tr.prototype,"signerInfos",void 0);const bi="1.2.840.10045.2.1",Qs="1.2.840.10045.4.1",Wc="1.2.840.10045.4.3.1",Xs="1.2.840.10045.4.3.2",ea="1.2.840.10045.4.3.3",ta="1.2.840.10045.4.3.4",Jc="1.2.840.10045.3.1.7",Yc="1.3.132.0.34",Zc="1.3.132.0.35";function wi(e){return new F({algorithm:e})}const Ah=wi(Qs);wi(Wc);const Bh=wi(Xs),Ih=wi(ea),Eh=wi(ta);let jr=class{constructor(t={}){Object.assign(this,t)}};u([p({type:w.ObjectIdentifier})],jr.prototype,"namedCurve",void 0),jr=u([j({type:V.Choice})],jr);class Rn{constructor(t={}){this.version=1,this.privateKey=new le,Object.assign(this,t)}}u([p({type:w.Integer})],Rn.prototype,"version",void 0),u([p({type:le})],Rn.prototype,"privateKey",void 0),u([p({type:jr,context:0,optional:!0})],Rn.prototype,"parameters",void 0),u([p({type:w.BitString,context:1,optional:!0})],Rn.prototype,"publicKey",void 0);class Mn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.Integer,converter:ye})],Mn.prototype,"r",void 0),u([p({type:w.Integer,converter:ye})],Mn.prototype,"s",void 0);const qe="1.2.840.113549.1.1",$r=`${qe}.1`,Nh=`${qe}.7`,Oh=`${qe}.9`,_h=`${qe}.10`,Vh=`${qe}.2`,Th=`${qe}.4`,Pn=`${qe}.5`,jh=`${qe}.14`,ra=`${qe}.11`,Un=`${qe}.12`,Ln=`${qe}.13`,Qc=`${qe}.15`,Xc=`${qe}.16`,eu="1.3.14.3.2.26",tu="2.16.840.1.101.3.4.2.4",ru="2.16.840.1.101.3.4.2.1",iu="2.16.840.1.101.3.4.2.2",nu="2.16.840.1.101.3.4.2.3",$h="2.16.840.1.101.3.4.2.5",Dh="2.16.840.1.101.3.4.2.6",Rh="1.2.840.113549.2.2",Mh="1.2.840.113549.2.5",ia=`${qe}.8`;function Ce(e){return new F({algorithm:e,parameters:null})}Ce(Rh),Ce(Mh);const sr=Ce(eu);Ce(tu),Ce(ru),Ce(iu),Ce(nu),Ce($h),Ce(Dh);const ou=new F({algorithm:ia,parameters:z.serialize(sr)}),su=new F({algorithm:Oh,parameters:z.serialize(sn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ce($r),Ce(Vh),Ce(Th),Ce(Pn),Ce(Qc),Ce(Xc),Ce(Un),Ce(Ln),Ce(Qc),Ce(Xc);class Hn{constructor(t={}){this.hashAlgorithm=new F(sr),this.maskGenAlgorithm=new F({algorithm:ia,parameters:z.serialize(sr)}),this.pSourceAlgorithm=new F(su),Object.assign(this,t)}}u([p({type:F,context:0,defaultValue:sr})],Hn.prototype,"hashAlgorithm",void 0),u([p({type:F,context:1,defaultValue:ou})],Hn.prototype,"maskGenAlgorithm",void 0),u([p({type:F,context:2,defaultValue:su})],Hn.prototype,"pSourceAlgorithm",void 0),new F({algorithm:Nh,parameters:z.serialize(new Hn)});class vi{constructor(t={}){this.hashAlgorithm=new F(sr),this.maskGenAlgorithm=new F({algorithm:ia,parameters:z.serialize(sr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([p({type:F,context:0,defaultValue:sr})],vi.prototype,"hashAlgorithm",void 0),u([p({type:F,context:1,defaultValue:ou})],vi.prototype,"maskGenAlgorithm",void 0),u([p({type:w.Integer,context:2,defaultValue:20})],vi.prototype,"saltLength",void 0),u([p({type:w.Integer,context:3,defaultValue:1})],vi.prototype,"trailerField",void 0),new F({algorithm:_h,parameters:z.serialize(new vi)});class Fn{constructor(t={}){this.digestAlgorithm=new F,this.digest=new le,Object.assign(this,t)}}u([p({type:F})],Fn.prototype,"digestAlgorithm",void 0),u([p({type:le})],Fn.prototype,"digest",void 0);var na;class qn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.Integer,converter:ye})],qn.prototype,"prime",void 0),u([p({type:w.Integer,converter:ye})],qn.prototype,"exponent",void 0),u([p({type:w.Integer,converter:ye})],qn.prototype,"coefficient",void 0);let oa=na=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,na.prototype)}};oa=na=u([j({type:V.Sequence,itemType:qn})],oa);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([p({type:w.Integer})],bt.prototype,"version",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"modulus",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"publicExponent",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"privateExponent",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"prime1",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"prime2",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"exponent1",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"exponent2",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"coefficient",void 0),u([p({type:oa,optional:!0})],bt.prototype,"otherPrimeInfos",void 0);class sa{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.Integer,converter:ye})],sa.prototype,"modulus",void 0),u([p({type:w.Integer,converter:ye})],sa.prototype,"publicExponent",void 0);var aa;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(aa||(aa={}));const Ke=aa;/*! *****************************************************************************
|
|
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
|
|
88
|
+
***************************************************************************** */var la=function(e,t){return la=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])},la(e,t)};function ca(e,t){la(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Ph(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 l(y){try{d(n.next(y))}catch(f){a(f)}}function c(y){try{d(n.throw(y))}catch(f){a(f)}}function d(y){y.done?s(y.value):o(y.value).then(l,c)}d((n=n.apply(e,t||[])).next())})}function Uh(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:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(d){return function(y){return c([d,y])}}function c(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 Kn(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 zn(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(l){a={error:l}}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(zn(arguments[t]));return e}var Lh="injectionTokens";function Hh(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(Lh,e)||{};return Object.keys(r).forEach(function(n){t[+n]=r[n]}),t}function au(e){return!!e.useClass}function ua(e){return!!e.useFactory}var lu=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 l=Reflect[o];return l.apply(void 0,ar(s))}};return this.reflectMethods.forEach(n),r},e}();function Dr(e){return typeof e=="string"||typeof e=="symbol"}function Fh(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function cu(e){return typeof e=="object"&&"token"in e&&"transform"in e}function qh(e){return typeof e=="function"||e instanceof lu}function Gn(e){return!!e.useToken}function Wn(e){return e.useValue!=null}function Kh(e){return au(e)||Wn(e)||Gn(e)||ua(e)}var da=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}(),zh=function(e){ca(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(da),uu=function(){function e(){this.scopedResolutions=new Map}return e}();function Gh(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function Wh(e,t,r){return r===void 0&&(r=" "),ar([e],t.message.split(`
|
|
89
89
|
`).map(function(n){return r+n})).join(`
|
|
90
|
-
`)}function Kh(e,t,r){var n=qn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=n[1],s=o===void 0?null:o,a=Fh(s,t);return qh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function zh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Gh=function(e){sa(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(la),Wh=function(e){sa(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(la),Jh=function(){function e(){this.preResolution=new Gh,this.postResolution=new Wh}return e}(),lu=new Map,Yh=function(){function e(t){this.parent=t,this._registry=new Hh,this.interceptors=new Jh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,n){n===void 0&&(n={lifecycle:qe.Transient}),this.ensureNotDisposed();var o;if(Lh(r)?o=r:o={useClass:r},Kn(o))for(var s=[t],a=o;a!=null;){var l=a.useToken;if(s.includes(l))throw new Error("Token registration cycle detected! "+sr(s,[l]).join(" -> "));s.push(l);var c=this._registry.get(l);c&&Kn(c.provider)?a=c.provider:a=null}if((n.lifecycle===qe.Singleton||n.lifecycle==qe.ContainerScoped||n.lifecycle==qe.ResolutionScoped)&&(zn(o)||aa(o)))throw new Error('Cannot use lifecycle "'+qe[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:qe.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:qe.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:qe.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new au),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(Uh(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=Fn(this.interceptors.preResolution.getAll(t)),l=a.next();!l.done;l=a.next()){var c=l.value;c.options.frequency!="Once"&&s.push(c),c.callback(t,r)}}catch(d){n={error:d}}finally{try{l&&!l.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 l=Fn(this.interceptors.postResolution.getAll(t)),c=l.next();!c.done;c=l.next()){var d=c.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,n)}}catch(y){o={error:y}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var n=t.options.lifecycle===qe.Singleton,o=t.options.lifecycle===qe.ContainerScoped,s=n||o,a;return zn(t.provider)?a=t.provider.useValue:Kn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):nu(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):aa(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var n=this;r===void 0&&(r=new au),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(l){return n.resolveRegistration(l,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=Fn(this._registry.entries()),o=n.next();!o.done;o=n.next()){var s=qn(o.value,2),a=s[0],l=s[1];this._registry.setAll(a,l.filter(function(c){return!zn(c.provider)}).map(function(c){return c.instance=void 0,c}))}}catch(c){t={error:c}}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=Fn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=qn(s.value,2),l=a[0],c=a[1];c.some(function(d){var y=d.options;return y.lifecycle===qe.ContainerScoped})&&n._registry.setAll(l,c.map(function(d){return d.options.lifecycle===qe.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 $h(this,void 0,void 0,function(){var t;return Dh(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 ou)return t.createProxy(function(s){return n.resolve(s,r)});var o=function(){var s=lu.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,sr([void 0],a)))}();return zh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var n=this;return function(o,s){var a,l,c;try{return Ph(o)?su(o)?o.multiple?(a=n.resolve(o.transform)).transform.apply(a,sr([n.resolveAll(o.token)],o.transformArgs)):(l=n.resolve(o.transform)).transform.apply(l,sr([n.resolve(o.token,t)],o.transformArgs)):o.multiple?n.resolveAll(o.token):n.resolve(o.token,t):su(o)?(c=n.resolve(o.transform,t)).transform.apply(c,sr([n.resolve(o.token,t)],o.transformArgs)):n.resolve(o,t)}catch(d){throw new Error(Kh(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}(),rt=new Yh;function ca(){return function(e){lu.set(e,Rh(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 ua;class Gn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:m.ObjectIdentifier})],Gn.prototype,"attrId",void 0),u([f({type:m.Any,repeated:"set"})],Gn.prototype,"attrValues",void 0);let cu=ua=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ua.prototype)}};cu=ua=u([j({type:V.Sequence,itemType:Gn})],cu);var da;let uu=da=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,da.prototype)}};uu=da=u([j({type:V.Sequence,itemType:Er})],uu);class du{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],du.prototype,"certId",void 0),u([f({type:m.Any,context:0})],du.prototype,"certValue",void 0);class fu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],fu.prototype,"crlId",void 0),u([f({type:m.Any,context:0})],fu.prototype,"crltValue",void 0);class pu extends le{}let Wn=class{constructor(t={}){this.encryptionAlgorithm=new F,this.encryptedData=new pu,Object.assign(this,t)}};u([f({type:F})],Wn.prototype,"encryptionAlgorithm",void 0),u([f({type:pu})],Wn.prototype,"encryptedData",void 0);var fa,pa;(function(e){e[e.v1=0]="v1"})(pa||(pa={}));class hu extends le{}let ha=fa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,fa.prototype)}};ha=fa=u([j({type:V.Sequence,itemType:Et})],ha);class wi{constructor(t={}){this.version=pa.v1,this.privateKeyAlgorithm=new F,this.privateKey=new hu,Object.assign(this,t)}}u([f({type:m.Integer})],wi.prototype,"version",void 0),u([f({type:F})],wi.prototype,"privateKeyAlgorithm",void 0),u([f({type:hu})],wi.prototype,"privateKey",void 0),u([f({type:ha,implicit:!0,context:0,optional:!0})],wi.prototype,"attributes",void 0);let yu=class extends wi{};yu=u([j({type:V.Sequence})],yu);let gu=class extends Wn{};gu=u([j({type:V.Sequence})],gu);class mu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],mu.prototype,"secretTypeId",void 0),u([f({type:m.Any,context:0})],mu.prototype,"secretValue",void 0);class vi{constructor(t={}){this.mac=new Ln,this.macSalt=new le,this.iterations=1,Object.assign(this,t)}}u([f({type:Ln})],vi.prototype,"mac",void 0),u([f({type:le})],vi.prototype,"macSalt",void 0),u([f({type:m.Integer,defaultValue:1})],vi.prototype,"iterations",void 0);class Jn{constructor(t={}){this.version=3,this.authSafe=new Er,this.macData=new vi,Object.assign(this,t)}}u([f({type:m.Integer})],Jn.prototype,"version",void 0),u([f({type:Er})],Jn.prototype,"authSafe",void 0),u([f({type:vi,optional:!0})],Jn.prototype,"macData",void 0);var ya;class Yn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Yn.prototype,"bagId",void 0),u([f({type:m.Any,context:0})],Yn.prototype,"bagValue",void 0),u([f({type:Gn,repeated:"set",optional:!0})],Yn.prototype,"bagAttributes",void 0);let bu=ya=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ya.prototype)}};bu=ya=u([j({type:V.Sequence,itemType:Yn})],bu);var ga,ma,ba;const wu="1.2.840.113549.1.9",vu=`${wu}.7`,wa=`${wu}.14`;let Zn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:m.IA5String})],Zn.prototype,"ia5String",void 0),Zn=u([j({type:V.Choice})],Zn);let ku=class extends Er{};ku=u([j({type:V.Sequence})],ku);let Cu=class extends Jn{};Cu=u([j({type:V.Sequence})],Cu);let Su=class extends Wn{};Su=u([j({type:V.Sequence})],Su);let va=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.IA5String})],va.prototype,"value",void 0),va=u([j({type:V.Choice})],va);let xu=class extends Zn{};xu=u([j({type:V.Choice})],xu);let Au=class extends Oe{};Au=u([j({type:V.Choice})],Au);let ka=class{constructor(t=new Date){this.value=t}};u([f({type:m.GeneralizedTime})],ka.prototype,"value",void 0),ka=u([j({type:V.Choice})],ka);let Bu=class extends Oe{};Bu=u([j({type:V.Choice})],Bu);let Ca=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],Ca.prototype,"value",void 0),Ca=u([j({type:V.Choice})],Ca);let Qn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],Qn.prototype,"value",void 0),Qn=u([j({type:V.Choice})],Qn);let Iu=class extends Qn{};Iu=u([j({type:V.Choice})],Iu);let Eu=class extends Oe{};Eu=u([j({type:V.Choice})],Eu);let Sa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.ObjectIdentifier})],Sa.prototype,"value",void 0),Sa=u([j({type:V.Choice})],Sa);let Nu=class extends _e{};Nu=u([j({type:V.Choice})],Nu);let xa=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:m.Integer})],xa.prototype,"value",void 0),xa=u([j({type:V.Choice})],xa);let Ou=class extends gt{};Ou=u([j({type:V.Sequence})],Ou);let Xn=class extends Oe{};Xn=u([j({type:V.Choice})],Xn);let _u=ga=class extends tr{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};_u=ga=u([j({type:V.Sequence})],_u);let Vu=ma=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ma.prototype)}};Vu=ma=u([j({type:V.Set,itemType:xr})],Vu);let Aa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.BmpString})],Aa.prototype,"value",void 0),Aa=u([j({type:V.Choice})],Aa);let Ba=class extends F{};Ba=u([j({type:V.Sequence})],Ba);let Tu=ba=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ba.prototype)}};Tu=ba=u([j({type:V.Sequence,itemType:Ba})],Tu);var Ia;let eo=Ia=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ia.prototype)}};eo=Ia=u([j({type:V.Sequence,itemType:Et})],eo);class Dr{constructor(t={}){this.version=0,this.subject=new ke,this.subjectPKInfo=new Nt,this.attributes=new eo,Object.assign(this,t)}}u([f({type:m.Integer})],Dr.prototype,"version",void 0),u([f({type:ke})],Dr.prototype,"subject",void 0),u([f({type:Nt})],Dr.prototype,"subjectPKInfo",void 0),u([f({type:eo,implicit:!0,context:0})],Dr.prototype,"attributes",void 0);class ki{constructor(t={}){this.certificationRequestInfo=new Dr,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Dr})],ki.prototype,"certificationRequestInfo",void 0),u([f({type:F})],ki.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],ki.prototype,"signature",void 0);/*!
|
|
90
|
+
`)}function Jh(e,t,r){var n=zn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=n[1],s=o===void 0?null:o,a=Gh(s,t);return Wh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function Yh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Zh=function(e){ca(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(da),Qh=function(e){ca(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(da),Xh=function(){function e(){this.preResolution=new Zh,this.postResolution=new Qh}return e}(),du=new Map,ey=function(){function e(t){this.parent=t,this._registry=new zh,this.interceptors=new Xh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,n){n===void 0&&(n={lifecycle:Ke.Transient}),this.ensureNotDisposed();var o;if(Kh(r)?o=r:o={useClass:r},Gn(o))for(var s=[t],a=o;a!=null;){var l=a.useToken;if(s.includes(l))throw new Error("Token registration cycle detected! "+ar(s,[l]).join(" -> "));s.push(l);var c=this._registry.get(l);c&&Gn(c.provider)?a=c.provider:a=null}if((n.lifecycle===Ke.Singleton||n.lifecycle==Ke.ContainerScoped||n.lifecycle==Ke.ResolutionScoped)&&(Wn(o)||ua(o)))throw new Error('Cannot use lifecycle "'+Ke[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(),Dr(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(),Dr(t)){if(Dr(r))return this.register(t,{useToken:r},{lifecycle:Ke.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:Ke.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=t;return r&&!Dr(r)&&(n=r),this.register(t,{useClass:n},{lifecycle:Ke.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new uu),this.ensureNotDisposed();var n=this.getRegistration(t);if(!n&&Dr(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(qh(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=Kn(this.interceptors.preResolution.getAll(t)),l=a.next();!l.done;l=a.next()){var c=l.value;c.options.frequency!="Once"&&s.push(c),c.callback(t,r)}}catch(d){n={error:d}}finally{try{l&&!l.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 l=Kn(this.interceptors.postResolution.getAll(t)),c=l.next();!c.done;c=l.next()){var d=c.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,n)}}catch(y){o={error:y}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===Ke.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var n=t.options.lifecycle===Ke.Singleton,o=t.options.lifecycle===Ke.ContainerScoped,s=n||o,a;return Wn(t.provider)?a=t.provider.useValue:Gn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):au(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):ua(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===Ke.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var n=this;r===void 0&&(r=new uu),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&Dr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(l){return n.resolveRegistration(l,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=Kn(this._registry.entries()),o=n.next();!o.done;o=n.next()){var s=zn(o.value,2),a=s[0],l=s[1];this._registry.setAll(a,l.filter(function(c){return!Wn(c.provider)}).map(function(c){return c.instance=void 0,c}))}}catch(c){t={error:c}}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=Kn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=zn(s.value,2),l=a[0],c=a[1];c.some(function(d){var y=d.options;return y.lifecycle===Ke.ContainerScoped})&&n._registry.setAll(l,c.map(function(d){return d.options.lifecycle===Ke.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 Ph(this,void 0,void 0,function(){var t;return Uh(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 lu)return t.createProxy(function(s){return n.resolve(s,r)});var o=function(){var s=du.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 Yh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var n=this;return function(o,s){var a,l,c;try{return Fh(o)?cu(o)?o.multiple?(a=n.resolve(o.transform)).transform.apply(a,ar([n.resolveAll(o.token)],o.transformArgs)):(l=n.resolve(o.transform)).transform.apply(l,ar([n.resolve(o.token,t)],o.transformArgs)):o.multiple?n.resolveAll(o.token):n.resolve(o.token,t):cu(o)?(c=n.resolve(o.transform,t)).transform.apply(c,ar([n.resolve(o.token,t)],o.transformArgs)):n.resolve(o,t)}catch(d){throw new Error(Jh(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}(),it=new ey;function fa(){return function(e){du.set(e,Hh(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 pa;class Jn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([p({type:w.ObjectIdentifier})],Jn.prototype,"attrId",void 0),u([p({type:w.Any,repeated:"set"})],Jn.prototype,"attrValues",void 0);let fu=pa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,pa.prototype)}};fu=pa=u([j({type:V.Sequence,itemType:Jn})],fu);var ha;let pu=ha=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ha.prototype)}};pu=ha=u([j({type:V.Sequence,itemType:Nr})],pu);class hu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],hu.prototype,"certId",void 0),u([p({type:w.Any,context:0})],hu.prototype,"certValue",void 0);class yu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],yu.prototype,"crlId",void 0),u([p({type:w.Any,context:0})],yu.prototype,"crltValue",void 0);class gu extends le{}let Yn=class{constructor(t={}){this.encryptionAlgorithm=new F,this.encryptedData=new gu,Object.assign(this,t)}};u([p({type:F})],Yn.prototype,"encryptionAlgorithm",void 0),u([p({type:gu})],Yn.prototype,"encryptedData",void 0);var ya,ga;(function(e){e[e.v1=0]="v1"})(ga||(ga={}));class mu extends le{}let ma=ya=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ya.prototype)}};ma=ya=u([j({type:V.Sequence,itemType:Nt})],ma);class ki{constructor(t={}){this.version=ga.v1,this.privateKeyAlgorithm=new F,this.privateKey=new mu,Object.assign(this,t)}}u([p({type:w.Integer})],ki.prototype,"version",void 0),u([p({type:F})],ki.prototype,"privateKeyAlgorithm",void 0),u([p({type:mu})],ki.prototype,"privateKey",void 0),u([p({type:ma,implicit:!0,context:0,optional:!0})],ki.prototype,"attributes",void 0);let bu=class extends ki{};bu=u([j({type:V.Sequence})],bu);let wu=class extends Yn{};wu=u([j({type:V.Sequence})],wu);class vu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],vu.prototype,"secretTypeId",void 0),u([p({type:w.Any,context:0})],vu.prototype,"secretValue",void 0);class Ci{constructor(t={}){this.mac=new Fn,this.macSalt=new le,this.iterations=1,Object.assign(this,t)}}u([p({type:Fn})],Ci.prototype,"mac",void 0),u([p({type:le})],Ci.prototype,"macSalt",void 0),u([p({type:w.Integer,defaultValue:1})],Ci.prototype,"iterations",void 0);class Zn{constructor(t={}){this.version=3,this.authSafe=new Nr,this.macData=new Ci,Object.assign(this,t)}}u([p({type:w.Integer})],Zn.prototype,"version",void 0),u([p({type:Nr})],Zn.prototype,"authSafe",void 0),u([p({type:Ci,optional:!0})],Zn.prototype,"macData",void 0);var ba;class Qn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],Qn.prototype,"bagId",void 0),u([p({type:w.Any,context:0})],Qn.prototype,"bagValue",void 0),u([p({type:Jn,repeated:"set",optional:!0})],Qn.prototype,"bagAttributes",void 0);let ku=ba=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ba.prototype)}};ku=ba=u([j({type:V.Sequence,itemType:Qn})],ku);var wa,va,ka;const Cu="1.2.840.113549.1.9",Su=`${Cu}.7`,Ca=`${Cu}.14`;let Xn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([p({type:w.IA5String})],Xn.prototype,"ia5String",void 0),Xn=u([j({type:V.Choice})],Xn);let xu=class extends Nr{};xu=u([j({type:V.Sequence})],xu);let Au=class extends Zn{};Au=u([j({type:V.Sequence})],Au);let Bu=class extends Yn{};Bu=u([j({type:V.Sequence})],Bu);let Sa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([p({type:w.IA5String})],Sa.prototype,"value",void 0),Sa=u([j({type:V.Choice})],Sa);let Iu=class extends Xn{};Iu=u([j({type:V.Choice})],Iu);let Eu=class extends Oe{};Eu=u([j({type:V.Choice})],Eu);let xa=class{constructor(t=new Date){this.value=t}};u([p({type:w.GeneralizedTime})],xa.prototype,"value",void 0),xa=u([j({type:V.Choice})],xa);let Nu=class extends Oe{};Nu=u([j({type:V.Choice})],Nu);let Aa=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([p({type:w.PrintableString})],Aa.prototype,"value",void 0),Aa=u([j({type:V.Choice})],Aa);let eo=class{constructor(t=""){this.value=t}toString(){return this.value}};u([p({type:w.PrintableString})],eo.prototype,"value",void 0),eo=u([j({type:V.Choice})],eo);let Ou=class extends eo{};Ou=u([j({type:V.Choice})],Ou);let _u=class extends Oe{};_u=u([j({type:V.Choice})],_u);let Ba=class{constructor(t=""){this.value=t}toString(){return this.value}};u([p({type:w.ObjectIdentifier})],Ba.prototype,"value",void 0),Ba=u([j({type:V.Choice})],Ba);let Vu=class extends _e{};Vu=u([j({type:V.Choice})],Vu);let Ia=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([p({type:w.Integer})],Ia.prototype,"value",void 0),Ia=u([j({type:V.Choice})],Ia);let Tu=class extends mt{};Tu=u([j({type:V.Sequence})],Tu);let to=class extends Oe{};to=u([j({type:V.Choice})],to);let ju=wa=class extends rr{constructor(t){super(t),Object.setPrototypeOf(this,wa.prototype)}};ju=wa=u([j({type:V.Sequence})],ju);let $u=va=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,va.prototype)}};$u=va=u([j({type:V.Set,itemType:Ar})],$u);let Ea=class{constructor(t=""){this.value=t}toString(){return this.value}};u([p({type:w.BmpString})],Ea.prototype,"value",void 0),Ea=u([j({type:V.Choice})],Ea);let Na=class extends F{};Na=u([j({type:V.Sequence})],Na);let Du=ka=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ka.prototype)}};Du=ka=u([j({type:V.Sequence,itemType:Na})],Du);var Oa;let ro=Oa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Oa.prototype)}};ro=Oa=u([j({type:V.Sequence,itemType:Nt})],ro);class Rr{constructor(t={}){this.version=0,this.subject=new ke,this.subjectPKInfo=new Ot,this.attributes=new ro,Object.assign(this,t)}}u([p({type:w.Integer})],Rr.prototype,"version",void 0),u([p({type:ke})],Rr.prototype,"subject",void 0),u([p({type:Ot})],Rr.prototype,"subjectPKInfo",void 0),u([p({type:ro,implicit:!0,context:0})],Rr.prototype,"attributes",void 0);class Si{constructor(t={}){this.certificationRequestInfo=new Rr,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:Rr})],Si.prototype,"certificationRequestInfo",void 0),u([p({type:F})],Si.prototype,"signatureAlgorithm",void 0),u([p({type:w.BitString})],Si.prototype,"signature",void 0);/*!
|
|
91
91
|
* MIT License
|
|
92
92
|
*
|
|
93
93
|
* Copyright (c) Peculiar Ventures. All rights reserved.
|
|
@@ -110,39 +110,57 @@ ${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
|
|
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[de.VALUE];a&&(s=` ${a}`),n.push(`${o}${t[de.NAME]}:${s}`),o=this.pad(r);for(const l in t){if(typeof l=="symbol")continue;const c=t[l],d=l?`${l}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")n.push(`${o}${d}${c}`);else if(c instanceof Date)n.push(`${o}${d}${c.toUTCString()}`);else if(Array.isArray(c))for(const y of c)y[de.NAME]=l,n.push(...this.serializeObj(y,r));else if(c instanceof de)c[de.NAME]=l,n.push(...this.serializeObj(c,r));else if(
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=l:
|
|
116
|
-
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:
|
|
117
|
-
`)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class Vt extends Ut{static isAsnEncoded(t){return M.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Ze.isPem(r)?Ze.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):M.toArrayBuffer(t)}}constructor(...t){Vt.isAsnEncoded(t[0])?super(Vt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class cr extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Nt):super(t),this.tag=Ze.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]||Ye.get()):r=t[0]||Ye.get(),r.subtle.importKey("spki",this.rawData,o,!0,n)}onInit(t){const r=rt.resolve(ro),n=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case jr:{const o=z.parse(t.subjectPublicKey,ia),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]||Ye.get()):n=t[0]||Ye.get(),await n.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ye.get());const r=z.parse(this.rawData,Nt);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,Nt);switch(t.Algorithm=ar.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case gi:t["EC Point"]=r.subjectPublicKey;break;case jr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class wt{static register(t,r){this.items.set(t,r)}static create(t){const r=new bt(t),n=this.items.get(r.type);return n?new n(t):r}}wt.items=new Map;const oo="crypto.signatureFormatter";class uy{toAsnSignature(t,r){return M.toArrayBuffer(r)}toWebSignature(t,r){return M.toArrayBuffer(r)}}class so extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,kr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=z.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Lt(r.subject),this.subject=new Lt(r.subject).toString(),this.issuerName=new Lt(r.issuer),this.issuer=this.issuerName.toString();const n=rt.resolve(ro);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=>wt.create(z.serialize(a)))),this.publicKey=new cr(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=Ye.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 cr)n={...s.algorithm,...this.signatureAlgorithm},o=await s.export(n,["verify"],r);else if(M.isBufferSource(s)){const d=new cr(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=rt.resolveAll(oo).reverse();let l=null;for(const d of a)if(l=d.toWebSignature(n,this.signature),l)break;if(!l)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const c=await r.subtle.verify(this.signatureAlgorithm,o,l,this.tbs);if(t.signatureOnly)return c;{const y=(t.date||new Date).getTime();return c&&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=Ye.get()),await r.subtle.digest(n,this.rawData)}async isSelfSigned(t=Ye.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,kr),n=r.tbsCertificate,o=new de("",{Version:`${vr[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":ar.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new de("",{"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 de("");for(const a of this.extensions){const l=a.toTextObject();s[l[de.NAME]]=l}o.Extensions=s}return t.Data=o,t.Signature=new de("",{Algorithm:ar.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}so.NAME="Certificate";class Bi extends bt{static async create(t,r=!1,n=Ye.get()){if(t instanceof so||lr.isCryptoKey(t)){const o=t instanceof so?await t.publicKey.export(n):t,s=await n.subtle.exportKey("spki",o),l=await new cr(s).getKeyIdentifier(n);return new Bi(L.ToHex(l),r)}else return new Bi(t,r)}constructor(...t){if(M.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new er({keyIdentifier:new Qo(L.FromHex(t[0]))});super(Zo,t[1],z.serialize(r))}else{const r=t[0],n=r.name instanceof Si?z.parse(r.name.rawData,Re):r.name,o=new er({authorityCertIssuer:n,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Zo,t[1],z.serialize(o))}}onInit(t){super.onInit(t);const r=z.parse(t.extnValue,er);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,er);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Si(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Bi.NAME="Authority Key Identifier";class wd extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,sn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new sn({cA:t[0],pathLenConstraint:t[1]});super(vc,t[2],z.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}}wd.NAME="Basic Constraints";var vd;(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"})(vd||(vd={}));class kd extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,dn);this.usages=r.map(n=>n)}else{const r=new dn(t[0]);super(Bc,t[1],z.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}kd.NAME="Extended Key Usages";var $a;(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"})($a||($a={}));class Da extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,ps);this.usages=r.toNumber()}else{const r=new ps(t[0]);super(Ec,t[1],z.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,ps);return t[""]=r.toJSON().join(", "),t}}Da.NAME="Key Usages";class ao extends bt{static async create(t,r=!1,n=Ye.get()){let o;t instanceof cr?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 cr(o).getKeyIdentifier(n);return new ao(L.ToHex(a),r)}constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,Mt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],n=new Mt(r);super(jc,t[1],z.serialize(n)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,Mt);return t[""]=r,t}}ao.NAME="Subject Key Identifier";class Ma extends bt{constructor(...t){M.isBufferSource(t[0])?super(t[0]):super(Vc,t[1],new Si(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=z.parse(t.extnValue,bs);this.names=new Si(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const n in r)t[n]=r[n];return t}}Ma.NAME="Subject Alternative Name";class Cd extends bt{constructor(...t){var r;if(M.isBufferSource(t[0])){super(t[0]);const n=z.parse(this.value,cn);this.policies=n.map(o=>o.policyIdentifier)}else{const n=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new cn(n.map(a=>new ln({policyIdentifier:a})));super(Cc,o,z.serialize(s)),this.policies=n}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new de("",{},Pt.toString(r))),t}}Cd.NAME="Certificate Policies",wt.register(Cc,Cd);class Rr extends Ut{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=z.serialize(new Et({type:n,values:o}))}super(r,Et)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new de("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[de.NAME]===Rr.NAME&&(t[de.NAME]=Pt.toString(this.type)),t}}Rr.NAME="Attribute";class Sd extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=new Xn({printableString:t[0]});super(vu,[z.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=z.parse(this.values[0],Xn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[de.VALUE]=this.password,t}}Sd.NAME="Challenge Password";class Ra extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=t[0],o=new tr;for(const s of n)o.push(z.parse(s.rawData,at));super(wa,[z.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=z.parse(this.values[0],tr);this.items=r.map(n=>wt.create(z.serialize(n)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(n=>n.toTextObject());for(const n of r)t[n[de.NAME]]=n;return t}}Ra.NAME="Extensions";class lo{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}}lo.items=new Map;let Pa=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:Mn,parameters:null});case"sha-256":return new F({algorithm:Xs,parameters:null});case"sha-384":return new F({algorithm:Rn,parameters:null});case"sha-512":return new F({algorithm:Pn,parameters:null})}}else return new F({algorithm:jr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case jr:return{name:"RSASSA-PKCS1-v1_5"};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Xs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Rn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Pn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Pa=u([ca()],Pa),rt.registerSingleton(to,Pa);class it{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=it.namedCurveSize.get(n)||it.defaultNamedCurveSize,s=new Dn,a=M.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),z.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const n=z.parse(r,Dn),o=t.namedCurve,s=it.namedCurveSize.get(o)||it.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(n.r)),l=this.addPadding(s,this.removePadding(n.s));return Bp(a,l)}return null}}it.namedCurveSize=new Map,it.defaultNamedCurveSize=32;const xd="1.3.101.110",Ad="1.3.101.111",Bd="1.3.101.112",Id="1.3.101.113";let Ua=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Bd;break;case"ed448":r=Id;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=xd;break;case"x448":r=Ad;break}}return r?new F({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Bd:return{name:"EdDSA",namedCurve:"Ed25519"};case Id:return{name:"EdDSA",namedCurve:"Ed448"};case xd:return{name:"ECDH-ES",namedCurve:"X25519"};case Ad:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ua=u([ca()],Ua),rt.registerSingleton(to,Ua);class dy extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,ki):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=z.serialize(t.certificationRequestInfo),this.publicKey=new cr(t.certificationRequestInfo.subjectPKInfo);const r=rt.resolve(ro);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>lo.create(z.serialize(o)));const n=this.getAttribute(wa);this.extensions=[],n instanceof Ra&&(this.extensions=n.items),this.subjectName=new Lt(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=Ye.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(r,["verify"],t),o=rt.resolveAll(oo).reverse();let s=null;for(const l of o)if(s=l.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=z.parse(this.rawData,ki),n=r.certificationRequestInfo,o=new de("",{Version:`${vr[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new de("");for(const a of this.attributes){const l=a.toTextObject();s[l[de.NAME]]=l}o.Attributes=s}return t.Data=o,t.Signature=new de("",{Algorithm:ar.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}dy.NAME="PKCS#10 Certificate Request";var Ed;(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"})(Ed||(Ed={})),wt.register(vc,wd),wt.register(Bc,kd),wt.register(Ec,Da),wt.register(jc,ao),wt.register(Zo,Bi),wt.register(Vc,Ma),lo.register(vu,Sd),lo.register(wa,Ra),rt.registerSingleton(oo,uy),rt.registerSingleton(oo,it),it.namedCurveSize.set("P-256",32),it.namedCurveSize.set("K-256",32),it.namedCurveSize.set("P-384",48),it.namedCurveSize.set("P-521",66);function Nd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new so(t),n={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ma){const s=o.names.toJSON(),l=Object.entries(s).map(c=>({type:c[1].type,value:c[1].value})).reduce((c,d)=>{const y=d.type,p=c[y]??[];return{...c,[y]:[...p,d.value]}},{});for(const c in l)n.subjectAltName=`${c}=${l[c].join(", ")}`}else if(o instanceof Da){const s=Object.values($a),a=Array(s.length/2).fill(null).reduce((l,c,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];l.push(p)}return l},[]);n.keyUsage=a}return n}}}function fy(){const e=Nd(),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 py={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function hy(){const e=Di.createI18n("en-us",py);return{i18n:e,i18nT:Di.i18nTComponent(e)}}const ct={useCertificate:fy,useI18n:hy,useX509:Nd},co="/v2/control-planes/{controlPlaneId}/core-entities",uo="/{workspace}",Ii={list:{konnect:`${co}/certificates`,kongManager:`${uo}/certificates`},form:{konnect:{create:`${co}/certificates`,edit:`${co}/certificates/{id}`,validate:`${co}/v1/schemas/json/certificate/validate`},kongManager:{create:`${uo}/certificates`,edit:`${uo}/certificates/{id}`,validate:`${uo}/schemas/certificates/validate`}}};var La=(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.Secret="secret",e))(La||{}),Ht=(e=>(e.Edit="edit",e.Create="create",e))(Ht||{}),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.CopyBadge="copy-badge",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 yy(){return{getAxiosInstance:(e={})=>{try{const t=i.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):al.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),al.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 gy(){return{debounce:(e,t)=>{let r;return(...n)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...n)},t)}}}}const Ha="khcp-user-table-preferences",my={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function by(){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(Ha));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(Ha,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||my},deleteAllTablePreferences:()=>{localStorage.removeItem(Ha)}}}function Fa(e={}){const{getAxiosInstance:t}=yy();return{axiosInstance:t(e)}}const wy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},vy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ky={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."}},Cy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Sy={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"}},xy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Ay={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},By={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Iy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Ey={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ny={global:wy,deleteModal:vy,baseForm:ky,baseTable:Cy,baseConfigCard:Sy,filter:xy,debouncedFilter:Ay,errors:By,validationErrors:Iy,toggleModal:Ey};function fo(){const e=Di.createI18n("en-us",Ny);return{i18n:e,i18nT:Di.i18nTComponent(e)}}function Od(){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(c=>c===s).length,l=n.filter(c=>c===s).length;if(a!==l)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 Oy(e,t,r,n={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=Fa(e.axiosRequestConfig),{i18n:{t:s}}=fo(),{debounce:a}=gy(),l=a(async S=>{await B(S)},200),c=i.ref(!1),d=i.ref(""),y=i.ref(""),p=i.ref([]),I=i.ref([]),w=i.ref(void 0),h=i.computed(()=>{const S=`${e.apiBaseUrl}${i.unref(t)}`;return e.app==="konnect"?S.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?S.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):S}),{isValidUuid:g}=Od(),b=async()=>{try{c.value=!0;const{data:S}=await o.get(`${h.value}?size=${r}`);S!=null&&S.next||(w.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[]),I.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},v=i.ref(""),B=async S=>{var C,T,N;if(v.value!==S){if(v.value=S??"",!S){p.value=I.value;return}if(w.value===void 0)try{if(c.value=!0,d.value="",y.value="",e.app==="konnect"){const E=`${h.value}/${S}`,{data:x}=await o.get(`${E}?size=${r}`);n.fetchedItemsKey in x?p.value=x[n.fetchedItemsKey]:x!=null&&x[n.exactMatchKey??"id"]?p.value=[x]:p.value=[]}else{const E=[];g(S)&&n.searchKeys.includes("id")?E.push((async()=>{const{data:G}=await o.get(`${h.value}/${S}`);return[G[n.fetchedItemsKey]??G]})()):E.push(...n.searchKeys.filter(G=>G!=="id").map(async G=>{const{data:R}=await o.get(`${h.value}?${G}=${S}`);return R[n.fetchedItemsKey]}));const x=await Promise.all(E),O=new Set;p.value=[],(C=x==null?void 0:x.forEach)==null||C.call(x,G=>{var R;(R=G==null?void 0:G.forEach)==null||R.call(G,J=>{O.has(J.id)||(O.add(J.id),p.value.push(J))})})}}catch(E){((T=E==null?void 0:E.response)==null?void 0:T.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,y.value="",p.value=(N=w.value)==null?void 0:N.filter(E=>{var x;let O=!1;for(const G of n.searchKeys){const R=typeof E[G]=="string"?(x=E[G])==null?void 0:x.toLowerCase():E[G];R!=null&&R.includes(S.toLowerCase())&&(O=!0)}return O}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:d,validationError:y,results:p,allRecords:w,loadItems:b,debouncedQueryChange:l}}function _y(e,t){const r=i.unref(t),n=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return n.value.search="",o=>`${n.value.href}/${o}`}function Vy(){const{i18n:{t:e}}=fo();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 l=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(l=a.messages.join(", ")),a.field?`${a.field} - ${l}`:l}).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 Ty(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 _d(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:l,pageSize:c,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let w=new URL(s.value.href);return o.value&&I?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${I}/`):new URL(`${w.href}?filter[name][contains]=${I}`)):(o.value||new URLSearchParams(I).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(c))),d&&l!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),n.value}}}function jy(e,t,r){const n=i.unref(t),{axiosInstance:o}=Fa(e.axiosRequestConfig),s=_d(e,n),a=i.ref({status:Ft.Idle});return{fetcher:async l=>{var c;const d=i.toValue(r)||"data";try{a.value={status:Ft.Loading};let y=s(l);y.includes("filter[name]")&&(y=`${y}&page[size]=${l.pageSize}&page[number]=${l.page}`);const p=await o.get(y);if(p.status>=400)throw p;const I=p.data,w=d&&d.replace(/[^\w-_]/gi,"");let h;I[w]?h=Array.isArray(I[w])?I[w]:[I[w]]:Array.isArray(I)?h=I:h=Object.keys(I).length?[I]:[];const g={data:h,total:h.length,...I.offset?{pagination:{offset:I.offset}}:null};return a.value={status:Ft.Idle,response:g},g}catch(y){const p={data:[],total:0};return l.query&&(((c=y.response)==null?void 0:c.status)===404||y.status===404)?(a.value={status:Ft.NoResults,response:p,error:y.response?y:{response:y}},p):(a.value={status:Ft.Error,response:p,error:y.response?y:{response:y}},p)}},fetcherState:a}}function $y(){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 Vd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Td=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Vd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},jd=e=>e==="*"||e==="x"||e==="X",$d=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Dy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],My=(e,t)=>{if(jd(e)||jd(t))return 0;const[r,n]=Dy($d(e),$d(t));return r>n?1:r<n?-1:0},Dd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=My(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0},Ry=(e,t)=>{const r=Td(e),n=Td(t),o=r.pop(),s=n.pop(),a=Dd(r,n);return a!==0?a:o&&s?Dd(o.split("."),s.split(".")):o||s?o?-1:1:0},Md=(e,t,r)=>{Py(r);const n=Ry(e,t);return Rd[r].includes(n)},Rd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Pd=Object.keys(Rd),Py=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Pd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Pd.join("|")}`)},Uy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Vd.test(e);function Ly(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:n,version:o}=t;if(!Uy(o))return console.error("Invalid version"),!1;const s=r[n];if(!s)return!1;const[a,l]=s;return!(a&&Md(o,a,"<")||l&&Md(o,l,">"))}function Hy(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)}}function Fy(){const{i18n:{t:e}}=fo();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Ie={useAxios:Fa,useDebouncedFilter:Oy,useDeleteUrlBuilder:_y,useErrors:Vy,useExternalLinkCreator:Ty,useFetcher:jy,useFetchUrlBuilder:_d,useHelpers:Od,useStringHelpers:$y,useI18n:fo,useGatewayFeatureSupported:Ly,useTruncationDetector:Hy,useValidators:Fy},qy={key:0,class:"config-card-fieldset-title"},Ky=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}}=Ie.useI18n(),{convertKeyToTitle:n}=Ie.useStringHelpers(),o=i.computed(()=>t.item.key??"json-array-item"),s=i.computed(()=>t.item.value??t.item),a=i.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete c.name,c}),l=i.computed(()=>{var c;return t.isArrayItem?(c=s.value)!=null&&c.name?n(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(c,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",qy,[i.createElementVNode("b",null,i.toDisplayString(l.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(po,{key:`${o.value}-property-${p}`,item:{key:y,label:i.unref(n)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ut=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},Ud=ut(Ky,[["__scopeId","data-v-68ca83ec"]]),zy=i.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ie.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})])}}}),Gy=ut(zy,[["__scopeId","data-v-c96811e5"]]),Wy=i.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ie.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"])}}}),Jy="#0044f4",Yy="#e0e4ea",Zy="#afb7c5",Qy="1px",Xy="20px",eg={class:"config-card-details-row"},tg=["data-testid"],rg=["data-testid"],ig=["data-testid"],ng=["data-testid"],og={key:1},sg=["data-testid"],ag=["data-testid"],lg=["data-testid"],cg=["data-testid"],ug={name:"ConfigCardItem",components:{JsonCardItem:Ud,StatusBadge:Wy,InternalLinkItem:Gy}},dg=i.defineComponent({...ug,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=>({"2f5b0492":y.value?"none":`solid ${i.unref(Qy)} ${i.unref(Yy)}`,"5d59c22c":d.value&&l.value?"block":"flex",aa41a894:d.value&&l.value?"100%":r.slim?"50%":"25%",aa3d1cde:d.value&&l.value?"100%":r.slim?"50%":"75%"}));const r=e,n=t,o=i.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Ie.useI18n(),l=i.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=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:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};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.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:r.item.value}};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}}}),I=i.ref(),{isTruncated:w}=Ie.useTruncationDetector(I);return(h,g)=>{const b=i.resolveComponent("KLabel"),v=i.resolveComponent("KBadge"),B=i.resolveComponent("KCopy"),S=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("div",eg,[i.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[i.renderSlot(h.$slots,"label",{item:e.item},()=>[i.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.label)+" ",1)]),_:2},[c.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,rg)]),key:"0"}:void 0]),1024)],!0)],8,tg),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},()=>[l.value?(i.openBlock(),i.createElementBlock("div",og,[(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,(C,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-tag-${T}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${T}`,tooltip:C,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,sg)):i.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(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,(C,T)=>(i.openBlock(),i.createBlock(B,i.mergeProps({ref_for:!0},p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${T}`,"data-testid":`${e.item.key}-copy-uuid-${T}`,text:C}),null,16,["data-testid","text"]))),128))],8,ag)):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,(C,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-method-${T}`,appearance:Object.values(i.unref(fp.BadgeMethodAppearances)).includes(C.toLowerCase())?C.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${T}`},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,lg)):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,(C,T)=>(i.openBlock(),i.createBlock(Ud,{key:`json-array-item-${T}`,index:T,"is-array-item":"",item:C},null,8,["index","item"]))),128))],8,cg)):(i.openBlock(),i.createBlock(S,{key:4,text:i.unref(w)?e.item.value:""},{default:i.withCtx(()=>[i.createElementVNode("span",{ref_key:"textContent",ref:I,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,ng))],!0)],8,ig)])}}}),po=ut(dg,[["__scopeId","data-v-711ebcf2"]]),fg={class:"json-config"},pg={key:0,class:"json-endpoint"},Ld=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=>({"7a485cf8":`${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)=>{const a=i.resolveComponent("KBadge"),l=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",fg,[t.fetcherUrl?(i.openBlock(),i.createElementBlock("div",pg,[i.createVNode(a,{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,language:"json","single-line":"",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 Hd(e){return typeof e>"u"||e===null}function hg(e){return typeof e=="object"&&e!==null}function yg(e){return Array.isArray(e)?e:Hd(e)?[]:[e]}function gg(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 mg(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function bg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var wg=Hd,vg=hg,kg=yg,Cg=mg,Sg=bg,xg=gg,Se={isNothing:wg,isObject:vg,toArray:kg,repeat:Cg,isNegativeZero:Sg,extend:xg};function Fd(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
113
|
+
*/const io="crypto.algorithm";class ty{getAlgorithms(){return it.resolveAll(io)}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 no="crypto.algorithmProvider";it.registerSingleton(no,ty);var oo;const ze="1.3.36.3.3.2.8.1.1",Ru=`${ze}.1`,Mu=`${ze}.2`,Pu=`${ze}.3`,Uu=`${ze}.4`,Lu=`${ze}.5`,Hu=`${ze}.6`,Fu=`${ze}.7`,qu=`${ze}.8`,Ku=`${ze}.9`,zu=`${ze}.10`,Gu=`${ze}.11`,Wu=`${ze}.12`,Ju=`${ze}.13`,Yu=`${ze}.14`,Zu="brainpoolP160r1",Qu="brainpoolP160t1",Xu="brainpoolP192r1",ed="brainpoolP192t1",td="brainpoolP224r1",rd="brainpoolP224t1",id="brainpoolP256r1",nd="brainpoolP256t1",od="brainpoolP320r1",sd="brainpoolP320t1",ad="brainpoolP384r1",ld="brainpoolP384t1",cd="brainpoolP512r1",ud="brainpoolP512t1",ge="ECDSA";let xi=oo=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case ge.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 Bh;case"sha-384":return Ih;case"sha-512":return Eh}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Jc;break;case"K-256":r=oo.SECP256K1;break;case"P-384":r=Yc;break;case"P-521":r=Zc;break;case Zu:r=Ru;break;case Qu:r=Mu;break;case Xu:r=Pu;break;case ed:r=Uu;break;case td:r=Lu;break;case rd:r=Hu;break;case id:r=Fu;break;case nd:r=qu;break;case od:r=Ku;break;case sd:r=zu;break;case ad:r=Gu;break;case ld:r=Wu;break;case cd:r=Ju;break;case ud:r=Yu;break}if(r)return new F({algorithm:bi,parameters:z.serialize(new jr({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Qs:return{name:ge,hash:{name:"SHA-1"}};case Xs:return{name:ge,hash:{name:"SHA-256"}};case ea:return{name:ge,hash:{name:"SHA-384"}};case ta:return{name:ge,hash:{name:"SHA-512"}};case bi:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(z.parse(t.parameters,jr).namedCurve){case Jc:return{name:ge,namedCurve:"P-256"};case oo.SECP256K1:return{name:ge,namedCurve:"K-256"};case Yc:return{name:ge,namedCurve:"P-384"};case Zc:return{name:ge,namedCurve:"P-521"};case Ru:return{name:ge,namedCurve:Zu};case Mu:return{name:ge,namedCurve:Qu};case Pu:return{name:ge,namedCurve:Xu};case Uu:return{name:ge,namedCurve:ed};case Lu:return{name:ge,namedCurve:td};case Hu:return{name:ge,namedCurve:rd};case Fu:return{name:ge,namedCurve:id};case qu:return{name:ge,namedCurve:nd};case Ku:return{name:ge,namedCurve:od};case zu:return{name:ge,namedCurve:sd};case Gu:return{name:ge,namedCurve:ad};case Wu:return{name:ge,namedCurve:ld};case Ju:return{name:ge,namedCurve:cd};case Yu:return{name:ge,namedCurve:ud}}}}return null}};xi.SECP256K1="1.3.132.0.10",xi=oo=u([fa()],xi),it.registerSingleton(io,xi);const dd=Symbol("name"),fd=Symbol("value");class de{constructor(t,r={},n=""){this[dd]=t,this[fd]=n;for(const o in r)this[o]=r[o]}}de.NAME=dd,de.VALUE=fd;class ry{static toTextObject(t){const r=new de("Algorithm Identifier",{},Ut.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case bi:{const n=new xi().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={[eu]:"sha1",[tu]:"sha224",[ru]:"sha256",[iu]:"sha384",[nu]:"sha512",[$r]:"rsaEncryption",[Pn]:"sha1WithRSAEncryption",[jh]:"sha224WithRSAEncryption",[ra]:"sha256WithRSAEncryption",[Un]:"sha384WithRSAEncryption",[Ln]:"sha512WithRSAEncryption",[bi]:"ecPublicKey",[Qs]:"ecdsaWithSHA1",[Wc]:"ecdsaWithSHA224",[Xs]:"ecdsaWithSHA256",[ea]:"ecdsaWithSHA384",[ta]:"ecdsaWithSHA512",[bh]:"TLS WWW server authentication",[wh]:"TLS WWW client authentication",[vh]:"Code Signing",[kh]:"E-mail Protection",[Ch]:"Time Stamping",[Sh]:"OCSP Signing",[xh]:"Signed Data"};class lr{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[de.VALUE];a&&(s=` ${a}`),n.push(`${o}${t[de.NAME]}:${s}`),o=this.pad(r);for(const l in t){if(typeof l=="symbol")continue;const c=t[l],d=l?`${l}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")n.push(`${o}${d}${c}`);else if(c instanceof Date)n.push(`${o}${d}${c.toUTCString()}`);else if(Array.isArray(c))for(const y of c)y[de.NAME]=l,n.push(...this.serializeObj(y,r));else if(c instanceof de)c[de.NAME]=l,n.push(...this.serializeObj(c,r));else if(R.isBufferSource(c))l?(n.push(`${o}${d}`),n.push(...this.serializeBufferSource(c,r+1))):n.push(...this.serializeBufferSource(c,r));else if("toTextObject"in c){const y=c.toTextObject();y[de.NAME]=l,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=R.toUint8Array(t),s=[];for(let a=0;a<o.length;){const l=[];for(let c=0;c<16&&a<o.length;c++){c===8&&l.push("");const d=o[a++].toString(16).padStart(2,"0");l.push(d)}s.push(`${n}${l.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}lr.oidSerializer=Ut,lr.algorithmSerializer=ry;class Lt{constructor(...t){if(t.length===1){const r=t[0];this.rawData=z.serialize(r),this.onInit(r)}else{const r=z.parse(t[0],t[1]);this.rawData=R.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Lt?hl(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return z.toString(this.rawData);case"text":return lr.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const t=this.toTextObjectEmpty();return t[""]=this.rawData,t}toTextObjectEmpty(t){return new de(this.getTextName(),{},t)}}Lt.NAME="ASN";class wt extends Lt{constructor(...t){let r;R.isBufferSource(t[0])?r=R.toArrayBuffer(t[0]):r=z.serialize(new lt({extnID:t[0],critical:t[1],extnValue:new le(R.toArrayBuffer(t[2]))})),super(r,lt)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[de.NAME]===wt.NAME&&(t[de.NAME]=Ut.toString(this.type)),t}}var pd;class cr{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[pd]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(cr.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=cr.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(cr.DEFAULT,t);return this}}pd=Symbol.toStringTag,cr.DEFAULT="default";const Ze=new cr,iy=/^[0-2](?:\.[1-9][0-9]*)+$/;function ny(e){return new RegExp(iy).test(e)}class hd{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return ny(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Ge=new hd;Ge.register("CN","2.5.4.3"),Ge.register("L","2.5.4.7"),Ge.register("ST","2.5.4.8"),Ge.register("O","2.5.4.10"),Ge.register("OU","2.5.4.11"),Ge.register("C","2.5.4.6"),Ge.register("DC","0.9.2342.19200300.100.1.25"),Ge.register("E","1.2.840.113549.1.9.1"),Ge.register("G","2.5.4.42"),Ge.register("I","2.5.4.43"),Ge.register("SN","2.5.4.4"),Ge.register("T","2.5.4.12");function oy(e,t){return`\\${L.ToHex(L.FromUtf8String(t)).toUpperCase()}`}function sy(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,oy)}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 hd,this.asn=new ke;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 ke?this.asn=t:R.isBufferSource(t)?this.asn=z.parse(t,ke):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||Ge.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)||Ge.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const n=this.getName(r.type)||r.type,o=r.value.anyValue?`#${L.ToHex(r.value.anyValue)}`:sy(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?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new ke,n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=n.exec(`${t},`);){let[,a,l]=o;const c=l[l.length-1];(c===","||c==="+")&&(l=l.slice(0,l.length-1),o[3]=c);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 ri({type:a});if(l.charAt(0)==="#")y.value.anyValue=L.FromHex(l.slice(1));else{const f=/"(.*?[^\\])?"/.exec(l);f&&(l=f[1]),l=l.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=l:Ht.isPrintableString(l)?y.value.printableString=l:y.value.utf8String=l}s==="+"?r[r.length-1].push(y):r.push(new br([y])),s=d}return r}fromJSON(t){const r=new ke;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 l=n[s];for(const c of l){const d=new ri({type:a});if(typeof c=="object")for(const y in c)switch(y){case"ia5String":d.value.ia5String=c[y];break;case"utf8String":d.value.utf8String=c[y];break;case"universalString":d.value.universalString=c[y];break;case"bmpString":d.value.bmpString=c[y];break;case"printableString":d.value.printableString=c[y];break}else c[0]==="#"?d.value.anyValue=L.FromHex(c.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=c:d.value.printableString=c;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return z.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]||Ze.get()):n=t[0]||Ze.get(),await n.subtle.digest(o,this.toArrayBuffer())}}const yd="Cannot initialize GeneralName from ASN.1 data.",gd=`${yd} Unsupported string format in use.`,ay=`${yd} Value doesn't match to GUID regular expression.`,md=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,bd="1.3.6.1.4.1.311.25.1",wd="1.3.6.1.4.1.311.20.2.3",_a="dns",Va="dn",Ta="email",ja="ip",$a="url",Da="guid",Ra="upn",so="id";class vd extends Lt{constructor(...t){let r;if(t.length===2)switch(t[0]){case Va:{const n=new Ht(t[1]).toArrayBuffer(),o=z.parse(n,ke);r=new oe({directoryName:o});break}case _a:r=new oe({dNSName:t[1]});break;case Ta:r=new oe({rfc822Name:t[1]});break;case Da:{const n=new RegExp(md,"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?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");r=new oe({otherName:new ii({typeId:bd,value:z.serialize(new le(L.FromHex(o)))})});break}case ja:r=new oe({iPAddress:t[1]});break;case so:r=new oe({registeredID:t[1]});break;case Ra:{r=new oe({otherName:new ii({typeId:wd,value:z.serialize(gc.toASN(t[1]))})});break}case $a:r=new oe({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else R.isBufferSource(t[0])?r=z.parse(t[0],oe):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=_a,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=Ta,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=ja,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=$a,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=so,this.value=t.registeredID;else if(t.directoryName!=null)this.type=Va,this.value=new Ht(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===bd){this.type=Da;const r=z.parse(t.otherName.value,le),n=new RegExp(md,"i").exec(L.ToHex(r));if(!n)throw new Error(ay);this.value=n.slice(1).map((o,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===wd)this.type=Ra,this.value=z.parse(t.otherName.value,Oe).toString();else throw new Error(gd);else throw new Error(gd)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case Va:case _a:case Da:case ja:case so:case Ra:case $a:t=this.type.toUpperCase();break;case Ta:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===so&&(r=Ut.toString(r)),new de(t,void 0,r)}}class Ai extends Lt{constructor(t){let r;if(t instanceof Me)r=t;else if(Array.isArray(t)){const n=[];for(const o of t)if(o instanceof oe)n.push(o);else{const s=z.parse(new vd(o.type,o.value).rawData,oe);n.push(s)}r=new Me(n)}else if(R.isBufferSource(t))r=z.parse(t,Me);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 vd(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[de.NAME]];Array.isArray(o)||(o=[],t[n[de.NAME]]=o),o.push(n)}return t}}Ai.NAME="GeneralNames";const Bi="-{5}",Ii="\\n",ly=`[^${Ii}]+`,cy=`${Bi}BEGIN (${ly}(?=${Bi}))${Bi}`,uy=`${Bi}END \\1${Bi}`,Mr="\\n",dy=`[^:${Ii}]+`,fy=`(?:[^${Ii}]+${Mr}(?: +[^${Ii}]+${Mr})*)`,py=`(?:[a-zA-Z0-9=+/]+${Mr})+`,kd=`${cy}${Mr}(?:((?:${dy}: ${fy})+))?${Mr}?(${py})${uy}`;class Qe{static isPem(t){return typeof t=="string"&&new RegExp(kd,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(kd,"g"),n=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${Ii}]+`,"g"),""),a={type:o[1],headers:[],rawData:L.FromBase64(s)},l=o[2];if(l){const c=l.split(new RegExp(Mr,"g"));let d=null;for(const y of c){const[f,x]=y.split(/:(.*)/);if(x===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=f.trim()}else d&&a.headers.push(d),d={key:f,value:x.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(!R.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:R.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:R.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=L.ToBase64(t.rawData);let a,l=0;const c=Array();for(;l<s.length&&(s.length-l<64?a=s.substring(l):(a=s.substring(l,l+64),l+=64),a.length!==0);)if(c.push(a),a.length<64)break;return o.push(...c),o.push(`-----END ${n}-----`),o.join(`
|
|
117
|
+
`)}}Qe.CertificateTag="CERTIFICATE",Qe.CrlTag="CRL",Qe.CertificateRequestTag="CERTIFICATE REQUEST",Qe.PublicKeyTag="PUBLIC KEY",Qe.PrivateKeyTag="PRIVATE KEY";class Tt extends Lt{static isAsnEncoded(t){return R.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Qe.isPem(t))return Qe.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Qe.isPem(r)?Qe.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):R.toArrayBuffer(t)}}constructor(...t){Tt.isAsnEncoded(t[0])?super(Tt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Qe.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ur extends Tt{constructor(t){Tt.isAsnEncoded(t)?super(t,Ot):super(t),this.tag=Qe.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]||Ze.get()):r=t[0]||Ze.get(),r.subtle.importKey("spki",this.rawData,o,!0,n)}onInit(t){const r=it.resolve(no),n=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case $r:{const o=z.parse(t.subjectPublicKey,sa),s=R.toUint8Array(o.modulus);n.publicExponent=R.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]||Ze.get()):n=t[0]||Ze.get(),await n.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ze.get());const r=z.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,Ot);switch(t.Algorithm=lr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case bi:t["EC Point"]=r.subjectPublicKey;break;case $r: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 ao="crypto.signatureFormatter";class hy{toAsnSignature(t,r){return R.toArrayBuffer(r)}toWebSignature(t,r){return R.toArrayBuffer(r)}}class lo extends Tt{constructor(t){Tt.isAsnEncoded(t)?super(t,Cr):super(t),this.tag=Qe.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=z.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Ht(r.subject),this.subject=new Ht(r.subject).toString(),this.issuerName=new Ht(r.issuer),this.issuer=this.issuerName.toString();const n=it.resolve(no);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(z.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=Ze.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(R.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=it.resolveAll(ao).reverse();let l=null;for(const d of a)if(l=d.toWebSignature(n,this.signature),l)break;if(!l)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const c=await r.subtle.verify(this.signatureAlgorithm,o,l,this.tbs);if(t.signatureOnly)return c;{const y=(t.date||new Date).getTime();return c&&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=Ze.get()),await r.subtle.digest(n,this.rawData)}async isSelfSigned(t=Ze.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,Cr),n=r.tbsCertificate,o=new de("",{Version:`${kr[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":lr.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new de("",{"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 de("");for(const a of this.extensions){const l=a.toTextObject();s[l[de.NAME]]=l}o.Extensions=s}return t.Data=o,t.Signature=new de("",{Algorithm:lr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}lo.NAME="Certificate";class Ei extends wt{static async create(t,r=!1,n=Ze.get()){if(t instanceof lo||cr.isCryptoKey(t)){const o=t instanceof lo?await t.publicKey.export(n):t,s=await n.subtle.exportKey("spki",o),l=await new ur(s).getKeyIdentifier(n);return new Ei(L.ToHex(l),r)}else return new Ei(t,r)}constructor(...t){if(R.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new ts(L.FromHex(t[0]))});super(es,t[1],z.serialize(r))}else{const r=t[0],n=r.name instanceof Ai?z.parse(r.name.rawData,Me):r.name,o=new tr({authorityCertIssuer:n,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(es,t[1],z.serialize(o))}}onInit(t){super.onInit(t);const r=z.parse(t.extnValue,tr);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,tr);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ai(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ei.NAME="Authority Key Identifier";class Cd extends wt{constructor(...t){if(R.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,ln);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new ln({cA:t[0],pathLenConstraint:t[1]});super(Sc,t[2],z.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 Sd;(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"})(Sd||(Sd={}));class xd extends wt{constructor(...t){if(R.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,pn);this.usages=r.map(n=>n)}else{const r=new pn(t[0]);super(Nc,t[1],z.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}xd.NAME="Extended Key Usages";var Ma;(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"})(Ma||(Ma={}));class Pa extends wt{constructor(...t){if(R.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,gs);this.usages=r.toNumber()}else{const r=new gs(t[0]);super(_c,t[1],z.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,gs);return t[""]=r.toJSON().join(", "),t}}Pa.NAME="Key Usages";class co extends wt{static async create(t,r=!1,n=Ze.get()){let o;t instanceof ur?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:R.isBufferSource(t)?o=t:o=await n.subtle.exportKey("spki",t);const a=await new ur(o).getKeyIdentifier(n);return new co(L.ToHex(a),r)}constructor(...t){if(R.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,Mt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],n=new Mt(r);super(Rc,t[1],z.serialize(n)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,Mt);return t[""]=r,t}}co.NAME="Subject Key Identifier";class Ua extends wt{constructor(...t){R.isBufferSource(t[0])?super(t[0]):super($c,t[1],new Ai(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=z.parse(t.extnValue,ks);this.names=new Ai(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const n in r)t[n]=r[n];return t}}Ua.NAME="Subject Alternative Name";class Ad extends wt{constructor(...t){var r;if(R.isBufferSource(t[0])){super(t[0]);const n=z.parse(this.value,dn);this.policies=n.map(o=>o.policyIdentifier)}else{const n=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new dn(n.map(a=>new un({policyIdentifier:a})));super(Ac,o,z.serialize(s)),this.policies=n}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new de("",{},Ut.toString(r))),t}}Ad.NAME="Certificate Policies",vt.register(Ac,Ad);class Pr extends Lt{constructor(...t){let r;if(R.isBufferSource(t[0]))r=R.toArrayBuffer(t[0]);else{const n=t[0],o=Array.isArray(t[1])?t[1].map(s=>R.toArrayBuffer(s)):[];r=z.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 de("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[de.NAME]===Pr.NAME&&(t[de.NAME]=Ut.toString(this.type)),t}}Pr.NAME="Attribute";class Bd extends Pr{constructor(...t){var r;if(R.isBufferSource(t[0]))super(t[0]);else{const n=new to({printableString:t[0]});super(Su,[z.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=z.parse(this.values[0],to);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[de.VALUE]=this.password,t}}Bd.NAME="Challenge Password";class La extends Pr{constructor(...t){var r;if(R.isBufferSource(t[0]))super(t[0]);else{const n=t[0],o=new rr;for(const s of n)o.push(z.parse(s.rawData,lt));super(Ca,[z.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=z.parse(this.values[0],rr);this.items=r.map(n=>vt.create(z.serialize(n)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(n=>n.toTextObject());for(const n of r)t[n[de.NAME]]=n;return t}}La.NAME="Extensions";class uo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Pr(t),n=this.items.get(r.type);return n?new n(t):r}}uo.items=new Map;let Ha=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:Pn,parameters:null});case"sha-256":return new F({algorithm:ra,parameters:null});case"sha-384":return new F({algorithm:Un,parameters:null});case"sha-512":return new F({algorithm:Ln,parameters:null})}}else return new F({algorithm:$r,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case $r:return{name:"RSASSA-PKCS1-v1_5"};case Pn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case ra:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Un:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Ln:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ha=u([fa()],Ha),it.registerSingleton(io,Ha);class nt{addPadding(t,r){const n=R.toUint8Array(r),o=new Uint8Array(t);return o.set(n,t-n.length),o}removePadding(t,r=!1){let n=R.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=nt.namedCurveSize.get(n)||nt.defaultNamedCurveSize,s=new Mn,a=R.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),z.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const n=z.parse(r,Mn),o=t.namedCurve,s=nt.namedCurveSize.get(o)||nt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(n.r)),l=this.addPadding(s,this.removePadding(n.s));return Op(a,l)}return null}}nt.namedCurveSize=new Map,nt.defaultNamedCurveSize=32;const Id="1.3.101.110",Ed="1.3.101.111",Nd="1.3.101.112",Od="1.3.101.113";let Fa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Nd;break;case"ed448":r=Od;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=Id;break;case"x448":r=Ed;break}}return r?new F({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Nd:return{name:"EdDSA",namedCurve:"Ed25519"};case Od:return{name:"EdDSA",namedCurve:"Ed448"};case Id:return{name:"ECDH-ES",namedCurve:"X25519"};case Ed:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Fa=u([fa()],Fa),it.registerSingleton(io,Fa);class yy extends Tt{constructor(t){Tt.isAsnEncoded(t)?super(t,Si):super(t),this.tag=Qe.CertificateRequestTag}onInit(t){this.tbs=z.serialize(t.certificationRequestInfo),this.publicKey=new ur(t.certificationRequestInfo.subjectPKInfo);const r=it.resolve(no);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>uo.create(z.serialize(o)));const n=this.getAttribute(Ca);this.extensions=[],n instanceof La&&(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=Ze.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(r,["verify"],t),o=it.resolveAll(ao).reverse();let s=null;for(const l of o)if(s=l.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=z.parse(this.rawData,Si),n=r.certificationRequestInfo,o=new de("",{Version:`${kr[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new de("");for(const a of this.attributes){const l=a.toTextObject();s[l[de.NAME]]=l}o.Attributes=s}return t.Data=o,t.Signature=new de("",{Algorithm:lr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}yy.NAME="PKCS#10 Certificate Request";var _d;(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"})(_d||(_d={})),vt.register(Sc,Cd),vt.register(Nc,xd),vt.register(_c,Pa),vt.register(Rc,co),vt.register(es,Ei),vt.register($c,Ua),uo.register(Su,Bd),uo.register(Ca,La),it.registerSingleton(ao,hy),it.registerSingleton(ao,nt),nt.namedCurveSize.set("P-256",32),nt.namedCurveSize.set("K-256",32),nt.namedCurveSize.set("P-384",48),nt.namedCurveSize.set("P-521",66);function Vd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new lo(t),n={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ua){const s=o.names.toJSON(),l=Object.entries(s).map(c=>({type:c[1].type,value:c[1].value})).reduce((c,d)=>{const y=d.type,f=c[y]??[];return{...c,[y]:[...f,d.value]}},{});for(const c in l)n.subjectAltName=`${c}=${l[c].join(", ")}`}else if(o instanceof Pa){const s=Object.values(Ma),a=Array(s.length/2).fill(null).reduce((l,c,d)=>{const y=s[s.length/2+d];if(o.usages&y){const f=s[d];l.push(f)}return l},[]);n.keyUsage=a}return n}}}function gy(){const e=Vd(),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 my={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function by(){const e=Mi.createI18n("en-us",my);return{i18n:e,i18nT:Mi.i18nTComponent(e)}}const ut={useCertificate:gy,useI18n:by,useX509:Vd},fo="/v2/control-planes/{controlPlaneId}/core-entities",po="/{workspace}",Ni={list:{konnect:`${fo}/certificates`,kongManager:`${po}/certificates`},form:{konnect:{create:`${fo}/certificates`,edit:`${fo}/certificates/{id}`,validate:`${fo}/v1/schemas/json/certificate/validate`},kongManager:{create:`${po}/certificates`,edit:`${po}/certificates/{id}`,validate:`${po}/schemas/certificates/validate`}}};var qa=(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.Secret="secret",e))(qa||{}),Ft=(e=>(e.Edit="edit",e.Create="create",e))(Ft||{}),qt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(qt||{}),Ur=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="key_set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e))(Ur||{});const ho=Object.values(Ur);var 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.CopyBadge="copy-badge",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 wy(){return{getAxiosInstance:(e={})=>{try{const t=i.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):ul.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),ul.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 vy(){return{debounce:(e,t)=>{let r;return(...n)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...n)},t)}}}}const Ka="khcp-user-table-preferences",ky={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function Cy(){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(Ka));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(Ka,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||ky},deleteAllTablePreferences:()=>{localStorage.removeItem(Ka)}}}function za(e={}){const{getAxiosInstance:t}=wy();return{axiosInstance:t(e)}}const Sy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},xy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Ay={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",terraform:"Terraform"},errors:{edit:"The entity could not be edited at this time."}},By={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Iy={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"}},Ey={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Ny={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Oy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},_y={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Vy={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"}},Ty={global:Sy,deleteModal:xy,baseForm:Ay,baseTable:By,baseConfigCard:Iy,filter:Ey,debouncedFilter:Ny,errors:Oy,validationErrors:_y,toggleModal:Vy};function yo(){const e=Mi.createI18n("en-us",Ty);return{i18n:e,i18nT:Mi.i18nTComponent(e)}}function Td(){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(c=>c===s).length,l=n.filter(c=>c===s).length;if(a!==l)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 jy(e,t,r,n={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=za(e.axiosRequestConfig),{i18n:{t:s}}=yo(),{debounce:a}=vy(),l=a(async C=>{await A(C)},200),c=i.ref(!1),d=i.ref(""),y=i.ref(""),f=i.ref([]),x=i.ref([]),m=i.ref(void 0),h=i.computed(()=>{const C=`${e.apiBaseUrl}${i.unref(t)}`;return e.app==="konnect"?C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):C}),{isValidUuid:g}=Td(),b=async()=>{try{c.value=!0;const{data:C}=await o.get(`${h.value}?size=${r}`);C!=null&&C.next||(m.value=n.fetchedItemsKey in C?C[n.fetchedItemsKey]:[]),x.value=n.fetchedItemsKey in C?C[n.fetchedItemsKey]:[],f.value=x.value}catch{f.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},v=i.ref(""),A=async C=>{var S,T,N;if(v.value!==C){if(v.value=C??"",!C){f.value=x.value;return}if(m.value===void 0)try{if(c.value=!0,d.value="",y.value="",e.app==="konnect"){const E=`${h.value}/${C}`,{data:B}=await o.get(`${E}?size=${r}`);n.fetchedItemsKey in B?f.value=B[n.fetchedItemsKey]:B!=null&&B[n.exactMatchKey??"id"]?f.value=[B]:f.value=[]}else{const E=[];g(C)&&n.searchKeys.includes("id")?E.push((async()=>{const{data:G}=await o.get(`${h.value}/${C}`);return[G[n.fetchedItemsKey]??G]})()):E.push(...n.searchKeys.filter(G=>G!=="id").map(async G=>{const{data:M}=await o.get(`${h.value}?${G}=${C}`);return M[n.fetchedItemsKey]}));const B=await Promise.all(E),O=new Set;f.value=[],(S=B==null?void 0:B.forEach)==null||S.call(B,G=>{var M;(M=G==null?void 0:G.forEach)==null||M.call(G,J=>{O.has(J.id)||(O.add(J.id),f.value.push(J))})})}}catch(E){((T=E==null?void 0:E.response)==null?void 0:T.status)===404?y.value=s("debouncedFilter.errors.invalid"):(f.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,y.value="",f.value=(N=m.value)==null?void 0:N.filter(E=>{var B;let O=!1;for(const G of n.searchKeys){const M=typeof E[G]=="string"?(B=E[G])==null?void 0:B.toLowerCase():E[G];M!=null&&M.includes(C.toLowerCase())&&(O=!0)}return O}),(!f.value||!f.value.length)&&(y.value=s("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:d,validationError:y,results:f,allRecords:m,loadItems:b,debouncedQueryChange:l}}function $y(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 Dy(){const{i18n:{t:e}}=yo();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 l=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(l=a.messages.join(", ")),a.field?`${a.field} - ${l}`:l}).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 Ry(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 jd(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:l,pageSize:c,offset:d,sortColumnKey:y,sortColumnOrder:f,query:x}=a;try{let m=new URL(s.value.href);return o.value&&x?(m.search="",m=r.value.isExactMatch?new URL(`${m.href}/${x}/`):new URL(`${m.href}?filter[name][contains]=${x}`)):(o.value||new URLSearchParams(x).forEach((h,g)=>{m.searchParams.append(g,h)}),y&&m.searchParams.append("sort_by",y),f==="desc"&&m.searchParams.append("sort_desc","1"),m.searchParams.append("size",String(c))),d&&l!==1&&m.searchParams.append("offset",String(d)),m.href}catch(m){return console.error("RouteList(fetcher)",m),n.value}}}function My(e,t,r){const n=i.unref(t),{axiosInstance:o}=za(e.axiosRequestConfig),s=jd(e,n),a=i.ref({status:qt.Idle});return{fetcher:async l=>{var c;const d=i.toValue(r)||"data";try{a.value={status:qt.Loading};let y=s(l);y.includes("filter[name]")&&(y=`${y}&page[size]=${l.pageSize}&page[number]=${l.page}`);const f=await o.get(y);if(f.status>=400)throw f;const x=f.data,m=d&&d.replace(/[^\w-_]/gi,"");let h;x[m]?h=Array.isArray(x[m])?x[m]:[x[m]]:Array.isArray(x)?h=x:h=Object.keys(x).length?[x]:[];const g={data:h,total:h.length,...x.offset?{pagination:{offset:x.offset}}:null};return a.value={status:qt.Idle,response:g},g}catch(y){const f={data:[],total:0};return l.query&&(((c=y.response)==null?void 0:c.status)===404||y.status===404)?(a.value={status:qt.NoResults,response:f,error:y.response?y:{response:y}},f):(a.value={status:qt.Error,response:f,error:y.response?y:{response:y}},f)}},fetcherState:a}}function Py(){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 $d=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Dd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match($d);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Rd=e=>e==="*"||e==="x"||e==="X",Md=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Uy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Ly=(e,t)=>{if(Rd(e)||Rd(t))return 0;const[r,n]=Uy(Md(e),Md(t));return r>n?1:r<n?-1:0},Pd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=Ly(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0},Hy=(e,t)=>{const r=Dd(e),n=Dd(t),o=r.pop(),s=n.pop(),a=Pd(r,n);return a!==0?a:o&&s?Pd(o.split("."),s.split(".")):o||s?o?-1:1:0},Ud=(e,t,r)=>{Fy(r);const n=Hy(e,t);return Ld[r].includes(n)},Ld={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Hd=Object.keys(Ld),Fy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Hd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Hd.join("|")}`)},qy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&$d.test(e);function Ky(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:n,version:o}=t;if(!qy(o))return console.error("Invalid version"),!1;const s=r[n];if(!s)return!1;const[a,l]=s;return!(a&&Ud(o,a,"<")||l&&Ud(o,l,">"))}function zy(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)}}function Gy(){const{i18n:{t:e}}=yo();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Ie={useAxios:za,useDebouncedFilter:jy,useDeleteUrlBuilder:$y,useErrors:Dy,useExternalLinkCreator:Ry,useFetcher:My,useFetchUrlBuilder:jd,useHelpers:Td,useStringHelpers:Py,useI18n:yo,useGatewayFeatureSupported:Ky,useTruncationDetector:zy,useValidators:Gy},Wy={key:0,class:"config-card-fieldset-title"},Jy=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}}=Ie.useI18n(),{convertKeyToTitle:n}=Ie.useStringHelpers(),o=i.computed(()=>t.item.key??"json-array-item"),s=i.computed(()=>t.item.value??t.item),a=i.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete c.name,c}),l=i.computed(()=>{var c;return t.isArrayItem?(c=s.value)!=null&&c.name?n(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(c,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",Wy,[i.createElementVNode("b",null,i.toDisplayString(l.value),1)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(a.value),(y,f)=>(i.openBlock(),i.createBlock(go,{key:`${o.value}-property-${f}`,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},Fd=dt(Jy,[["__scopeId","data-v-68ca83ec"]]),Yy=i.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ie.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})])}}}),Zy=dt(Yy,[["__scopeId","data-v-c96811e5"]]),Qy=i.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ie.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"])}}}),Xy="#0044f4",eg="#e0e4ea",tg="#afb7c5",rg="1px",ig="20px",ng={class:"config-card-details-row"},og=["data-testid"],sg=["data-testid"],ag=["data-testid"],lg=["data-testid"],cg={key:1},ug=["data-testid"],dg=["data-testid"],fg=["data-testid"],pg=["data-testid"],hg={name:"ConfigCardItem",components:{JsonCardItem:Fd,StatusBadge:Qy,InternalLinkItem:Zy}},yg=i.defineComponent({...hg,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=>({"2f5b0492":y.value?"none":`solid ${i.unref(rg)} ${i.unref(eg)}`,"5d59c22c":d.value&&l.value?"block":"flex",aa41a894:d.value&&l.value?"100%":r.slim?"50%":"25%",aa3d1cde:d.value&&l.value?"100%":r.slim?"50%":"75%"}));const r=e,n=t,o=i.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Ie.useI18n(),l=i.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=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),f=i.computed(()=>{switch(r.item.type){case ce.ID:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};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.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:r.item.value}};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}}}),x=i.ref(),{isTruncated:m}=Ie.useTruncationDetector(x);return(h,g)=>{const b=i.resolveComponent("KLabel"),v=i.resolveComponent("KBadge"),A=i.resolveComponent("KCopy"),C=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("div",ng,[i.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[i.renderSlot(h.$slots,"label",{item:e.item},()=>[i.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.label)+" ",1)]),_:2},[c.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,sg)]),key:"0"}:void 0]),1024)],!0)],8,og),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},()=>[l.value?(i.openBlock(),i.createElementBlock("div",cg,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(f.value.tag),i.normalizeProps(i.guardReactiveProps(f.value.attrs)),{default:i.withCtx(()=>[f.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,(S,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-tag-${T}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${T}`,tooltip:S,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,ug)):i.createCommentVNode("",!0),f.value.additionalComponent==="KCopy"?(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,(S,T)=>(i.openBlock(),i.createBlock(A,i.mergeProps({ref_for:!0},f.value.childAttrs,{key:`${e.item.key}-copy-uuid-${T}`,"data-testid":`${e.item.key}-copy-uuid-${T}`,text:S}),null,16,["data-testid","text"]))),128))],8,dg)):f.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,(S,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-method-${T}`,appearance:Object.values(i.unref(gp.BadgeMethodAppearances)).includes(S.toLowerCase())?S.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${T}`},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,fg)):i.createCommentVNode("",!0),f.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,(S,T)=>(i.openBlock(),i.createBlock(Fd,{key:`json-array-item-${T}`,index:T,"is-array-item":"",item:S},null,8,["index","item"]))),128))],8,pg)):(i.openBlock(),i.createBlock(C,{key:4,text:i.unref(m)?e.item.value:""},{default:i.withCtx(()=>[i.createElementVNode("span",{ref_key:"textContent",ref:x,class:i.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},i.toDisplayString(f.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,lg))],!0)],8,ag)])}}}),go=dt(yg,[["__scopeId","data-v-711ebcf2"]]),gg={class:"json-config"},mg={key:0,class:"json-endpoint"},qd=i.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},entityRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){i.useCssVars(o=>({"454fa8c4":`${n.value}ch`}));const t=e,r=i.computed(()=>t.entityRecord),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)=>{const a=i.resolveComponent("KBadge"),l=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",gg,[t.fetcherUrl?(i.openBlock(),i.createElementBlock("div",mg,[i.createVNode(a,{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,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):i.createCommentVNode("",!0),t.entityRecord?(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 Kd(e){return typeof e>"u"||e===null}function bg(e){return typeof e=="object"&&e!==null}function wg(e){return Array.isArray(e)?e:Kd(e)?[]:[e]}function vg(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 kg(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Cg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Sg=Kd,xg=bg,Ag=wg,Bg=kg,Ig=Cg,Eg=vg,Se={isNothing:Sg,isObject:xg,toArray:Ag,repeat:Bg,isNegativeZero:Ig,extend:Eg};function zd(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),n+" "+r):n}function
|
|
120
|
-
`+l;for(d=
|
|
119
|
+
`+e.mark.snippet),n+" "+r):n}function Oi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=zd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Oi.prototype=Object.create(Error.prototype),Oi.prototype.constructor=Oi,Oi.prototype.toString=function(e){return this.name+": "+zd(this,e)};var Pe=Oi;function Ga(e,t,r,n,o){var s="",a="",l=Math.floor(o/2)-1;return n-t>l&&(s=" ... ",t=n-l+s.length),r-n>l&&(a=" ...",r=n+l-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:n-t+s.length}}function Wa(e,t){return Se.repeat(" ",t-e.length)+e}function Ng(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 l="",c,d,y=Math.min(e.line+t.linesAfter,o.length).toString().length,f=t.maxLength-(t.indent+y+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)d=Ga(e.buffer,n[a-c],o[a-c],e.position-(n[a]-n[a-c]),f),l=Se.repeat(" ",t.indent)+Wa((e.line-c+1).toString(),y)+" | "+d.str+`
|
|
120
|
+
`+l;for(d=Ga(e.buffer,n[a],o[a],e.position,f),l+=Se.repeat(" ",t.indent)+Wa((e.line+1).toString(),y)+" | "+d.str+`
|
|
121
121
|
`,l+=Se.repeat("-",t.indent+y+3+d.pos)+`^
|
|
122
|
-
`,c=1;c<=t.linesAfter&&!(a+c>=o.length);c++)d=
|
|
123
|
-
`;return l.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+c:c):o===
|
|
128
|
-
`);break}for(n?
|
|
122
|
+
`,c=1;c<=t.linesAfter&&!(a+c>=o.length);c++)d=Ga(e.buffer,n[a+c],o[a+c],e.position-(n[a]-n[a+c]),f),l+=Se.repeat(" ",t.indent)+Wa((e.line+c+1).toString(),y)+" | "+d.str+`
|
|
123
|
+
`;return l.replace(/\n$/,"")}var Og=Ng,_g=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Vg=["scalar","sequence","mapping"];function Tg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function jg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(_g.indexOf(r)===-1)throw new Pe('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=Tg(t.styleAliases||null),Vg.indexOf(this.kind)===-1)throw new Pe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ve=jg;function Gd(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 $g(){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 Ja(e){return this.extend(e)}Ja.prototype.extend=function(e){var t=[],r=[];if(e instanceof Ve)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 Pe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof Ve))throw new Pe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Pe("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 Pe("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 Ve))throw new Pe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var n=Object.create(Ja.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=Gd(n,"implicit"),n.compiledExplicit=Gd(n,"explicit"),n.compiledTypeMap=$g(n.compiledImplicit,n.compiledExplicit),n};var Wd=Ja,Jd=new Ve("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Yd=new Ve("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Zd=new Ve("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Qd=new Wd({explicit:[Jd,Yd,Zd]});function Dg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Rg(){return null}function Mg(e){return e===null}var Xd=new Ve("tag:yaml.org,2002:null",{kind:"scalar",resolve:Dg,construct:Rg,predicate:Mg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Pg(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 Ug(e){return e==="true"||e==="True"||e==="TRUE"}function Lg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ef=new Ve("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Pg,construct:Ug,predicate:Lg,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 Hg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Fg(e){return 48<=e&&e<=55}function qg(e){return 48<=e&&e<=57}function Kg(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(!Hg(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Fg(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!qg(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function zg(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 Gg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Se.isNegativeZero(e)}var tf=new Ve("tag:yaml.org,2002:int",{kind:"scalar",resolve:Kg,construct:zg,predicate:Gg,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"]}}),Wg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Jg(e){return!(e===null||!Wg.test(e)||e[e.length-1]==="_")}function Yg(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 Zg=/^[-+]?[0-9]+e/;function Qg(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(Se.isNegativeZero(e))return"-0.0";return r=e.toString(10),Zg.test(r)?r.replace("e",".e"):r}function Xg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Se.isNegativeZero(e))}var rf=new Ve("tag:yaml.org,2002:float",{kind:"scalar",resolve:Jg,construct:Yg,predicate:Xg,represent:Qg,defaultStyle:"lowercase"}),nf=Qd.extend({implicit:[Xd,ef,tf,rf]}),of=nf,sf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),af=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 em(e){return e===null?!1:sf.exec(e)!==null||af.exec(e)!==null}function tm(e){var t,r,n,o,s,a,l,c=0,d=null,y,f,x;if(t=sf.exec(e),t===null&&(t=af.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],l=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(y=+t[10],f=+(t[11]||0),d=(y*60+f)*6e4,t[9]==="-"&&(d=-d)),x=new Date(Date.UTC(r,n,o,s,a,l,c)),d&&x.setTime(x.getTime()-d),x}function rm(e){return e.toISOString()}var lf=new Ve("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:em,construct:tm,instanceOf:Date,represent:rm});function im(e){return e==="<<"||e===null}var cf=new Ve("tag:yaml.org,2002:merge",{kind:"scalar",resolve:im}),Ya=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
124
|
+
\r`;function nm(e){if(e===null)return!1;var t,r,n=0,o=e.length,s=Ya;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 om(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,s=Ya,a=0,l=[];for(t=0;t<o;t++)t%4===0&&t&&(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)),a=a<<6|s.indexOf(n.charAt(t));return r=o%4*6,r===0?(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)):r===18?(l.push(a>>10&255),l.push(a>>2&255)):r===12&&l.push(a>>4&255),new Uint8Array(l)}function sm(e){var t="",r=0,n,o,s=e.length,a=Ya;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 am(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var uf=new Ve("tag:yaml.org,2002:binary",{kind:"scalar",resolve:nm,construct:om,predicate:am,represent:sm}),lm=Object.prototype.hasOwnProperty,cm=Object.prototype.toString;function um(e){if(e===null)return!0;var t=[],r,n,o,s,a,l=e;for(r=0,n=l.length;r<n;r+=1){if(o=l[r],a=!1,cm.call(o)!=="[object Object]")return!1;for(s in o)if(lm.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 dm(e){return e!==null?e:[]}var df=new Ve("tag:yaml.org,2002:omap",{kind:"sequence",resolve:um,construct:dm}),fm=Object.prototype.toString;function pm(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],fm.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;s[t]=[o[0],n[o[0]]]}return!0}function hm(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 ff=new Ve("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pm,construct:hm}),ym=Object.prototype.hasOwnProperty;function gm(e){if(e===null)return!0;var t,r=e;for(t in r)if(ym.call(r,t)&&r[t]!==null)return!1;return!0}function mm(e){return e!==null?e:{}}var pf=new Ve("tag:yaml.org,2002:set",{kind:"mapping",resolve:gm,construct:mm}),Za=of.extend({implicit:[lf,cf],explicit:[uf,df,ff,pf]}),Kt=Object.prototype.hasOwnProperty,mo=1,hf=2,yf=3,bo=4,Qa=1,bm=2,gf=3,wm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,vm=/[\x85\u2028\u2029]/,km=/[,\[\]\{\}]/,mf=/^(?:!|!!|![a-z\-]+!)$/i,bf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function wf(e){return Object.prototype.toString.call(e)}function kt(e){return e===10||e===13}function dr(e){return e===9||e===32}function We(e){return e===9||e===32||e===10||e===13}function Lr(e){return e===44||e===91||e===93||e===123||e===125}function Cm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Sm(e){return e===120?2:e===117?4:e===85?8:0}function xm(e){return 48<=e&&e<=57?e-48:-1}function vf(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 Am(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var kf=new Array(256),Cf=new Array(256),Hr=0;Hr<256;Hr++)kf[Hr]=vf(Hr)?1:0,Cf[Hr]=vf(Hr);function Bm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Za,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 Sf(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=Og(r),new Pe(t,r)}function Y(e,t){throw Sf(e,t)}function wo(e,t){e.onWarning&&e.onWarning.call(null,Sf(e,t))}var xf={YAML:function(e,t,r){var n,o,s;e.version!==null&&Y(e,"duplication of %YAML directive"),r.length!==1&&Y(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),n===null&&Y(e,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),s=parseInt(n[2],10),o!==1&&Y(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&wo(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var n,o;r.length!==2&&Y(e,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],mf.test(n)||Y(e,"ill-formed tag handle (first argument) of the TAG directive"),Kt.call(e.tagMap,n)&&Y(e,'there is a previously declared suffix for "'+n+'" tag handle'),bf.test(o)||Y(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{Y(e,"tag prefix is malformed: "+o)}e.tagMap[n]=o}};function zt(e,t,r,n){var o,s,a,l;if(t<r){if(l=e.input.slice(t,r),n)for(o=0,s=l.length;o<s;o+=1)a=l.charCodeAt(o),a===9||32<=a&&a<=1114111||Y(e,"expected valid JSON character");else wm.test(l)&&Y(e,"the stream contains non-printable characters");e.result+=l}}function Af(e,t,r,n){var o,s,a,l;for(Se.isObject(r)||Y(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,l=o.length;a<l;a+=1)s=o[a],Kt.call(t,s)||(t[s]=r[s],n[s]=!0)}function Fr(e,t,r,n,o,s,a,l,c){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])&&Y(e,"nested arrays are not supported inside keys"),typeof o=="object"&&wf(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&wf(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)Af(e,t,s[d],r);else Af(e,t,s,r);else!e.json&&!Kt.call(r,o)&&Kt.call(t,o)&&(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,Y(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 Xa(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++):Y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ve(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;dr(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(kt(o))for(Xa(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&&wo(e,"deficient indentation"),n}function vo(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||We(r)))}function el(e,t){t===1?e.result+=" ":t>1&&(e.result+=Se.repeat(`
|
|
126
|
+
`,t-1))}function Im(e,t,r){var n,o,s,a,l,c,d,y,f=e.kind,x=e.result,m;if(m=e.input.charCodeAt(e.position),We(m)||Lr(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(o=e.input.charCodeAt(e.position+1),We(o)||r&&Lr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,l=!1;m!==0;){if(m===58){if(o=e.input.charCodeAt(e.position+1),We(o)||r&&Lr(o))break}else if(m===35){if(n=e.input.charCodeAt(e.position-1),We(n))break}else{if(e.position===e.lineStart&&vo(e)||r&&Lr(m))break;if(kt(m))if(c=e.line,d=e.lineStart,y=e.lineIndent,ve(e,!1,-1),e.lineIndent>=t){l=!0,m=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=c,e.lineStart=d,e.lineIndent=y;break}}l&&(zt(e,s,a,!1),el(e,e.line-c),s=a=e.position,l=!1),dr(m)||(a=e.position+1),m=e.input.charCodeAt(++e.position)}return zt(e,s,a,!1),e.result?!0:(e.kind=f,e.result=x,!1)}function Em(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(zt(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 kt(r)?(zt(e,n,o,!0),el(e,ve(e,!1,t)),n=o=e.position):e.position===e.lineStart&&vo(e)?Y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);Y(e,"unexpected end of the stream within a single quoted scalar")}function Nm(e,t){var r,n,o,s,a,l;if(l=e.input.charCodeAt(e.position),l!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(l=e.input.charCodeAt(e.position))!==0;){if(l===34)return zt(e,r,e.position,!0),e.position++,!0;if(l===92){if(zt(e,r,e.position,!0),l=e.input.charCodeAt(++e.position),kt(l))ve(e,!1,t);else if(l<256&&kf[l])e.result+=Cf[l],e.position++;else if((a=Sm(l))>0){for(o=a,s=0;o>0;o--)l=e.input.charCodeAt(++e.position),(a=Cm(l))>=0?s=(s<<4)+a:Y(e,"expected hexadecimal character");e.result+=Am(s),e.position++}else Y(e,"unknown escape sequence");r=n=e.position}else kt(l)?(zt(e,r,n,!0),el(e,ve(e,!1,t)),r=n=e.position):e.position===e.lineStart&&vo(e)?Y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Y(e,"unexpected end of the stream within a double quoted scalar")}function Om(e,t){var r=!0,n,o,s,a=e.tag,l,c=e.anchor,d,y,f,x,m,h=Object.create(null),g,b,v,A;if(A=e.input.charCodeAt(e.position),A===91)y=93,m=!1,l=[];else if(A===123)y=125,m=!0,l={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),A=e.input.charCodeAt(++e.position);A!==0;){if(ve(e,!0,t),A=e.input.charCodeAt(e.position),A===y)return e.position++,e.tag=a,e.anchor=c,e.kind=m?"mapping":"sequence",e.result=l,!0;r?A===44&&Y(e,"expected the node content, but found ','"):Y(e,"missed comma between flow collection entries"),b=g=v=null,f=x=!1,A===63&&(d=e.input.charCodeAt(e.position+1),We(d)&&(f=x=!0,e.position++,ve(e,!0,t))),n=e.line,o=e.lineStart,s=e.position,qr(e,t,mo,!1,!0),b=e.tag,g=e.result,ve(e,!0,t),A=e.input.charCodeAt(e.position),(x||e.line===n)&&A===58&&(f=!0,A=e.input.charCodeAt(++e.position),ve(e,!0,t),qr(e,t,mo,!1,!0),v=e.result),m?Fr(e,l,h,b,g,v,n,o,s):f?l.push(Fr(e,null,h,b,g,v,n,o,s)):l.push(g),ve(e,!0,t),A=e.input.charCodeAt(e.position),A===44?(r=!0,A=e.input.charCodeAt(++e.position)):r=!1}Y(e,"unexpected end of the stream within a flow collection")}function _m(e,t){var r,n,o=Qa,s=!1,a=!1,l=t,c=0,d=!1,y,f;if(f=e.input.charCodeAt(e.position),f===124)n=!1;else if(f===62)n=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)Qa===o?o=f===43?gf:bm:Y(e,"repeat of a chomping mode identifier");else if((y=xm(f))>=0)y===0?Y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Y(e,"repeat of an indentation width identifier"):(l=t+y-1,a=!0);else break;if(dr(f)){do f=e.input.charCodeAt(++e.position);while(dr(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!kt(f)&&f!==0)}for(;f!==0;){for(Xa(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!a||e.lineIndent<l)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>l&&(l=e.lineIndent),kt(f)){c++;continue}if(e.lineIndent<l){o===gf?e.result+=Se.repeat(`
|
|
127
|
+
`,s?1+c:c):o===Qa&&s&&(e.result+=`
|
|
128
|
+
`);break}for(n?dr(f)?(d=!0,e.result+=Se.repeat(`
|
|
129
129
|
`,s?1+c:c)):d?(d=!1,e.result+=Se.repeat(`
|
|
130
130
|
`,c+1)):c===0?s&&(e.result+=" "):e.result+=Se.repeat(`
|
|
131
131
|
`,c):e.result+=Se.repeat(`
|
|
132
|
-
`,s?1+c:c),s=!0,a=!0,c=0,r=e.position;!
|
|
133
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
132
|
+
`,s?1+c:c),s=!0,a=!0,c=0,r=e.position;!kt(f)&&f!==0;)f=e.input.charCodeAt(++e.position);zt(e,r,e.position,!1)}return!0}function Bf(e,t){var r,n=e.tag,o=e.anchor,s=[],a,l=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),!(c!==45||(a=e.input.charCodeAt(e.position+1),!We(a))));){if(l=!0,e.position++,ve(e,!0,-1)&&e.lineIndent<=t){s.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,qr(e,t,yf,!1,!0),s.push(e.result),ve(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)Y(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return l?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function Vm(e,t,r){var n,o,s,a,l,c,d=e.tag,y=e.anchor,f={},x=Object.create(null),m=null,h=null,g=null,b=!1,v=!1,A;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),A=e.input.charCodeAt(e.position);A!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,(A===63||A===58)&&We(n))A===63?(b&&(Fr(e,f,x,m,h,null,a,l,c),m=h=g=null),v=!0,b=!0,o=!0):b?(b=!1,o=!0):Y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,A=n;else{if(a=e.line,l=e.lineStart,c=e.position,!qr(e,r,hf,!1,!0))break;if(e.line===s){for(A=e.input.charCodeAt(e.position);dr(A);)A=e.input.charCodeAt(++e.position);if(A===58)A=e.input.charCodeAt(++e.position),We(A)||Y(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Fr(e,f,x,m,h,null,a,l,c),m=h=g=null),v=!0,b=!1,o=!1,m=e.tag,h=e.result;else if(v)Y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(v)Y(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)&&(b&&(a=e.line,l=e.lineStart,c=e.position),qr(e,t,bo,!0,o)&&(b?h=e.result:g=e.result),b||(Fr(e,f,x,m,h,g,a,l,c),m=h=g=null),ve(e,!0,-1),A=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&A!==0)Y(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&Fr(e,f,x,m,h,null,a,l,c),v&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=f),v}function Tm(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&&Y(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)):Y(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!We(a);)a===33&&(n?Y(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),mf.test(o)||Y(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),km.test(s)&&Y(e,"tag suffix cannot contain flow indicator characters")}s&&!bf.test(s)&&Y(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{Y(e,"tag name is malformed: "+s)}return r?e.tag=s:Kt.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:Y(e,'undeclared tag handle "'+o+'"'),!0}function jm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Y(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!We(r)&&!Lr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function $m(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&&!We(n)&&!Lr(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Kt.call(e.anchorMap,r)||Y(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ve(e,!0,-1),!0}function qr(e,t,r,n,o){var s,a,l,c=1,d=!1,y=!1,f,x,m,h,g,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=l=bo===r||yf===r,n&&ve(e,!0,-1)&&(d=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Tm(e)||jm(e);)ve(e,!0,-1)?(d=!0,l=s,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):l=!1;if(l&&(l=d||o),(c===1||bo===r)&&(mo===r||hf===r?g=t:g=t+1,b=e.position-e.lineStart,c===1?l&&(Bf(e,b)||Vm(e,b,g))||Om(e,g)?y=!0:(a&&_m(e,g)||Em(e,g)||Nm(e,g)?y=!0:$m(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&Y(e,"alias node should not have any properties")):Im(e,g,mo===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(y=l&&Bf(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Y(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,x=e.implicitTypes.length;f<x;f+=1)if(h=e.implicitTypes[f],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(Kt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,m=e.typeMap.multi[e.kind||"fallback"],f=0,x=m.length;f<x;f+=1)if(e.tag.slice(0,m[f].tag.length)===m[f].tag){h=m[f];break}h||Y(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&Y(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)):Y(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 Dm(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&&(ve(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&&!We(a);)a=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&Y(e,"directive name must not be less than one character in length");a!==0;){for(;dr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!kt(a));break}if(kt(a))break;for(r=e.position;a!==0&&!We(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Xa(e),Kt.call(xf,n)?xf[n](e,n,o):wo(e,'unknown document directive "'+n+'"')}if(ve(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,ve(e,!0,-1)):s&&Y(e,"directives end mark is expected"),qr(e,e.lineIndent-1,bo,!1,!0),ve(e,!0,-1),e.checkLineBreaks&&vm.test(e.input.slice(t,e.position))&&wo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&vo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ve(e,!0,-1));return}if(e.position<e.length-1)Y(e,"end of the stream or a document separator is expected");else return}function If(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 Bm(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,Y(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;)Dm(r);return r.documents}function Rm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=If(e,r);if(typeof t!="function")return n;for(var o=0,s=n.length;o<s;o+=1)t(n[o])}function Mm(e,t){var r=If(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Pe("expected a single document in the stream, but found more")}}var Pm=Rm,Um=Mm,Ef={loadAll:Pm,load:Um},Nf=Object.prototype.toString,Of=Object.prototype.hasOwnProperty,tl=65279,Lm=9,_i=10,Hm=13,Fm=32,qm=33,Km=34,rl=35,zm=37,Gm=38,Wm=39,Jm=42,_f=44,Ym=45,ko=58,Zm=61,Qm=62,Xm=63,e0=64,Vf=91,Tf=93,t0=96,jf=123,r0=124,$f=125,De={};De[0]="\\0",De[7]="\\a",De[8]="\\b",De[9]="\\t",De[10]="\\n",De[11]="\\v",De[12]="\\f",De[13]="\\r",De[27]="\\e",De[34]='\\"',De[92]="\\\\",De[133]="\\N",De[160]="\\_",De[8232]="\\L",De[8233]="\\P";var i0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],n0=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function o0(e,t){var r,n,o,s,a,l,c;if(t===null)return{};for(r={},n=Object.keys(t),o=0,s=n.length;o<s;o+=1)a=n[o],l=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&Of.call(c.styleAliases,l)&&(l=c.styleAliases[l]),r[a]=l;return r}function s0(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 Pe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Se.repeat("0",n-t.length)+t}var a0=1,Vi=2;function l0(e){this.schema=e.schema||Za,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Se.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=o0(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==='"'?Vi:a0,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 Df(e,t){for(var r=Se.repeat(" ",t),n=0,o=-1,s="",a,l=e.length;n<l;)o=e.indexOf(`
|
|
134
134
|
`,n),o===-1?(a=e.slice(n),n=l):(a=e.slice(n,o+1),n=o+1),a.length&&a!==`
|
|
135
|
-
`&&(s+=r),s+=a;return s}function
|
|
136
|
-
`+Se.repeat(" ",e.indent*t)}function
|
|
135
|
+
`&&(s+=r),s+=a;return s}function il(e,t){return`
|
|
136
|
+
`+Se.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 Co(e){return e===Fm||e===Lm}function Ti(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==tl||65536<=e&&e<=1114111}function Rf(e){return Ti(e)&&e!==tl&&e!==Hm&&e!==_i}function Mf(e,t,r){var n=Rf(e),o=n&&!Co(e);return(r?n:n&&e!==_f&&e!==Vf&&e!==Tf&&e!==jf&&e!==$f)&&e!==rl&&!(t===ko&&!o)||Rf(t)&&!Co(t)&&e===rl||t===ko&&o}function u0(e){return Ti(e)&&e!==tl&&!Co(e)&&e!==Ym&&e!==Xm&&e!==ko&&e!==_f&&e!==Vf&&e!==Tf&&e!==jf&&e!==$f&&e!==rl&&e!==Gm&&e!==Jm&&e!==qm&&e!==r0&&e!==Zm&&e!==Qm&&e!==Wm&&e!==Km&&e!==zm&&e!==e0&&e!==t0}function d0(e){return!Co(e)&&e!==ko}function ji(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 Pf(e){var t=/^\n* /;return t.test(e)}var Uf=1,nl=2,Lf=3,Hf=4,Kr=5;function f0(e,t,r,n,o,s,a,l){var c,d=0,y=null,f=!1,x=!1,m=n!==-1,h=-1,g=u0(ji(e,0))&&d0(ji(e,e.length-1));if(t||a)for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=ji(e,c),!Ti(d))return Kr;g=g&&Mf(d,y,l),y=d}else{for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=ji(e,c),d===_i)f=!0,m&&(x=x||c-h-1>n&&e[h+1]!==" ",h=c);else if(!Ti(d))return Kr;g=g&&Mf(d,y,l),y=d}x=x||m&&c-h-1>n&&e[h+1]!==" "}return!f&&!x?g&&!a&&!o(e)?Uf:s===Vi?Kr:nl:r>9&&Pf(e)?Kr:a?s===Vi?Kr:nl:x?Hf:Lf}function p0(e,t,r,n,o){e.dump=function(){if(t.length===0)return e.quotingType===Vi?'""':"''";if(!e.noCompatMode&&(i0.indexOf(t)!==-1||n0.test(t)))return e.quotingType===Vi?'"'+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),l=n||e.flowLevel>-1&&r>=e.flowLevel;function c(d){return c0(e,d)}switch(f0(t,l,e.indent,a,c,e.quotingType,e.forceQuotes&&!n,o)){case Uf:return t;case nl:return"'"+t.replace(/'/g,"''")+"'";case Lf:return"|"+Ff(t,e.indent)+qf(Df(t,s));case Hf:return">"+Ff(t,e.indent)+qf(Df(h0(t,a),s));case Kr:return'"'+y0(t)+'"';default:throw new Pe("impossible error: invalid scalar style")}}()}function Ff(e,t){var r=Pf(e)?String(t):"",n=e[e.length-1]===`
|
|
137
137
|
`,o=n&&(e[e.length-2]===`
|
|
138
138
|
`||e===`
|
|
139
139
|
`),s=o?"+":n?"":"-";return r+s+`
|
|
140
|
-
`}function
|
|
141
|
-
`?e.slice(0,-1):e}function
|
|
142
|
-
`);return d=d!==-1?d:e.length,r.lastIndex=d,
|
|
140
|
+
`}function qf(e){return e[e.length-1]===`
|
|
141
|
+
`?e.slice(0,-1):e}function h0(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var d=e.indexOf(`
|
|
142
|
+
`);return d=d!==-1?d:e.length,r.lastIndex=d,Kf(e.slice(0,d),t)}(),o=e[0]===`
|
|
143
143
|
`||e[0]===" ",s,a;a=r.exec(e);){var l=a[1],c=a[2];s=c[0]===" ",n+=l+(!o&&!s&&c!==""?`
|
|
144
|
-
`:"")+
|
|
144
|
+
`:"")+Kf(c,t),o=s}return n}function Kf(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,s,a=0,l=0,c="";n=r.exec(e);)l=n.index,l-o>t&&(s=a>o?a:l,c+=`
|
|
145
145
|
`+e.slice(o,s),o=s+1),a=l;return c+=`
|
|
146
146
|
`,e.length-o>t&&a>o?c+=e.slice(o,a)+`
|
|
147
|
-
`+e.slice(a+1):c+=e.slice(o),c.slice(1)}function
|
|
148
|
-
`:""}var m0=g0,b0={dump:m0};function il(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 w0=Ve,v0=Kd,k0=Jd,C0=ef,S0=tf,x0=Wa,A0=Af.load,B0=Af.loadAll,I0=b0.dump,E0=Pe,N0={binary:af,float:Xd,map:Wd,null:Yd,pairs:cf,set:uf,timestamp:of,bool:Zd,int:Qd,merge:sf,omap:lf,seq:Gd,str:zd},O0=il("safeLoad","load"),_0=il("safeLoadAll","loadAll"),V0=il("safeDump","dump"),T0={Type:w0,Schema:v0,FAILSAFE_SCHEMA:k0,JSON_SCHEMA:C0,CORE_SCHEMA:S0,DEFAULT_SCHEMA:x0,load:A0,loadAll:B0,dump:I0,YAMLException:E0,types:N0,safeLoad:O0,safeLoadAll:_0,safeDump:V0};const j0={class:"yaml-config"},Kf=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!==null&&o!==""&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(n).length===0&&n.constructor===Object?"":T0.dump(n).trim()});return(n,o)=>{const s=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",j0,[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)])}}}),$0={key:0,class:"config-card-display-form"},D0=["data-testid"],M0={key:0,class:"config-card-prop-section-title"},R0=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}}=Ie.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,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[e.format==="structured"?(i.openBlock(),i.createElementBlock("div",$0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propListTypes,c=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${c}-props`,class:i.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(i.openBlock(),i.createElementBlock("div",M0,i.toDisplayString(c==="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[c],d=>(i.openBlock(),i.createBlock(po,{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,D0))),128))])):i.createCommentVNode("",!0),e.format==="json"&&t.record?(i.openBlock(),i.createBlock(Ld,{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(Kf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):i.createCommentVNode("",!0)],64))}}),P0=ut(R0,[["__scopeId","data-v-2052238b"]]),kt="24px",Ti=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},U0=e=>(i.pushScopeId("data-v-c1f7c39c"),e=e(),i.popScopeId(),e),L0=["aria-hidden"],H0={key:0,"data-testid":"kui-icon-svg-title"},F0=U0(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),q0=i.defineComponent({__name:"AddIcon",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:kt,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 kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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 add-icon","data-testid":"kui-icon-wrapper-add-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-add-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",H0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),F0],8,L0))]),_:1},8,["aria-hidden","style"]))}}),K0=Ti(q0,[["__scopeId","data-v-c1f7c39c"]]),z0=e=>(i.pushScopeId("data-v-fbe6ddff"),e=e(),i.popScopeId(),e),G0=["aria-hidden"],W0={key:0,"data-testid":"kui-icon-svg-title"},J0=z0(()=>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)),Y0=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:kt,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 kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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",W0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),J0],8,G0))]),_:1},8,["aria-hidden","style"]))}}),Z0=Ti(Y0,[["__scopeId","data-v-fbe6ddff"]]),Q0=e=>(i.pushScopeId("data-v-745761f6"),e=e(),i.popScopeId(),e),X0=["aria-hidden"],e1={key:0,"data-testid":"kui-icon-svg-title"},t1=Q0(()=>i.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),r1=i.defineComponent({__name:"ChevronDownIcon",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:kt,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 kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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 chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-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-chevron-down-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",e1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),t1],8,X0))]),_:1},8,["aria-hidden","style"]))}}),i1=Ti(r1,[["__scopeId","data-v-745761f6"]]),n1=e=>(i.pushScopeId("data-v-863d10eb"),e=e(),i.popScopeId(),e),o1=["aria-hidden"],s1={key:0,"data-testid":"kui-icon-svg-title"},a1=n1(()=>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)),l1=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:kt,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 kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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",s1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),a1],8,o1))]),_:1},8,["aria-hidden","style"]))}}),c1=Ti(l1,[["__scopeId","data-v-863d10eb"]]),u1=e=>(i.pushScopeId("data-v-d9894a05"),e=e(),i.popScopeId(),e),d1=["aria-hidden"],f1={key:0,"data-testid":"kui-icon-svg-title"},p1=u1(()=>i.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),h1=i.defineComponent({__name:"MoreIcon",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:kt,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 kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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 more-icon","data-testid":"kui-icon-wrapper-more-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-more-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",f1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),p1],8,d1))]),_:1},8,["aria-hidden","style"]))}}),y1=Ti(h1,[["__scopeId","data-v-d9894a05"]]),g1={class:"config-card-title","data-testid":"config-card-title"},m1={class:"config-card-actions"},b1=["href"],w1={class:"config-card-details-section"},v1=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},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const n=t,o=e,{i18n:{t:s}}=Ie.useI18n(),{getMessageFromError:a}=Ie.useErrors(),{convertKeyToTitle:l}=Ie.useStringHelpers(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=i.ref("structured"),p=N=>{y.value=N==null?void 0:N.value},I={id:{type:ce.ID,label:s("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:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:ce.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:ce.BadgeTag,order:-1,section:pe.Basic}},w=i.ref(!1),h=i.ref(!1),g=i.ref(""),b=i.ref({}),v=i.computed(()=>{var N,E,x;if(!b.value)return[];const O=[],G=Object.keys(b.value).length;for(const R in b.value){const J=(E=(N=o.configSchema)==null?void 0:N[R])==null?void 0:E.order,ee=(x=I[R])==null?void 0:x.order;let ne=G;(ee||ee===0)&&(ne=ee===-1?G+1:ee),J&&(ne=J===-1?G+1:J),O.push([R,ne])}return O.sort(function(R,J){return R[1]-J[1]}),O.map(R=>{var J,ee;const ne=R[0],me=(J=b.value)==null?void 0:J[ne],ie=((ee=o.configSchema)==null?void 0:ee[ne])||{},Ee=I[ne];return{key:ne,value:me,hidden:ie.hidden||!1,type:ie.type??((Ee==null?void 0:Ee.type)||ce.Text),label:ie.label??((Ee==null?void 0:Ee.label)||l(ne)),tooltip:ie.tooltip??((Ee==null?void 0:Ee.tooltip)||void 0),section:ie.section??((Ee==null?void 0:Ee.section)||pe.Advanced)}}).filter(R=>!R.hidden&&R.key!==o.pluginConfigKey)}),B=i.computed(()=>{var N,E;if(!b.value||!o.pluginConfigKey)return[];const x=b.value[o.pluginConfigKey]||{},O=Object.keys(x).length,G=[];for(const R in x){const J=(E=(N=o.pluginConfigSchema)==null?void 0:N[R])==null?void 0:E.order,ee=x[R];let ne=ee!=null&&ee!==""?O-1:O;J&&(ne=J===-1?O+1:J),G.push([R,ne])}return G.sort(function(R,J){return R[1]-J[1]}),G.map(R=>{var J;const ee=R[0],ne=x[ee],me=((J=o.pluginConfigSchema)==null?void 0:J[ee])||{};return{key:ee,value:ne,hidden:me.hidden||!1,type:me.type??ce.Text,label:me.label??l(ee),tooltip:me.tooltip??void 0,section:pe.Plugin}}).filter(R=>!R.hidden)}),S=i.computed(()=>{var N,E,x,O;return{basic:(N=v.value)==null?void 0:N.filter(G=>G.section===pe.Basic),advanced:(E=v.value)==null?void 0:E.filter(G=>G.section===pe.Advanced),plugin:(O=B.value)==null?void 0:O.concat((x=v.value)==null?void 0:x.filter(G=>G.section===pe.Plugin))}}),C=i.computed(()=>{const N=[];return S.value.basic.length&&N.push("basic"),S.value.advanced.length&&N.push("advanced"),S.value.plugin.length&&N.push("plugin"),N}),T=i.computed(()=>{var N,E;let x=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):o.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(E=o.config)!=null&&E.workspace?`/${o.config.workspace}`:"")),x=x.replace(/{id}/gi,o.config.entityId),x});return i.watch(w,N=>{n("loading",N)},{immediate:!0}),i.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:N}=await c.get(T.value);if(o.dataKey)if(typeof N[o.dataKey]<"u")b.value={...N[o.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:o.dataKey}));else b.value={...N};Object.keys(o.configSchema).filter(E=>o.configSchema[E].forceShow).forEach(E=>{b.value&&typeof b.value[E]>"u"&&(b.value[E]=null)}),n("fetch:success",N)}catch(N){const E=a(N);g.value=E.startsWith("code")?s("baseConfigCard.errors.load"):E,h.value=!0,n("fetch:error",N)}finally{w.value=!1}}),(N,E)=>{const x=i.resolveComponent("KLabel"),O=i.resolveComponent("KSelect"),G=i.resolveComponent("KButton"),R=i.resolveComponent("KSkeleton"),J=i.resolveComponent("KEmptyState"),ee=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(ee,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},i.createSlots({actions:i.withCtx(()=>[i.createElementVNode("div",m1,[i.renderSlot(N.$slots,"actions",{},void 0,!0),i.createVNode(x,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.label),1)]),_:1}),i.createVNode(O,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(i.openBlock(),i.createBlock(G,{key:0,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(Z0),{size:i.unref(Xy)},null,8,["size"])],8,b1)]),_:1})):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[w.value?(i.openBlock(),i.createBlock(R,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(i.openBlock(),i.createBlock(J,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(g.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",w1,[i.createVNode(P0,{config:e.config,"fetcher-url":T.value,format:y.value,"prop-list-types":C.value,"property-collections":S.value,record:b.value},i.createSlots({_:2},[i.renderList(Object.keys(N.$slots),ne=>({name:ne,fn:i.withCtx(({row:me,rowValue:ie})=>[i.renderSlot(N.$slots,ne,{row:me,rowValue:ie},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("span",g1,[i.renderSlot(N.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),zf=ut(v1,[["__scopeId","data-v-f40a683b"]]),k1=["novalidate"],C1={class:"form-actions","data-testid":"form-actions"},S1=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},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const n=t,o=e,s=Wr.useRouter(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:l}=Ie.useErrors(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=i.ref(!1),y=i.ref(!1),p=i.ref(""),I=i.computed(()=>o.canSubmit===!1||o.isReadonly),w=i.ref(!1),h=i.computed(()=>{var C,T;let N=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((C=o.config)==null?void 0:C.controlPlaneId)||""):o.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(T=o.config)!=null&&T.workspace?`/${o.config.workspace}`:"")),o.editId?(N=N.replace(/{id}/gi,o.editId),N):(N=N.replace(/\/{id}/gi,""),N)}),g=()=>{w.value=!w.value},b=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):v()},v=()=>{n("cancel")},B=()=>{I.value||n("submit")},S=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 c.get(h.value);n("fetch:success",C)}catch(C){const T=l(C);p.value=T.startsWith("code")?a("baseForm.errors.edit"):T,y.value=!0,n("fetch:error",C)}finally{d.value=!1}}),(C,T)=>{const N=i.resolveComponent("KSkeleton"),E=i.resolveComponent("KEmptyState"),x=i.resolveComponent("KAlert"),O=i.resolveComponent("KButton"),G=i.resolveComponent("KTabs"),R=i.resolveComponent("KSlideout");return i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(N,{key:0,type:"form"})):y.value?(i.openBlock(),i.createBlock(E,{key:1,"action-button-text":i.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(i.openBlock(),i.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:o.noValidate,onReset:i.withModifiers(v,["prevent"]),onSubmit:i.withModifiers(B,["prevent"])},[i.renderSlot(C.$slots,"default",{},void 0,!0),e.errorMessage?(i.openBlock(),i.createBlock(x,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):i.createCommentVNode("",!0),i.createElementVNode("div",C1,[i.renderSlot(C.$slots,"form-actions",{},()=>[i.createVNode(O,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:T[0]||(T[0]=J=>g())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),i.createVNode(O,{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(O,{appearance:"primary","data-testid":"form-submit",disabled:I.value,type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,k1)),i.createVNode(R,{"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:T[1]||(T[1]=J=>g())},{default:i.withCtx(()=>[i.createElementVNode("div",null,i.toDisplayString(i.unref(a)("baseForm.configuration.message")),1),i.createVNode(G,{"data-testid":"form-view-configuration-slideout-tabs",tabs:S.value},{json:i.withCtx(()=>[i.createVNode(Ld,{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(Kf,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Gf=ut(S1,[["__scopeId","data-v-fd05df8e"]]),x1=["data-truncate"],A1=i.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const t=e,r=i.computed(()=>{var b;return((b=t.rowEl)==null?void 0:b.querySelector(`[data-testid="${t.keyName}"]`))||null}),n=i.computed(()=>{var b;return((b=r.value)==null?void 0:b.querySelector('[data-truncate="true"]'))||null}),o=i.computed(()=>{var b,v;const B=(b=t.rowEl)==null?void 0:b.querySelectorAll("td");return B?((v=B[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!0}),s=i.computed(()=>o.value||t.tooltip);let a;const l=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{var b,v,B;let S=((b=r.value)==null?void 0:b.clientWidth)||0;if(r.value&&"getComputedStyle"in window){const C=window.getComputedStyle(r.value);S-=(parseFloat(C.paddingLeft)||0)+(parseFloat(C.paddingRight)||0)}y.value=((v=n.value)==null?void 0:v.getBoundingClientRect().width)||0,p.value=S,I.value=((B=d.value)==null?void 0:B.innerText)||""},d=i.ref({}),y=i.ref(0),p=i.ref(0),I=i.ref(""),w=i.computed(()=>[n.value,r.value]),h=i.watch(w,b=>{if(s.value&&(l(),"ResizeObserver"in window&&window)){a=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of b)v&&a.observe(v)}},{immediate:!0,flush:"post",deep:!0}),g=i.computed(()=>s.value?y.value>p.value:!1);return i.onMounted(()=>{c()}),i.onUnmounted(()=>{h()}),(b,v)=>{const B=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:d,class:"content-wrapper"},[s.value?(i.openBlock(),i.createElementBlock("span",{key:0,"data-truncate":s.value||void 0},[i.createVNode(B,{"max-width":"300",placement:"bottom-start",text:g.value?I.value:""},{default:i.withCtx(()=>[i.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,x1)):i.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),B1=ut(A1,[["__scopeId","data-v-b252463e"]]),I1={class:"toolbar-container"},E1={key:0,class:"toolbar-button-container"},N1=["data-testid"],O1=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},sortHandlerFunction:{type:Function,default:()=>({})},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:""},titleTag:{type:String,default:"h2"},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}}=Ie.useI18n(),s=i.computed(()=>{var N,E;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(N=r.errorMessage)==null?void 0:N.title,message:(E=r.errorMessage)==null?void 0:E.message}}),a=i.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),l=N=>N.hasData||!!r.query,c=i.computed(()=>{const N=[];return Object.keys(r.tableHeaders).forEach(E=>{const x=r.tableHeaders[E];N.push({label:x.label??E,key:E,sortable:x.sortable??!1,hidable:x.hidable??!0})}),r.enableEntityActions&&N.push({key:"actions",hideLabel:!0}),N}),d=N=>({"data-rowid":N.id,"data-testid":N.name,...r.rowAttributes(N)}),y=i.ref({}),p=N=>{var E;return(E=y.value)==null?void 0:E.$el.querySelector(`[data-rowid="${N.id}"]`)},I=N=>{const E={"data-testid":N.headerKey,...r.cellAttributes(N)};return N.colIndex===0&&(E.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),E},w=()=>{n("empty-state-cta-clicked"),h()},h=()=>{n("clear-search-input")},g=i.computed(()=>r.disableRowClick?void 0:(N,E)=>{n("click:row",E)}),b=N=>{n("sort",N)},{setTablePreferences:v,getTablePreferences:B}=by(),S=i.ref(B(a.value)),C=i.computed(()=>{const N=B(a.value);return{...r.initialFetcherParams,...N}}),T=N=>{S.value=N,c.value.forEach(E=>{!("hidable"in E)||!S.value.columnVisibility||E.hidable===!1&&(S.value.columnVisibility[E.key]=!0)}),a.value&&v(a.value,N)};return(N,E)=>{const x=i.resolveComponent("KButton"),O=i.resolveComponent("KDropdown"),G=i.resolveComponent("KTable"),R=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(R,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:i.withCtx(()=>[i.createVNode(G,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":I,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","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,error:s.value.hasError,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":C.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":d,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":S.value,onEmptyStateActionClick:w,"onRow:click":g.value,onSort:E[0]||(E[0]=J=>b(J)),"onUpdate:tablePreferences":T},i.createSlots({toolbar:i.withCtx(({state:J})=>[i.withDirectives(i.createElementVNode("div",I1,[i.renderSlot(N.$slots,"toolbar-filter",{},void 0,!0),N.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",E1,[i.renderSlot(N.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,l(J)]])]),actions:i.withCtx(({row:J,rowKey:ee,rowValue:ne})=>[i.createElementVNode("div",{class:"actions-container","data-testid":J.name},[i.createVNode(O,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(N.$slots,"actions",{row:J,rowKey:ee,rowValue:ne},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(x,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:i.withCtx(()=>[i.createVNode(i.unref(y1))]),_:1})]),_:2},1032,["width"])],8,N1)]),_:2},[i.renderList(e.tableHeaders,(J,ee)=>({name:ee,fn:i.withCtx(({row:ne,rowKey:me,rowValue:ie})=>[i.createVNode(B1,{"key-name":String(ee),"row-el":p(ne),tooltip:J.tooltip},{default:i.withCtx(()=>[i.renderSlot(N.$slots,ee,{row:ne,rowKey:me,rowValue:ie},()=>[i.createTextVNode(i.toDisplayString(ie),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:i.withCtx(()=>[i.createVNode(i.unref(K0))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Wf=ut(O1,[["__scopeId","data-v-71b4425a"]]),_1={key:0,class:"kong-ui-entity-delete-error"},V1={key:1,class:"description"},T1=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}=Ie.useI18n(),n=e,o=t,s=i.computed(()=>n.needConfirm?n.entityName:""),a=()=>{o("cancel")},l=()=>{o("proceed")};return(c,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:l},{default:i.withCtx(()=>[e.error?(i.openBlock(),i.createElementBlock("div",_1,[i.createVNode(y,{appearance:"danger"},{default: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||c.$slots.description?(i.openBlock(),i.createElementBlock("div",V1,[i.renderSlot(c.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(n.description),1)],!0)])):i.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Jf=ut(T1,[["__scopeId","data-v-4361d622"]]),j1={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"},D1=["fill"],M1={mask:"url(#mask0_180_20349)"},R1=["fill"],Yf=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Jy})`}},setup(e){return(t,r)=>(i.openBlock(),i.createElementBlock("svg",j1,[i.createElementVNode("mask",$1,[i.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,D1)]),i.createElementVNode("g",M1,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,R1)])]))}}),P1={key:1,class:"kong-ui-entity-filter"},U1={class:"kong-ui-entity-filter-menu"},L1=["data-testid"],H1=["onClick","onKeydown"],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}}=Ie.useI18n(),n=e,o=t,s=i.ref(!1),a=i.ref({}),l=i.ref(new Set),c=i.computed(()=>{const C=[];return new URLSearchParams(n.modelValue).forEach((T,N)=>{T!==""&&C.push(N)}),C}),d=i.computed(()=>{const C=n.config.fields;return Object.keys(C).filter(T=>{var N;return(N=C==null?void 0:C[T])==null?void 0:N.searchable}).map(T=>({label:C[T].label||T,value:T,expanded:!1}))});i.watch(()=>n.modelValue,C=>{a.value={},new URLSearchParams(C).forEach((T,N)=>{a.value[N]=T})});const y=()=>{s.value=!s.value},p=C=>{l.value.has(C)?l.value.delete(C):l.value.add(C)},I=C=>{o("update:modelValue",C)},w=()=>{I("")},h=C=>`filter-${C}`,g=C=>{var T,N;return(((N=(T=n.config.schema)==null?void 0:T[C])==null?void 0:N.values)??[]).map(E=>({value:E,label:E}))},b=C=>{var T,N;return((N=(T=n.config.schema)==null?void 0:T[C])==null?void 0:N.type)??"text"},v=C=>{a.value={...a.value,[C]:""},S()},B=()=>{a.value={},S(!0)},S=(C=!1)=>{const T=Object.keys(a.value).reduce((N,E)=>(a.value[E]&&(N[E]=`${a.value[E]}`),N),{});C&&(s.value=!1),o("update:modelValue",new URLSearchParams(T).toString())};return(C,T)=>{const N=i.resolveComponent("KInput"),E=i.resolveComponent("KButton"),x=i.resolveComponent("KSelect");return e.config.isExactMatch?(i.openBlock(),i.createBlock(N,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":I},{before:i.withCtx(()=>[i.createVNode(Yf)]),after:i.withCtx(()=>[i.withDirectives(i.createVNode(i.unref(c1),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[i.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",P1,[i.createVNode(E,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:i.withCtx(()=>[i.createVNode(Yf),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:y},null,512),[[i.vShow,s.value]]),i.withDirectives(i.createElementVNode("div",U1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,O=>{var G,R;return i.openBlock(),i.createElementBlock("div",{key:O.value,class:"kong-ui-entity-filter-menu-item","data-testid":O.value},[i.createElementVNode("span",{class:i.normalizeClass(["menu-item-title",{expanded:l.value.has(O.value)}]),role:"button",tabindex:"0",onClick:J=>p(O.value),onKeydown:i.withKeys(J=>p(O.value),["enter"])},[i.createTextVNode(i.toDisplayString(O.label)+" ",1),i.withDirectives(i.createElementVNode("span",F1,null,512),[[i.vShow,c.value.includes(O.value)]]),i.createVNode(i.unref(i1),{class:i.normalizeClass(["menu-item-expand-icon",{expanded:l.value.has(O.value)}]),color:i.unref(Zy)},null,8,["class","color"])],42,H1),i.withDirectives(i.createElementVNode("div",q1,[i.createElementVNode("label",{class:"menu-item-label",for:h(O.value)},i.toDisplayString(i.unref(r)("filter.fieldLabel")),9,K1),((R=(G=e.config.schema)==null?void 0:G[O.value])==null?void 0:R.type)==="select"?(i.openBlock(),i.createBlock(x,{key:0,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,items:g(O.value),placeholder:i.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(N,{key:1,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,autocomplete:"off",placeholder:i.unref(r)("filter.inputPlaceholder"),type:b(O.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[i.vShow,l.value.has(O.value)]]),i.withDirectives(i.createElementVNode("div",z1,[i.createVNode(E,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:T[0]||(T[0]=J=>S(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.applyButtonText")),1)]),_:1}),i.createVNode(E,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:J=>v(O.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[i.vShow,l.value.has(O.value)]])],8,L1)}),128)),i.createElementVNode("div",G1,[i.createVNode(E,{appearance:"tertiary",size:"small",onClick:B},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[i.vShow,s.value]])]))}}}),Zf=ut(W1,[["__scopeId","data-v-94990087"]]),jt=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)}});let vo;const J1=new Uint8Array(16);function Y1(){if(!vo&&(vo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vo(J1)}const Te=[];for(let e=0;e<256;++e)Te.push((e+256).toString(16).slice(1));function Z1(e,t=0){return Te[e[t+0]]+Te[e[t+1]]+Te[e[t+2]]+Te[e[t+3]]+"-"+Te[e[t+4]]+Te[e[t+5]]+"-"+Te[e[t+6]]+Te[e[t+7]]+"-"+Te[e[t+8]]+Te[e[t+9]]+"-"+Te[e[t+10]]+Te[e[t+11]]+Te[e[t+12]]+Te[e[t+13]]+Te[e[t+14]]+Te[e[t+15]]}const Q1=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Qf={randomUUID:Q1};function X1(e,t,r){if(Qf.randomUUID&&!t&&!e)return Qf.randomUUID();e=e||{};const n=e.random||(e.rng||Y1)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Z1(n)}const eb=["aria-labelledby"],tb={class:"form-section-wrapper"},rb={key:1,class:"form-section-description"},ib={key:2,class:"form-section-footer"},nb={class:"form-section-content"},ob=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},titleTag:{type:String,default:"h2"}},setup(e){const t=i.useSlots(),r=X1();return(n,o)=>(i.openBlock(),i.createElementBlock("div",{"aria-labelledby":e.title?i.unref(r):void 0,class:i.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[i.createElementVNode("div",tb,[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.createBlock(i.resolveDynamicComponent(e.titleTag),{key:0,id:i.unref(r),class:"form-section-title"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.title),1)]),_:1},8,["id"])):i.createCommentVNode("",!0),e.description||i.unref(t).description?(i.openBlock(),i.createElementBlock("div",rb,[i.renderSlot(n.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(e.description),1)],!0)])):i.createCommentVNode("",!0),i.unref(t).footer?(i.openBlock(),i.createElementBlock("div",ib,[i.renderSlot(n.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",nb,[i.renderSlot(n.$slots,"default",{},void 0,!0)])])],10,eb))}}),ko=ut(ob,[["__scopeId","data-v-b1f74200"]]),{useAxios:Co,useDeleteUrlBuilder:Xf,useErrors:ep,useExternalLinkCreator:ew,useFetchUrlBuilder:tw,useFetcher:tp,useDebouncedFilter:rw,useStringHelpers:rp,useHelpers:ip,useGatewayFeatureSupported:iw,useTruncationDetector:nw,useValidators:ow}=Ie,sb={class:"kong-ui-entities-certificates-list"},ab={key:0},lb={key:1},cb={key:0},ub={key:1},db={key:0},fb={key:1},pb={key:1},hb={key:1},yb=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 te;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ct.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=Co((te=n.config)==null?void 0:te.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),I={subject:{label:o("certificates.list.table_headers.subject"),hidable:!1},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 q,fe;let U=`${n.config.apiBaseUrl}${Ii.list[n.config.app]}`;return n.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((q=n.config)==null?void 0:q.controlPlaneId)||""):n.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(fe=n.config)!=null&&fe.workspace?`/${n.config.workspace}`:"")),U}),h=i.ref(""),g=i.computed(()=>{const U=n.config.app==="konnect"||n.config.isExactMatch;return U?{isExactMatch:U,placeholder:o("certificates.search.placeholder")}:{isExactMatch:U,schema:n.config.filterSchema}}),{fetcher:b,fetcherState:v}=tp(n.config,w.value),B=()=>{h.value=""},S=()=>{d.value++},C=i.ref(null),T=(U,q)=>{const fe=U.id;if(!q(fe)){r("copy:error",{entity:U,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:o("certificates.copy.success",{val:fe})})},N=(U,q)=>{const fe=JSON.stringify(U);if(!q(fe)){r("copy:error",{entity:U,message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,message:o("certificates.copy.success_brief")})},E=async U=>{var fe;await((fe=n.canRetrieve)==null?void 0:fe.call(n,U))&&l.push(n.config.getViewRoute(U.id))},x=U=>({label:o("certificates.actions.view"),to:n.config.getViewRoute(U)}),O=U=>({label:o("certificates.actions.edit"),to:n.config.getEditRoute(U)}),G=U=>{if(n.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:n.config.getCreateSniRoute(U)}},R=i.ref(void 0),J=i.ref(!1),ee=i.ref(!1),ne=i.ref(""),me=Xf(n.config,w.value),{certificateDataCache:ie,getCertificateData:Ee}=ct.useCertificate(),qr=U=>{R.value=U,J.value=!0},Kr=()=>{J.value=!1},fr=async()=>{var U,q,fe;if((U=R.value)!=null&&U.id){ee.value=!0;try{await c.delete(me(R.value.id)),ee.value=!1,J.value=!1,d.value++,r("delete:success",R.value)}catch(Ue){ne.value=((fe=(q=Ue.response)==null?void 0:q.data)==null?void 0:fe.message)||Ue.message||o("certificates.errors.delete"),r("error",Ue)}finally{ee.value=!1}}},$t=i.ref(!1);i.watch(v,U=>{var q,fe,Ue,Qe;if(Array.isArray((q=U==null?void 0:U.response)==null?void 0:q.data)&&($t.value=U.response.data.length>0),U.status===Ft.Error){C.value={title:o("certificates.errors.general")},(Qe=(Ue=(fe=U.error)==null?void 0:fe.response)==null?void 0:Ue.data)!=null&&Qe.message&&(C.value.message=U.error.response.data.message),r("error",U.error);return}ie.value={},C.value=null});const X=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(X.value.title=o("certificates.list.empty_state.title"),X.value.ctaText=o("certificates.actions.create"))}),(U,q)=>{const fe=i.resolveComponent("KButton"),Ue=i.resolveComponent("KCopy"),Qe=i.resolveComponent("KBadge"),zr=i.resolveComponent("KTruncate"),re=i.resolveComponent("KDropdownItem"),xe=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",sb,[i.createVNode(i.unref(Wf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":C.value,fetcher:i.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":i.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":q[2]||(q[2]=Z=>E(Z)),onSort:S},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(Zf),{modelValue:h.value,"onUpdate:modelValue":q[0]||(q[0]=Z=>h.value=Z),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref(jt),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(fe,{appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[i.vShow,$t.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",ab,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.subject?Z.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",lb,i.toDisplayString(i.unref(Ee)(Z).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",cb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.expiry?i.unref(s)(Z.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",ub,i.toDisplayString(i.unref(Ee)(Z).schemaExpiry?i.unref(s)(i.unref(Ee)(Z).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",db,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.dns_names?`dns=${Z.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",fb,i.toDisplayString(i.unref(Ee)(Z).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:Z})=>[Z!=null&&Z.cert?(i.openBlock(),i.createBlock(Ue,{key:0,"data-testid":"copy-certificate-cert",text:Z.cert,truncate:""},null,8,["text"])):(i.openBlock(),i.createElementBlock("span",pb,"-"))]),tags:i.withCtx(({row:Z})=>{var Ae;return[((Ae=Z==null?void 0:Z.tags)==null?void 0:Ae.length)>0?(i.openBlock(),i.createBlock(zr,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Z==null?void 0:Z.tags,Gr=>(i.openBlock(),i.createBlock(Qe,{key:Gr,onClick:q[1]||(q[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Gr),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",hb,"-"))]}),actions:i.withCtx(({row:Z})=>[i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-id",onClick:Gr=>T(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-json",onClick:Gr=>N(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(jt),{"auth-function":()=>e.canRetrieve(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-view","has-divider":"",item:x(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canEdit(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-edit",item:O(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(i.openBlock(),i.createBlock(i.unref(jt),{key:0,"auth-function":()=>e.canCreateSni()},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-add-sni",item:G(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref(jt),{"auth-function":()=>e.canDelete(Z)},{default:i.withCtx(()=>[i.createVNode(re,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ae=>qr(Z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),i.createVNode(i.unref(Jf),{"action-pending":ee.value,"entity-type":i.unref(La).Certificate,error:ne.value,title:i.unref(o)("certificates.delete.title"),visible:J.value,onCancel:Kr,onProceed:fr},{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"])])}}}),dr=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},gb=dr(yb,[["__scopeId","data-v-8059a087"]]),mb="#d60027",bb={class:"sni-field-container"},wb={key:1,class:"sni-field-controls-container"},vb={key:0},kb=dr(i.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(e,{emit:t}){const r=e,n=t,{i18nT:o,i18n:{t:s}}=ct.useI18n(),a=i.ref([]);return i.watch(r.modelValue,l=>{a.value=[...l]},{immediate:!0,deep:!0}),i.watch(a,l=>{n("update:modelValue",l)},{deep:!0}),(l,c)=>{const d=i.resolveComponent("KLabel"),y=i.resolveComponent("KInput"),p=i.resolveComponent("KButton"),I=i.resolveComponent("router-link");return i.openBlock(),i.createElementBlock("div",bb,[i.createVNode(d,{info:i.unref(s)("certificates.form.fields.snis.tooltip")},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(w,h)=>(i.openBlock(),i.createElementBlock("div",{key:h,class:"sni-field-input"},[!e.isEditing||a.value[h]?(i.openBlock(),i.createBlock(y,{key:0,modelValue:a.value[h],"onUpdate:modelValue":g=>a.value[h]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${h+1}`,disabled:e.isEditing,placeholder:i.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):i.createCommentVNode("",!0),e.isEditing?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",wb,[i.createVNode(p,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>l.$emit("remove",h)},{default:i.withCtx(()=>[i.createVNode(i.unref(kp),{color:i.unref(mb)},null,8,["color"])]),_:2},1032,["onClick"]),i.createVNode(p,{appearance:"tertiary","data-testid":"add-sni",disabled:h!==a.value.length-1,icon:"",onClick:c[0]||(c[0]=g=>l.$emit("add"))},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao))]),_:2},1032,["disabled"])]))]))),128)),a.value.length===0?(i.openBlock(),i.createElementBlock("div",vb,[i.createVNode(p,{onClick:c[1]||(c[1]=w=>l.$emit("add"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):i.createCommentVNode("",!0),e.isEditing?(i.openBlock(),i.createBlock(i.unref(o),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:i.withCtx(()=>[i.createVNode(I,{to:e.sniListRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),Cb={class:"kong-ui-entities-certificates-form"},Sb=dr(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:""},showSnisField:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading"],setup(e,{emit:t}){var N;const r=t,n=e,o=Wr.useRouter(),{i18nT:s,i18n:{t:a}}=ct.useI18n(),{getMessageFromError:l}=ep(),{axiosInstance:c}=Co((N=n.config)==null?void 0:N.axiosRequestConfig),d=i.computed(()=>Ii.form[n.config.app].edit),y=i.computed(()=>n.certificateId?Ht.Edit:Ht.Create),p=i.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),I=i.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),w=i.computed(()=>(y.value===Ht.Create||JSON.stringify(p.fields)!==JSON.stringify(I))&&!!p.fields.cert&&!!p.fields.key),h=E=>{var x,O;p.fields.cert=(E==null?void 0:E.cert)||"",p.fields.key=(E==null?void 0:E.key)||"",p.fields.certAlt=(E==null?void 0:E.cert_alt)||"",p.fields.keyAlt=(E==null?void 0:E.key_alt)||"",p.fields.snis=(x=E==null?void 0:E.snis)!=null&&x.length?E.snis:[""],p.fields.tags=((O=E==null?void 0:E.tags)==null?void 0:O.join(", "))||"",Object.assign(I,p.fields)},g=()=>{o.push(n.config.cancelRoute)},b=()=>{p.fields.snis.push("")},v=E=>{p.fields.snis.splice(E,1)},B=i.computed(()=>{var x,O;let E=`${n.config.apiBaseUrl}${Ii.form[n.config.app].validate}`;return n.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((x=n.config)==null?void 0:x.controlPlaneId)||""):n.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),E=E.replace(/{id}/gi,n.certificateId),E}),S=i.computed(()=>{var x,O;let E=`${n.config.apiBaseUrl}${Ii.form[n.config.app][y.value]}`;return n.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((x=n.config)==null?void 0:x.controlPlaneId)||""):n.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),E=E.replace(/{id}/gi,n.certificateId),E}),C=i.computed(()=>{var E,x;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,...n.showSnisField?{snis:p.fields.snis.filter(Boolean)}:{},tags:(x=(E=p.fields.tags.split(","))==null?void 0:E.map(O=>String(O||"").trim()))==null?void 0:x.filter(O=>O!=="")}}),T=async()=>{var E,x,O,G,R,J,ee,ne,me;try{p.isReadonly=!0;let ie;await c.post(B.value,C.value),y.value==="create"?ie=await c.post(S.value,C.value):y.value==="edit"&&(ie=((E=n.config)==null?void 0:E.app)==="konnect"?await c.put(S.value,C.value):await c.patch(S.value,C.value)),p.fields.cert=((x=ie==null?void 0:ie.data)==null?void 0:x.cert)||"",p.fields.key=((O=ie==null?void 0:ie.data)==null?void 0:O.key)||"",p.fields.certAlt=((G=ie==null?void 0:ie.data)==null?void 0:G.cert_alt)||"",p.fields.keyAlt=((R=ie==null?void 0:ie.data)==null?void 0:R.key_alt)||"",p.fields.snis=(ee=(J=ie==null?void 0:ie.data)==null?void 0:J.snis)!=null&&ee.length?ie.data.snis:[""],p.fields.tags=((me=(ne=ie==null?void 0:ie.data)==null?void 0:ne.tags)==null?void 0:me.join(", "))||"",Object.assign(I,p.fields),r("update",ie==null?void 0:ie.data)}catch(ie){p.errorMessage=l(ie),r("error",ie)}finally{p.isReadonly=!1}};return(E,x)=>{const O=i.resolveComponent("KTextArea"),G=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Cb,[i.createVNode(i.unref(Gf),{"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":x[7]||(x[7]=R=>E.$emit("error",R)),"onFetch:success":h,onLoading:x[8]||(x[8]=R=>E.$emit("loading",R)),onSubmit:T},{default:i.withCtx(()=>[i.createVNode(i.unref(ko),{description:i.unref(a)("certificates.form.sections.ssl.description"),title:i.unref(a)("certificates.form.sections.ssl.title")},{default:i.withCtx(()=>[i.createVNode(O,{modelValue:p.fields.cert,"onUpdate:modelValue":x[0]||(x[0]=R=>p.fields.cert=R),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(O,{modelValue:p.fields.key,"onUpdate:modelValue":x[1]||(x[1]=R=>p.fields.key=R),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(O,{modelValue:p.fields.certAlt,"onUpdate:modelValue":x[2]||(x[2]=R=>p.fields.certAlt=R),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(O,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":x[3]||(x[3]=R=>p.fields.keyAlt=R),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"]),e.showSnisField&&e.config.sniListRoute?(i.openBlock(),i.createBlock(kb,{key:0,modelValue:p.fields.snis,"onUpdate:modelValue":x[4]||(x[4]=R=>p.fields.snis=R),"is-editing":y.value===i.unref(Ht).Edit,"sni-list-route":e.config.sniListRoute,onAdd:b,onRemove:x[5]||(x[5]=R=>v(R))},null,8,["modelValue","is-editing","sni-list-route"])):i.createCommentVNode("",!0)]),_:1},8,["description","title"]),i.createVNode(i.unref(ko),{description:i.unref(a)("certificates.form.sections.general.description"),title:i.unref(a)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(G,{modelValue:p.fields.tags,"onUpdate:modelValue":x[6]||(x[6]=R=>p.fields.tags=R),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-59428be8"]]),So="/v2/control-planes/{controlPlaneId}/core-entities",xo="/{workspace}",ji={list:{konnect:`${So}/ca_certificates`,kongManager:`${xo}/ca_certificates`},form:{konnect:{create:`${So}/ca_certificates`,edit:`${So}/ca_certificates/{id}`,validate:`${So}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${xo}/ca_certificates`,edit:`${xo}/ca_certificates/{id}`,validate:`${xo}/schemas/ca_certificates/validate`}}},xb={class:"kong-ui-ca-certificate-entity-config-card"},Ab={key:0},Bb=dr(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"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],n=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=ct.useI18n(),{convertKeyToTitle:l}=rp(),{getPropValue:c}=ip(),{getCertificateData:d}=ct.useCertificate(),y=i.computed(()=>ji.form[o.config.app].edit),p=i.ref(),I=i.computed(()=>{if(p.value)return d(p.value)}),w=i.computed(()=>{var S;return((S=I.value)==null?void 0:S.schemaIssuer)||""}),h=i.computed(()=>{var S,C;return(S=I.value)!=null&&S.schemaExpiry?a((C=I.value)==null?void 0:C.schemaExpiry):""}),g=i.computed(()=>{var S;return((S=I.value)==null?void 0:S.schemaKeyUsages)||[]}),b=(S,C)=>{const T=c("rowValue",C);if(S==="expiry")return h.value;if(S==="key_usages")return g.value;if(T)return T[S]},v=S=>{p.value=S,n("fetch:success",S)},B=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(S,C)=>{const T=i.resolveComponent("KCodeBlock"),N=i.resolveComponent("KLabel"),E=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",xb,[i.createVNode(i.unref(zf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":C[0]||(C[0]=x=>S.$emit("fetch:error",x)),"onFetch:success":v,onLoading:C[1]||(C[1]=x=>S.$emit("loading",x))},{cert:i.withCtx(x=>[i.unref(c)("rowValue",x)?(i.openBlock(),i.createBlock(T,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",x),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),"metadata-label":i.withCtx(()=>[i.createVNode(N,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(x=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",x)).filter(O=>!r.includes(O)),O=>(i.openBlock(),i.createBlock(i.unref(po),{key:O,"data-testid":`ca-cert-metadata-${O}`,item:{key:O,label:i.unref(l)(O),value:b(O,x),type:O==="key_usages"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(w.value||"–"),1)]),key_usages:i.withCtx(()=>[g.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ab,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(g.value,(x,O)=>(i.openBlock(),i.createBlock(E,{key:`key_usages-badge-tag-${O}`,class:"config-badge","data-testid":`key_usages-badge-tag-${O}`,tooltip:x,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-b34eea10"]]),Ib={class:"kong-ui-entities-ca-certificates-list"},Eb={key:0},Nb={key:1},Ob={key:0},_b={key:1},Vb={key:1},Tb=dr(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}=ct.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=Co((X=n.config)==null?void 0:X.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),I={issuer:{label:o("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},w=i.computed(()=>{var U,q;let te=`${n.config.apiBaseUrl}${ji.list[n.config.app]}`;return n.config.app==="konnect"?te=te.replace(/{controlPlaneId}/gi,((U=n.config)==null?void 0:U.controlPlaneId)||""):n.config.app==="kongManager"&&(te=te.replace(/\/{workspace}/gi,(q=n.config)!=null&&q.workspace?`/${n.config.workspace}`:"")),te}),h=i.ref(""),g=i.computed(()=>{const te=n.config.app==="konnect"||n.config.isExactMatch;return te?{isExactMatch:te,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:te,schema:n.config.filterSchema}}),{fetcher:b,fetcherState:v}=tp(n.config,w.value),B=()=>{h.value=""},S=()=>{d.value++},C=i.ref(null),T=(te,U)=>{const q=te.id;if(!U(q)){r("copy:error",{entity:te,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,field:"id",message:o("ca-certificates.copy.success",{val:q})})},N=(te,U)=>{const q=JSON.stringify(te);if(!U(q)){r("copy:error",{entity:te,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,message:o("ca-certificates.copy.success_brief")})},E=async te=>{var q;await((q=n.canRetrieve)==null?void 0:q.call(n,te))&&l.push(n.config.getViewRoute(te.id))},x=te=>({label:o("ca-certificates.actions.view"),to:n.config.getViewRoute(te)}),O=te=>({label:o("ca-certificates.actions.edit"),to:n.config.getEditRoute(te)}),G=i.ref(void 0),R=i.ref(!1),J=i.ref(!1),ee=i.ref(""),ne=Xf(n.config,w.value),{certificateDataCache:me,getCertificateData:ie}=ct.useCertificate(),Ee=te=>{G.value=te,R.value=!0},qr=()=>{R.value=!1},Kr=async()=>{var te,U,q;if((te=G.value)!=null&&te.id){J.value=!0;try{await c.delete(ne(G.value.id)),J.value=!1,R.value=!1,d.value++,r("delete:success",G.value)}catch(fe){ee.value=((q=(U=fe.response)==null?void 0:U.data)==null?void 0:q.message)||fe.message||o("ca-certificates.errors.delete"),r("error",fe)}finally{J.value=!1}}},fr=i.ref(!1);i.watch(v,te=>{var U,q,fe,Ue;if(Array.isArray((U=te==null?void 0:te.response)==null?void 0:U.data)&&(fr.value=te.response.data.length>0),te.status===Ft.Error){C.value={title:o("ca-certificates.errors.general")},(Ue=(fe=(q=te.error)==null?void 0:q.response)==null?void 0:fe.data)!=null&&Ue.message&&(C.value.message=te.error.response.data.message),r("error",te.error);return}me.value={},C.value=null});const $t=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("ca-certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("ca-certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&($t.value.title=o("ca-certificates.list.empty_state.title"),$t.value.ctaText=o("ca-certificates.actions.create"))}),(te,U)=>{const q=i.resolveComponent("KButton"),fe=i.resolveComponent("KBadge"),Ue=i.resolveComponent("KTruncate"),Qe=i.resolveComponent("KDropdownItem"),zr=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",Ib,[i.createVNode(i.unref(Wf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":$t.value,"enable-entity-actions":"","error-message":C.value,fetcher:i.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":i.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":U[2]||(U[2]=re=>E(re)),onSort:S},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(Zf),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=re=>h.value=re),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref(jt),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[i.vShow,fr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Eb,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.issuer?re.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",Nb,i.toDisplayString(i.unref(ie)(re).schemaIssuer||"-"),1))]}),expiry:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Ob,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.expiry?i.unref(s)(re.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",_b,i.toDisplayString(i.unref(ie)(re).schemaExpiry?i.unref(s)(i.unref(ie)(re).schemaExpiry):"-"),1))]}),tags:i.withCtx(({row:re})=>{var xe;return[((xe=re==null?void 0:re.tags)==null?void 0:xe.length)>0?(i.openBlock(),i.createBlock(Ue,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(re==null?void 0:re.tags,Z=>(i.openBlock(),i.createBlock(fe,{key:Z,onClick:U[1]||(U[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Z),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Vb,"-"))]}),actions:i.withCtx(({row:re})=>[i.createVNode(zr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Qe,{"data-testid":"action-entity-copy-id",onClick:Z=>T(re,xe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(zr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Qe,{"data-testid":"action-entity-copy-json",onClick:Z=>N(re,xe)},{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(jt),{"auth-function":()=>e.canRetrieve(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{"data-testid":"action-entity-view","has-divider":"",item:x(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canEdit(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{"data-testid":"action-entity-edit",item:O(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canDelete(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Ee(re)},{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(Jf),{"action-pending":J.value,"entity-type":i.unref(La).CACertificate,error:ee.value,title:i.unref(o)("ca-certificates.delete.title"),visible:R.value,onCancel:qr,onProceed:Kr},{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-8620b081"]]),jb={class:"kong-ui-entities-ca-certificates-form"},$b=dr(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 S;const r=t,n=e,o=Wr.useRouter(),{i18n:{t:s}}=ct.useI18n(),{getMessageFromError:a}=ep(),{axiosInstance:l}=Co((S=n.config)==null?void 0:S.axiosRequestConfig),c=i.computed(()=>ji.form[n.config.app].edit),d=i.computed(()=>n.certificateId?Ht.Edit:Ht.Create),y=i.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=i.reactive({cert:"",certDigest:"",tags:""}),I=i.computed(()=>(d.value===Ht.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=C=>{var T;y.fields.cert=(C==null?void 0:C.cert)||"",y.fields.certDigest=(C==null?void 0:C.cert_digest)||"",y.fields.tags=((T=C==null?void 0:C.tags)==null?void 0:T.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(n.config.cancelRoute)},g=i.computed(()=>{var T,N;let C=`${n.config.apiBaseUrl}${ji.form[n.config.app].validate}`;return n.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),C=C.replace(/{id}/gi,n.certificateId),C}),b=i.computed(()=>{var T,N;let C=`${n.config.apiBaseUrl}${ji.form[n.config.app][d.value]}`;return n.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),C=C.replace(/{id}/gi,n.certificateId),C}),v=i.computed(()=>{var C,T;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(T=(C=y.fields.tags.split(","))==null?void 0:C.map(N=>String(N||"").trim()))==null?void 0:T.filter(N=>N!=="")}}),B=async()=>{var C,T,N,E,x;try{y.isReadonly=!0;let O;await l.post(g.value,v.value),d.value==="create"?O=await l.post(b.value,v.value):d.value==="edit"&&(O=((C=n.config)==null?void 0:C.app)==="konnect"?await l.put(b.value,v.value):await l.patch(b.value,v.value)),y.fields.cert=((T=O==null?void 0:O.data)==null?void 0:T.cert)||"",y.fields.certDigest=((N=O==null?void 0:O.data)==null?void 0:N.cert_digest)||"",y.fields.tags=((x=(E=O==null?void 0:O.data)==null?void 0:E.tags)==null?void 0:x.join(", "))||"",Object.assign(p,y.fields),r("update",O==null?void 0:O.data)}catch(O){y.errorMessage=a(O),r("error",O)}finally{y.isReadonly=!1}};return(C,T)=>{const N=i.resolveComponent("KTextArea"),E=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",jb,[i.createVNode(i.unref(Gf),{"can-submit":I.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":c.value,"form-fields":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":T[3]||(T[3]=x=>C.$emit("error",x)),"onFetch:success":w,onLoading:T[4]||(T[4]=x=>C.$emit("loading",x)),onSubmit:B},{default:i.withCtx(()=>[i.createVNode(i.unref(ko),{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(N,{modelValue:y.fields.cert,"onUpdate:modelValue":T[0]||(T[0]=x=>y.fields.cert=x),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(E,{modelValue:y.fields.certDigest,"onUpdate:modelValue":T[1]||(T[1]=x=>y.fields.certDigest=x),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(ko),{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(E,{modelValue:y.fields.tags,"onUpdate:modelValue":T[2]||(T[2]=x=>y.fields.tags=x),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-54396784"]]),Db={class:"kong-ui-certificate-entity-config-card"},Mb={key:0},Rb=dr(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"],setup(e,{emit:t}){const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ct.useI18n(),{convertKeyToTitle:l}=rp(),{getPropValue:c}=ip(),{getCertificateData:d}=ct.useCertificate(),y=i.computed(()=>Ii.form[n.config.app].edit),p=i.ref(),I=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=x=>{p.value=x,r("fetch:success",x)},h=(x,O)=>{const G=c("rowValue",O);if(x==="expiry")return b.value;if(x==="key_usages")return C.value;if(x==="san_names")return B.value;if(G)return G[x]},g=i.computed(()=>{if(p.value)return d(p.value)}),b=i.computed(()=>{var x,O;return(x=g.value)!=null&&x.schemaExpiry?s((O=g.value)==null?void 0:O.schemaExpiry):""}),v=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaIssuer)||""}),B=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaSanNames)||""}),S=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaSubject)||""}),C=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaKeyUsages)||[]}),T=i.computed(()=>{var x,O;return((O=(x=p==null?void 0:p.value)==null?void 0:x.snis)==null?void 0:O.length)>0}),N=i.computed(()=>{var x;return!!((x=p==null?void 0:p.value)!=null&&x.cert_alt)}),E=x=>{var O,G;return x==="san_names"?o("certificates.list.table_headers.san"):((G=(O=I.value)==null?void 0:O[x])==null?void 0:G.label)||l(x)};return(x,O)=>{const G=i.resolveComponent("KCodeBlock"),R=i.resolveComponent("KLabel"),J=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",Db,[i.createVNode(i.unref(zf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":I.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":O[0]||(O[0]=ee=>x.$emit("fetch:error",ee)),"onFetch:success":w,onLoading:O[1]||(O[1]=ee=>x.$emit("loading",ee))},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(ee=>[i.unref(c)("rowValue",ee)?(i.openBlock(),i.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",ee),language:"plaintext","single-line":""},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(R,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(ee=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",ee)),ne=>(i.openBlock(),i.createBlock(i.unref(po),{key:ne,item:{key:ne,value:h(ne,ee),label:E(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(v.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(B.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S.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",Mb,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(C.value,(ee,ne)=>(i.openBlock(),i.createBlock(J,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:ee,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(ee),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[T.value?void 0:{name:"snis",fn:i.withCtx(()=>[i.createTextVNode(" – ")]),key:"0"},N.value?{name:"cert_alt",fn:i.withCtx(ee=>[i.createTextVNode(" > "),i.unref(c)("rowValue",ee)?(i.openBlock(),i.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:i.unref(c)("rowValue",ee),language:"plaintext","single-line":""},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-d40682b9"]]);je.CACertificateConfigCard=Bb,je.CACertificateForm=$b,je.CACertificateList=Tb,je.CertificateConfigCard=Rb,je.CertificateForm=Sb,je.CertificateList=gb,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|
|
147
|
+
`+e.slice(a+1):c+=e.slice(o),c.slice(1)}function y0(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=ji(e,o),n=De[r],!n&&Ti(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||s0(r);return t}function g0(e,t,r){var n="",o=e.tag,s,a,l;for(s=0,a=r.length;s<a;s+=1)l=r[s],e.replacer&&(l=e.replacer.call(r,String(s),l)),(jt(e,t,l,!1,!1)||typeof l>"u"&&jt(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function zf(e,t,r,n){var o="",s=e.tag,a,l,c;for(a=0,l=r.length;a<l;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(jt(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&jt(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=il(e,t)),e.dump&&_i===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function m0(e,t,r){var n="",o=e.tag,s=Object.keys(r),a,l,c,d,y;for(a=0,l=s.length;a<l;a+=1)y="",n!==""&&(y+=", "),e.condenseFlow&&(y+='"'),c=s[a],d=r[c],e.replacer&&(d=e.replacer.call(r,c,d)),jt(e,t,c,!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 b0(e,t,r,n){var o="",s=e.tag,a=Object.keys(r),l,c,d,y,f,x;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Pe("sortKeys must be a boolean or a function");for(l=0,c=a.length;l<c;l+=1)x="",(!n||o!=="")&&(x+=il(e,t)),d=a[l],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),jt(e,t+1,d,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&_i===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,f&&(x+=il(e,t)),jt(e,t+1,y,!0,f)&&(e.dump&&_i===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,o+=x));e.tag=s,e.dump=o||"{}"}function Gf(e,t,r){var n,o,s,a,l,c;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(l=o[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof t=="object"&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(r?l.multi&&l.representName?e.tag=l.representName(t):e.tag=l.tag:e.tag="?",l.represent){if(c=e.styleMap[l.tag]||l.defaultStyle,Nf.call(l.represent)==="[object Function]")n=l.represent(t,c);else if(Of.call(l.represent,c))n=l.represent[c](t,c);else throw new Pe("!<"+l.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function jt(e,t,r,n,o,s,a){e.tag=null,e.dump=r,Gf(e,r,!1)||Gf(e,r,!0);var l=Nf.call(e.dump),c=n,d;n&&(n=e.flowLevel<0||e.flowLevel>t);var y=l==="[object Object]"||l==="[object Array]",f,x;if(y&&(f=e.duplicates.indexOf(r),x=f!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(o=!1),x&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(y&&x&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),l==="[object Object]")n&&Object.keys(e.dump).length!==0?(b0(e,t,e.dump,o),x&&(e.dump="&ref_"+f+e.dump)):(m0(e,t,e.dump),x&&(e.dump="&ref_"+f+" "+e.dump));else if(l==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?zf(e,t-1,e.dump,o):zf(e,t,e.dump,o),x&&(e.dump="&ref_"+f+e.dump)):(g0(e,t,e.dump),x&&(e.dump="&ref_"+f+" "+e.dump));else if(l==="[object String]")e.tag!=="?"&&p0(e,e.dump,t,s,c);else{if(l==="[object Undefined]"||e.skipInvalid)return!1;throw new Pe("unacceptable kind of an object to dump "+l)}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 w0(e,t){var r=[],n=[],o,s;for(ol(e,r,n),o=0,s=n.length;o<s;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(s)}function ol(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)ol(e[o],t,r);else for(n=Object.keys(e),o=0,s=n.length;o<s;o+=1)ol(e[n[o]],t,r)}function v0(e,t){t=t||{};var r=new l0(t);r.noRefs||w0(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),jt(r,0,n,!0,!0)?r.dump+`
|
|
148
|
+
`:""}var k0=v0,C0={dump:k0};function sl(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 S0=Ve,x0=Wd,A0=Qd,B0=nf,I0=of,E0=Za,N0=Ef.load,O0=Ef.loadAll,_0=C0.dump,V0=Pe,T0={binary:uf,float:rf,map:Zd,null:Xd,pairs:ff,set:pf,timestamp:lf,bool:ef,int:tf,merge:cf,omap:df,seq:Yd,str:Jd},j0=sl("safeLoad","load"),$0=sl("safeLoadAll","loadAll"),D0=sl("safeDump","dump"),R0={Type:S0,Schema:x0,FAILSAFE_SCHEMA:A0,JSON_SCHEMA:B0,CORE_SCHEMA:I0,DEFAULT_SCHEMA:E0,load:N0,loadAll:O0,dump:_0,YAMLException:V0,types:T0,safeLoad:j0,safeLoadAll:$0,safeDump:D0};const M0={class:"yaml-config"},Wf=i.defineComponent({__name:"YamlCodeBlock",props:{entityRecord:{type:Object,required:!0}},setup(e){const t=e,r=i.computed(()=>{const n=Object.fromEntries(Object.entries(t.entityRecord).filter(([,o])=>o!==null&&o!==""&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(n).length===0&&n.constructor===Object?"":R0.dump(n).trim()});return(n,o)=>{const s=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",M0,[t.entityRecord?(i.openBlock(),i.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):i.createCommentVNode("",!0)])}}}),P0={class:"terraform-config"},Ue=" ",Jf=i.defineComponent({__name:"TerraformCodeBlock",props:{entityRecord:{type:Object,required:!0},entityType:{type:String,required:!0,validator:e=>ho.includes(e)}},setup(e){const t=e,r=(l,c)=>{const d=Ue;let y="";return typeof l=="string"?y+=`
|
|
149
|
+
${d}${c} = "${l}"`:y+=`
|
|
150
|
+
${d}${c} = ${String(l??"")}`,y},n=(l,c,d="")=>{if(typeof l!="object")return"Invalid object";const y=Ue+d;let f="";if(c&&(f+=`
|
|
151
|
+
${y}${c} = {
|
|
152
|
+
`),l===null)return c?f+=`${y}}`:f="{}",f;const x=Object.fromEntries(Object.entries(l).filter(([,h])=>h!==null));let m="";for(const[h,g]of Object.entries(x))Array.isArray(g)?g.length===0?m="[]":(m=`[
|
|
153
|
+
`,m+=o(g,void 0,y),m+=`${y}${Ue}]`):g&&typeof g=="object"?(m=`{
|
|
154
|
+
`,m+=n(g,void 0,y),m+=`${y}${Ue}}`):m=String(g??""),typeof g=="string"&&(m=`"${m}"`),f+=`${y}${Ue}${h} = ${m}
|
|
155
|
+
`;return c?f+=`${y}}`:f},o=(l,c,d="")=>{if(!Array.isArray(l))return"Invalid array";const y=Ue+d;let f="";c&&(l.length===0?f+=`${y}${c} = [`:f+=`
|
|
156
|
+
${y}${c} = [
|
|
157
|
+
`);for(let x=0;x<l.length;x++){const m=l[x];typeof m=="object"?(f+=`${y}${Ue}{
|
|
158
|
+
`,f+=n(m,void 0,y),f+=`${y}${Ue}}`):typeof m=="string"?f+=`${y}${Ue}"${m}"`:f+=`${y}${Ue}${String(m??"")}`,x<l.length-1&&(f+=","),f+=`
|
|
159
|
+
`}return c&&(l.length===0?f+="]":f+=`${y}]`),f},s=l=>{let c="";for(const[d,y]of Object.entries(l))Array.isArray(y)?c+=o(y,d):typeof y=="object"?c+=n(y,d):c+=r(y,d);return c},a=i.computed(()=>{var l,c,d,y,f,x,m;const h=Object.fromEntries(Object.entries(t.entityRecord).filter(([,A])=>A!=null)),g=t.entityRecord.config?Object.fromEntries(Object.entries((l=t.entityRecord)==null?void 0:l.config).filter(([,A])=>A!=null)):void 0;if(g&&(h.config=g),Object.keys(h).length===0)return"";delete h.id;let b="",v="";if((c=h.service)!=null&&c.id?(v="service",delete h.service):(d=h.route)!=null&&d.id?(v="route",delete h.route):(y=h.consumer)!=null&&y.id?(v="consumer",delete h.consumer):(f=h.consumer_group)!=null&&f.id?(v="consumer_group",delete h.consumer_group):(x=h.certificate)!=null&&x.id?(v="certificate",delete h.certificate):(m=h.key_set)!=null&&m.id&&(v="key_set",delete h.key_set),t.entityType==="plugin"){const A=(h.name+"").replace(/-/g,"_");delete h.name,b+=`resource "konnect_gateway_plugin_${A}" "my_${A}" {`}else b+=`resource "konnect_gateway_${t.entityType}" "my_${t.entityType}" {`;return b+=s(h),b+=`
|
|
160
|
+
${Ue}control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
|
|
161
|
+
`,v&&(b+=`
|
|
162
|
+
${Ue}${v} = {
|
|
163
|
+
`,b+=`${Ue}${Ue}id = konnect_gateway_${v}.my_${v}.id
|
|
164
|
+
`,b+=`${Ue}}
|
|
165
|
+
`),b+=`}
|
|
166
|
+
`,b});return(l,c)=>{const d=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",P0,[t.entityRecord?(i.openBlock(),i.createBlock(d,{key:0,id:"terraform-codeblock",code:a.value,language:"terraform",theme:"dark"},null,8,["code"])):i.createCommentVNode("",!0)])}}}),U0={key:0,class:"config-card-display-form"},L0=["data-testid"],H0={key:0,class:"config-card-prop-section-title"},F0=i.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},entityType:{type:String,required:!0,validator:e=>ho.includes(e)},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json","terraform"].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}}=Ie.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,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[e.format==="structured"?(i.openBlock(),i.createElementBlock("div",U0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propListTypes,c=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${c}-props`,class:i.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(i.openBlock(),i.createElementBlock("div",H0,i.toDisplayString(c==="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[c],d=>(i.openBlock(),i.createBlock(go,{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,L0))),128))])):i.createCommentVNode("",!0),e.format==="json"&&s.value?(i.openBlock(),i.createBlock(qd,{key:1,config:t.config,"entity-record":s.value,"fetcher-url":t.fetcherUrl,"request-method":"get"},null,8,["config","entity-record","fetcher-url"])):i.createCommentVNode("",!0),e.format==="yaml"&&s.value?(i.openBlock(),i.createBlock(Wf,{key:2,"entity-record":s.value},null,8,["entity-record"])):i.createCommentVNode("",!0),e.format==="terraform"&&s.value?(i.openBlock(),i.createBlock(Jf,{key:3,"entity-record":s.value,"entity-type":t.entityType},null,8,["entity-record","entity-type"])):i.createCommentVNode("",!0)],64))}}),q0=dt(F0,[["__scopeId","data-v-d15be7fe"]]),Ct="24px",$i=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},K0=e=>(i.pushScopeId("data-v-c1f7c39c"),e=e(),i.popScopeId(),e),z0=["aria-hidden"],G0={key:0,"data-testid":"kui-icon-svg-title"},W0=K0(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),J0=i.defineComponent({__name:"AddIcon",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:Ct,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 Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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 add-icon","data-testid":"kui-icon-wrapper-add-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-add-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",G0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),W0],8,z0))]),_:1},8,["aria-hidden","style"]))}}),Y0=$i(J0,[["__scopeId","data-v-c1f7c39c"]]),Z0=e=>(i.pushScopeId("data-v-fbe6ddff"),e=e(),i.popScopeId(),e),Q0=["aria-hidden"],X0={key:0,"data-testid":"kui-icon-svg-title"},e1=Z0(()=>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)),t1=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:Ct,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 Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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",X0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),e1],8,Q0))]),_:1},8,["aria-hidden","style"]))}}),r1=$i(t1,[["__scopeId","data-v-fbe6ddff"]]),i1=e=>(i.pushScopeId("data-v-745761f6"),e=e(),i.popScopeId(),e),n1=["aria-hidden"],o1={key:0,"data-testid":"kui-icon-svg-title"},s1=i1(()=>i.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),a1=i.defineComponent({__name:"ChevronDownIcon",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:Ct,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 Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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 chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-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-chevron-down-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"]))}}),l1=$i(a1,[["__scopeId","data-v-745761f6"]]),c1=e=>(i.pushScopeId("data-v-863d10eb"),e=e(),i.popScopeId(),e),u1=["aria-hidden"],d1={key:0,"data-testid":"kui-icon-svg-title"},f1=c1(()=>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:Ct,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 Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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=$i(p1,[["__scopeId","data-v-863d10eb"]]),y1=e=>(i.pushScopeId("data-v-d9894a05"),e=e(),i.popScopeId(),e),g1=["aria-hidden"],m1={key:0,"data-testid":"kui-icon-svg-title"},b1=y1(()=>i.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),w1=i.defineComponent({__name:"MoreIcon",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:Ct,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 Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",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 more-icon","data-testid":"kui-icon-wrapper-more-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-more-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",m1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),b1],8,g1))]),_:1},8,["aria-hidden","style"]))}}),v1=$i(w1,[["__scopeId","data-v-d9894a05"]]),k1={class:"config-card-title","data-testid":"config-card-title"},C1={class:"config-card-actions"},S1=["href"],x1={class:"config-card-details-section"},A1=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:()=>({})},entityType:{type:String,required:!0,validator:e=>ho.includes(e)},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},titleTag:{type:String,default:"h2"},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const n=t,o=e,{i18n:{t:s}}=Ie.useI18n(),{getMessageFromError:a}=Ie.useErrors(),{convertKeyToTitle:l}=Ie.useStringHelpers(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:s("baseForm.configuration.json"),value:"json"},{label:s("baseForm.configuration.yaml"),value:"yaml"}];o.enableTerraform&&d.splice(2,0,{label:s("baseForm.configuration.terraform"),value:"terraform"});const y=i.ref("structured"),f=N=>{y.value=N==null?void 0:N.value},x={id:{type:ce.ID,label:s("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:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:ce.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:ce.BadgeTag,order:-1,section:pe.Basic}},m=i.ref(!1),h=i.ref(!1),g=i.ref(""),b=i.ref({}),v=i.computed(()=>{var N,E,B;if(!b.value)return[];const O=[],G=Object.keys(b.value).length;for(const M in b.value){const J=(E=(N=o.configSchema)==null?void 0:N[M])==null?void 0:E.order,ee=(B=x[M])==null?void 0:B.order;let ne=G;(ee||ee===0)&&(ne=ee===-1?G+1:ee),J&&(ne=J===-1?G+1:J),O.push([M,ne])}return O.sort(function(M,J){return M[1]-J[1]}),O.map(M=>{var J,ee;const ne=M[0],me=(J=b.value)==null?void 0:J[ne],ie=((ee=o.configSchema)==null?void 0:ee[ne])||{},Ee=x[ne];return{key:ne,value:me,hidden:ie.hidden||!1,type:ie.type??((Ee==null?void 0:Ee.type)||ce.Text),label:ie.label??((Ee==null?void 0:Ee.label)||l(ne)),tooltip:ie.tooltip??((Ee==null?void 0:Ee.tooltip)||void 0),section:ie.section??((Ee==null?void 0:Ee.section)||pe.Advanced)}}).filter(M=>!M.hidden&&M.key!==o.pluginConfigKey)}),A=i.computed(()=>{var N,E;if(!b.value||!o.pluginConfigKey)return[];const B=b.value[o.pluginConfigKey]||{},O=Object.keys(B).length,G=[];for(const M in B){const J=(E=(N=o.pluginConfigSchema)==null?void 0:N[M])==null?void 0:E.order,ee=B[M];let ne=ee!=null&&ee!==""?O-1:O;J&&(ne=J===-1?O+1:J),G.push([M,ne])}return G.sort(function(M,J){return M[1]-J[1]}),G.map(M=>{var J;const ee=M[0],ne=B[ee],me=((J=o.pluginConfigSchema)==null?void 0:J[ee])||{};return{key:ee,value:ne,hidden:me.hidden||!1,type:me.type??ce.Text,label:me.label??l(ee),tooltip:me.tooltip??void 0,section:pe.Plugin}}).filter(M=>!M.hidden)}),C=i.computed(()=>{var N,E,B,O;return{basic:(N=v.value)==null?void 0:N.filter(G=>G.section===pe.Basic),advanced:(E=v.value)==null?void 0:E.filter(G=>G.section===pe.Advanced),plugin:(O=A.value)==null?void 0:O.concat((B=v.value)==null?void 0:B.filter(G=>G.section===pe.Plugin))}}),S=i.computed(()=>{const N=[];return C.value.basic.length&&N.push("basic"),C.value.advanced.length&&N.push("advanced"),C.value.plugin.length&&N.push("plugin"),N}),T=i.computed(()=>{var N,E;let B=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):o.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(E=o.config)!=null&&E.workspace?`/${o.config.workspace}`:"")),B=B.replace(/{id}/gi,o.config.entityId),B});return i.watch(m,N=>{n("loading",N)},{immediate:!0}),i.onBeforeMount(async()=>{h.value=!1,m.value=!0;try{const{data:N}=await c.get(T.value);if(o.dataKey)if(typeof N[o.dataKey]<"u")b.value={...N[o.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:o.dataKey}));else b.value={...N};Object.keys(o.configSchema).filter(E=>o.configSchema[E].forceShow).forEach(E=>{b.value&&typeof b.value[E]>"u"&&(b.value[E]=null)}),n("fetch:success",N)}catch(N){const E=a(N);g.value=E.startsWith("code")?s("baseConfigCard.errors.load"):E,h.value=!0,n("fetch:error",N)}finally{m.value=!1}}),(N,E)=>{const B=i.resolveComponent("KLabel"),O=i.resolveComponent("KSelect"),G=i.resolveComponent("KButton"),M=i.resolveComponent("KSkeleton"),J=i.resolveComponent("KEmptyState"),ee=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(ee,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},i.createSlots({actions:i.withCtx(()=>[i.createElementVNode("div",C1,[i.renderSlot(N.$slots,"actions",{},void 0,!0),i.createVNode(B,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.label),1)]),_:1}),i.createVNode(O,{"data-testid":"select-config-format",items:d,onChange:f}),e.configCardDoc?(i.openBlock(),i.createBlock(G,{key:0,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(r1),{size:i.unref(ig)},null,8,["size"])],8,S1)]),_:1})):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[m.value?(i.openBlock(),i.createBlock(M,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(i.openBlock(),i.createBlock(J,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(g.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",x1,[i.createVNode(q0,{config:e.config,"entity-type":e.entityType,"fetcher-url":T.value,format:y.value,"prop-list-types":S.value,"property-collections":C.value,record:b.value},i.createSlots({_:2},[i.renderList(Object.keys(N.$slots),ne=>({name:ne,fn:i.withCtx(({row:me,rowValue:ie})=>[i.renderSlot(N.$slots,ne,{row:me,rowValue:ie},void 0,!0)])}))]),1032,["config","entity-type","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("span",k1,[i.renderSlot(N.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Yf=dt(A1,[["__scopeId","data-v-85381f68"]]),B1=["novalidate"],I1={class:"form-actions","data-testid":"form-actions"},E1=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:""},entityType:{type:String,required:!0,validator:e=>ho.includes(e)},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},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const n=t,o=e,s=Yr.useRouter(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:l}=Ie.useErrors(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=i.ref(!1),y=i.ref(!1),f=i.ref(""),x=i.computed(()=>o.canSubmit===!1||o.isReadonly),m=i.ref(!1),h=i.computed(()=>{var S,T;let N=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((S=o.config)==null?void 0:S.controlPlaneId)||""):o.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(T=o.config)!=null&&T.workspace?`/${o.config.workspace}`:"")),o.editId?(N=N.replace(/{id}/gi,o.editId),N):(N=N.replace(/\/{id}/gi,""),N)}),g=()=>{m.value=!m.value},b=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):v()},v=()=>{n("cancel")},A=()=>{x.value||n("submit")},C=i.ref([{title:a("baseForm.configuration.json"),hash:"#json"},{title:a("baseForm.configuration.yaml"),hash:"#yaml"}]);return o.enableTerraform&&C.value.splice(1,0,{title:a("baseForm.configuration.terraform"),hash:"#terraform"}),i.watch(()=>d.value,S=>{n("loading",S)},{immediate:!0}),i.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:S}=await c.get(h.value);n("fetch:success",S)}catch(S){const T=l(S);f.value=T.startsWith("code")?a("baseForm.errors.edit"):T,y.value=!0,n("fetch:error",S)}finally{d.value=!1}}),(S,T)=>{const N=i.resolveComponent("KSkeleton"),E=i.resolveComponent("KEmptyState"),B=i.resolveComponent("KAlert"),O=i.resolveComponent("KButton"),G=i.resolveComponent("KTabs"),M=i.resolveComponent("KSlideout");return i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(N,{key:0,type:"form"})):y.value?(i.openBlock(),i.createBlock(E,{key:1,"action-button-text":i.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(f.value),1)]),_:1},8,["action-button-text"])):(i.openBlock(),i.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:o.noValidate,onReset:i.withModifiers(v,["prevent"]),onSubmit:i.withModifiers(A,["prevent"])},[i.renderSlot(S.$slots,"default",{},void 0,!0),e.errorMessage?(i.openBlock(),i.createBlock(B,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):i.createCommentVNode("",!0),i.createElementVNode("div",I1,[i.renderSlot(S.$slots,"form-actions",{},()=>[i.createVNode(O,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:T[0]||(T[0]=J=>g())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),i.createVNode(O,{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(O,{appearance:"primary","data-testid":"form-submit",disabled:x.value,type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,B1)),i.createVNode(M,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:i.unref(a)("baseForm.configuration.title"),visible:m.value,onClose:T[1]||(T[1]=J=>g())},{default:i.withCtx(()=>[i.createElementVNode("div",null,i.toDisplayString(i.unref(a)("baseForm.configuration.message")),1),i.createVNode(G,{"data-testid":"form-view-configuration-slideout-tabs",tabs:C.value},{json:i.withCtx(()=>[i.createVNode(qd,{config:e.config,"entity-record":o.formFields,"fetcher-url":h.value,"request-method":o.editId?"put":"post"},null,8,["config","entity-record","fetcher-url","request-method"])]),yaml:i.withCtx(()=>[i.createVNode(Wf,{"entity-record":o.formFields},null,8,["entity-record"])]),terraform:i.withCtx(()=>[i.createVNode(Jf,{"entity-record":o.formFields,"entity-type":e.entityType},null,8,["entity-record","entity-type"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Zf=dt(E1,[["__scopeId","data-v-073c33c8"]]),N1=["data-truncate"],O1=i.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const t=e,r=i.computed(()=>{var b;return((b=t.rowEl)==null?void 0:b.querySelector(`[data-testid="${t.keyName}"]`))||null}),n=i.computed(()=>{var b;return((b=r.value)==null?void 0:b.querySelector('[data-truncate="true"]'))||null}),o=i.computed(()=>{var b,v;const A=(b=t.rowEl)==null?void 0:b.querySelectorAll("td");return A?((v=A[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!0}),s=i.computed(()=>o.value||t.tooltip);let a;const l=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{var b,v,A;let C=((b=r.value)==null?void 0:b.clientWidth)||0;if(r.value&&"getComputedStyle"in window){const S=window.getComputedStyle(r.value);C-=(parseFloat(S.paddingLeft)||0)+(parseFloat(S.paddingRight)||0)}y.value=((v=n.value)==null?void 0:v.getBoundingClientRect().width)||0,f.value=C,x.value=((A=d.value)==null?void 0:A.innerText)||""},d=i.ref({}),y=i.ref(0),f=i.ref(0),x=i.ref(""),m=i.computed(()=>[n.value,r.value]),h=i.watch(m,b=>{if(s.value&&(l(),"ResizeObserver"in window&&window)){a=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of b)v&&a.observe(v)}},{immediate:!0,flush:"post",deep:!0}),g=i.computed(()=>s.value?y.value>f.value:!1);return i.onMounted(()=>{c()}),i.onUnmounted(()=>{h()}),(b,v)=>{const A=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:d,class:"content-wrapper"},[s.value?(i.openBlock(),i.createElementBlock("span",{key:0,"data-truncate":s.value||void 0},[i.createVNode(A,{"max-width":"300",placement:"bottom-start",text:g.value?x.value:""},{default:i.withCtx(()=>[i.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,N1)):i.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),_1=dt(O1,[["__scopeId","data-v-b252463e"]]),V1={class:"toolbar-container"},T1={key:0,class:"toolbar-button-container"},j1=["data-testid"],$1=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},sortHandlerFunction:{type:Function,default:()=>({})},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:""},titleTag:{type:String,default:"h2"},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}}=Ie.useI18n(),s=i.computed(()=>{var N,E;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(N=r.errorMessage)==null?void 0:N.title,message:(E=r.errorMessage)==null?void 0:E.message}}),a=i.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),l=N=>N.hasData||!!r.query,c=i.computed(()=>{const N=[];return Object.keys(r.tableHeaders).forEach(E=>{const B=r.tableHeaders[E];N.push({label:B.label??E,key:E,sortable:B.sortable??!1,hidable:B.hidable??!0})}),r.enableEntityActions&&N.push({key:"actions",hideLabel:!0}),N}),d=N=>({"data-rowid":N.id,"data-testid":N.name,...r.rowAttributes(N)}),y=i.ref({}),f=N=>{var E;return(E=y.value)==null?void 0:E.$el.querySelector(`[data-rowid="${N.id}"]`)},x=N=>{const E={"data-testid":N.headerKey,...r.cellAttributes(N)};return N.colIndex===0&&(E.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),E},m=()=>{n("empty-state-cta-clicked"),h()},h=()=>{n("clear-search-input")},g=i.computed(()=>r.disableRowClick?void 0:(N,E)=>{n("click:row",E)}),b=N=>{n("sort",N)},{setTablePreferences:v,getTablePreferences:A}=Cy(),C=i.ref(A(a.value)),S=i.computed(()=>{const N=A(a.value);return{...r.initialFetcherParams,...N}}),T=N=>{C.value=N,c.value.forEach(E=>{!("hidable"in E)||!C.value.columnVisibility||E.hidable===!1&&(C.value.columnVisibility[E.key]=!0)}),a.value&&v(a.value,N)};return(N,E)=>{const B=i.resolveComponent("KButton"),O=i.resolveComponent("KDropdown"),G=i.resolveComponent("KTable"),M=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(M,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:i.withCtx(()=>[i.createVNode(G,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":x,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","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,error:s.value.hasError,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":S.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":d,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":C.value,onEmptyStateActionClick:m,"onRow:click":g.value,onSort:E[0]||(E[0]=J=>b(J)),"onUpdate:tablePreferences":T},i.createSlots({toolbar:i.withCtx(({state:J})=>[i.withDirectives(i.createElementVNode("div",V1,[i.renderSlot(N.$slots,"toolbar-filter",{},void 0,!0),N.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",T1,[i.renderSlot(N.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,l(J)]])]),actions:i.withCtx(({row:J,rowKey:ee,rowValue:ne})=>[i.createElementVNode("div",{class:"actions-container","data-testid":J.name},[i.createVNode(O,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(N.$slots,"actions",{row:J,rowKey:ee,rowValue:ne},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(B,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:i.withCtx(()=>[i.createVNode(i.unref(v1))]),_:1})]),_:2},1032,["width"])],8,j1)]),_:2},[i.renderList(e.tableHeaders,(J,ee)=>({name:ee,fn:i.withCtx(({row:ne,rowKey:me,rowValue:ie})=>[i.createVNode(_1,{"key-name":String(ee),"row-el":f(ne),tooltip:J.tooltip},{default:i.withCtx(()=>[i.renderSlot(N.$slots,ee,{row:ne,rowKey:me,rowValue:ie},()=>[i.createTextVNode(i.toDisplayString(ie),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:i.withCtx(()=>[i.createVNode(i.unref(Y0))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Qf=dt($1,[["__scopeId","data-v-71b4425a"]]),D1={key:0,class:"kong-ui-entity-delete-error"},R1={key:1,class:"description"},M1=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}=Ie.useI18n(),n=e,o=t,s=i.computed(()=>n.needConfirm?n.entityName:""),a=()=>{o("cancel")},l=()=>{o("proceed")};return(c,d)=>{const y=i.resolveComponent("KAlert"),f=i.resolveComponent("KPrompt");return i.openBlock(),i.createBlock(f,{"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:l},{default:i.withCtx(()=>[e.error?(i.openBlock(),i.createElementBlock("div",D1,[i.createVNode(y,{appearance:"danger"},{default: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||c.$slots.description?(i.openBlock(),i.createElementBlock("div",R1,[i.renderSlot(c.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(n.description),1)],!0)])):i.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Xf=dt(M1,[["__scopeId","data-v-4361d622"]]),P1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},U1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},L1=["fill"],H1={mask:"url(#mask0_180_20349)"},F1=["fill"],ep=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Xy})`}},setup(e){return(t,r)=>(i.openBlock(),i.createElementBlock("svg",P1,[i.createElementVNode("mask",U1,[i.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,L1)]),i.createElementVNode("g",H1,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,F1)])]))}}),q1={key:1,class:"kong-ui-entity-filter"},K1={class:"kong-ui-entity-filter-menu"},z1=["data-testid"],G1=["onClick","onKeydown"],W1={class:"menu-item-indicator"},J1={class:"menu-item-body"},Y1=["for"],Z1={class:"menu-item-buttons"},Q1={class:"filter-clear-button-container"},X1=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}}=Ie.useI18n(),n=e,o=t,s=i.ref(!1),a=i.ref({}),l=i.ref(new Set),c=i.computed(()=>{const S=[];return new URLSearchParams(n.modelValue).forEach((T,N)=>{T!==""&&S.push(N)}),S}),d=i.computed(()=>{const S=n.config.fields;return Object.keys(S).filter(T=>{var N;return(N=S==null?void 0:S[T])==null?void 0:N.searchable}).map(T=>({label:S[T].label||T,value:T,expanded:!1}))});i.watch(()=>n.modelValue,S=>{a.value={},new URLSearchParams(S).forEach((T,N)=>{a.value[N]=T})});const y=()=>{s.value=!s.value},f=S=>{l.value.has(S)?l.value.delete(S):l.value.add(S)},x=S=>{o("update:modelValue",S)},m=()=>{x("")},h=S=>`filter-${S}`,g=S=>{var T,N;return(((N=(T=n.config.schema)==null?void 0:T[S])==null?void 0:N.values)??[]).map(E=>({value:E,label:E}))},b=S=>{var T,N;return((N=(T=n.config.schema)==null?void 0:T[S])==null?void 0:N.type)??"text"},v=S=>{a.value={...a.value,[S]:""},C()},A=()=>{a.value={},C(!0)},C=(S=!1)=>{const T=Object.keys(a.value).reduce((N,E)=>(a.value[E]&&(N[E]=`${a.value[E]}`),N),{});S&&(s.value=!1),o("update:modelValue",new URLSearchParams(T).toString())};return(S,T)=>{const N=i.resolveComponent("KInput"),E=i.resolveComponent("KButton"),B=i.resolveComponent("KSelect");return e.config.isExactMatch?(i.openBlock(),i.createBlock(N,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":x},{before:i.withCtx(()=>[i.createVNode(ep)]),after:i.withCtx(()=>[i.withDirectives(i.createVNode(i.unref(h1),{class:"kong-ui-entity-filter-clear",onClick:m},null,512),[[i.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",q1,[i.createVNode(E,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:i.withCtx(()=>[i.createVNode(ep),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:y},null,512),[[i.vShow,s.value]]),i.withDirectives(i.createElementVNode("div",K1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,O=>{var G,M;return i.openBlock(),i.createElementBlock("div",{key:O.value,class:"kong-ui-entity-filter-menu-item","data-testid":O.value},[i.createElementVNode("span",{class:i.normalizeClass(["menu-item-title",{expanded:l.value.has(O.value)}]),role:"button",tabindex:"0",onClick:J=>f(O.value),onKeydown:i.withKeys(J=>f(O.value),["enter"])},[i.createTextVNode(i.toDisplayString(O.label)+" ",1),i.withDirectives(i.createElementVNode("span",W1,null,512),[[i.vShow,c.value.includes(O.value)]]),i.createVNode(i.unref(l1),{class:i.normalizeClass(["menu-item-expand-icon",{expanded:l.value.has(O.value)}]),color:i.unref(tg)},null,8,["class","color"])],42,G1),i.withDirectives(i.createElementVNode("div",J1,[i.createElementVNode("label",{class:"menu-item-label",for:h(O.value)},i.toDisplayString(i.unref(r)("filter.fieldLabel")),9,Y1),((M=(G=e.config.schema)==null?void 0:G[O.value])==null?void 0:M.type)==="select"?(i.openBlock(),i.createBlock(B,{key:0,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,items:g(O.value),placeholder:i.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(N,{key:1,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,autocomplete:"off",placeholder:i.unref(r)("filter.inputPlaceholder"),type:b(O.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[i.vShow,l.value.has(O.value)]]),i.withDirectives(i.createElementVNode("div",Z1,[i.createVNode(E,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:T[0]||(T[0]=J=>C(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.applyButtonText")),1)]),_:1}),i.createVNode(E,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:J=>v(O.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[i.vShow,l.value.has(O.value)]])],8,z1)}),128)),i.createElementVNode("div",Q1,[i.createVNode(E,{appearance:"tertiary",size:"small",onClick:A},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[i.vShow,s.value]])]))}}}),tp=dt(X1,[["__scopeId","data-v-94990087"]]),$t=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)}});let So;const eb=new Uint8Array(16);function tb(){if(!So&&(So=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!So))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return So(eb)}const Te=[];for(let e=0;e<256;++e)Te.push((e+256).toString(16).slice(1));function rb(e,t=0){return Te[e[t+0]]+Te[e[t+1]]+Te[e[t+2]]+Te[e[t+3]]+"-"+Te[e[t+4]]+Te[e[t+5]]+"-"+Te[e[t+6]]+Te[e[t+7]]+"-"+Te[e[t+8]]+Te[e[t+9]]+"-"+Te[e[t+10]]+Te[e[t+11]]+Te[e[t+12]]+Te[e[t+13]]+Te[e[t+14]]+Te[e[t+15]]}const ib=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rp={randomUUID:ib};function nb(e,t,r){if(rp.randomUUID&&!t&&!e)return rp.randomUUID();e=e||{};const n=e.random||(e.rng||tb)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return rb(n)}const ob=["aria-labelledby"],sb={class:"form-section-wrapper"},ab={key:1,class:"form-section-description"},lb={key:2,class:"form-section-footer"},cb={class:"form-section-content"},ub=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},titleTag:{type:String,default:"h2"}},setup(e){const t=i.useSlots(),r=nb();return(n,o)=>(i.openBlock(),i.createElementBlock("div",{"aria-labelledby":e.title?i.unref(r):void 0,class:i.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[i.createElementVNode("div",sb,[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.createBlock(i.resolveDynamicComponent(e.titleTag),{key:0,id:i.unref(r),class:"form-section-title"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.title),1)]),_:1},8,["id"])):i.createCommentVNode("",!0),e.description||i.unref(t).description?(i.openBlock(),i.createElementBlock("div",ab,[i.renderSlot(n.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(e.description),1)],!0)])):i.createCommentVNode("",!0),i.unref(t).footer?(i.openBlock(),i.createElementBlock("div",lb,[i.renderSlot(n.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",cb,[i.renderSlot(n.$slots,"default",{},void 0,!0)])])],10,ob))}}),xo=dt(ub,[["__scopeId","data-v-b1f74200"]]),{useAxios:Ao,useDeleteUrlBuilder:ip,useErrors:np,useExternalLinkCreator:ow,useFetchUrlBuilder:sw,useFetcher:op,useDebouncedFilter:aw,useStringHelpers:sp,useHelpers:ap,useGatewayFeatureSupported:lw,useTruncationDetector:cw,useValidators:uw}=Ie,db={class:"kong-ui-entities-certificates-list"},fb={key:0},pb={key:1},hb={key:0},yb={key:1},gb={key:0},mb={key:1},bb={key:1},wb={key:1},vb=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 te;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ut.useI18n(),l=Yr.useRouter(),{axiosInstance:c}=Ao((te=n.config)==null?void 0:te.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),x={subject:{label:o("certificates.list.table_headers.subject"),hidable:!1},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}},m=i.computed(()=>{var q,fe;let U=`${n.config.apiBaseUrl}${Ni.list[n.config.app]}`;return n.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((q=n.config)==null?void 0:q.controlPlaneId)||""):n.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(fe=n.config)!=null&&fe.workspace?`/${n.config.workspace}`:"")),U}),h=i.ref(""),g=i.computed(()=>{const U=n.config.app==="konnect"||n.config.isExactMatch;return U?{isExactMatch:U,placeholder:o("certificates.search.placeholder")}:{isExactMatch:U,schema:n.config.filterSchema}}),{fetcher:b,fetcherState:v}=op(n.config,m.value),A=()=>{h.value=""},C=()=>{d.value++},S=i.ref(null),T=(U,q)=>{const fe=U.id;if(!q(fe)){r("copy:error",{entity:U,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:o("certificates.copy.success",{val:fe})})},N=(U,q)=>{const fe=JSON.stringify(U);if(!q(fe)){r("copy:error",{entity:U,message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,message:o("certificates.copy.success_brief")})},E=async U=>{var fe;await((fe=n.canRetrieve)==null?void 0:fe.call(n,U))&&l.push(n.config.getViewRoute(U.id))},B=U=>({label:o("certificates.actions.view"),to:n.config.getViewRoute(U)}),O=U=>({label:o("certificates.actions.edit"),to:n.config.getEditRoute(U)}),G=U=>{if(n.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:n.config.getCreateSniRoute(U)}},M=i.ref(void 0),J=i.ref(!1),ee=i.ref(!1),ne=i.ref(""),me=ip(n.config,m.value),{certificateDataCache:ie,getCertificateData:Ee}=ut.useCertificate(),zr=U=>{M.value=U,J.value=!0},Gr=()=>{J.value=!1},pr=async()=>{var U,q,fe;if((U=M.value)!=null&&U.id){ee.value=!0;try{await c.delete(me(M.value.id)),ee.value=!1,J.value=!1,d.value++,r("delete:success",M.value)}catch(Le){ne.value=((fe=(q=Le.response)==null?void 0:q.data)==null?void 0:fe.message)||Le.message||o("certificates.errors.delete"),r("error",Le)}finally{ee.value=!1}}},Dt=i.ref(!1);i.watch(v,U=>{var q,fe,Le,Xe;if(Array.isArray((q=U==null?void 0:U.response)==null?void 0:q.data)&&(Dt.value=U.response.data.length>0),U.status===qt.Error){S.value={title:o("certificates.errors.general")},(Xe=(Le=(fe=U.error)==null?void 0:fe.response)==null?void 0:Le.data)!=null&&Xe.message&&(S.value.message=U.error.response.data.message),r("error",U.error);return}ie.value={},S.value=null});const X=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(X.value.title=o("certificates.list.empty_state.title"),X.value.ctaText=o("certificates.actions.create"))}),(U,q)=>{const fe=i.resolveComponent("KButton"),Le=i.resolveComponent("KCopy"),Xe=i.resolveComponent("KBadge"),Wr=i.resolveComponent("KTruncate"),re=i.resolveComponent("KDropdownItem"),xe=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",db,[i.createVNode(i.unref(Qf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":S.value,fetcher:i.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":i.unref(x),"use-action-outside":e.useActionOutside,onClearSearchInput:A,"onClick:row":q[2]||(q[2]=Z=>E(Z)),onSort:C},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(tp),{modelValue:h.value,"onUpdate:modelValue":q[0]||(q[0]=Z=>h.value=Z),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref($t),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(fe,{appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[i.vShow,Dt.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",fb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.subject?Z.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",pb,i.toDisplayString(i.unref(Ee)(Z).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",hb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.expiry?i.unref(s)(Z.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",yb,i.toDisplayString(i.unref(Ee)(Z).schemaExpiry?i.unref(s)(i.unref(Ee)(Z).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",gb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.dns_names?`dns=${Z.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",mb,i.toDisplayString(i.unref(Ee)(Z).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:Z})=>[Z!=null&&Z.cert?(i.openBlock(),i.createBlock(Le,{key:0,"data-testid":"copy-certificate-cert",text:Z.cert,truncate:""},null,8,["text"])):(i.openBlock(),i.createElementBlock("span",bb,"-"))]),tags:i.withCtx(({row:Z})=>{var Ae;return[((Ae=Z==null?void 0:Z.tags)==null?void 0:Ae.length)>0?(i.openBlock(),i.createBlock(Wr,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Z==null?void 0:Z.tags,Jr=>(i.openBlock(),i.createBlock(Xe,{key:Jr,onClick:q[1]||(q[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Jr),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",wb,"-"))]}),actions:i.withCtx(({row:Z})=>[i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-id",onClick:Jr=>T(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-json",onClick:Jr=>N(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref($t),{"auth-function":()=>e.canRetrieve(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-view","has-divider":"",item:B(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref($t),{"auth-function":()=>e.canEdit(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-edit",item:O(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(i.openBlock(),i.createBlock(i.unref($t),{key:0,"auth-function":()=>e.canCreateSni()},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-add-sni",item:G(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref($t),{"auth-function":()=>e.canDelete(Z)},{default:i.withCtx(()=>[i.createVNode(re,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ae=>zr(Z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),i.createVNode(i.unref(Xf),{"action-pending":ee.value,"entity-type":i.unref(qa).Certificate,error:ne.value,title:i.unref(o)("certificates.delete.title"),visible:J.value,onCancel:Gr,onProceed:pr},{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"])])}}}),fr=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},kb=fr(vb,[["__scopeId","data-v-8059a087"]]),Cb="#d60027",Sb={class:"sni-field-container"},xb={key:1,class:"sni-field-controls-container"},Ab={key:0},Bb=fr(i.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(e,{emit:t}){const r=e,n=t,{i18nT:o,i18n:{t:s}}=ut.useI18n(),a=i.ref([]);return i.watch(r.modelValue,l=>{a.value=[...l]},{immediate:!0,deep:!0}),i.watch(a,l=>{n("update:modelValue",l)},{deep:!0}),(l,c)=>{const d=i.resolveComponent("KLabel"),y=i.resolveComponent("KInput"),f=i.resolveComponent("KButton"),x=i.resolveComponent("router-link");return i.openBlock(),i.createElementBlock("div",Sb,[i.createVNode(d,{info:i.unref(s)("certificates.form.fields.snis.tooltip")},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(m,h)=>(i.openBlock(),i.createElementBlock("div",{key:h,class:"sni-field-input"},[!e.isEditing||a.value[h]?(i.openBlock(),i.createBlock(y,{key:0,modelValue:a.value[h],"onUpdate:modelValue":g=>a.value[h]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${h+1}`,disabled:e.isEditing,placeholder:i.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):i.createCommentVNode("",!0),e.isEditing?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",xb,[i.createVNode(f,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>l.$emit("remove",h)},{default:i.withCtx(()=>[i.createVNode(i.unref(Ap),{color:i.unref(Cb)},null,8,["color"])]),_:2},1032,["onClick"]),i.createVNode(f,{appearance:"tertiary","data-testid":"add-sni",disabled:h!==a.value.length-1,icon:"",onClick:c[0]||(c[0]=g=>l.$emit("add"))},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo))]),_:2},1032,["disabled"])]))]))),128)),a.value.length===0?(i.openBlock(),i.createElementBlock("div",Ab,[i.createVNode(f,{onClick:c[1]||(c[1]=m=>l.$emit("add"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):i.createCommentVNode("",!0),e.isEditing?(i.openBlock(),i.createBlock(i.unref(o),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:i.withCtx(()=>[i.createVNode(x,{to:e.sniListRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),Ib={class:"kong-ui-entities-certificates-form"},Eb=fr(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:""},showSnisField:{type:Boolean,required:!1,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(e,{emit:t}){var N;const r=t,n=e,o=Yr.useRouter(),{i18nT:s,i18n:{t:a}}=ut.useI18n(),{getMessageFromError:l}=np(),{axiosInstance:c}=Ao((N=n.config)==null?void 0:N.axiosRequestConfig),d=i.computed(()=>Ni.form[n.config.app].edit),y=i.computed(()=>n.certificateId?Ft.Edit:Ft.Create),f=i.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),x=i.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),m=i.computed(()=>(y.value===Ft.Create||JSON.stringify(f.fields)!==JSON.stringify(x))&&!!f.fields.cert&&!!f.fields.key),h=E=>{var B,O;f.fields.cert=(E==null?void 0:E.cert)||"",f.fields.key=(E==null?void 0:E.key)||"",f.fields.certAlt=(E==null?void 0:E.cert_alt)||"",f.fields.keyAlt=(E==null?void 0:E.key_alt)||"",f.fields.snis=(B=E==null?void 0:E.snis)!=null&&B.length?E.snis:[""],f.fields.tags=((O=E==null?void 0:E.tags)==null?void 0:O.join(", "))||"",Object.assign(x,f.fields)},g=()=>{o.push(n.config.cancelRoute)},b=()=>{f.fields.snis.push("")},v=E=>{f.fields.snis.splice(E,1)},A=i.computed(()=>{var B,O;let E=`${n.config.apiBaseUrl}${Ni.form[n.config.app].validate}`;return n.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((B=n.config)==null?void 0:B.controlPlaneId)||""):n.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),E=E.replace(/{id}/gi,n.certificateId),E}),C=i.computed(()=>{var B,O;let E=`${n.config.apiBaseUrl}${Ni.form[n.config.app][y.value]}`;return n.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((B=n.config)==null?void 0:B.controlPlaneId)||""):n.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),E=E.replace(/{id}/gi,n.certificateId),E}),S=i.computed(()=>{var E,B;return{cert:f.fields.cert,key:f.fields.key,cert_alt:f.fields.certAlt||null,key_alt:f.fields.keyAlt||null,...n.showSnisField?{snis:f.fields.snis.filter(Boolean)}:{},tags:(B=(E=f.fields.tags.split(","))==null?void 0:E.map(O=>String(O||"").trim()))==null?void 0:B.filter(O=>O!=="")}}),T=async()=>{var E,B,O,G,M,J,ee,ne,me;try{f.isReadonly=!0;let ie;await c.post(A.value,S.value),y.value==="create"?ie=await c.post(C.value,S.value):y.value==="edit"&&(ie=((E=n.config)==null?void 0:E.app)==="konnect"?await c.put(C.value,S.value):await c.patch(C.value,S.value)),f.fields.cert=((B=ie==null?void 0:ie.data)==null?void 0:B.cert)||"",f.fields.key=((O=ie==null?void 0:ie.data)==null?void 0:O.key)||"",f.fields.certAlt=((G=ie==null?void 0:ie.data)==null?void 0:G.cert_alt)||"",f.fields.keyAlt=((M=ie==null?void 0:ie.data)==null?void 0:M.key_alt)||"",f.fields.snis=(ee=(J=ie==null?void 0:ie.data)==null?void 0:J.snis)!=null&&ee.length?ie.data.snis:[""],f.fields.tags=((me=(ne=ie==null?void 0:ie.data)==null?void 0:ne.tags)==null?void 0:me.join(", "))||"",Object.assign(x,f.fields),r("update",ie==null?void 0:ie.data)}catch(ie){f.errorMessage=l(ie),r("error",ie)}finally{f.isReadonly=!1}};return(E,B)=>{const O=i.resolveComponent("KTextArea"),G=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Ib,[i.createVNode(i.unref(Zf),{"can-submit":m.value,config:e.config,"edit-id":e.certificateId,"enable-terraform":e.enableTerraform,"entity-type":i.unref(Ur).Certificate,"error-message":f.errorMessage,"fetch-url":d.value,"form-fields":S.value,"is-readonly":f.isReadonly,onCancel:g,"onFetch:error":B[7]||(B[7]=M=>E.$emit("error",M)),"onFetch:success":h,onLoading:B[8]||(B[8]=M=>E.$emit("loading",M)),onSubmit:T},{default:i.withCtx(()=>[i.createVNode(i.unref(xo),{description:i.unref(a)("certificates.form.sections.ssl.description"),title:i.unref(a)("certificates.form.sections.ssl.title")},{default:i.withCtx(()=>[i.createVNode(O,{modelValue:f.fields.cert,"onUpdate:modelValue":B[0]||(B[0]=M=>f.fields.cert=M),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:f.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(O,{modelValue:f.fields.key,"onUpdate:modelValue":B[1]||(B[1]=M=>f.fields.key=M),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:f.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(O,{modelValue:f.fields.certAlt,"onUpdate:modelValue":B[2]||(B[2]=M=>f.fields.certAlt=M),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:f.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(O,{modelValue:f.fields.keyAlt,"onUpdate:modelValue":B[3]||(B[3]=M=>f.fields.keyAlt=M),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:f.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"]),e.showSnisField&&e.config.sniListRoute?(i.openBlock(),i.createBlock(Bb,{key:0,modelValue:f.fields.snis,"onUpdate:modelValue":B[4]||(B[4]=M=>f.fields.snis=M),"is-editing":y.value===i.unref(Ft).Edit,"sni-list-route":e.config.sniListRoute,onAdd:b,onRemove:B[5]||(B[5]=M=>v(M))},null,8,["modelValue","is-editing","sni-list-route"])):i.createCommentVNode("",!0)]),_:1},8,["description","title"]),i.createVNode(i.unref(xo),{description:i.unref(a)("certificates.form.sections.general.description"),title:i.unref(a)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(G,{modelValue:f.fields.tags,"onUpdate:modelValue":B[6]||(B[6]=M=>f.fields.tags=M),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:f.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-1f98afe8"]]),Bo="/v2/control-planes/{controlPlaneId}/core-entities",Io="/{workspace}",Di={list:{konnect:`${Bo}/ca_certificates`,kongManager:`${Io}/ca_certificates`},form:{konnect:{create:`${Bo}/ca_certificates`,edit:`${Bo}/ca_certificates/{id}`,validate:`${Bo}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${Io}/ca_certificates`,edit:`${Io}/ca_certificates/{id}`,validate:`${Io}/schemas/ca_certificates/validate`}}},Nb={class:"kong-ui-ca-certificate-entity-config-card"},Ob={key:0},_b=fr(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},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],n=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=ut.useI18n(),{convertKeyToTitle:l}=sp(),{getPropValue:c}=ap(),{getCertificateData:d}=ut.useCertificate(),y=i.computed(()=>Di.form[o.config.app].edit),f=i.ref(),x=i.computed(()=>{if(f.value)return d(f.value)}),m=i.computed(()=>{var C;return((C=x.value)==null?void 0:C.schemaIssuer)||""}),h=i.computed(()=>{var C,S;return(C=x.value)!=null&&C.schemaExpiry?a((S=x.value)==null?void 0:S.schemaExpiry):""}),g=i.computed(()=>{var C;return((C=x.value)==null?void 0:C.schemaKeyUsages)||[]}),b=(C,S)=>{const T=c("rowValue",S);if(C==="expiry")return h.value;if(C==="key_usages")return g.value;if(T)return T[C]},v=C=>{f.value=C,n("fetch:success",C)},A=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(C,S)=>{const T=i.resolveComponent("KCodeBlock"),N=i.resolveComponent("KLabel"),E=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",Nb,[i.createVNode(i.unref(Yf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":A.value,"enable-terraform":e.enableTerraform,"entity-type":i.unref(Ur).CaCertificate,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":S[0]||(S[0]=B=>C.$emit("fetch:error",B)),"onFetch:success":v,onLoading:S[1]||(S[1]=B=>C.$emit("loading",B))},{cert:i.withCtx(B=>[i.unref(c)("rowValue",B)?(i.openBlock(),i.createBlock(T,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",B),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),"metadata-label":i.withCtx(()=>[i.createVNode(N,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(B=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",B)).filter(O=>!r.includes(O)),O=>(i.openBlock(),i.createBlock(i.unref(go),{key:O,"data-testid":`ca-cert-metadata-${O}`,item:{key:O,label:i.unref(l)(O),value:b(O,B),type:O==="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(m.value||"–"),1)]),key_usages:i.withCtx(()=>[g.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ob,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(g.value,(B,O)=>(i.openBlock(),i.createBlock(E,{key:`key_usages-badge-tag-${O}`,class:"config-badge","data-testid":`key_usages-badge-tag-${O}`,tooltip:B,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(B),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-46ffa2f8"]]),Vb={class:"kong-ui-entities-ca-certificates-list"},Tb={key:0},jb={key:1},$b={key:0},Db={key:1},Rb={key:1},Mb=fr(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}=ut.useI18n(),l=Yr.useRouter(),{axiosInstance:c}=Ao((X=n.config)==null?void 0:X.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),x={issuer:{label:o("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},m=i.computed(()=>{var U,q;let te=`${n.config.apiBaseUrl}${Di.list[n.config.app]}`;return n.config.app==="konnect"?te=te.replace(/{controlPlaneId}/gi,((U=n.config)==null?void 0:U.controlPlaneId)||""):n.config.app==="kongManager"&&(te=te.replace(/\/{workspace}/gi,(q=n.config)!=null&&q.workspace?`/${n.config.workspace}`:"")),te}),h=i.ref(""),g=i.computed(()=>{const te=n.config.app==="konnect"||n.config.isExactMatch;return te?{isExactMatch:te,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:te,schema:n.config.filterSchema}}),{fetcher:b,fetcherState:v}=op(n.config,m.value),A=()=>{h.value=""},C=()=>{d.value++},S=i.ref(null),T=(te,U)=>{const q=te.id;if(!U(q)){r("copy:error",{entity:te,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,field:"id",message:o("ca-certificates.copy.success",{val:q})})},N=(te,U)=>{const q=JSON.stringify(te);if(!U(q)){r("copy:error",{entity:te,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,message:o("ca-certificates.copy.success_brief")})},E=async te=>{var q;await((q=n.canRetrieve)==null?void 0:q.call(n,te))&&l.push(n.config.getViewRoute(te.id))},B=te=>({label:o("ca-certificates.actions.view"),to:n.config.getViewRoute(te)}),O=te=>({label:o("ca-certificates.actions.edit"),to:n.config.getEditRoute(te)}),G=i.ref(void 0),M=i.ref(!1),J=i.ref(!1),ee=i.ref(""),ne=ip(n.config,m.value),{certificateDataCache:me,getCertificateData:ie}=ut.useCertificate(),Ee=te=>{G.value=te,M.value=!0},zr=()=>{M.value=!1},Gr=async()=>{var te,U,q;if((te=G.value)!=null&&te.id){J.value=!0;try{await c.delete(ne(G.value.id)),J.value=!1,M.value=!1,d.value++,r("delete:success",G.value)}catch(fe){ee.value=((q=(U=fe.response)==null?void 0:U.data)==null?void 0:q.message)||fe.message||o("ca-certificates.errors.delete"),r("error",fe)}finally{J.value=!1}}},pr=i.ref(!1);i.watch(v,te=>{var U,q,fe,Le;if(Array.isArray((U=te==null?void 0:te.response)==null?void 0:U.data)&&(pr.value=te.response.data.length>0),te.status===qt.Error){S.value={title:o("ca-certificates.errors.general")},(Le=(fe=(q=te.error)==null?void 0:q.response)==null?void 0:fe.data)!=null&&Le.message&&(S.value.message=te.error.response.data.message),r("error",te.error);return}me.value={},S.value=null});const Dt=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("ca-certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("ca-certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(Dt.value.title=o("ca-certificates.list.empty_state.title"),Dt.value.ctaText=o("ca-certificates.actions.create"))}),(te,U)=>{const q=i.resolveComponent("KButton"),fe=i.resolveComponent("KBadge"),Le=i.resolveComponent("KTruncate"),Xe=i.resolveComponent("KDropdownItem"),Wr=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",Vb,[i.createVNode(i.unref(Qf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Dt.value,"enable-entity-actions":"","error-message":S.value,fetcher:i.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":i.unref(x),"use-action-outside":e.useActionOutside,onClearSearchInput:A,"onClick:row":U[2]||(U[2]=re=>E(re)),onSort:C},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(tp),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=re=>h.value=re),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref($t),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[i.vShow,pr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Tb,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.issuer?re.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",jb,i.toDisplayString(i.unref(ie)(re).schemaIssuer||"-"),1))]}),expiry:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",$b,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.expiry?i.unref(s)(re.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",Db,i.toDisplayString(i.unref(ie)(re).schemaExpiry?i.unref(s)(i.unref(ie)(re).schemaExpiry):"-"),1))]}),tags:i.withCtx(({row:re})=>{var xe;return[((xe=re==null?void 0:re.tags)==null?void 0:xe.length)>0?(i.openBlock(),i.createBlock(Le,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(re==null?void 0:re.tags,Z=>(i.openBlock(),i.createBlock(fe,{key:Z,onClick:U[1]||(U[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Z),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Rb,"-"))]}),actions:i.withCtx(({row:re})=>[i.createVNode(Wr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Xe,{"data-testid":"action-entity-copy-id",onClick:Z=>T(re,xe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(Wr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Xe,{"data-testid":"action-entity-copy-json",onClick:Z=>N(re,xe)},{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($t),{"auth-function":()=>e.canRetrieve(re)},{default:i.withCtx(()=>[i.createVNode(Xe,{"data-testid":"action-entity-view","has-divider":"",item:B(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref($t),{"auth-function":()=>e.canEdit(re)},{default:i.withCtx(()=>[i.createVNode(Xe,{"data-testid":"action-entity-edit",item:O(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref($t),{"auth-function":()=>e.canDelete(re)},{default:i.withCtx(()=>[i.createVNode(Xe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Ee(re)},{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(Xf),{"action-pending":J.value,"entity-type":i.unref(qa).CACertificate,error:ee.value,title:i.unref(o)("ca-certificates.delete.title"),visible:M.value,onCancel:zr,onProceed:Gr},{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-8620b081"]]),Pb={class:"kong-ui-entities-ca-certificates-form"},Ub=fr(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:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(e,{emit:t}){var C;const r=t,n=e,o=Yr.useRouter(),{i18n:{t:s}}=ut.useI18n(),{getMessageFromError:a}=np(),{axiosInstance:l}=Ao((C=n.config)==null?void 0:C.axiosRequestConfig),c=i.computed(()=>Di.form[n.config.app].edit),d=i.computed(()=>n.certificateId?Ft.Edit:Ft.Create),y=i.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),f=i.reactive({cert:"",certDigest:"",tags:""}),x=i.computed(()=>(d.value===Ft.Create||JSON.stringify(y.fields)!==JSON.stringify(f))&&!!y.fields.cert),m=S=>{var T;y.fields.cert=(S==null?void 0:S.cert)||"",y.fields.certDigest=(S==null?void 0:S.cert_digest)||"",y.fields.tags=((T=S==null?void 0:S.tags)==null?void 0:T.join(", "))||"",Object.assign(f,y.fields)},h=()=>{o.push(n.config.cancelRoute)},g=i.computed(()=>{var T,N;let S=`${n.config.apiBaseUrl}${Di.form[n.config.app].validate}`;return n.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),S=S.replace(/{id}/gi,n.certificateId),S}),b=i.computed(()=>{var T,N;let S=`${n.config.apiBaseUrl}${Di.form[n.config.app][d.value]}`;return n.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),S=S.replace(/{id}/gi,n.certificateId),S}),v=i.computed(()=>{var S,T;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(T=(S=y.fields.tags.split(","))==null?void 0:S.map(N=>String(N||"").trim()))==null?void 0:T.filter(N=>N!=="")}}),A=async()=>{var S,T,N,E,B;try{y.isReadonly=!0;let O;await l.post(g.value,v.value),d.value==="create"?O=await l.post(b.value,v.value):d.value==="edit"&&(O=((S=n.config)==null?void 0:S.app)==="konnect"?await l.put(b.value,v.value):await l.patch(b.value,v.value)),y.fields.cert=((T=O==null?void 0:O.data)==null?void 0:T.cert)||"",y.fields.certDigest=((N=O==null?void 0:O.data)==null?void 0:N.cert_digest)||"",y.fields.tags=((B=(E=O==null?void 0:O.data)==null?void 0:E.tags)==null?void 0:B.join(", "))||"",Object.assign(f,y.fields),r("update",O==null?void 0:O.data)}catch(O){y.errorMessage=a(O),r("error",O)}finally{y.isReadonly=!1}};return(S,T)=>{const N=i.resolveComponent("KTextArea"),E=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Pb,[i.createVNode(i.unref(Zf),{"can-submit":x.value,config:e.config,"edit-id":e.certificateId,"enable-terraform":e.enableTerraform,"entity-type":i.unref(Ur).CaCertificate,"error-message":y.errorMessage,"fetch-url":c.value,"form-fields":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":T[3]||(T[3]=B=>S.$emit("error",B)),"onFetch:success":m,onLoading:T[4]||(T[4]=B=>S.$emit("loading",B)),onSubmit:A},{default:i.withCtx(()=>[i.createVNode(i.unref(xo),{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(N,{modelValue:y.fields.cert,"onUpdate:modelValue":T[0]||(T[0]=B=>y.fields.cert=B),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(E,{modelValue:y.fields.certDigest,"onUpdate:modelValue":T[1]||(T[1]=B=>y.fields.certDigest=B),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(xo),{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(E,{modelValue:y.fields.tags,"onUpdate:modelValue":T[2]||(T[2]=B=>y.fields.tags=B),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","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-b74c6273"]]),Lb={class:"kong-ui-certificate-entity-config-card"},Hb={key:0},Fb=fr(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},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ut.useI18n(),{convertKeyToTitle:l}=sp(),{getPropValue:c}=ap(),{getCertificateData:d}=ut.useCertificate(),y=i.computed(()=>Ni.form[n.config.app].edit),f=i.ref(),x=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}}),m=B=>{f.value=B,r("fetch:success",B)},h=(B,O)=>{const G=c("rowValue",O);if(B==="expiry")return b.value;if(B==="key_usages")return S.value;if(B==="san_names")return A.value;if(G)return G[B]},g=i.computed(()=>{if(f.value)return d(f.value)}),b=i.computed(()=>{var B,O;return(B=g.value)!=null&&B.schemaExpiry?s((O=g.value)==null?void 0:O.schemaExpiry):""}),v=i.computed(()=>{var B;return((B=g.value)==null?void 0:B.schemaIssuer)||""}),A=i.computed(()=>{var B;return((B=g.value)==null?void 0:B.schemaSanNames)||""}),C=i.computed(()=>{var B;return((B=g.value)==null?void 0:B.schemaSubject)||""}),S=i.computed(()=>{var B;return((B=g.value)==null?void 0:B.schemaKeyUsages)||[]}),T=i.computed(()=>{var B,O;return((O=(B=f==null?void 0:f.value)==null?void 0:B.snis)==null?void 0:O.length)>0}),N=i.computed(()=>{var B;return!!((B=f==null?void 0:f.value)!=null&&B.cert_alt)}),E=B=>{var O,G;return B==="san_names"?o("certificates.list.table_headers.san"):((G=(O=x.value)==null?void 0:O[B])==null?void 0:G.label)||l(B)};return(B,O)=>{const G=i.resolveComponent("KCodeBlock"),M=i.resolveComponent("KLabel"),J=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",Lb,[i.createVNode(i.unref(Yf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":x.value,"enable-terraform":e.enableTerraform,"entity-type":i.unref(Ur).Certificate,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":O[0]||(O[0]=ee=>B.$emit("fetch:error",ee)),"onFetch:success":m,onLoading:O[1]||(O[1]=ee=>B.$emit("loading",ee))},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(ee=>[i.unref(c)("rowValue",ee)?(i.openBlock(),i.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",ee),language:"plaintext","single-line":""},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(M,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(ee=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",ee)),ne=>(i.openBlock(),i.createBlock(i.unref(go),{key:ne,item:{key:ne,value:h(ne,ee),label:E(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(v.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(A.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C.value||"–"),1)]),"cert_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:i.withCtx(()=>[S.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Hb,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(S.value,(ee,ne)=>(i.openBlock(),i.createBlock(J,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:ee,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(ee),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[T.value?void 0:{name:"snis",fn:i.withCtx(()=>[i.createTextVNode(" – ")]),key:"0"},N.value?{name:"cert_alt",fn:i.withCtx(ee=>[i.createTextVNode(" > "),i.unref(c)("rowValue",ee)?(i.openBlock(),i.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:i.unref(c)("rowValue",ee),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-c65f3278"]]);je.CACertificateConfigCard=_b,je.CACertificateForm=Ub,je.CACertificateList=Mb,je.CertificateConfigCard=Fb,je.CertificateForm=Eb,je.CertificateList=kb,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|