@kong-ui-public/entities-key-sets 1.2.0 → 1.2.1

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.
@@ -403,7 +403,7 @@ function ba(e, n, t = "data") {
403
403
  }
404
404
  function ka() {
405
405
  return {
406
- getPropValue: (e, n) => (n == null ? void 0 : n[e]) || void 0
406
+ getPropValue: (e, n) => (n == null ? void 0 : n[e]) ?? void 0
407
407
  };
408
408
  }
409
409
  function Ca() {
@@ -1,4 +1,4 @@
1
- (function(G,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(G=typeof globalThis<"u"?globalThis:G||self,t(G["kong-ui-public-entities-key-sets"]={},G.Vue,G.VueRouter,G["kong-ui-public-i18n"],G.axios,G.Kongponents))})(this,function(G,t,Ne,ue,yn,gn){"use strict";const hn={keySets:{title:"Key Sets",list:{toolbar_actions:{new_key_set:"New Key Set"},table_headers:{name:"Name",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key Set",description:"A Key Set object holds a collection of asymmetric key objects. This entity allows to logically group keys by their purpose."}},actions:{create:"New Key Set",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact name or ID"},delete:{title:"Delete a Key Set",description:"Deleting this key set will also delete keys associated. This action cannot be reversed so make sure to check the key set usage before deleting."},errors:{general:"Key sets could not be retrieved",delete:"The key set 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"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key set."}},fields:{name:{label:"Name",placeholder:"Enter a unique name for this key set"},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."}}}}};function kn(){const e=ue.createI18n("en-us",hn);return{i18n:e,i18nT:ue.i18nTComponent(e)}}const _e={useI18n:kn},be={list:{konnect:"/api/runtime_groups/{controlPlaneId}/key-sets",kongManager:"/{workspace}/key-sets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/key-sets",edit:"/api/runtime_groups/{controlPlaneId}/key-sets/{id}"},kongManager:{create:"/{workspace}/key-sets",edit:"/{workspace}/key-sets/{id}"}}};var We=(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))(We||{}),Ee=(e=>(e.Edit="edit",e.Create="create",e))(Ee||{}),ae=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(ae||{}),M=(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))(M||{}),Z=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(Z||{});function Te(e={}){return{axiosInstance:yn.create({withCredentials:!0,timeout:3e4,...e})}}function bn(){return{debounce:(e,o)=>{let n;return(...a)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{e(...a)},o)}}}}const Ve="khcp-user-table-preferences",Cn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function wn(){const e=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(a){console.error("useTablePreferences(tryParseJson)",a);return}},o=()=>{const n=e(localStorage.getItem(Ve));return!n||!Object.keys(n).length?new Map:new Map(Object.entries(n))};return{setTablePreferences:(n,a)=>{try{const r=o();r.set(n,a),localStorage.setItem(Ve,JSON.stringify(Object.fromEntries(r.entries())))}catch(r){console.error("useTablePreferences(setTablePreferences)",r)}},getTablePreferences:n=>{const a=o();return(a==null?void 0:a.get(n))||void 0||Cn},deleteAllTablePreferences:()=>{localStorage.removeItem(Ve)}}}const Sn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},xn={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Bn={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},In={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"}},An={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Nn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},_n={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},En={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"}},Tn={deleteModal:Sn,baseForm:xn,baseTable:Bn,baseConfigCard:In,filter:An,debouncedFilter:Nn,errors:_n,toggleModal:En};function Oe(){const e=ue.createI18n("en-us",Tn);return{i18n:e,i18nT:ue.i18nTComponent(e)}}function Vn(e,o,n,a={fetchedItemsKey:"data",searchKeys:["id"]}){n||(n="100");const{axiosInstance:r}=Te({headers:e.requestHeaders}),{i18n:{t:l}}=Oe(),{debounce:i}=bn(),s=i(async m=>{await y(m)},200),c=t.ref(!1),d=t.ref(""),u=t.ref(""),p=t.ref([]),h=t.ref(void 0),g=t.unref(o);let k=`${e.apiBaseUrl}${g}`;e.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const b=async()=>{try{c.value=!0;const{data:m}=await r.get(`${k}?size=${n}`);m!=null&&m.next||(h.value=a.fetchedItemsKey in m?m[a.fetchedItemsKey]:[]),p.value=a.fetchedItemsKey in m?m[a.fetchedItemsKey]:[]}catch{p.value=[],d.value=l("debouncedFilter.errors.fetch")}finally{c.value=!1}},f=t.ref(""),y=async m=>{var w,I;if(f.value!==m)if(f.value=m||"",h.value===void 0)try{c.value=!0,d.value="",u.value="";let E=k+"";m&&(E+=`/${m}`);const{data:O}=await r.get(`${E}?size=${n}`);a.fetchedItemsKey in O?p.value=O[a.fetchedItemsKey]:O!=null&&O.id?p.value=[O]:p.value=[]}catch(E){((w=E==null?void 0:E.response)==null?void 0:w.status)===404?u.value=l("debouncedFilter.errors.invalid"):(p.value=[],d.value=l("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,u.value="",m?(p.value=(I=h.value)==null?void 0:I.filter(E=>{var O;let A=!1;for(const C of a.searchKeys){const N=typeof E[C]=="string"?(O=E[C])==null?void 0:O.toLowerCase():E[C];N!=null&&N.includes(m.toLowerCase())&&(A=!0)}return A}),(!p.value||!p.value.length)&&(u.value=l("debouncedFilter.errors.invalid"))):p.value=h.value,c.value=!1};return{loading:c,error:d,validationError:u,results:p,allRecords:h,loadItems:b,debouncedQueryChange:s}}function On(e,o){const n=t.unref(o),a=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${n}`):new URL(n));return a.value.search="",r=>`${a.value.href}/${r}`}function $n(){const{i18n:{t:e}}=Oe();return{getMessageFromError:o=>{var n,a,r;if(!o)return e("errors.unexpected");if((n=o==null?void 0:o.response)!=null&&n.data){if(o.response.data.detail)return o.response.data.detail;if((a=o.response.data.details)!=null&&a.length)return o.response.data.details.map(l=>{let i=e("errors.unexpected");return l.messages&&typeof l.messages=="object"&&l.messages.length&&(i=l.messages.join(", ")),l.field?`${l.field} - ${i}`:i}).join("; ");if(o.response.data.message){const{message:l}=o.response.data;return Array.isArray(l)?(r=l[0])!=null&&r.constraints?Object.values(l[0].constraints)[0]:l[0]:l}if(typeof o.response.data=="string")return o.response.data;if(typeof o.response.data=="object")return Object.keys(o.response.data).map(l=>`${l} ${o.response.data[l]}`).join(", ")}return o.message||e("errors.unexpected")}}}function Ge(e,o){const n=t.ref(t.unref(e)),a=t.ref(t.unref(o)),r=t.computed(()=>!!(n.value.app==="konnect"||n.value.isExactMatch)),l=t.computed(()=>a.value.startsWith("/")?new URL(`${window.location.origin}${a.value}`):new URL(a.value));return i=>{const{page:s,pageSize:c,offset:d,sortColumnKey:u,sortColumnOrder:p,query:h}=i;try{let g=new URL(l.value.href);return r.value&&h?(g.search="",g=new URL(`${g.href}/${h}/`)):(r.value||new URLSearchParams(h).forEach((k,b)=>{g.searchParams.append(b,k)}),u&&g.searchParams.append("sort_by",u),p==="desc"&&g.searchParams.append("sort_desc","1"),g.searchParams.append("size",String(c))),d&&s!==1&&g.searchParams.append("offset",String(d)),g.href}catch(g){return console.error("RouteList(fetcher)",g),a.value}}}function jn(e,o,n="data"){const a=t.unref(o),{axiosInstance:r}=Te({headers:e.requestHeaders}),l=Ge(e,a),i=t.ref({status:ae.Idle});return{fetcher:async s=>{try{i.value={status:ae.Loading};const c=l(s),{data:d}=await r.get(c),u=n&&n.replace(/[^\w-_]/gi,"");let p;d[u]&&Array.isArray(d[u])?p=d[u]:p=Object.keys(d).length?[d]:[];const h={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return i.value={status:ae.Idle,response:h},h}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(i.value={status:ae.NoResults,response:d,error:c},d):(i.value={status:ae.Error,response:d,error:c},d)}},fetcherState:i}}function Mn(){return{getPropValue:(e,o)=>(o==null?void 0:o[e])||void 0}}function Fn(){return{convertKeyToTitle:(e,o="_")=>e?e.split(o).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):""}}const Ze=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Qe=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const o=e.match(Ze);if(!o)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return o.shift(),o},Xe=e=>e==="*"||e==="x"||e==="X",et=e=>{const o=parseInt(e,10);return isNaN(o)?e:o},Kn=(e,o)=>typeof e!=typeof o?[String(e),String(o)]:[e,o],Ln=(e,o)=>{if(Xe(e)||Xe(o))return 0;const[n,a]=Kn(et(e),et(o));return n>a?1:n<a?-1:0},tt=(e,o)=>{for(let n=0;n<Math.max(e.length,o.length);n++){const a=Ln(e[n]||"0",o[n]||"0");if(a!==0)return a}return 0},Dn=(e,o)=>{const n=Qe(e),a=Qe(o),r=n.pop(),l=a.pop(),i=tt(n,a);return i!==0?i:r&&l?tt(r.split("."),l.split(".")):r||l?r?-1:1:0},nt=(e,o,n)=>{qn(n);const a=Dn(e,o);return ot[n].includes(a)},ot={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},at=Object.keys(ot),qn=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(at.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${at.join("|")}`)},Pn=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Ze.test(e);function vn(e){const{gatewayInfo:o,supportedRange:n}=e;if(!o)return!0;const{edition:a,version:r}=o;if(!Pn(r))return console.error("Invalid version"),!1;const l=n[a];if(!l)return!1;const[i,s]=l;return!(i&&nt(r,i,"<")||s&&nt(r,s,">"))}const U={useAxios:Te,useDebouncedFilter:Vn,useDeleteUrlBuilder:On,useErrors:$n,useFetcher:jn,useFetchUrlBuilder:Ge,useHelpers:Mn,useStringHelpers:Fn,useI18n:Oe,useGatewayFeatureSupported:vn},Un={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Rn="Copy to clipboard",zn={message:Un,iconTitle:Rn},Hn="kong-ui-copy-uuid-notify",Yn={class:"kong-ui-copy-uuid"},Jn=["onClick"],rt=15,Wn=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:o}){const n=e,{t:a}=ue.createI18n("en-us",zn),r=n.notify||t.inject(Hn,()=>{}),l=t.computed(()=>n.idTooltip?{label:n.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:n.uuid}),i=t.computed(()=>!!(n.tooltip&&n.successTooltip)),s=t.ref(n.tooltip),c=t.computed(()=>n.tooltip?{label:s.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=t.computed(()=>n.format==="redacted"?"*****":n.format==="deleted"?`*${n.uuid.substring(0,5)}`:n.uuid),u=h=>{s.value=h,setTimeout(()=>{s.value=n.tooltip},1800)},p=h=>{if(!h(n.uuid)){typeof r=="function"&&r({type:"error",message:a("message.fail")}),i.value?u(a("message.fail")):o("error",n.uuid);return}const g=n.uuid.length>rt,k=n.format==="hidden"||n.format==="redacted"?a("message.success.prefix"):`"${n.uuid.substring(0,rt)+(g?"...":"")}"`;typeof r=="function"&&r({type:"success",message:`${k}${a("message.success.content")}`}),i.value?u(n.successTooltip):o("success",n.uuid)};return(h,g)=>{const k=t.resolveComponent("KIcon"),b=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Yn,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},l.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(d.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(c.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(b,null,{default:t.withCtx(({copyToClipboard:f})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(y=>p(f),["stop"])},[t.createVNode(k,{class:"uuid-icon",color:e.iconColor,"hide-title":!!e.tooltip||void 0,icon:"copy",size:"16",title:t.unref(a)("iconTitle")},null,8,["color","hide-title","title"])],8,Jn)]),_:1})]),_:1},16))])}}}),Gn=(e,o)=>{const n=e.__vccOpts||e;for(const[a,r]of o)n[a]=r;return n},it=Gn(Wn,[["__scopeId","data-v-bfdaf6f7"]]),Zn={key:0,class:"config-card-fieldset-title"},Qn=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const o=e,{i18n:{t:n}}=U.useI18n(),{convertKeyToTitle:a}=U.useStringHelpers(),r=t.computed(()=>o.item.key??"json-array-item"),l=t.computed(()=>o.item.value??o.item),i=t.computed(()=>{const c=JSON.parse(JSON.stringify(l.value));return o.isArrayItem&&delete c.name,c}),s=t.computed(()=>{var c;return o.isArrayItem?(c=l.value)!=null&&c.name?a(l.value.name,"_"):n("baseConfigCard.general.entryTitle",{index:o.index}):""});return(c,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",Zn,[t.createElementVNode("b",null,t.toDisplayString(s.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(i.value),(u,p)=>(t.openBlock(),t.createBlock($e,{key:`${r.value}-property-${p}`,item:{key:u,label:t.unref(a)(u),value:i.value[u]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),Q=(e,o)=>{const n=e.__vccOpts||e;for(const[a,r]of o)n[a]=r;return n},lt=Q(Qn,[["__scopeId","data-v-68ca83ec"]]),Xn=Q(t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:o}}=U.useI18n();return(n,a)=>{const r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(r,{appearance:"btn-link",class:"navigation-button",onClick:a[0]||(a[0]=l=>n.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(o)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-7410504d"]]),eo=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:o}}=U.useI18n();return(n,a)=>{const r=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(r,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(o)("baseConfigCard.statusBadge.enabledLabel"):t.unref(o)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),to="#0044f4",no="#e0e4ea",oo="#3a3f51",ao="1px",ro="20px",io={class:"config-card-details-row"},lo=["data-testid"],so=["data-testid"],co=["data-testid"],po=["data-testid"],uo={key:1},fo=["data-testid"],mo=["data-testid"],yo=["data-testid"],go=["data-testid"],ho=["title"],ko={name:"ConfigCardItem",components:{CopyUuid:it,JsonCardItem:lt,StatusBadge:eo,InternalLinkItem:Xn}},bo=t.defineComponent({...ko,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:o}){const n=e;t.useCssVars(p=>({"2c6ac268":d.value?"none":`solid ${t.unref(ao)} ${t.unref(no)}`,c7a65802:c.value&&i.value?"block":"flex","778426fe":c.value&&i.value?"100%":n.slim?"50%":"25%","777f9b48":c.value&&i.value?"100%":n.slim?"50%":"75%"}));const a=t.useSlots(),{i18n:{t:r,formatUnixTimeStamp:l}}=U.useI18n(),i=t.computed(()=>n.item.value!==void 0&&n.item.value!==null&&n.item.value!==""),s=t.computed(()=>!!(n.item.tooltip||a["label-tooltip"])),c=t.computed(()=>n.item.type===M.Json||n.item.type===M.JsonArray),d=t.computed(()=>n.item.type===M.JsonArray),u=t.computed(()=>{switch(n.item.type){case M.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid`,"success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case M.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case M.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case M.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case M.Date:return{tag:"div",attrs:{"data-testid":`${n.item.key}-date`},text:l(n.item.value)};case M.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${n.item.key}-badge-status`,status:n.item.value}};case M.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case M.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case M.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${n.item.key}-internal-link`,item:n.item,onNavigationClick:p=>{o("navigation-click",p)}}};case M.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${n.item.key}-external-link`,href:n.item.value},text:n.item.value};case M.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-content`,item:n.item}};case M.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-array-content`,item:n.item}};default:return{tag:"div",attrs:{"data-testid":`${n.item.key}-plain-text`},text:n.item.value}}});return(p,h)=>{const g=t.resolveComponent("KLabel"),k=t.resolveComponent("KBadge"),b=t.resolveComponent("KMethodBadge");return t.openBlock(),t.createElementBlock("div",io,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(p.$slots,"label",{item:e.item},()=>[t.createVNode(g,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[s.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(p.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,so)]),key:"0"}:void 0]),1024)],!0)],8,lo),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(p.$slots,e.item.key,{rowValue:e.item.value},()=>[i.value?(t.openBlock(),t.createElementBlock("div",uo,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(f,y)=>(t.openBlock(),t.createBlock(k,{key:`${e.item.key}-badge-tag-${y}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${y}`,"truncation-tooltip":f},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(f),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,fo)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(f,y)=>(t.openBlock(),t.createBlock(t.unref(it),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${y}`,"data-testid":`${e.item.key}-copy-uuid-${y}`,uuid:f}),null,16,["data-testid","uuid"]))),128))],8,mo)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(f,y)=>(t.openBlock(),t.createBlock(b,{key:`${e.item.key}-badge-method-${y}`,class:"config-badge","data-testid":`${e.item.key}-badge-method-${y}`,"is-rounded":"",label:f,method:t.unref(gn.MethodsArray).includes(f.toLowerCase())?f.toLowerCase():"custom"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(f),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,yo)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${n.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(f,y)=>(t.openBlock(),t.createBlock(lt,{key:`json-array-item-${y}`,index:y,"is-array-item":"",item:f},null,8,["index","item"]))),128))],8,go)):(t.openBlock(),t.createElementBlock("span",{key:4,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}]),title:e.truncated?e.item.value:void 0},t.toDisplayString(u.value.text),11,ho))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,po))],!0)],8,co)])}}}),$e=Q(bo,[["__scopeId","data-v-a3c5ab01"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function st(e){return typeof e>"u"||e===null}function Co(e){return typeof e=="object"&&e!==null}function wo(e){return Array.isArray(e)?e:st(e)?[]:[e]}function So(e,o){var n,a,r,l;if(o)for(l=Object.keys(o),n=0,a=l.length;n<a;n+=1)r=l[n],e[r]=o[r];return e}function xo(e,o){var n="",a;for(a=0;a<o;a+=1)n+=e;return n}function Bo(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Io=st,Ao=Co,No=wo,_o=xo,Eo=Bo,To=So,q={isNothing:Io,isObject:Ao,toArray:No,repeat:_o,isNegativeZero:Eo,extend:To};function ct(e,o){var n="",a=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!o&&e.mark.snippet&&(n+=`
1
+ (function(G,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(G=typeof globalThis<"u"?globalThis:G||self,t(G["kong-ui-public-entities-key-sets"]={},G.Vue,G.VueRouter,G["kong-ui-public-i18n"],G.axios,G.Kongponents))})(this,function(G,t,Ne,ue,yn,gn){"use strict";const hn={keySets:{title:"Key Sets",list:{toolbar_actions:{new_key_set:"New Key Set"},table_headers:{name:"Name",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key Set",description:"A Key Set object holds a collection of asymmetric key objects. This entity allows to logically group keys by their purpose."}},actions:{create:"New Key Set",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact name or ID"},delete:{title:"Delete a Key Set",description:"Deleting this key set will also delete keys associated. This action cannot be reversed so make sure to check the key set usage before deleting."},errors:{general:"Key sets could not be retrieved",delete:"The key set 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"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key set."}},fields:{name:{label:"Name",placeholder:"Enter a unique name for this key set"},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."}}}}};function kn(){const e=ue.createI18n("en-us",hn);return{i18n:e,i18nT:ue.i18nTComponent(e)}}const _e={useI18n:kn},be={list:{konnect:"/api/runtime_groups/{controlPlaneId}/key-sets",kongManager:"/{workspace}/key-sets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/key-sets",edit:"/api/runtime_groups/{controlPlaneId}/key-sets/{id}"},kongManager:{create:"/{workspace}/key-sets",edit:"/{workspace}/key-sets/{id}"}}};var We=(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))(We||{}),Ee=(e=>(e.Edit="edit",e.Create="create",e))(Ee||{}),ae=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(ae||{}),M=(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))(M||{}),Z=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(Z||{});function Te(e={}){return{axiosInstance:yn.create({withCredentials:!0,timeout:3e4,...e})}}function bn(){return{debounce:(e,o)=>{let n;return(...a)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{e(...a)},o)}}}}const Ve="khcp-user-table-preferences",Cn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function wn(){const e=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(a){console.error("useTablePreferences(tryParseJson)",a);return}},o=()=>{const n=e(localStorage.getItem(Ve));return!n||!Object.keys(n).length?new Map:new Map(Object.entries(n))};return{setTablePreferences:(n,a)=>{try{const r=o();r.set(n,a),localStorage.setItem(Ve,JSON.stringify(Object.fromEntries(r.entries())))}catch(r){console.error("useTablePreferences(setTablePreferences)",r)}},getTablePreferences:n=>{const a=o();return(a==null?void 0:a.get(n))||void 0||Cn},deleteAllTablePreferences:()=>{localStorage.removeItem(Ve)}}}const Sn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},xn={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Bn={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},In={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"}},An={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Nn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},_n={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},En={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"}},Tn={deleteModal:Sn,baseForm:xn,baseTable:Bn,baseConfigCard:In,filter:An,debouncedFilter:Nn,errors:_n,toggleModal:En};function Oe(){const e=ue.createI18n("en-us",Tn);return{i18n:e,i18nT:ue.i18nTComponent(e)}}function Vn(e,o,n,a={fetchedItemsKey:"data",searchKeys:["id"]}){n||(n="100");const{axiosInstance:r}=Te({headers:e.requestHeaders}),{i18n:{t:l}}=Oe(),{debounce:i}=bn(),s=i(async m=>{await y(m)},200),c=t.ref(!1),d=t.ref(""),u=t.ref(""),p=t.ref([]),h=t.ref(void 0),g=t.unref(o);let k=`${e.apiBaseUrl}${g}`;e.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const b=async()=>{try{c.value=!0;const{data:m}=await r.get(`${k}?size=${n}`);m!=null&&m.next||(h.value=a.fetchedItemsKey in m?m[a.fetchedItemsKey]:[]),p.value=a.fetchedItemsKey in m?m[a.fetchedItemsKey]:[]}catch{p.value=[],d.value=l("debouncedFilter.errors.fetch")}finally{c.value=!1}},f=t.ref(""),y=async m=>{var w,I;if(f.value!==m)if(f.value=m||"",h.value===void 0)try{c.value=!0,d.value="",u.value="";let E=k+"";m&&(E+=`/${m}`);const{data:O}=await r.get(`${E}?size=${n}`);a.fetchedItemsKey in O?p.value=O[a.fetchedItemsKey]:O!=null&&O.id?p.value=[O]:p.value=[]}catch(E){((w=E==null?void 0:E.response)==null?void 0:w.status)===404?u.value=l("debouncedFilter.errors.invalid"):(p.value=[],d.value=l("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,u.value="",m?(p.value=(I=h.value)==null?void 0:I.filter(E=>{var O;let A=!1;for(const C of a.searchKeys){const N=typeof E[C]=="string"?(O=E[C])==null?void 0:O.toLowerCase():E[C];N!=null&&N.includes(m.toLowerCase())&&(A=!0)}return A}),(!p.value||!p.value.length)&&(u.value=l("debouncedFilter.errors.invalid"))):p.value=h.value,c.value=!1};return{loading:c,error:d,validationError:u,results:p,allRecords:h,loadItems:b,debouncedQueryChange:s}}function On(e,o){const n=t.unref(o),a=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${n}`):new URL(n));return a.value.search="",r=>`${a.value.href}/${r}`}function $n(){const{i18n:{t:e}}=Oe();return{getMessageFromError:o=>{var n,a,r;if(!o)return e("errors.unexpected");if((n=o==null?void 0:o.response)!=null&&n.data){if(o.response.data.detail)return o.response.data.detail;if((a=o.response.data.details)!=null&&a.length)return o.response.data.details.map(l=>{let i=e("errors.unexpected");return l.messages&&typeof l.messages=="object"&&l.messages.length&&(i=l.messages.join(", ")),l.field?`${l.field} - ${i}`:i}).join("; ");if(o.response.data.message){const{message:l}=o.response.data;return Array.isArray(l)?(r=l[0])!=null&&r.constraints?Object.values(l[0].constraints)[0]:l[0]:l}if(typeof o.response.data=="string")return o.response.data;if(typeof o.response.data=="object")return Object.keys(o.response.data).map(l=>`${l} ${o.response.data[l]}`).join(", ")}return o.message||e("errors.unexpected")}}}function Ge(e,o){const n=t.ref(t.unref(e)),a=t.ref(t.unref(o)),r=t.computed(()=>!!(n.value.app==="konnect"||n.value.isExactMatch)),l=t.computed(()=>a.value.startsWith("/")?new URL(`${window.location.origin}${a.value}`):new URL(a.value));return i=>{const{page:s,pageSize:c,offset:d,sortColumnKey:u,sortColumnOrder:p,query:h}=i;try{let g=new URL(l.value.href);return r.value&&h?(g.search="",g=new URL(`${g.href}/${h}/`)):(r.value||new URLSearchParams(h).forEach((k,b)=>{g.searchParams.append(b,k)}),u&&g.searchParams.append("sort_by",u),p==="desc"&&g.searchParams.append("sort_desc","1"),g.searchParams.append("size",String(c))),d&&s!==1&&g.searchParams.append("offset",String(d)),g.href}catch(g){return console.error("RouteList(fetcher)",g),a.value}}}function jn(e,o,n="data"){const a=t.unref(o),{axiosInstance:r}=Te({headers:e.requestHeaders}),l=Ge(e,a),i=t.ref({status:ae.Idle});return{fetcher:async s=>{try{i.value={status:ae.Loading};const c=l(s),{data:d}=await r.get(c),u=n&&n.replace(/[^\w-_]/gi,"");let p;d[u]&&Array.isArray(d[u])?p=d[u]:p=Object.keys(d).length?[d]:[];const h={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return i.value={status:ae.Idle,response:h},h}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(i.value={status:ae.NoResults,response:d,error:c},d):(i.value={status:ae.Error,response:d,error:c},d)}},fetcherState:i}}function Mn(){return{getPropValue:(e,o)=>(o==null?void 0:o[e])??void 0}}function Fn(){return{convertKeyToTitle:(e,o="_")=>e?e.split(o).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):""}}const Ze=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Qe=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const o=e.match(Ze);if(!o)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return o.shift(),o},Xe=e=>e==="*"||e==="x"||e==="X",et=e=>{const o=parseInt(e,10);return isNaN(o)?e:o},Kn=(e,o)=>typeof e!=typeof o?[String(e),String(o)]:[e,o],Ln=(e,o)=>{if(Xe(e)||Xe(o))return 0;const[n,a]=Kn(et(e),et(o));return n>a?1:n<a?-1:0},tt=(e,o)=>{for(let n=0;n<Math.max(e.length,o.length);n++){const a=Ln(e[n]||"0",o[n]||"0");if(a!==0)return a}return 0},Dn=(e,o)=>{const n=Qe(e),a=Qe(o),r=n.pop(),l=a.pop(),i=tt(n,a);return i!==0?i:r&&l?tt(r.split("."),l.split(".")):r||l?r?-1:1:0},nt=(e,o,n)=>{qn(n);const a=Dn(e,o);return ot[n].includes(a)},ot={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},at=Object.keys(ot),qn=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(at.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${at.join("|")}`)},Pn=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Ze.test(e);function vn(e){const{gatewayInfo:o,supportedRange:n}=e;if(!o)return!0;const{edition:a,version:r}=o;if(!Pn(r))return console.error("Invalid version"),!1;const l=n[a];if(!l)return!1;const[i,s]=l;return!(i&&nt(r,i,"<")||s&&nt(r,s,">"))}const U={useAxios:Te,useDebouncedFilter:Vn,useDeleteUrlBuilder:On,useErrors:$n,useFetcher:jn,useFetchUrlBuilder:Ge,useHelpers:Mn,useStringHelpers:Fn,useI18n:Oe,useGatewayFeatureSupported:vn},Un={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Rn="Copy to clipboard",zn={message:Un,iconTitle:Rn},Hn="kong-ui-copy-uuid-notify",Yn={class:"kong-ui-copy-uuid"},Jn=["onClick"],rt=15,Wn=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:o}){const n=e,{t:a}=ue.createI18n("en-us",zn),r=n.notify||t.inject(Hn,()=>{}),l=t.computed(()=>n.idTooltip?{label:n.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:n.uuid}),i=t.computed(()=>!!(n.tooltip&&n.successTooltip)),s=t.ref(n.tooltip),c=t.computed(()=>n.tooltip?{label:s.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=t.computed(()=>n.format==="redacted"?"*****":n.format==="deleted"?`*${n.uuid.substring(0,5)}`:n.uuid),u=h=>{s.value=h,setTimeout(()=>{s.value=n.tooltip},1800)},p=h=>{if(!h(n.uuid)){typeof r=="function"&&r({type:"error",message:a("message.fail")}),i.value?u(a("message.fail")):o("error",n.uuid);return}const g=n.uuid.length>rt,k=n.format==="hidden"||n.format==="redacted"?a("message.success.prefix"):`"${n.uuid.substring(0,rt)+(g?"...":"")}"`;typeof r=="function"&&r({type:"success",message:`${k}${a("message.success.content")}`}),i.value?u(n.successTooltip):o("success",n.uuid)};return(h,g)=>{const k=t.resolveComponent("KIcon"),b=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Yn,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},l.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(d.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(c.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(b,null,{default:t.withCtx(({copyToClipboard:f})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(y=>p(f),["stop"])},[t.createVNode(k,{class:"uuid-icon",color:e.iconColor,"hide-title":!!e.tooltip||void 0,icon:"copy",size:"16",title:t.unref(a)("iconTitle")},null,8,["color","hide-title","title"])],8,Jn)]),_:1})]),_:1},16))])}}}),Gn=(e,o)=>{const n=e.__vccOpts||e;for(const[a,r]of o)n[a]=r;return n},it=Gn(Wn,[["__scopeId","data-v-bfdaf6f7"]]),Zn={key:0,class:"config-card-fieldset-title"},Qn=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const o=e,{i18n:{t:n}}=U.useI18n(),{convertKeyToTitle:a}=U.useStringHelpers(),r=t.computed(()=>o.item.key??"json-array-item"),l=t.computed(()=>o.item.value??o.item),i=t.computed(()=>{const c=JSON.parse(JSON.stringify(l.value));return o.isArrayItem&&delete c.name,c}),s=t.computed(()=>{var c;return o.isArrayItem?(c=l.value)!=null&&c.name?a(l.value.name,"_"):n("baseConfigCard.general.entryTitle",{index:o.index}):""});return(c,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",Zn,[t.createElementVNode("b",null,t.toDisplayString(s.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(i.value),(u,p)=>(t.openBlock(),t.createBlock($e,{key:`${r.value}-property-${p}`,item:{key:u,label:t.unref(a)(u),value:i.value[u]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),Q=(e,o)=>{const n=e.__vccOpts||e;for(const[a,r]of o)n[a]=r;return n},lt=Q(Qn,[["__scopeId","data-v-68ca83ec"]]),Xn=Q(t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:o}}=U.useI18n();return(n,a)=>{const r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(r,{appearance:"btn-link",class:"navigation-button",onClick:a[0]||(a[0]=l=>n.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(o)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-7410504d"]]),eo=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:o}}=U.useI18n();return(n,a)=>{const r=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(r,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(o)("baseConfigCard.statusBadge.enabledLabel"):t.unref(o)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),to="#0044f4",no="#e0e4ea",oo="#3a3f51",ao="1px",ro="20px",io={class:"config-card-details-row"},lo=["data-testid"],so=["data-testid"],co=["data-testid"],po=["data-testid"],uo={key:1},fo=["data-testid"],mo=["data-testid"],yo=["data-testid"],go=["data-testid"],ho=["title"],ko={name:"ConfigCardItem",components:{CopyUuid:it,JsonCardItem:lt,StatusBadge:eo,InternalLinkItem:Xn}},bo=t.defineComponent({...ko,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:o}){const n=e;t.useCssVars(p=>({"2c6ac268":d.value?"none":`solid ${t.unref(ao)} ${t.unref(no)}`,c7a65802:c.value&&i.value?"block":"flex","778426fe":c.value&&i.value?"100%":n.slim?"50%":"25%","777f9b48":c.value&&i.value?"100%":n.slim?"50%":"75%"}));const a=t.useSlots(),{i18n:{t:r,formatUnixTimeStamp:l}}=U.useI18n(),i=t.computed(()=>n.item.value!==void 0&&n.item.value!==null&&n.item.value!==""),s=t.computed(()=>!!(n.item.tooltip||a["label-tooltip"])),c=t.computed(()=>n.item.type===M.Json||n.item.type===M.JsonArray),d=t.computed(()=>n.item.type===M.JsonArray),u=t.computed(()=>{switch(n.item.type){case M.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid`,"success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case M.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case M.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case M.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case M.Date:return{tag:"div",attrs:{"data-testid":`${n.item.key}-date`},text:l(n.item.value)};case M.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${n.item.key}-badge-status`,status:n.item.value}};case M.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case M.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case M.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${n.item.key}-internal-link`,item:n.item,onNavigationClick:p=>{o("navigation-click",p)}}};case M.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${n.item.key}-external-link`,href:n.item.value},text:n.item.value};case M.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-content`,item:n.item}};case M.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-array-content`,item:n.item}};default:return{tag:"div",attrs:{"data-testid":`${n.item.key}-plain-text`},text:n.item.value}}});return(p,h)=>{const g=t.resolveComponent("KLabel"),k=t.resolveComponent("KBadge"),b=t.resolveComponent("KMethodBadge");return t.openBlock(),t.createElementBlock("div",io,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(p.$slots,"label",{item:e.item},()=>[t.createVNode(g,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[s.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(p.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,so)]),key:"0"}:void 0]),1024)],!0)],8,lo),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(p.$slots,e.item.key,{rowValue:e.item.value},()=>[i.value?(t.openBlock(),t.createElementBlock("div",uo,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(f,y)=>(t.openBlock(),t.createBlock(k,{key:`${e.item.key}-badge-tag-${y}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${y}`,"truncation-tooltip":f},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(f),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,fo)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(f,y)=>(t.openBlock(),t.createBlock(t.unref(it),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${y}`,"data-testid":`${e.item.key}-copy-uuid-${y}`,uuid:f}),null,16,["data-testid","uuid"]))),128))],8,mo)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(f,y)=>(t.openBlock(),t.createBlock(b,{key:`${e.item.key}-badge-method-${y}`,class:"config-badge","data-testid":`${e.item.key}-badge-method-${y}`,"is-rounded":"",label:f,method:t.unref(gn.MethodsArray).includes(f.toLowerCase())?f.toLowerCase():"custom"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(f),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,yo)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${n.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(f,y)=>(t.openBlock(),t.createBlock(lt,{key:`json-array-item-${y}`,index:y,"is-array-item":"",item:f},null,8,["index","item"]))),128))],8,go)):(t.openBlock(),t.createElementBlock("span",{key:4,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}]),title:e.truncated?e.item.value:void 0},t.toDisplayString(u.value.text),11,ho))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,po))],!0)],8,co)])}}}),$e=Q(bo,[["__scopeId","data-v-a3c5ab01"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function st(e){return typeof e>"u"||e===null}function Co(e){return typeof e=="object"&&e!==null}function wo(e){return Array.isArray(e)?e:st(e)?[]:[e]}function So(e,o){var n,a,r,l;if(o)for(l=Object.keys(o),n=0,a=l.length;n<a;n+=1)r=l[n],e[r]=o[r];return e}function xo(e,o){var n="",a;for(a=0;a<o;a+=1)n+=e;return n}function Bo(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Io=st,Ao=Co,No=wo,_o=xo,Eo=Bo,To=So,q={isNothing:Io,isObject:Ao,toArray:No,repeat:_o,isNegativeZero:Eo,extend:To};function ct(e,o){var n="",a=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!o&&e.mark.snippet&&(n+=`
2
2
 
3
3
  `+e.mark.snippet),a+" "+n):a}function fe(e,o){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=o,this.message=ct(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}fe.prototype=Object.create(Error.prototype),fe.prototype.constructor=fe,fe.prototype.toString=function(e){return this.name+": "+ct(this,e)};var Y=fe;function je(e,o,n,a,r){var l="",i="",s=Math.floor(r/2)-1;return a-o>s&&(l=" ... ",o=a-s+l.length),n-a>s&&(i=" ...",n=a+s-i.length),{str:l+e.slice(o,n).replace(/\t/g,"→")+i,pos:a-o+l.length}}function Me(e,o){return q.repeat(" ",o-e.length)+e}function Vo(e,o){if(o=Object.create(o||null),!e.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);for(var n=/\r?\n|\r|\0/g,a=[0],r=[],l,i=-1;l=n.exec(e.buffer);)r.push(l.index),a.push(l.index+l[0].length),e.position<=l.index&&i<0&&(i=a.length-2);i<0&&(i=a.length-1);var s="",c,d,u=Math.min(e.line+o.linesAfter,r.length).toString().length,p=o.maxLength-(o.indent+u+3);for(c=1;c<=o.linesBefore&&!(i-c<0);c++)d=je(e.buffer,a[i-c],r[i-c],e.position-(a[i]-a[i-c]),p),s=q.repeat(" ",o.indent)+Me((e.line-c+1).toString(),u)+" | "+d.str+`
4
4
  `+s;for(d=je(e.buffer,a[i],r[i],e.position,p),s+=q.repeat(" ",o.indent)+Me((e.line+1).toString(),u)+" | "+d.str+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-key-sets",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-key-sets.umd.js",
6
6
  "module": "./dist/entities-key-sets.es.js",
@@ -50,7 +50,7 @@
50
50
  "errorLimit": "500KB"
51
51
  },
52
52
  "dependencies": {
53
- "@kong-ui-public/entities-shared": "^1.5.0"
53
+ "@kong-ui-public/entities-shared": "^1.5.1"
54
54
  },
55
55
  "scripts": {
56
56
  "dev": "cross-env USE_SANDBOX=true vite",