@kong-ui-public/entities-certificates 2.4.4 → 2.4.5
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.
|
@@ -114,7 +114,7 @@ ${t.join(`
|
|
|
114
114
|
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let n=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),i.push(`${n}${t[ue.NAME]}:${s}`),n=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${n}${d}${l}`);else if(l instanceof Date)i.push(`${n}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const y of l)y[ue.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,i.push(...this.serializeObj(l,r));else if($.isBufferSource(l))c?(i.push(`${n}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const y=l.toTextObject();y[ue.NAME]=c,i.push(...this.serializeObj(y,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(t,r=0){const i=this.pad(r),n=$.toUint8Array(t),s=[];for(let a=0;a<n.length;){const c=[];for(let l=0;l<16&&a<n.length;l++){l===8&&c.push("");const d=n[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${i}${c.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}or.oidSerializer=Pt,or.algorithmSerializer=Vh;class $t{constructor(...t){if(t.length===1){const r=t[0];this.rawData=G.serialize(r),this.onInit(r)}else{const r=G.parse(t[0],t[1]);this.rawData=$.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof $t?rc(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return G.toString(this.rawData);case"text":return or.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 ue(this.getTextName(),{},t)}}$t.NAME="ASN";class gt extends $t{constructor(...t){let r;$.isBufferSource(t[0])?r=$.toArrayBuffer(t[0]):r=G.serialize(new st({extnID:t[0],critical:t[1],extnValue:new ae($.toArrayBuffer(t[2]))})),super(r,st)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[ue.NAME]===gt.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}var td;class sr{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[td]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(sr.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=sr.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(sr.DEFAULT,t);return this}}td=Symbol.toStringTag,sr.DEFAULT="default";const Je=new sr,jh=/^[0-2](?:\.[1-9][0-9]*)+$/;function Dh(e){return new RegExp(jh).test(e)}class rd{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Dh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Ke=new rd;Ke.register("CN","2.5.4.3"),Ke.register("L","2.5.4.7"),Ke.register("ST","2.5.4.8"),Ke.register("O","2.5.4.10"),Ke.register("OU","2.5.4.11"),Ke.register("C","2.5.4.6"),Ke.register("DC","0.9.2342.19200300.100.1.25"),Ke.register("E","1.2.840.113549.1.9.1"),Ke.register("G","2.5.4.42"),Ke.register("I","2.5.4.43"),Ke.register("SN","2.5.4.4"),Ke.register("T","2.5.4.12");function Mh(e,t){return`\\${L.ToHex(L.FromUtf8String(t)).toUpperCase()}`}function Ph(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Mh)}class Rt{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 rd,this.asn=new we;for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)){const n=r[i];this.extraNames.register(i,n)}typeof t=="string"?this.asn=this.fromString(t):t instanceof we?this.asn=t:$.isBufferSource(t)?this.asn=G.parse(t,we):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||Ke.findId(t),i=[];for(const n of this.asn)for(const s of n)s.type===r&&i.push(s.value.toString());return i}getName(t){return this.extraNames.get(t)||Ke.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,n=r.value.anyValue?`#${L.ToHex(r.value.anyValue)}`:Ph(r.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const i of this.asn){const n={};for(const s of i){const a=this.getName(s.type)||s.type;(t=n[a])!==null&&t!==void 0||(n[a]=[]),n[a].push(s.value.anyValue?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(n)}return r}fromString(t){const r=new we,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${t},`);){let[,a,c]=n;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),n[3]=l);const d=n[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const y=new Xr({type:a});if(c.charAt(0)==="#")y.value.anyValue=L.FromHex(c.slice(1));else{const p=/"(.*?[^\\])?"/.exec(c);p&&(c=p[1]),c=c.replace(/\\0a/ig,`
|
|
115
115
|
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Rt.isPrintableString(c)?y.value.printableString=c:y.value.utf8String=c}s==="+"?r[r.length-1].push(y):r.push(new yr([y])),s=d}return r}fromJSON(t){const r=new we;for(const i of t){const n=new yr;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Xr({type:a});if(typeof l=="object")for(const y in l)switch(y){case"ia5String":d.value.ia5String=l[y];break;case"utf8String":d.value.utf8String=l[y];break;case"universalString":d.value.universalString=l[y];break;case"bmpString":d.value.bmpString=l[y];break;case"printableString":d.value.printableString=l[y];break}else l[0]==="#"?d.value.anyValue=L.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;n.push(d)}}r.push(n)}return r}toArrayBuffer(){return G.serialize(this.asn)}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Je.get()):i=t[0]||Je.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const id="Cannot initialize GeneralName from ASN.1 data.",nd=`${id} Unsupported string format in use.`,$h=`${id} Value doesn't match to GUID regular expression.`,od=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,sd="1.3.6.1.4.1.311.25.1",ad="1.3.6.1.4.1.311.20.2.3",wa="dns",va="dn",ka="email",Ca="ip",Sa="url",xa="guid",Aa="upn",to="id";class cd extends $t{constructor(...t){let r;if(t.length===2)switch(t[0]){case va:{const i=new Rt(t[1]).toArrayBuffer(),n=G.parse(i,we);r=new ie({directoryName:n});break}case wa:r=new ie({dNSName:t[1]});break;case ka:r=new ie({rfc822Name:t[1]});break;case xa:{const i=new RegExp(od,"i").exec(t[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,a)=>a<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ei({typeId:sd,value:G.serialize(new ae(L.FromHex(n)))})});break}case Ca:r=new ie({iPAddress:t[1]});break;case to:r=new ie({registeredID:t[1]});break;case Aa:{r=new ie({otherName:new ei({typeId:ad,value:G.serialize(nl.toASN(t[1]))})});break}case Sa:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else $.isBufferSource(t[0])?r=G.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=wa,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=ka,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=Ca,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=Sa,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=to,this.value=t.registeredID;else if(t.directoryName!=null)this.type=va,this.value=new Rt(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===sd){this.type=xa;const r=G.parse(t.otherName.value,ae),i=new RegExp(od,"i").exec(L.ToHex(r));if(!i)throw new Error($h);this.value=i.slice(1).map((n,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(n)).reverse()):n).join("-")}else if(t.otherName.typeId===ad)this.type=Aa,this.value=G.parse(t.otherName.value,Oe).toString();else throw new Error(nd);else throw new Error(nd)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case va:case wa:case xa:case Ca:case to:case Aa:case Sa:t=this.type.toUpperCase();break;case ka:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===to&&(r=Pt.toString(r)),new ue(t,void 0,r)}}class Ci extends $t{constructor(t){let r;if(t instanceof Pe)r=t;else if(Array.isArray(t)){const i=[];for(const n of t)if(n instanceof ie)i.push(n);else{const s=G.parse(new cd(n.type,n.value).rawData,ie);i.push(s)}r=new Pe(i)}else if($.isBufferSource(t))r=G.parse(t,Pe);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let n=null;try{n=new cd(i)}catch{continue}r.push(n)}this.items=r}toJSON(){return this.items.map(t=>t.toJSON())}toTextObject(){const t=super.toTextObjectEmpty();for(const r of this.items){const i=r.toTextObject();let n=t[i[ue.NAME]];Array.isArray(n)||(n=[],t[i[ue.NAME]]=n),n.push(i)}return t}}Ci.NAME="GeneralNames";const Si="-{5}",xi="\\n",Rh=`[^${xi}]+`,Uh=`${Si}BEGIN (${Rh}(?=${Si}))${Si}`,Lh=`${Si}END \\1${Si}`,Dr="\\n",Fh=`[^:${xi}]+`,Hh=`(?:[^${xi}]+${Dr}(?: +[^${xi}]+${Dr})*)`,qh=`(?:[a-zA-Z0-9=+/]+${Dr})+`,ld=`${Uh}${Dr}(?:((?:${Fh}: ${Hh})+))?${Dr}?(${qh})${Lh}`;class Ye{static isPem(t){return typeof t=="string"&&new RegExp(ld,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(ld,"g"),i=[];let n=null;for(;n=r.exec(t);){const s=n[3].replace(new RegExp(`[${xi}]+`,"g"),""),a={type:n[1],headers:[],rawData:L.FromBase64(s)},c=n[2];if(c){const l=c.split(new RegExp(Dr,"g"));let d=null;for(const y of l){const[p,I]=y.split(/:(.*)/);if(I===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=p.trim()}else d&&a.headers.push(d),d={key:p,value:I.trim()}}d&&a.headers.push(d)}i.push(a)}return i}static decode(t){return this.decodeWithHeaders(t).map(i=>i.rawData)}static decodeFirst(t){const r=this.decode(t);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(t,r){if(Array.isArray(t)){const i=new Array;return r?t.forEach(n=>{if(!$.isBufferSource(n))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:$.toArrayBuffer(n)}))}):t.forEach(n=>{if(!("type"in n))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(n))}),i.join(`
|
|
116
116
|
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:$.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((r=t.headers)===null||r===void 0)&&r.length){for(const d of t.headers)n.push(`${d.key}: ${d.value}`);n.push("")}const s=L.ToBase64(t.rawData);let a,c=0;const l=Array();for(;c<s.length&&(s.length-c<64?a=s.substring(c):(a=s.substring(c,c+64),c+=64),a.length!==0);)if(l.push(a),a.length<64)break;return n.push(...l),n.push(`-----END ${i}-----`),n.join(`
|
|
117
|
-
`)}}Ye.CertificateTag="CERTIFICATE",Ye.CrlTag="CRL",Ye.CertificateRequestTag="CERTIFICATE REQUEST",Ye.PublicKeyTag="PUBLIC KEY",Ye.PrivateKeyTag="PRIVATE KEY";class Ot extends $t{static isAsnEncoded(t){return $.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ye.isPem(t))return Ye.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 Ye.isPem(r)?Ye.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):$.toArrayBuffer(t)}}constructor(...t){Ot.isAsnEncoded(t[0])?super(Ot.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ye.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ar extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,It):super(t),this.tag=Ye.PublicKeyTag}async export(...t){let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};return t.length>1?(n=t[0]||n,i=t[1]||i,r=t[2]||Je.get()):r=t[0]||Je.get(),r.subtle.importKey("spki",this.rawData,n,!0,i)}onInit(t){const r=tt.resolve(Xn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const n=G.parse(t.subjectPublicKey,Ws),s=$.toUint8Array(n.modulus);i.publicExponent=$.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Je.get()):i=t[0]||Je.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(t){t||(t=Je.get());const r=G.parse(this.rawData,It);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,It);switch(t.Algorithm=or.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case yi:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class mt{static register(t,r){this.items.set(t,r)}static create(t){const r=new gt(t),i=this.items.get(r.type);return i?new i(t):r}}mt.items=new Map;const ro="crypto.signatureFormatter";class Kh{toAsnSignature(t,r){return $.toArrayBuffer(r)}toWebSignature(t,r){return $.toArrayBuffer(r)}}class io extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,wr):super(t),this.tag=Ye.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Rt(r.subject),this.subject=new Rt(r.subject).toString(),this.issuerName=new Rt(r.issuer),this.issuer=this.issuerName.toString();const i=tt.resolve(Xn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const n=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;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=>mt.create(G.serialize(a)))),this.publicKey=new ar(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=Je.get()){let i,n;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],r);else if(s instanceof ar)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],r);else if($.isBufferSource(s)){const d=new ar(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=tt.resolveAll(ro).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,n,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Je.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Je.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,wr),i=r.tbsCertificate,n=new ue("",{Version:`${br[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":or.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Extensions=s}return t.Data=n,t.Signature=new ue("",{Algorithm:or.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends gt{static async create(t,r=!1,i=Je.get()){if(t instanceof io||sr.isCryptoKey(t)){const n=t instanceof io?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",n),c=await new ar(s).getKeyIdentifier(i);return new Ai(L.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if($.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Qt({keyIdentifier:new Ho(L.FromHex(t[0]))});super(Fo,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?G.parse(r.name.rawData,Pe):r.name,n=new Qt({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Fo,t[1],G.serialize(n))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,Qt);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Qt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ci(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ai.NAME="Authority Key Identifier";class ud extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(dl,t[2],G.serialize(r)),this.ca=t[0],this.pathLength=t[1]}}toTextObject(){const t=this.toTextObjectWithoutValue();return this.ca&&(t.CA=this.ca),this.pathLength!==void 0&&(t["Path Length"]=this.pathLength),t}}ud.NAME="Basic Constraints";var dd;(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"})(dd||(dd={}));class fd extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(ml,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}fd.NAME="Extended Key Usages";var Ba;(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"})(Ba||(Ba={}));class Ia extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ns);this.usages=r.toNumber()}else{const r=new ns(t[0]);super(wl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ns);return t[""]=r.toJSON().join(", "),t}}Ia.NAME="Key Usages";class no extends gt{static async create(t,r=!1,i=Je.get()){let n;t instanceof ar?n=t.rawData:"publicKey"in t?n=t.publicKey.rawData:$.isBufferSource(t)?n=t:n=await i.subtle.exportKey("spki",t);const a=await new ar(n).getKeyIdentifier(i);return new no(L.ToHex(a),r)}constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,Dt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new Dt(r);super(Al,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Dt);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ea extends gt{constructor(...t){$.isBufferSource(t[0])?super(t[0]):super(Sl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,ls);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Ea.NAME="Subject Alternative Name";class pd extends gt{constructor(...t){var r;if($.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,sn);this.policies=i.map(n=>n.policyIdentifier)}else{const i=t[0],n=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(i.map(a=>new on({policyIdentifier:a})));super(pl,n,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Pt.toString(r))),t}}pd.NAME="Certificate Policies",mt.register(pl,pd);class Mr extends $t{constructor(...t){let r;if($.isBufferSource(t[0]))r=$.toArrayBuffer(t[0]);else{const i=t[0],n=Array.isArray(t[1])?t[1].map(s=>$.toArrayBuffer(s)):[];r=G.serialize(new Bt({type:i,values:n}))}super(r,Bt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===Mr.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}Mr.NAME="Attribute";class hd extends Mr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(du,[G.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}hd.NAME="Challenge Password";class Na extends Mr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=t[0],n=new Xt;for(const s of i)n.push(G.parse(s.rawData,st));super(ua,[G.serialize(n)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],Xt);this.items=r.map(i=>mt.create(G.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ue.NAME]]=i;return t}}Na.NAME="Extensions";class oo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Mr(t),i=this.items.get(r.type);return i?new i(t):r}}oo.items=new Map;let Oa=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new H({algorithm:jn,parameters:null});case"sha-256":return new H({algorithm:qs,parameters:null});case"sha-384":return new H({algorithm:Dn,parameters:null});case"sha-512":return new H({algorithm:Mn,parameters:null})}}else return new H({algorithm:Tr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Tr:return{name:"RSASSA-PKCS1-v1_5"};case jn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case qs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Oa=u([ea()],Oa),tt.registerSingleton(Qn,Oa);class rt{addPadding(t,r){const i=$.toUint8Array(r),n=new Uint8Array(t);return n.set(i,t-i.length),n}removePadding(t,r=!1){let i=$.toUint8Array(t);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(r&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,n=rt.namedCurveSize.get(i)||rt.defaultNamedCurveSize,s=new Vn,a=$.toUint8Array(r);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,Vn),n=t.namedCurve,s=rt.namedCurveSize.get(n)||rt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return ap(a,c)}return null}}rt.namedCurveSize=new Map,rt.defaultNamedCurveSize=32;const yd="1.3.101.110",gd="1.3.101.111",md="1.3.101.112",bd="1.3.101.113";let _a=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=md;break;case"ed448":r=bd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=yd;break;case"x448":r=gd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case md:return{name:"EdDSA",namedCurve:"Ed25519"};case bd:return{name:"EdDSA",namedCurve:"Ed448"};case yd:return{name:"ECDH-ES",namedCurve:"X25519"};case gd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};_a=u([ea()],_a),tt.registerSingleton(Qn,_a);class zh extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,vi):super(t),this.tag=Ye.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new ar(t.certificationRequestInfo.subjectPKInfo);const r=tt.resolve(Xn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(n=>oo.create(G.serialize(n)));const i=this.getAttribute(ua);this.extensions=[],i instanceof Na&&(this.extensions=i.items),this.subjectName=new Rt(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=Je.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),n=tt.resolveAll(ro).reverse();let s=null;for(const c of n)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,vi),i=r.certificationRequestInfo,n=new ue("",{Version:`${br[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Attributes=s}return t.Data=n,t.Signature=new ue("",{Algorithm:or.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}zh.NAME="PKCS#10 Certificate Request";var wd;(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"})(wd||(wd={})),mt.register(dl,ud),mt.register(ml,fd),mt.register(wl,Ia),mt.register(Al,no),mt.register(Fo,Ai),mt.register(Sl,Ea),oo.register(du,hd),oo.register(ua,Na),tt.registerSingleton(ro,Kh),tt.registerSingleton(ro,rt),rt.namedCurveSize.set("P-256",32),rt.namedCurveSize.set("K-256",32),rt.namedCurveSize.set("P-384",48),rt.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 io(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const n of r.extensions)if(n instanceof Ea){const s=n.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(n instanceof Ia){const s=Object.values(Ba),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(n.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Gh(){const e=vd(),t=o.ref({}),r=n=>{if(!(n.id in t.value))try{t.value[n.id]=e.parseMetaCertificateData(n.cert)}catch{t.value[n.id]=void 0}return t.value[n.id]};return{certificateDataCache:t,getCertificateData:n=>{const s=r(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Wh={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Jh(){const e=ji.createI18n("en-us",Wh);return{i18n:e,i18nT:ji.i18nTComponent(e)}}const bt={useCertificate:Gh,useI18n:Jh,useX509:vd},Bi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}};var Ta=(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))(Ta||{}),cr=(e=>(e.Edit="edit",e.Create="create",e))(cr||{}),Ut=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ut||{}),ce=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ce||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function Yh(){return{getAxiosInstance:(e={})=>{try{const t=o.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):Xa.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Xa.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 Zh(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Va="khcp-user-table-preferences",Qh={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Xh(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Va));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const n=t();n.set(r,i),localStorage.setItem(Va,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||Qh},deleteAllTablePreferences:()=>{localStorage.removeItem(Va)}}}function ja(e={}){const{getAxiosInstance:t}=Yh();return{axiosInstance:t(e)}}const ey={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},ty={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ry={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."}},iy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ny={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"}},oy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},sy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ay={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},cy={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"}},ly={global:ey,deleteModal:ty,baseForm:ry,baseTable:iy,baseConfigCard:ny,filter:oy,debouncedFilter:sy,errors:ay,toggleModal:cy};function Da(){const e=ji.createI18n("en-us",ly);return{i18n:e,i18nT:ji.i18nTComponent(e)}}function kd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const n=new Set([...r,...i]);for(const s of n){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,n)=>{if(n){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,n)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=n[r]===void 0||n[r]===null?"":n[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(n[r])&&(a=n[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 uy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:n}=ja({headers:e.requestHeaders}),{i18n:{t:s}}=Da(),{debounce:a}=Zh(),c=a(async S=>{await E(S)},200),l=o.ref(!1),d=o.ref(""),y=o.ref(""),p=o.ref([]),I=o.ref([]),k=o.ref(void 0),h=o.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:b}=kd(),v=async()=>{try{l.value=!0;const{data:S}=await n.get(`${g}?size=${r}`);S!=null&&S.next||(k.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[]),I.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},B=o.ref(""),E=async S=>{var C,A,M;if(B.value!==S)if(B.value=S||"",k.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let _=g+"";S&&(_+=`/${S}`);const{data:N}=await n.get(`${_}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(S){const _=[];b(S)&&i.searchKeys.includes("id")?_.push((async()=>{const{data:q}=await n.get(`${g}/${S}`);return[q[i.fetchedItemsKey]??q]})()):_.push(...i.searchKeys.filter(q=>q!=="id").map(async q=>{const{data:j}=await n.get(`${g}?${q}=${S}`);return j[i.fetchedItemsKey]}));const N=await Promise.all(_),re=new Set;p.value=[],(C=N==null?void 0:N.forEach)==null||C.call(N,q=>{var j;(j=q==null?void 0:q.forEach)==null||j.call(q,Z=>{re.has(Z.id)||(re.add(Z.id),p.value.push(Z))})})}else p.value=I.value}catch(_){((A=_==null?void 0:_.response)==null?void 0:A.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",S?(p.value=(M=k.value)==null?void 0:M.filter(_=>{var N;let re=!1;for(const q of i.searchKeys){const j=typeof _[q]=="string"?(N=_[q])==null?void 0:N.toLowerCase():_[q];j!=null&&j.includes(S.toLowerCase())&&(re=!0)}return re}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=k.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:k,loadItems:v,debouncedQueryChange:c}}function dy(e,t){const r=o.unref(t),i=o.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",n=>`${i.value.href}/${n}`}function fy(){const{i18n:{t:e}}=Da();return{getMessageFromError:t=>{var r,i,n,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((n=t.response.data.details)!=null&&n.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function py(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),n=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!s&&new URL(n))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Cd(e,t){const r=o.ref(o.unref(e)),i=o.ref(o.unref(t)),n=o.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=o.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let k=new URL(s.value.href);return n.value&&I?(k.search="",k=r.value.app==="konnect"?new URL(`${k.href}?filter[name][contains]=${I}`):new URL(`${k.href}/${I}/`)):(n.value||new URLSearchParams(I).forEach((h,g)=>{k.searchParams.append(g,h)}),y&&k.searchParams.append("sort_by",y),p==="desc"&&k.searchParams.append("sort_desc","1"),k.searchParams.append("size",String(l))),d&&c!==1&&k.searchParams.append("offset",String(d)),k.href}catch(k){return console.error("RouteList(fetcher)",k),i.value}}}function hy(e,t,r="data"){const i=o.unref(t),{axiosInstance:n}=ja({headers:e.requestHeaders}),s=Cd(e,i),a=o.ref({status:Ut.Idle});return{fetcher:async c=>{try{a.value={status:Ut.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:d}=await n.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const I={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ut.Idle,response:I},I}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Ut.NoResults,response:d,error:l},d):(a.value={status:Ut.Error,response:d,error:l},d)}},fetcherState:a}}function yy(){const e=(r,i="_")=>r?r.split(i).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Sd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,xd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Sd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ad=e=>e==="*"||e==="x"||e==="X",Bd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},gy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],my=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,i]=gy(Bd(e),Bd(t));return r>i?1:r<i?-1:0},Id=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=my(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},by=(e,t)=>{const r=xd(e),i=xd(t),n=r.pop(),s=i.pop(),a=Id(r,i);return a!==0?a:n&&s?Id(n.split("."),s.split(".")):n||s?n?-1:1:0},Ed=(e,t,r)=>{wy(r);const i=by(e,t);return Nd[r].includes(i)},Nd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Od=Object.keys(Nd),wy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Od.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Od.join("|")}`)},vy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Sd.test(e);function ky(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:n}=t;if(!vy(n))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Ed(n,a,"<")||c&&Ed(n,c,">"))}function Cy(e){const t=o.ref(0),r=o.ref(0),i=o.ref(!1);return o.watch(e,n=>{n&&!i.value&&(t.value=n.offsetWidth,r.value=n.scrollWidth,i.value=!0)}),{isTruncated:o.computed(()=>t.value<r.value)}}const Be={useAxios:ja,useDebouncedFilter:uy,useDeleteUrlBuilder:dy,useErrors:fy,useExternalLinkCreator:py,useFetcher:hy,useFetchUrlBuilder:Cd,useHelpers:kd,useStringHelpers:yy,useI18n:Da,useGatewayFeatureSupported:ky,useTruncationDetector:Cy},Sy={key:0,class:"config-card-fieldset-title"},xy=o.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}}=Be.useI18n(),{convertKeyToTitle:i}=Be.useStringHelpers(),n=o.computed(()=>t.item.key??"json-array-item"),s=o.computed(()=>t.item.value??t.item),a=o.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=o.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:o.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:o.withCtx(()=>[e.isArrayItem?(o.openBlock(),o.createElementBlock("legend",Sy,[o.createElementVNode("b",null,o.toDisplayString(c.value),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(a.value),(y,p)=>(o.openBlock(),o.createBlock(so,{key:`${n.value}-property-${p}`,item:{key:y,label:o.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ct=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},_d=ct(xy,[["__scopeId","data-v-68ca83ec"]]),Ay=o.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KButton");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.value||o.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),By=ct(Ay,[["__scopeId","data-v-c96811e5"]]),Iy=o.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KBadge");return o.openBlock(),o.createBlock(n,{appearance:e.status?"success":"neutral"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.status?o.unref(t)("baseConfigCard.statusBadge.enabledLabel"):o.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Ey="#0044f4",Ny="#e0e4ea",Oy="#3a3f51",_y="#afb7c5",Ty="1px",Vy="20px",jy={class:"config-card-details-row"},Dy=["data-testid"],My=["data-testid"],Py=["data-testid"],$y=["data-testid"],Ry={key:1},Uy=["data-testid"],Ly=["data-testid"],Fy=["data-testid"],Hy=["data-testid"],qy={name:"ConfigCardItem",components:{JsonCardItem:_d,StatusBadge:Iy,InternalLinkItem:By}},Ky=o.defineComponent({...qy,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}){o.useCssVars(h=>({"07753575":y.value?"none":`solid ${o.unref(Ty)} ${o.unref(Ny)}`,"32d44ea8":d.value&&c.value?"block":"flex","5036b738":d.value&&c.value?"100%":r.slim?"50%":"25%","5038fd13":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,n=o.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Be.useI18n(),c=o.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=o.computed(()=>!!(r.item.tooltip||n["label-tooltip"])),d=o.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=o.computed(()=>r.item.type===ce.JsonArray),p=o.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.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),I=o.ref(),{isTruncated:k}=Be.useTruncationDetector(I);return(h,g)=>{const b=o.resolveComponent("KLabel"),v=o.resolveComponent("KBadge"),B=o.resolveComponent("KCopy"),E=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("div",jy,[o.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[o.renderSlot(h.$slots,"label",{item:e.item},()=>[o.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},o.createSlots({default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:o.withCtx(()=>[o.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[o.renderSlot(h.$slots,"label-tooltip",{},()=>[o.createTextVNode(o.toDisplayString(e.item.tooltip),1)],!0)],8,My)]),key:"0"}:void 0]),1024)],!0)],8,Dy),o.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[o.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(o.openBlock(),o.createElementBlock("div",Ry,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.value.tag),o.normalizeProps(o.guardReactiveProps(p.value.attrs)),{default:o.withCtx(()=>[p.value.additionalComponent==="KBadge"?(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(v,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:S,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Uy)):o.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(B,o.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,text:S}),null,16,["data-testid","text"]))),128))],8,Ly)):p.value.additionalComponent==="KMethodBadge"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(v,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(o.unref(rp.BadgeMethodAppearances)).includes(S.toLowerCase())?S.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Fy)):o.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(o.openBlock(),o.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(_d,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:S},null,8,["index","item"]))),128))],8,Hy)):(o.openBlock(),o.createBlock(E,{key:4,text:o.unref(k)?e.item.value:""},{default:o.withCtx(()=>[o.createElementVNode("span",{ref_key:"textContent",ref:I,class:o.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},o.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,$y))],!0)],8,Py)])}}}),so=ct(Ky,[["__scopeId","data-v-d056663c"]]),zy={class:"json-config"},Gy={key:0,class:"json-endpoint"},Td=o.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){o.useCssVars(n=>({"2d178975":`${i.value}ch`}));const t=e,r=o.computed(()=>t.jsonRecord),i=o.computed(()=>{var n;if(!t.fetcherUrl)return 0;const s=(n=t.fetcherUrl)==null?void 0:n.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(n,s)=>{var a;const c=o.resolveComponent("KBadge"),l=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",zy,[t.fetcherUrl&&(a=t.config)!=null&&a.jsonYamlFormsEnabled?(o.openBlock(),o.createElementBlock("div",Gy,[o.createVNode(c,{appearance:t.requestMethod},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),o.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):o.createCommentVNode("",!0),t.jsonRecord?(o.openBlock(),o.createBlock(l,{key:1,id:"json-codeblock",class:o.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):o.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Vd(e){return typeof e>"u"||e===null}function Wy(e){return typeof e=="object"&&e!==null}function Jy(e){return Array.isArray(e)?e:Vd(e)?[]:[e]}function Yy(e,t){var r,i,n,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)n=s[r],e[n]=t[n];return e}function Zy(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function Qy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Xy=Vd,eg=Wy,tg=Jy,rg=Zy,ig=Qy,ng=Yy,ke={isNothing:Xy,isObject:eg,toArray:tg,repeat:rg,isNegativeZero:ig,extend:ng};function jd(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
117
|
+
`)}}Ye.CertificateTag="CERTIFICATE",Ye.CrlTag="CRL",Ye.CertificateRequestTag="CERTIFICATE REQUEST",Ye.PublicKeyTag="PUBLIC KEY",Ye.PrivateKeyTag="PRIVATE KEY";class Ot extends $t{static isAsnEncoded(t){return $.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ye.isPem(t))return Ye.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 Ye.isPem(r)?Ye.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):$.toArrayBuffer(t)}}constructor(...t){Ot.isAsnEncoded(t[0])?super(Ot.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ye.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ar extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,It):super(t),this.tag=Ye.PublicKeyTag}async export(...t){let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};return t.length>1?(n=t[0]||n,i=t[1]||i,r=t[2]||Je.get()):r=t[0]||Je.get(),r.subtle.importKey("spki",this.rawData,n,!0,i)}onInit(t){const r=tt.resolve(Xn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const n=G.parse(t.subjectPublicKey,Ws),s=$.toUint8Array(n.modulus);i.publicExponent=$.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Je.get()):i=t[0]||Je.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(t){t||(t=Je.get());const r=G.parse(this.rawData,It);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,It);switch(t.Algorithm=or.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case yi:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class mt{static register(t,r){this.items.set(t,r)}static create(t){const r=new gt(t),i=this.items.get(r.type);return i?new i(t):r}}mt.items=new Map;const ro="crypto.signatureFormatter";class Kh{toAsnSignature(t,r){return $.toArrayBuffer(r)}toWebSignature(t,r){return $.toArrayBuffer(r)}}class io extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,wr):super(t),this.tag=Ye.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Rt(r.subject),this.subject=new Rt(r.subject).toString(),this.issuerName=new Rt(r.issuer),this.issuer=this.issuerName.toString();const i=tt.resolve(Xn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const n=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;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=>mt.create(G.serialize(a)))),this.publicKey=new ar(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=Je.get()){let i,n;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],r);else if(s instanceof ar)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],r);else if($.isBufferSource(s)){const d=new ar(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=tt.resolveAll(ro).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,n,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Je.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Je.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,wr),i=r.tbsCertificate,n=new ue("",{Version:`${br[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":or.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Extensions=s}return t.Data=n,t.Signature=new ue("",{Algorithm:or.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends gt{static async create(t,r=!1,i=Je.get()){if(t instanceof io||sr.isCryptoKey(t)){const n=t instanceof io?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",n),c=await new ar(s).getKeyIdentifier(i);return new Ai(L.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if($.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Qt({keyIdentifier:new Ho(L.FromHex(t[0]))});super(Fo,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?G.parse(r.name.rawData,Pe):r.name,n=new Qt({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Fo,t[1],G.serialize(n))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,Qt);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Qt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ci(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ai.NAME="Authority Key Identifier";class ud extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(dl,t[2],G.serialize(r)),this.ca=t[0],this.pathLength=t[1]}}toTextObject(){const t=this.toTextObjectWithoutValue();return this.ca&&(t.CA=this.ca),this.pathLength!==void 0&&(t["Path Length"]=this.pathLength),t}}ud.NAME="Basic Constraints";var dd;(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"})(dd||(dd={}));class fd extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(ml,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}fd.NAME="Extended Key Usages";var Ba;(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"})(Ba||(Ba={}));class Ia extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ns);this.usages=r.toNumber()}else{const r=new ns(t[0]);super(wl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ns);return t[""]=r.toJSON().join(", "),t}}Ia.NAME="Key Usages";class no extends gt{static async create(t,r=!1,i=Je.get()){let n;t instanceof ar?n=t.rawData:"publicKey"in t?n=t.publicKey.rawData:$.isBufferSource(t)?n=t:n=await i.subtle.exportKey("spki",t);const a=await new ar(n).getKeyIdentifier(i);return new no(L.ToHex(a),r)}constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,Dt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new Dt(r);super(Al,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Dt);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ea extends gt{constructor(...t){$.isBufferSource(t[0])?super(t[0]):super(Sl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,ls);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Ea.NAME="Subject Alternative Name";class pd extends gt{constructor(...t){var r;if($.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,sn);this.policies=i.map(n=>n.policyIdentifier)}else{const i=t[0],n=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(i.map(a=>new on({policyIdentifier:a})));super(pl,n,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Pt.toString(r))),t}}pd.NAME="Certificate Policies",mt.register(pl,pd);class Mr extends $t{constructor(...t){let r;if($.isBufferSource(t[0]))r=$.toArrayBuffer(t[0]);else{const i=t[0],n=Array.isArray(t[1])?t[1].map(s=>$.toArrayBuffer(s)):[];r=G.serialize(new Bt({type:i,values:n}))}super(r,Bt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===Mr.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}Mr.NAME="Attribute";class hd extends Mr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(du,[G.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}hd.NAME="Challenge Password";class Na extends Mr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=t[0],n=new Xt;for(const s of i)n.push(G.parse(s.rawData,st));super(ua,[G.serialize(n)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],Xt);this.items=r.map(i=>mt.create(G.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ue.NAME]]=i;return t}}Na.NAME="Extensions";class oo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Mr(t),i=this.items.get(r.type);return i?new i(t):r}}oo.items=new Map;let Oa=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new H({algorithm:jn,parameters:null});case"sha-256":return new H({algorithm:qs,parameters:null});case"sha-384":return new H({algorithm:Dn,parameters:null});case"sha-512":return new H({algorithm:Mn,parameters:null})}}else return new H({algorithm:Tr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Tr:return{name:"RSASSA-PKCS1-v1_5"};case jn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case qs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Oa=u([ea()],Oa),tt.registerSingleton(Qn,Oa);class rt{addPadding(t,r){const i=$.toUint8Array(r),n=new Uint8Array(t);return n.set(i,t-i.length),n}removePadding(t,r=!1){let i=$.toUint8Array(t);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(r&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,n=rt.namedCurveSize.get(i)||rt.defaultNamedCurveSize,s=new Vn,a=$.toUint8Array(r);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,Vn),n=t.namedCurve,s=rt.namedCurveSize.get(n)||rt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return ap(a,c)}return null}}rt.namedCurveSize=new Map,rt.defaultNamedCurveSize=32;const yd="1.3.101.110",gd="1.3.101.111",md="1.3.101.112",bd="1.3.101.113";let _a=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=md;break;case"ed448":r=bd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=yd;break;case"x448":r=gd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case md:return{name:"EdDSA",namedCurve:"Ed25519"};case bd:return{name:"EdDSA",namedCurve:"Ed448"};case yd:return{name:"ECDH-ES",namedCurve:"X25519"};case gd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};_a=u([ea()],_a),tt.registerSingleton(Qn,_a);class zh extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,vi):super(t),this.tag=Ye.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new ar(t.certificationRequestInfo.subjectPKInfo);const r=tt.resolve(Xn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(n=>oo.create(G.serialize(n)));const i=this.getAttribute(ua);this.extensions=[],i instanceof Na&&(this.extensions=i.items),this.subjectName=new Rt(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=Je.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),n=tt.resolveAll(ro).reverse();let s=null;for(const c of n)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,vi),i=r.certificationRequestInfo,n=new ue("",{Version:`${br[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Attributes=s}return t.Data=n,t.Signature=new ue("",{Algorithm:or.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}zh.NAME="PKCS#10 Certificate Request";var wd;(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"})(wd||(wd={})),mt.register(dl,ud),mt.register(ml,fd),mt.register(wl,Ia),mt.register(Al,no),mt.register(Fo,Ai),mt.register(Sl,Ea),oo.register(du,hd),oo.register(ua,Na),tt.registerSingleton(ro,Kh),tt.registerSingleton(ro,rt),rt.namedCurveSize.set("P-256",32),rt.namedCurveSize.set("K-256",32),rt.namedCurveSize.set("P-384",48),rt.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 io(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const n of r.extensions)if(n instanceof Ea){const s=n.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(n instanceof Ia){const s=Object.values(Ba),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(n.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Gh(){const e=vd(),t=o.ref({}),r=n=>{if(!(n.id in t.value))try{t.value[n.id]=e.parseMetaCertificateData(n.cert)}catch{t.value[n.id]=void 0}return t.value[n.id]};return{certificateDataCache:t,getCertificateData:n=>{const s=r(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Wh={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Jh(){const e=ji.createI18n("en-us",Wh);return{i18n:e,i18nT:ji.i18nTComponent(e)}}const bt={useCertificate:Gh,useI18n:Jh,useX509:vd},Bi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}};var Ta=(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))(Ta||{}),cr=(e=>(e.Edit="edit",e.Create="create",e))(cr||{}),Ut=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ut||{}),ce=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ce||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function Yh(){return{getAxiosInstance:(e={})=>{try{const t=o.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):Xa.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Xa.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 Zh(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Va="khcp-user-table-preferences",Qh={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Xh(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Va));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const n=t();n.set(r,i),localStorage.setItem(Va,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||Qh},deleteAllTablePreferences:()=>{localStorage.removeItem(Va)}}}function ja(e={}){const{getAxiosInstance:t}=Yh();return{axiosInstance:t(e)}}const ey={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},ty={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ry={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."}},iy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ny={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"}},oy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},sy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ay={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},cy={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"}},ly={global:ey,deleteModal:ty,baseForm:ry,baseTable:iy,baseConfigCard:ny,filter:oy,debouncedFilter:sy,errors:ay,toggleModal:cy};function Da(){const e=ji.createI18n("en-us",ly);return{i18n:e,i18nT:ji.i18nTComponent(e)}}function kd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const n=new Set([...r,...i]);for(const s of n){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,n)=>{if(n){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,n)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=n[r]===void 0||n[r]===null?"":n[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(n[r])&&(a=n[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 uy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:n}=ja({headers:e.requestHeaders}),{i18n:{t:s}}=Da(),{debounce:a}=Zh(),c=a(async S=>{await E(S)},200),l=o.ref(!1),d=o.ref(""),y=o.ref(""),p=o.ref([]),I=o.ref([]),k=o.ref(void 0),h=o.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:b}=kd(),v=async()=>{try{l.value=!0;const{data:S}=await n.get(`${g}?size=${r}`);S!=null&&S.next||(k.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[]),I.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},B=o.ref(""),E=async S=>{var C,A,M;if(B.value!==S)if(B.value=S||"",k.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let _=g+"";S&&(_+=`/${S}`);const{data:N}=await n.get(`${_}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(S){const _=[];b(S)&&i.searchKeys.includes("id")?_.push((async()=>{const{data:q}=await n.get(`${g}/${S}`);return[q[i.fetchedItemsKey]??q]})()):_.push(...i.searchKeys.filter(q=>q!=="id").map(async q=>{const{data:j}=await n.get(`${g}?${q}=${S}`);return j[i.fetchedItemsKey]}));const N=await Promise.all(_),re=new Set;p.value=[],(C=N==null?void 0:N.forEach)==null||C.call(N,q=>{var j;(j=q==null?void 0:q.forEach)==null||j.call(q,Z=>{re.has(Z.id)||(re.add(Z.id),p.value.push(Z))})})}else p.value=I.value}catch(_){((A=_==null?void 0:_.response)==null?void 0:A.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",S?(p.value=(M=k.value)==null?void 0:M.filter(_=>{var N;let re=!1;for(const q of i.searchKeys){const j=typeof _[q]=="string"?(N=_[q])==null?void 0:N.toLowerCase():_[q];j!=null&&j.includes(S.toLowerCase())&&(re=!0)}return re}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=k.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:k,loadItems:v,debouncedQueryChange:c}}function dy(e,t){const r=o.unref(t),i=o.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",n=>`${i.value.href}/${n}`}function fy(){const{i18n:{t:e}}=Da();return{getMessageFromError:t=>{var r,i,n,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((n=t.response.data.details)!=null&&n.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function py(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),n=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!s&&new URL(n))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Cd(e,t){const r=o.ref(o.unref(e)),i=o.ref(o.unref(t)),n=o.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=o.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let k=new URL(s.value.href);return n.value&&I?(k.search="",k=r.value.isExactMatch?new URL(`${k.href}/${I}/`):new URL(`${k.href}?filter[name][contains]=${I}`)):(n.value||new URLSearchParams(I).forEach((h,g)=>{k.searchParams.append(g,h)}),y&&k.searchParams.append("sort_by",y),p==="desc"&&k.searchParams.append("sort_desc","1"),k.searchParams.append("size",String(l))),d&&c!==1&&k.searchParams.append("offset",String(d)),k.href}catch(k){return console.error("RouteList(fetcher)",k),i.value}}}function hy(e,t,r="data"){const i=o.unref(t),{axiosInstance:n}=ja({headers:e.requestHeaders}),s=Cd(e,i),a=o.ref({status:Ut.Idle});return{fetcher:async c=>{try{a.value={status:Ut.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:d}=await n.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const I={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ut.Idle,response:I},I}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Ut.NoResults,response:d,error:l},d):(a.value={status:Ut.Error,response:d,error:l},d)}},fetcherState:a}}function yy(){const e=(r,i="_")=>r?r.split(i).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Sd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,xd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Sd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ad=e=>e==="*"||e==="x"||e==="X",Bd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},gy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],my=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,i]=gy(Bd(e),Bd(t));return r>i?1:r<i?-1:0},Id=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=my(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},by=(e,t)=>{const r=xd(e),i=xd(t),n=r.pop(),s=i.pop(),a=Id(r,i);return a!==0?a:n&&s?Id(n.split("."),s.split(".")):n||s?n?-1:1:0},Ed=(e,t,r)=>{wy(r);const i=by(e,t);return Nd[r].includes(i)},Nd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Od=Object.keys(Nd),wy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Od.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Od.join("|")}`)},vy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Sd.test(e);function ky(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:n}=t;if(!vy(n))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Ed(n,a,"<")||c&&Ed(n,c,">"))}function Cy(e){const t=o.ref(0),r=o.ref(0),i=o.ref(!1);return o.watch(e,n=>{n&&!i.value&&(t.value=n.offsetWidth,r.value=n.scrollWidth,i.value=!0)}),{isTruncated:o.computed(()=>t.value<r.value)}}const Be={useAxios:ja,useDebouncedFilter:uy,useDeleteUrlBuilder:dy,useErrors:fy,useExternalLinkCreator:py,useFetcher:hy,useFetchUrlBuilder:Cd,useHelpers:kd,useStringHelpers:yy,useI18n:Da,useGatewayFeatureSupported:ky,useTruncationDetector:Cy},Sy={key:0,class:"config-card-fieldset-title"},xy=o.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}}=Be.useI18n(),{convertKeyToTitle:i}=Be.useStringHelpers(),n=o.computed(()=>t.item.key??"json-array-item"),s=o.computed(()=>t.item.value??t.item),a=o.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=o.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:o.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:o.withCtx(()=>[e.isArrayItem?(o.openBlock(),o.createElementBlock("legend",Sy,[o.createElementVNode("b",null,o.toDisplayString(c.value),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(a.value),(y,p)=>(o.openBlock(),o.createBlock(so,{key:`${n.value}-property-${p}`,item:{key:y,label:o.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ct=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},_d=ct(xy,[["__scopeId","data-v-68ca83ec"]]),Ay=o.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KButton");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.value||o.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),By=ct(Ay,[["__scopeId","data-v-c96811e5"]]),Iy=o.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KBadge");return o.openBlock(),o.createBlock(n,{appearance:e.status?"success":"neutral"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.status?o.unref(t)("baseConfigCard.statusBadge.enabledLabel"):o.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Ey="#0044f4",Ny="#e0e4ea",Oy="#3a3f51",_y="#afb7c5",Ty="1px",Vy="20px",jy={class:"config-card-details-row"},Dy=["data-testid"],My=["data-testid"],Py=["data-testid"],$y=["data-testid"],Ry={key:1},Uy=["data-testid"],Ly=["data-testid"],Fy=["data-testid"],Hy=["data-testid"],qy={name:"ConfigCardItem",components:{JsonCardItem:_d,StatusBadge:Iy,InternalLinkItem:By}},Ky=o.defineComponent({...qy,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}){o.useCssVars(h=>({"07753575":y.value?"none":`solid ${o.unref(Ty)} ${o.unref(Ny)}`,"32d44ea8":d.value&&c.value?"block":"flex","5036b738":d.value&&c.value?"100%":r.slim?"50%":"25%","5038fd13":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,n=o.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Be.useI18n(),c=o.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=o.computed(()=>!!(r.item.tooltip||n["label-tooltip"])),d=o.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=o.computed(()=>r.item.type===ce.JsonArray),p=o.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.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),I=o.ref(),{isTruncated:k}=Be.useTruncationDetector(I);return(h,g)=>{const b=o.resolveComponent("KLabel"),v=o.resolveComponent("KBadge"),B=o.resolveComponent("KCopy"),E=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("div",jy,[o.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[o.renderSlot(h.$slots,"label",{item:e.item},()=>[o.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},o.createSlots({default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:o.withCtx(()=>[o.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[o.renderSlot(h.$slots,"label-tooltip",{},()=>[o.createTextVNode(o.toDisplayString(e.item.tooltip),1)],!0)],8,My)]),key:"0"}:void 0]),1024)],!0)],8,Dy),o.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[o.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(o.openBlock(),o.createElementBlock("div",Ry,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.value.tag),o.normalizeProps(o.guardReactiveProps(p.value.attrs)),{default:o.withCtx(()=>[p.value.additionalComponent==="KBadge"?(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(v,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:S,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Uy)):o.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(B,o.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,text:S}),null,16,["data-testid","text"]))),128))],8,Ly)):p.value.additionalComponent==="KMethodBadge"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(v,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(o.unref(rp.BadgeMethodAppearances)).includes(S.toLowerCase())?S.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Fy)):o.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(o.openBlock(),o.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(_d,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:S},null,8,["index","item"]))),128))],8,Hy)):(o.openBlock(),o.createBlock(E,{key:4,text:o.unref(k)?e.item.value:""},{default:o.withCtx(()=>[o.createElementVNode("span",{ref_key:"textContent",ref:I,class:o.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},o.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,$y))],!0)],8,Py)])}}}),so=ct(Ky,[["__scopeId","data-v-d056663c"]]),zy={class:"json-config"},Gy={key:0,class:"json-endpoint"},Td=o.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){o.useCssVars(n=>({"2d178975":`${i.value}ch`}));const t=e,r=o.computed(()=>t.jsonRecord),i=o.computed(()=>{var n;if(!t.fetcherUrl)return 0;const s=(n=t.fetcherUrl)==null?void 0:n.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(n,s)=>{var a;const c=o.resolveComponent("KBadge"),l=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",zy,[t.fetcherUrl&&(a=t.config)!=null&&a.jsonYamlFormsEnabled?(o.openBlock(),o.createElementBlock("div",Gy,[o.createVNode(c,{appearance:t.requestMethod},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),o.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):o.createCommentVNode("",!0),t.jsonRecord?(o.openBlock(),o.createBlock(l,{key:1,id:"json-codeblock",class:o.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):o.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Vd(e){return typeof e>"u"||e===null}function Wy(e){return typeof e=="object"&&e!==null}function Jy(e){return Array.isArray(e)?e:Vd(e)?[]:[e]}function Yy(e,t){var r,i,n,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)n=s[r],e[n]=t[n];return e}function Zy(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function Qy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Xy=Vd,eg=Wy,tg=Jy,rg=Zy,ig=Qy,ng=Yy,ke={isNothing:Xy,isObject:eg,toArray:tg,repeat:rg,isNegativeZero:ig,extend:ng};function jd(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
118
118
|
|
|
119
119
|
`+e.mark.snippet),i+" "+r):i}function Ii(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=jd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ii.prototype=Object.create(Error.prototype),Ii.prototype.constructor=Ii,Ii.prototype.toString=function(e){return this.name+": "+jd(this,e)};var $e=Ii;function Ma(e,t,r,i,n){var s="",a="",c=Math.floor(n/2)-1;return i-t>c&&(s=" ... ",t=i-c+s.length),r-i>c&&(a=" ...",r=i+c-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Pa(e,t){return ke.repeat(" ",t-e.length)+e}function og(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],n=[],s,a=-1;s=r.exec(e.buffer);)n.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var c="",l,d,y=Math.min(e.line+t.linesAfter,n.length).toString().length,p=t.maxLength-(t.indent+y+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=Ma(e.buffer,i[a-l],n[a-l],e.position-(i[a]-i[a-l]),p),c=ke.repeat(" ",t.indent)+Pa((e.line-l+1).toString(),y)+" | "+d.str+`
|
|
120
120
|
`+c;for(d=Ma(e.buffer,i[a],n[a],e.position,p),c+=ke.repeat(" ",t.indent)+Pa((e.line+1).toString(),y)+" | "+d.str+`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-certificates",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-certificates.umd.js",
|
|
6
6
|
"module": "./dist/entities-certificates.es.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@peculiar/x509": "^1.9.7",
|
|
51
|
-
"@kong-ui-public/entities-shared": "^2.10.
|
|
51
|
+
"@kong-ui-public/entities-shared": "^2.10.5"
|
|
52
52
|
},
|
|
53
53
|
"distSizeChecker": {
|
|
54
54
|
"errorLimit": "1.5MB"
|