@kong-ui-public/entities-upstreams-targets 3.3.18 → 3.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(re,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@kong-ui-public/i18n","@kong/kongponents","vue-router"],t):(re=typeof globalThis<"u"?globalThis:re||self,t(re["kong-ui-entities-upstreams-targets"]={},re.Vue,re.axios,re["kong-ui-public-i18n"],re.Kongponents,re.VueRouter))})(this,function(re,t,Bt,Ue,wl,tt){"use strict";var at=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e.Secret="secret",e))(at||{}),ie=(e=>(e.Edit="edit",e.Create="create",e))(ie||{}),fe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(fe||{}),L=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function Sl(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):Bt.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),Bt.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function _l(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const rt="khcp-user-table-preferences",xl={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function Nl(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(rt));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(rt,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||xl},deleteAllTablePreferences:()=>{localStorage.removeItem(rt)}}}function lt(e={}){const{getAxiosInstance:r}=Sl();return{axiosInstance:r(e)}}const Vl={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Bl={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Il={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."}},Tl={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Al={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"}},Hl={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},El={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ql={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},vl={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Fl={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"}},Ol={global:Vl,deleteModal:Bl,baseForm:Il,baseTable:Tl,baseConfigCard:Al,filter:Hl,debouncedFilter:El,errors:ql,validationErrors:vl,toggleModal:Fl};function De(){const e=Ue.createI18n("en-us",Ol);return{i18n:e,i18nT:Ue.i18nTComponent(e)}}function It(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const i of n){const o=a.filter(c=>c===i).length,d=l.filter(c=>c===i).length;if(o!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const i in a)if(Array.isArray(a[i])&&Array.isArray(l[i])){if(r(a[i],l[i]))continue;return!1}else{if(a[i]===l[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let i=l[a]===void 0||l[a]===null?"":l[a],o=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(i=l[a][0]),Array.isArray(n[a])&&(o=n[a][0]),i.localeCompare(o)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function $l(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="1000");const{axiosInstance:n}=lt(e.axiosRequestConfig),{i18n:{t:i}}=De(),{debounce:o}=_l(),d=o(async B=>{await T(B)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),m=t.ref([]),s=t.ref(void 0),S=t.computed(()=>{const B=`${e.apiBaseUrl}${t.unref(r)}`;return e.app==="konnect"?B.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?B.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):B}),{isValidUuid:N}=It(),g=async()=>{try{c.value=!0;const{data:B}=await n.get(`${S.value}?size=${a}`);B!=null&&B.next||(s.value=l.fetchedItemsKey in B?B[l.fetchedItemsKey]:[]),m.value=l.fetchedItemsKey in B?B[l.fetchedItemsKey]:[],u.value=m.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},_=t.ref(""),T=async B=>{var I,A,f;if(_.value!==B){if(B===""){u.value=m.value;return}else _.value=B||"";if(s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){let b=S.value+"";B&&(b+=`/${B}`);const{data:x}=await n.get(`${b}?size=${a}`);l.fetchedItemsKey in x?u.value=x[l.fetchedItemsKey]:x!=null&&x[l.exactMatchKey??"id"]?u.value=[x]:u.value=[]}else if(B){const b=[];N(B)&&l.searchKeys.includes("id")?b.push((async()=>{const{data:w}=await n.get(`${S.value}/${B}`);return[w[l.fetchedItemsKey]??w]})()):b.push(...l.searchKeys.filter(w=>w!=="id").map(async w=>{const{data:E}=await n.get(`${S.value}?${w}=${B}`);return E[l.fetchedItemsKey]}));const x=await Promise.all(b),V=new Set;u.value=[],(I=x==null?void 0:x.forEach)==null||I.call(x,w=>{var E;(E=w==null?void 0:w.forEach)==null||E.call(w,H=>{V.has(H.id)||(V.add(H.id),u.value.push(H))})})}else u.value=m.value}catch(b){((A=b==null?void 0:b.response)==null?void 0:A.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],h.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",B?(u.value=(f=s.value)==null?void 0:f.filter(b=>{var x;let V=!1;for(const w of l.searchKeys){const E=typeof b[w]=="string"?(x=b[w])==null?void 0:x.toLowerCase():b[w];E!=null&&E.includes(B.toLowerCase())&&(V=!0)}return V}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid"))):u.value=s.value,c.value=!1}};return{loading:c,error:h,validationError:p,results:u,allRecords:s,loadItems:g,debouncedQueryChange:d}}function Ul(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Dl(){const{i18n:{t:e}}=De();return{getMessageFromError:r=>{var a,l,n,i;if(!r)return e("errors.unexpected");if(((a=r==null?void 0:r.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((l=r==null?void 0:r.response)!=null&&l.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let d=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(d=o.messages.join(", ")),o.field?`${o.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Ml(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,i=e.some(o=>o.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!i&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function Tt(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),i=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return o=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:m}=o;try{let s=new URL(i.value.href);return n.value&&m?(s.search="",s=a.value.isExactMatch?new URL(`${s.href}/${m}/`):new URL(`${s.href}?filter[name][contains]=${m}`)):(n.value||new URLSearchParams(m).forEach((S,N)=>{s.searchParams.append(N,S)}),p&&s.searchParams.append("sort_by",p),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),h&&d!==1&&s.searchParams.append("offset",String(h)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function jl(e,r,a="data"){const l=t.unref(r),{axiosInstance:n}=lt(e.axiosRequestConfig),i=Tt(e,l),o=t.ref({status:fe.Idle});return{fetcher:async d=>{var c;try{o.value={status:fe.Loading};let h=i(d);h.includes("filter[name]")&&(h=`${h}&page[size]=${d.pageSize}&page[number]=${d.page}`);const p=await n.get(h);if(p.status>=400)throw p;const u=p.data,m=a&&a.replace(/[^\w-_]/gi,"");let s;u[m]&&Array.isArray(u[m])?s=u[m]:Array.isArray(u)?s=u:s=Object.keys(u).length?[u]:[];const S={data:s,total:s.length,...u.offset?{pagination:{offset:u.offset}}:null};return o.value={status:fe.Idle,response:S},S}catch(h){const p={data:[],total:0};return d.query&&(((c=h.response)==null?void 0:c.status)===404||h.status===404)?(o.value={status:fe.NoResults,response:p,error:h.response?h:{response:h}},p):(o.value={status:fe.Error,response:p,error:h.response?h:{response:h}},p)}},fetcherState:o}}function Kl(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const At=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ht=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(At);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},Et=e=>e==="*"||e==="x"||e==="X",qt=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Ll=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Pl=(e,r)=>{if(Et(e)||Et(r))return 0;const[a,l]=Ll(qt(e),qt(r));return a>l?1:a<l?-1:0},vt=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Pl(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},Rl=(e,r)=>{const a=Ht(e),l=Ht(r),n=a.pop(),i=l.pop(),o=vt(a,l);return o!==0?o:n&&i?vt(n.split("."),i.split(".")):n||i?n?-1:1:0},Ft=(e,r,a)=>{zl(a);const l=Rl(e,r);return Ot[a].includes(l)},Ot={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},$t=Object.keys(Ot),zl=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if($t.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${$t.join("|")}`)},Jl=e=>typeof e=="string"&&/^[v\d]/.test(e)&&At.test(e);function Wl(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!Jl(n))return console.error("Invalid version"),!1;const i=a[l];if(!i)return!1;const[o,d]=i;return!(o&&Ft(n,o,"<")||d&&Ft(n,d,">"))}function Ql(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}function Zl(){const{i18n:{t:e}}=De();return{utf8Name:r=>/^[\p{N}\p{L}.\-_~]*$/u.test(r)?"":e("validationErrors.utf8Name")}}const Y={useAxios:lt,useDebouncedFilter:$l,useDeleteUrlBuilder:Ul,useErrors:Dl,useExternalLinkCreator:Ml,useFetcher:jl,useFetchUrlBuilder:Tt,useHelpers:It,useStringHelpers:Kl,useI18n:De,useGatewayFeatureSupported:Wl,useTruncationDetector:Ql,useValidators:Zl},Yl={key:0,class:"config-card-fieldset-title"},Gl=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Y.useI18n(),{convertKeyToTitle:l}=Y.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),i=t.computed(()=>r.item.value??r.item),o=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=i.value)!=null&&c.name?l(i.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,h)=>(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",Yl,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(o.value),(p,u)=>(t.openBlock(),t.createBlock(Dt,{key:`${n.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:o.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),oe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Ut=oe(Gl,[["__scopeId","data-v-68ca83ec"]]),Xl=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Y.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=i=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),en=oe(Xl,[["__scopeId","data-v-c96811e5"]]),tn=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Y.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),an="#0044f4",rn="#e0e4ea",ln="#afb7c5",nn="1px",on="20px",sn={class:"config-card-details-row"},cn=["data-testid"],dn=["data-testid"],hn=["data-testid"],pn=["data-testid"],un={key:1},fn=["data-testid"],mn=["data-testid"],gn=["data-testid"],yn=["data-testid"],kn={name:"ConfigCardItem",components:{JsonCardItem:Ut,StatusBadge:tn,InternalLinkItem:en}},bn=t.defineComponent({...kn,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:r}){t.useCssVars(S=>({"2f5b0492":p.value?"none":`solid ${t.unref(nn)} ${t.unref(rn)}`,"5d59c22c":h.value&&d.value?"block":"flex",aa41a894:h.value&&d.value?"100%":a.slim?"50%":"25%",aa3d1cde:h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:o}}=Y.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),h=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),p=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:o(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:a.item.value}};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:S=>{l("navigation-click",S)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),m=t.ref(),{isTruncated:s}=Y.useTruncationDetector(m);return(S,N)=>{const g=t.resolveComponent("KLabel"),_=t.resolveComponent("KBadge"),T=t.resolveComponent("KCopy"),B=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",sn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(S.$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},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(S.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,dn)]),key:"0"}:void 0]),1024)],!0)],8,cn),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(S.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",un,[(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,(I,A)=>(t.openBlock(),t.createBlock(_,{key:`${e.item.key}-badge-tag-${A}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${A}`,tooltip:I,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(I),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,fn)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(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,(I,A)=>(t.openBlock(),t.createBlock(T,t.mergeProps({ref_for:!0},u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${A}`,"data-testid":`${e.item.key}-copy-uuid-${A}`,text:I}),null,16,["data-testid","text"]))),128))],8,mn)):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,(I,A)=>(t.openBlock(),t.createBlock(_,{key:`${e.item.key}-badge-method-${A}`,appearance:Object.values(t.unref(wl.BadgeMethodAppearances)).includes(I.toLowerCase())?I.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${A}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(I),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,gn)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${a.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(I,A)=>(t.openBlock(),t.createBlock(Ut,{key:`json-array-item-${A}`,index:A,"is-array-item":"",item:I},null,8,["index","item"]))),128))],8,yn)):(t.openBlock(),t.createBlock(B,{key:4,text:t.unref(s)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:m,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,pn))],!0)],8,hn)])}}}),Dt=oe(bn,[["__scopeId","data-v-711ebcf2"]]),Cn={class:"json-config"},wn={key:0,class:"json-endpoint"},Mt=t.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){t.useCssVars(n=>({"7a485cf8":`${l.value}ch`}));const r=e,a=t.computed(()=>r.jsonRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const i=(n=r.fetcherUrl)==null?void 0:n.split("/");return i.length<2?0:41+(r.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(n,i)=>{const o=t.resolveComponent("KBadge"),d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Cn,[r.fetcherUrl?(t.openBlock(),t.createElementBlock("div",wn,[t.createVNode(o,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(d,{id:"json-endpoint-codeblock",code:r.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(d,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(a.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function jt(e){return typeof e>"u"||e===null}function Sn(e){return typeof e=="object"&&e!==null}function _n(e){return Array.isArray(e)?e:jt(e)?[]:[e]}function xn(e,r){var a,l,n,i;if(r)for(i=Object.keys(r),a=0,l=i.length;a<l;a+=1)n=i[a],e[n]=r[n];return e}function Nn(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function Vn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Bn=jt,In=Sn,Tn=_n,An=Nn,Hn=Vn,En=xn,Q={isNothing:Bn,isObject:In,toArray:Tn,repeat:An,isNegativeZero:Hn,extend:En};function Kt(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
1
+ (function(re,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@kong-ui-public/i18n","@kong/kongponents","vue-router"],t):(re=typeof globalThis<"u"?globalThis:re||self,t(re["kong-ui-entities-upstreams-targets"]={},re.Vue,re.axios,re["kong-ui-public-i18n"],re.Kongponents,re.VueRouter))})(this,function(re,t,Bt,Ue,wl,tt){"use strict";var at=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e.Secret="secret",e))(at||{}),ie=(e=>(e.Edit="edit",e.Create="create",e))(ie||{}),fe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(fe||{}),L=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function Sl(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):Bt.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),Bt.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function _l(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const rt="khcp-user-table-preferences",xl={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function Nl(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(rt));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(rt,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||xl},deleteAllTablePreferences:()=>{localStorage.removeItem(rt)}}}function lt(e={}){const{getAxiosInstance:r}=Sl();return{axiosInstance:r(e)}}const Vl={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Bl={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Il={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."}},Tl={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Al={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"}},Hl={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},El={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ql={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},vl={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Fl={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"}},Ol={global:Vl,deleteModal:Bl,baseForm:Il,baseTable:Tl,baseConfigCard:Al,filter:Hl,debouncedFilter:El,errors:ql,validationErrors:vl,toggleModal:Fl};function De(){const e=Ue.createI18n("en-us",Ol);return{i18n:e,i18nT:Ue.i18nTComponent(e)}}function It(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const i of n){const o=a.filter(c=>c===i).length,d=l.filter(c=>c===i).length;if(o!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const i in a)if(Array.isArray(a[i])&&Array.isArray(l[i])){if(r(a[i],l[i]))continue;return!1}else{if(a[i]===l[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let i=l[a]===void 0||l[a]===null?"":l[a],o=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(i=l[a][0]),Array.isArray(n[a])&&(o=n[a][0]),i.localeCompare(o)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function $l(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="1000");const{axiosInstance:n}=lt(e.axiosRequestConfig),{i18n:{t:i}}=De(),{debounce:o}=_l(),d=o(async I=>{await T(I)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),m=t.ref([]),s=t.ref(void 0),S=t.computed(()=>{const I=`${e.apiBaseUrl}${t.unref(r)}`;return e.app==="konnect"?I.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?I.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):I}),{isValidUuid:N}=It(),g=async()=>{try{c.value=!0;const{data:I}=await n.get(`${S.value}?size=${a}`);I!=null&&I.next||(s.value=l.fetchedItemsKey in I?I[l.fetchedItemsKey]:[]),m.value=l.fetchedItemsKey in I?I[l.fetchedItemsKey]:[],u.value=m.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},_=t.ref(""),T=async I=>{var B,A,f;if(_.value!==I){if(_.value=I??"",!I){u.value=m.value;return}if(s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){const b=`${S.value}/${I}`,{data:x}=await n.get(`${b}?size=${a}`);l.fetchedItemsKey in x?u.value=x[l.fetchedItemsKey]:x!=null&&x[l.exactMatchKey??"id"]?u.value=[x]:u.value=[]}else{const b=[];N(I)&&l.searchKeys.includes("id")?b.push((async()=>{const{data:w}=await n.get(`${S.value}/${I}`);return[w[l.fetchedItemsKey]??w]})()):b.push(...l.searchKeys.filter(w=>w!=="id").map(async w=>{const{data:E}=await n.get(`${S.value}?${w}=${I}`);return E[l.fetchedItemsKey]}));const x=await Promise.all(b),V=new Set;u.value=[],(B=x==null?void 0:x.forEach)==null||B.call(x,w=>{var E;(E=w==null?void 0:w.forEach)==null||E.call(w,H=>{V.has(H.id)||(V.add(H.id),u.value.push(H))})})}}catch(b){((A=b==null?void 0:b.response)==null?void 0:A.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],h.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",u.value=(f=s.value)==null?void 0:f.filter(b=>{var x;let V=!1;for(const w of l.searchKeys){const E=typeof b[w]=="string"?(x=b[w])==null?void 0:x.toLowerCase():b[w];E!=null&&E.includes(I.toLowerCase())&&(V=!0)}return V}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:h,validationError:p,results:u,allRecords:s,loadItems:g,debouncedQueryChange:d}}function Ul(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Dl(){const{i18n:{t:e}}=De();return{getMessageFromError:r=>{var a,l,n,i;if(!r)return e("errors.unexpected");if(((a=r==null?void 0:r.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((l=r==null?void 0:r.response)!=null&&l.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let d=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(d=o.messages.join(", ")),o.field?`${o.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Ml(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,i=e.some(o=>o.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!i&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function Tt(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),i=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return o=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:m}=o;try{let s=new URL(i.value.href);return n.value&&m?(s.search="",s=a.value.isExactMatch?new URL(`${s.href}/${m}/`):new URL(`${s.href}?filter[name][contains]=${m}`)):(n.value||new URLSearchParams(m).forEach((S,N)=>{s.searchParams.append(N,S)}),p&&s.searchParams.append("sort_by",p),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),h&&d!==1&&s.searchParams.append("offset",String(h)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function jl(e,r,a="data"){const l=t.unref(r),{axiosInstance:n}=lt(e.axiosRequestConfig),i=Tt(e,l),o=t.ref({status:fe.Idle});return{fetcher:async d=>{var c;try{o.value={status:fe.Loading};let h=i(d);h.includes("filter[name]")&&(h=`${h}&page[size]=${d.pageSize}&page[number]=${d.page}`);const p=await n.get(h);if(p.status>=400)throw p;const u=p.data,m=a&&a.replace(/[^\w-_]/gi,"");let s;u[m]&&Array.isArray(u[m])?s=u[m]:Array.isArray(u)?s=u:s=Object.keys(u).length?[u]:[];const S={data:s,total:s.length,...u.offset?{pagination:{offset:u.offset}}:null};return o.value={status:fe.Idle,response:S},S}catch(h){const p={data:[],total:0};return d.query&&(((c=h.response)==null?void 0:c.status)===404||h.status===404)?(o.value={status:fe.NoResults,response:p,error:h.response?h:{response:h}},p):(o.value={status:fe.Error,response:p,error:h.response?h:{response:h}},p)}},fetcherState:o}}function Kl(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const At=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ht=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(At);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},Et=e=>e==="*"||e==="x"||e==="X",qt=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Ll=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Pl=(e,r)=>{if(Et(e)||Et(r))return 0;const[a,l]=Ll(qt(e),qt(r));return a>l?1:a<l?-1:0},vt=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Pl(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},Rl=(e,r)=>{const a=Ht(e),l=Ht(r),n=a.pop(),i=l.pop(),o=vt(a,l);return o!==0?o:n&&i?vt(n.split("."),i.split(".")):n||i?n?-1:1:0},Ft=(e,r,a)=>{zl(a);const l=Rl(e,r);return Ot[a].includes(l)},Ot={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},$t=Object.keys(Ot),zl=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if($t.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${$t.join("|")}`)},Jl=e=>typeof e=="string"&&/^[v\d]/.test(e)&&At.test(e);function Wl(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!Jl(n))return console.error("Invalid version"),!1;const i=a[l];if(!i)return!1;const[o,d]=i;return!(o&&Ft(n,o,"<")||d&&Ft(n,d,">"))}function Ql(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}function Zl(){const{i18n:{t:e}}=De();return{utf8Name:r=>/^[\p{N}\p{L}.\-_~]*$/u.test(r)?"":e("validationErrors.utf8Name")}}const Y={useAxios:lt,useDebouncedFilter:$l,useDeleteUrlBuilder:Ul,useErrors:Dl,useExternalLinkCreator:Ml,useFetcher:jl,useFetchUrlBuilder:Tt,useHelpers:It,useStringHelpers:Kl,useI18n:De,useGatewayFeatureSupported:Wl,useTruncationDetector:Ql,useValidators:Zl},Yl={key:0,class:"config-card-fieldset-title"},Gl=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Y.useI18n(),{convertKeyToTitle:l}=Y.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),i=t.computed(()=>r.item.value??r.item),o=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=i.value)!=null&&c.name?l(i.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,h)=>(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",Yl,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(o.value),(p,u)=>(t.openBlock(),t.createBlock(Dt,{key:`${n.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:o.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),oe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Ut=oe(Gl,[["__scopeId","data-v-68ca83ec"]]),Xl=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Y.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=i=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),en=oe(Xl,[["__scopeId","data-v-c96811e5"]]),tn=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Y.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),an="#0044f4",rn="#e0e4ea",ln="#afb7c5",nn="1px",on="20px",sn={class:"config-card-details-row"},cn=["data-testid"],dn=["data-testid"],hn=["data-testid"],pn=["data-testid"],un={key:1},fn=["data-testid"],mn=["data-testid"],gn=["data-testid"],yn=["data-testid"],kn={name:"ConfigCardItem",components:{JsonCardItem:Ut,StatusBadge:tn,InternalLinkItem:en}},bn=t.defineComponent({...kn,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:r}){t.useCssVars(S=>({"2f5b0492":p.value?"none":`solid ${t.unref(nn)} ${t.unref(rn)}`,"5d59c22c":h.value&&d.value?"block":"flex",aa41a894:h.value&&d.value?"100%":a.slim?"50%":"25%",aa3d1cde:h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:o}}=Y.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),h=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),p=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:o(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:a.item.value}};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:S=>{l("navigation-click",S)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),m=t.ref(),{isTruncated:s}=Y.useTruncationDetector(m);return(S,N)=>{const g=t.resolveComponent("KLabel"),_=t.resolveComponent("KBadge"),T=t.resolveComponent("KCopy"),I=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",sn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(S.$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},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(S.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,dn)]),key:"0"}:void 0]),1024)],!0)],8,cn),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(S.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",un,[(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,(B,A)=>(t.openBlock(),t.createBlock(_,{key:`${e.item.key}-badge-tag-${A}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${A}`,tooltip:B,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(B),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,fn)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(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,(B,A)=>(t.openBlock(),t.createBlock(T,t.mergeProps({ref_for:!0},u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${A}`,"data-testid":`${e.item.key}-copy-uuid-${A}`,text:B}),null,16,["data-testid","text"]))),128))],8,mn)):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,(B,A)=>(t.openBlock(),t.createBlock(_,{key:`${e.item.key}-badge-method-${A}`,appearance:Object.values(t.unref(wl.BadgeMethodAppearances)).includes(B.toLowerCase())?B.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${A}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(B),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,gn)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${a.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(B,A)=>(t.openBlock(),t.createBlock(Ut,{key:`json-array-item-${A}`,index:A,"is-array-item":"",item:B},null,8,["index","item"]))),128))],8,yn)):(t.openBlock(),t.createBlock(I,{key:4,text:t.unref(s)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:m,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,pn))],!0)],8,hn)])}}}),Dt=oe(bn,[["__scopeId","data-v-711ebcf2"]]),Cn={class:"json-config"},wn={key:0,class:"json-endpoint"},Mt=t.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){t.useCssVars(n=>({"7a485cf8":`${l.value}ch`}));const r=e,a=t.computed(()=>r.jsonRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const i=(n=r.fetcherUrl)==null?void 0:n.split("/");return i.length<2?0:41+(r.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(n,i)=>{const o=t.resolveComponent("KBadge"),d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Cn,[r.fetcherUrl?(t.openBlock(),t.createElementBlock("div",wn,[t.createVNode(o,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(d,{id:"json-endpoint-codeblock",code:r.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(d,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(a.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function jt(e){return typeof e>"u"||e===null}function Sn(e){return typeof e=="object"&&e!==null}function _n(e){return Array.isArray(e)?e:jt(e)?[]:[e]}function xn(e,r){var a,l,n,i;if(r)for(i=Object.keys(r),a=0,l=i.length;a<l;a+=1)n=i[a],e[n]=r[n];return e}function Nn(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function Vn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Bn=jt,In=Sn,Tn=_n,An=Nn,Hn=Vn,En=xn,Q={isNothing:Bn,isObject:In,toArray:Tn,repeat:An,isNegativeZero:Hn,extend:En};function Kt(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
2
2
 
3
3
  `+e.mark.snippet),l+" "+a):l}function Ae(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=Kt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ae.prototype=Object.create(Error.prototype),Ae.prototype.constructor=Ae,Ae.prototype.toString=function(e){return this.name+": "+Kt(this,e)};var le=Ae;function nt(e,r,a,l,n){var i="",o="",d=Math.floor(n/2)-1;return l-r>d&&(i=" ... ",r=l-d+i.length),a-l>d&&(o=" ...",a=l+d-o.length),{str:i+e.slice(r,a).replace(/\t/g,"→")+o,pos:l-r+i.length}}function ot(e,r){return Q.repeat(" ",r-e.length)+e}function qn(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var a=/\r?\n|\r|\0/g,l=[0],n=[],i,o=-1;i=a.exec(e.buffer);)n.push(i.index),l.push(i.index+i[0].length),e.position<=i.index&&o<0&&(o=l.length-2);o<0&&(o=l.length-1);var d="",c,h,p=Math.min(e.line+r.linesAfter,n.length).toString().length,u=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(o-c<0);c++)h=nt(e.buffer,l[o-c],n[o-c],e.position-(l[o]-l[o-c]),u),d=Q.repeat(" ",r.indent)+ot((e.line-c+1).toString(),p)+" | "+h.str+`
4
4
  `+d;for(h=nt(e.buffer,l[o],n[o],e.position,u),d+=Q.repeat(" ",r.indent)+ot((e.line+1).toString(),p)+" | "+h.str+`
@@ -29,4 +29,4 @@
29
29
  `+e.slice(n,i),n=i+1),o=d;return c+=`
30
30
  `,e.length-n>r&&o>n?c+=e.slice(n,o)+`
31
31
  `+e.slice(o+1):c+=e.slice(n),c.slice(1)}function Ci(e){for(var r="",a=0,l,n=0;n<e.length;a>=65536?n+=2:n++)a=ve(e,n),l=te[a],!l&&qe(a)?(r+=e[n],a>=65536&&(r+=e[n+1])):r+=l||hi(a);return r}function wi(e,r,a){var l="",n=e.tag,i,o,d;for(i=0,o=a.length;i<o;i+=1)d=a[i],e.replacer&&(d=e.replacer.call(a,String(i),d)),(de(e,r,d,!1,!1)||typeof d>"u"&&de(e,r,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=n,e.dump="["+l+"]"}function ja(e,r,a,l){var n="",i=e.tag,o,d,c;for(o=0,d=a.length;o<d;o+=1)c=a[o],e.replacer&&(c=e.replacer.call(a,String(o),c)),(de(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&de(e,r+1,null,!0,!0,!1,!0))&&((!l||n!=="")&&(n+=mt(e,r)),e.dump&&He===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function Si(e,r,a){var l="",n=e.tag,i=Object.keys(a),o,d,c,h,p;for(o=0,d=i.length;o<d;o+=1)p="",l!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[o],h=a[c],e.replacer&&(h=e.replacer.call(a,c,h)),de(e,r,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),de(e,r,h,!1,!1)&&(p+=e.dump,l+=p));e.tag=n,e.dump="{"+l+"}"}function _i(e,r,a,l){var n="",i=e.tag,o=Object.keys(a),d,c,h,p,u,m;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new le("sortKeys must be a boolean or a function");for(d=0,c=o.length;d<c;d+=1)m="",(!l||n!=="")&&(m+=mt(e,r)),h=o[d],p=a[h],e.replacer&&(p=e.replacer.call(a,h,p)),de(e,r+1,h,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&He===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,u&&(m+=mt(e,r)),de(e,r+1,p,!0,u)&&(e.dump&&He===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,n+=m));e.tag=i,e.dump=n||"{}"}function Ka(e,r,a){var l,n,i,o,d,c;for(n=a?e.explicitTypes:e.implicitTypes,i=0,o=n.length;i<o;i+=1)if(d=n[i],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof r=="object"&&r instanceof d.instanceOf)&&(!d.predicate||d.predicate(r))){if(a?d.multi&&d.representName?e.tag=d.representName(r):e.tag=d.tag:e.tag="?",d.represent){if(c=e.styleMap[d.tag]||d.defaultStyle,xa.call(d.represent)==="[object Function]")l=d.represent(r,c);else if(Na.call(d.represent,c))l=d.represent[c](r,c);else throw new le("!<"+d.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function de(e,r,a,l,n,i,o){e.tag=null,e.dump=a,Ka(e,a,!1)||Ka(e,a,!0);var d=xa.call(e.dump),c=l,h;l&&(l=e.flowLevel<0||e.flowLevel>r);var p=d==="[object Object]"||d==="[object Array]",u,m;if(p&&(u=e.duplicates.indexOf(a),m=u!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&r>0)&&(n=!1),m&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&m&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")l&&Object.keys(e.dump).length!==0?(_i(e,r,e.dump,n),m&&(e.dump="&ref_"+u+e.dump)):(Si(e,r,e.dump),m&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?ja(e,r-1,e.dump,n):ja(e,r,e.dump,n),m&&(e.dump="&ref_"+u+e.dump)):(wi(e,r,e.dump),m&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&ki(e,e.dump,r,i,c);else{if(d==="[object Undefined]"||e.skipInvalid)return!1;throw new le("unacceptable kind of an object to dump "+d)}e.tag!==null&&e.tag!=="?"&&(h=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",e.dump=h+" "+e.dump)}return!0}function xi(e,r){var a=[],l=[],n,i;for(yt(e,a,l),n=0,i=l.length;n<i;n+=1)r.duplicates.push(a[l[n]]);r.usedDuplicates=new Array(i)}function yt(e,r,a){var l,n,i;if(e!==null&&typeof e=="object")if(n=r.indexOf(e),n!==-1)a.indexOf(n)===-1&&a.push(n);else if(r.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)yt(e[n],r,a);else for(l=Object.keys(e),n=0,i=l.length;n<i;n+=1)yt(e[l[n]],r,a)}function Ni(e,r){r=r||{};var a=new ui(r);a.noRefs||xi(e,a);var l=e;return a.replacer&&(l=a.replacer.call({"":l},"",l)),de(a,0,l,!0,!0)?a.dump+`
32
- `:""}var Vi=Ni,Bi={dump:Vi};function kt(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var Ii=G,Ti=Pt,Ai=Wt,Hi=Xt,Ei=ea,qi=ct,vi=_a.load,Fi=_a.loadAll,Oi=Bi.dump,$i=le,Ui={binary:na,float:Gt,map:Jt,null:Qt,pairs:ia,set:sa,timestamp:ra,bool:Zt,int:Yt,merge:la,omap:oa,seq:zt,str:Rt},Di=kt("safeLoad","load"),Mi=kt("safeLoadAll","loadAll"),ji=kt("safeDump","dump"),Ki={Type:Ii,Schema:Ti,FAILSAFE_SCHEMA:Ai,JSON_SCHEMA:Hi,CORE_SCHEMA:Ei,DEFAULT_SCHEMA:qi,load:vi,loadAll:Fi,dump:Oi,YAMLException:$i,types:Ui,safeLoad:Di,safeLoadAll:Mi,safeDump:ji};const Li={class:"yaml-config"},La=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>{const l=Object.fromEntries(Object.entries(r.yamlRecord).filter(([,n])=>n!==null&&n!==""&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(l).length===0&&l.constructor===Object?"":Ki.dump(l).trim()});return(l,n)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Li,[r.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Pi={key:0,class:"config-card-display-form"},Ri=["data-testid"],zi={key:0,class:"config-card-prop-section-title"},Ji=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const r=e,a=t.useSlots(),{i18n:{t:l}}=Y.useI18n(),n=o=>!!(o.tooltip||a[`${o.key}-label-tooltip`]),i=t.computed(()=>{if(!r.record)return r.record;const o=JSON.parse(JSON.stringify(r.record));return delete o.created_at,delete o.updated_at,o});return(o,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Pi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,c=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${c}-props`,class:t.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(t.openBlock(),t.createElementBlock("div",zi,t.toDisplayString(c==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],h=>(t.openBlock(),t.createBlock(Dt,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(o.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[n(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Ri))),128))])):t.createCommentVNode("",!0),e.format==="json"&&r.record?(t.openBlock(),t.createBlock(Mt,{key:1,config:r.config,"fetcher-url":r.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&r.record?(t.openBlock(),t.createBlock(La,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),Wi=oe(Ji,[["__scopeId","data-v-2052238b"]]),ce="24px",Fe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Qi=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),Zi=["aria-hidden"],Yi={key:0,"data-testid":"kui-icon-svg-title"},Gi=Qi(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Xi=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Yi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Gi],8,Zi))]),_:1},8,["aria-hidden","style"]))}}),es=Fe(Xi,[["__scopeId","data-v-c1f7c39c"]]),ts=e=>(t.pushScopeId("data-v-fbe6ddff"),e=e(),t.popScopeId(),e),as=["aria-hidden"],rs={key:0,"data-testid":"kui-icon-svg-title"},ls=ts(()=>t.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),ns=t.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",rs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ls],8,as))]),_:1},8,["aria-hidden","style"]))}}),os=Fe(ns,[["__scopeId","data-v-fbe6ddff"]]),is=e=>(t.pushScopeId("data-v-745761f6"),e=e(),t.popScopeId(),e),ss=["aria-hidden"],cs={key:0,"data-testid":"kui-icon-svg-title"},ds=is(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),hs=t.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",cs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ds],8,ss))]),_:1},8,["aria-hidden","style"]))}}),ps=Fe(hs,[["__scopeId","data-v-745761f6"]]),us=e=>(t.pushScopeId("data-v-863d10eb"),e=e(),t.popScopeId(),e),fs=["aria-hidden"],ms={key:0,"data-testid":"kui-icon-svg-title"},gs=us(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),ys=t.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ms,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),gs],8,fs))]),_:1},8,["aria-hidden","style"]))}}),ks=Fe(ys,[["__scopeId","data-v-863d10eb"]]),bs=e=>(t.pushScopeId("data-v-d9894a05"),e=e(),t.popScopeId(),e),Cs=["aria-hidden"],ws={key:0,"data-testid":"kui-icon-svg-title"},Ss=bs(()=>t.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),_s=t.defineComponent({__name:"MoreIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon more-icon","data-testid":"kui-icon-wrapper-more-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-more-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ws,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Ss],8,Cs))]),_:1},8,["aria-hidden","style"]))}}),xs=Fe(_s,[["__scopeId","data-v-d9894a05"]]),Ns={class:"config-card-title","data-testid":"config-card-title"},Vs={class:"config-card-actions"},Bs=["href"],Is={class:"config-card-details-section"},Ts=t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:r}){var a;const l=r,n=e,{i18n:{t:i}}=Y.useI18n(),{getMessageFromError:o}=Y.useErrors(),{convertKeyToTitle:d}=Y.useStringHelpers(),{axiosInstance:c}=Y.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),h=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=f=>{p.value=f==null?void 0:f.value},m={id:{type:L.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:L.BadgeStatus,order:2,section:J.Basic},updated_at:{type:L.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:L.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:L.BadgeTag,order:-1,section:J.Basic}},s=t.ref(!1),S=t.ref(!1),N=t.ref(""),g=t.ref({}),_=t.computed(()=>{var f,b,x;if(!g.value)return[];const V=[],w=Object.keys(g.value).length;for(const E in g.value){const H=(b=(f=n.configSchema)==null?void 0:f[E])==null?void 0:b.order,$=(x=m[E])==null?void 0:x.order;let U=w;($||$===0)&&(U=$===-1?w+1:$),H&&(U=H===-1?w+1:H),V.push([E,U])}return V.sort(function(E,H){return E[1]-H[1]}),V.map(E=>{var H,$;const U=E[0],O=(H=g.value)==null?void 0:H[U],F=(($=n.configSchema)==null?void 0:$[U])||{},j=m[U];return{key:U,value:O,hidden:F.hidden||!1,type:F.type??((j==null?void 0:j.type)||L.Text),label:F.label??((j==null?void 0:j.label)||d(U)),tooltip:F.tooltip??((j==null?void 0:j.tooltip)||void 0),section:F.section??((j==null?void 0:j.section)||J.Advanced)}}).filter(E=>!E.hidden&&E.key!==n.pluginConfigKey)}),T=t.computed(()=>{var f,b;if(!g.value||!n.pluginConfigKey)return[];const x=g.value[n.pluginConfigKey]||{},V=Object.keys(x).length,w=[];for(const E in x){const H=(b=(f=n.pluginConfigSchema)==null?void 0:f[E])==null?void 0:b.order,$=x[E];let U=$!=null&&$!==""?V-1:V;H&&(U=H===-1?V+1:H),w.push([E,U])}return w.sort(function(E,H){return E[1]-H[1]}),w.map(E=>{var H;const $=E[0],U=x[$],O=((H=n.pluginConfigSchema)==null?void 0:H[$])||{};return{key:$,value:U,hidden:O.hidden||!1,type:O.type??L.Text,label:O.label??d($),tooltip:O.tooltip??void 0,section:J.Plugin}}).filter(E=>!E.hidden)}),B=t.computed(()=>{var f,b,x,V;return{basic:(f=_.value)==null?void 0:f.filter(w=>w.section===J.Basic),advanced:(b=_.value)==null?void 0:b.filter(w=>w.section===J.Advanced),plugin:(V=T.value)==null?void 0:V.concat((x=_.value)==null?void 0:x.filter(w=>w.section===J.Plugin))}}),I=t.computed(()=>{const f=[];return B.value.basic.length&&f.push("basic"),B.value.advanced.length&&f.push("advanced"),B.value.plugin.length&&f.push("plugin"),f}),A=t.computed(()=>{var f,b;let x=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((f=n.config)==null?void 0:f.controlPlaneId)||""):n.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(b=n.config)!=null&&b.workspace?`/${n.config.workspace}`:"")),x=x.replace(/{id}/gi,n.config.entityId),x});return t.watch(s,f=>{l("loading",f)},{immediate:!0}),t.onBeforeMount(async()=>{S.value=!1,s.value=!0;try{const{data:f}=await c.get(A.value);if(n.dataKey)if(typeof f[n.dataKey]<"u")g.value={...f[n.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:n.dataKey}));else g.value={...f};Object.keys(n.configSchema).filter(b=>n.configSchema[b].forceShow).forEach(b=>{g.value&&typeof g.value[b]>"u"&&(g.value[b]=null)}),l("fetch:success",f)}catch(f){const b=o(f);N.value=b.startsWith("code")?i("baseConfigCard.errors.load"):b,S.value=!0,l("fetch:error",f)}finally{s.value=!1}}),(f,b)=>{const x=t.resolveComponent("KLabel"),V=t.resolveComponent("KSelect"),w=t.resolveComponent("KButton"),E=t.resolveComponent("KSkeleton"),H=t.resolveComponent("KEmptyState"),$=t.resolveComponent("KCard");return t.openBlock(),t.createBlock($,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Vs,[t.renderSlot(f.$slots,"actions",{},void 0,!0),t.createVNode(x,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(V,{"data-testid":"select-config-format",items:h,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(w,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(os),{size:t.unref(on)},null,8,["size"])],8,Bs)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[s.value?(t.openBlock(),t.createBlock(E,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):S.value?(t.openBlock(),t.createBlock(H,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(N.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",Is,[t.createVNode(Wi,{config:e.config,"fetcher-url":A.value,format:p.value,"prop-list-types":I.value,"property-collections":B.value,record:g.value},t.createSlots({_:2},[t.renderList(Object.keys(f.$slots),U=>({name:U,fn:t.withCtx(({row:O,rowValue:F})=>[t.renderSlot(f.$slots,U,{row:O,rowValue:F},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("span",Ns,[t.renderSlot(f.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),As=oe(Ts,[["__scopeId","data-v-f40a683b"]]),Hs=["novalidate"],Es={class:"form-actions","data-testid":"form-actions"},qs=t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,i=tt.useRouter(),{i18n:{t:o}}=Y.useI18n(),{getMessageFromError:d}=Y.useErrors(),{axiosInstance:c}=Y.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),m=t.computed(()=>n.canSubmit===!1||n.isReadonly),s=t.ref(!1),S=t.computed(()=>{var I,A;let f=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((I=n.config)==null?void 0:I.controlPlaneId)||""):n.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(A=n.config)!=null&&A.workspace?`/${n.config.workspace}`:"")),n.editId?(f=f.replace(/{id}/gi,n.editId),f):(f=f.replace(/\/{id}/gi,""),f)}),N=()=>{s.value=!s.value},g=()=>{n.config.cancelRoute?i.push(n.config.cancelRoute):_()},_=()=>{l("cancel")},T=()=>{m.value||l("submit")},B=t.ref([{title:o("baseForm.configuration.yaml"),hash:"#yaml"},{title:o("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,I=>{l("loading",I)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{p.value=!1,h.value=!0;const{data:I}=await c.get(S.value);l("fetch:success",I)}catch(I){const A=d(I);u.value=A.startsWith("code")?o("baseForm.errors.edit"):A,p.value=!0,l("fetch:error",I)}finally{h.value=!1}}),(I,A)=>{const f=t.resolveComponent("KSkeleton"),b=t.resolveComponent("KEmptyState"),x=t.resolveComponent("KAlert"),V=t.resolveComponent("KButton"),w=t.resolveComponent("KTabs"),E=t.resolveComponent("KSlideout");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(f,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(b,{key:1,"action-button-text":t.unref(o)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:g},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:n.noValidate,onReset:t.withModifiers(_,["prevent"]),onSubmit:t.withModifiers(T,["prevent"])},[t.renderSlot(I.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(x,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Es,[t.renderSlot(I.$slots,"form-actions",{},()=>[t.createVNode(V,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:A[0]||(A[0]=H=>N())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.viewConfiguration")),1)]),_:1}),t.createVNode(V,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(V,{appearance:"primary","data-testid":"form-submit",disabled:m.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,Hs)),t.createVNode(E,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(o)("baseForm.configuration.title"),visible:s.value,onClose:A[1]||(A[1]=H=>N())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("baseForm.configuration.message")),1),t.createVNode(w,{"data-testid":"form-view-configuration-slideout-tabs",tabs:B.value},{json:t.withCtx(()=>[t.createVNode(Mt,{config:e.config,"fetcher-url":S.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(La,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Pa=oe(qs,[["__scopeId","data-v-fd05df8e"]]),vs=["data-truncate"],Fs=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const r=e,a=t.computed(()=>{var g;return((g=r.rowEl)==null?void 0:g.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var g;return((g=a.value)==null?void 0:g.querySelector('[data-truncate="true"]'))||null}),n=t.computed(()=>{var g,_;const T=(g=r.rowEl)==null?void 0:g.querySelectorAll("td");return T?((_=T[0])==null?void 0:_.getAttribute("data-testid"))===r.keyName:!0}),i=t.computed(()=>n.value||r.tooltip);let o;const d=()=>{o&&(o.disconnect(),o=void 0)},c=()=>{var g,_,T;let B=((g=a.value)==null?void 0:g.clientWidth)||0;if(a.value&&"getComputedStyle"in window){const I=window.getComputedStyle(a.value);B-=(parseFloat(I.paddingLeft)||0)+(parseFloat(I.paddingRight)||0)}p.value=((_=l.value)==null?void 0:_.getBoundingClientRect().width)||0,u.value=B,m.value=((T=h.value)==null?void 0:T.innerText)||""},h=t.ref({}),p=t.ref(0),u=t.ref(0),m=t.ref(""),s=t.computed(()=>[l.value,a.value]),S=t.watch(s,g=>{if(i.value&&(d(),"ResizeObserver"in window&&window)){o=new ResizeObserver(_=>{window.requestAnimationFrame(()=>{!Array.isArray(_)||!_.length||c()})});for(const _ of g)_&&o.observe(_)}},{immediate:!0,flush:"post",deep:!0}),N=t.computed(()=>i.value?p.value>u.value:!1);return t.onMounted(()=>{c()}),t.onUnmounted(()=>{S()}),(g,_)=>{const T=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:h,class:"content-wrapper"},[i.value?(t.openBlock(),t.createElementBlock("span",{key:0,"data-truncate":i.value||void 0},[t.createVNode(T,{"max-width":"300",placement:"bottom-start",text:N.value?m.value:""},{default:t.withCtx(()=>[t.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,vs)):t.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),Os=oe(Fs,[["__scopeId","data-v-b252463e"]]),$s={class:"toolbar-container"},Us={key:0,class:"toolbar-button-container"},Ds=["data-testid"],Ms=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},sortHandlerFunction:{type:Function,default:()=>({})},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:r}){const a=e,l=r,{i18n:{t:n}}=Y.useI18n(),i=t.computed(()=>{var f,b;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(f=a.errorMessage)==null?void 0:f.title,message:(b=a.errorMessage)==null?void 0:b.message}}),o=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=f=>f.hasData||!!a.query,c=t.computed(()=>{const f=[];return Object.keys(a.tableHeaders).forEach(b=>{const x=a.tableHeaders[b];f.push({label:x.label??b,key:b,sortable:x.sortable??!1,hidable:x.hidable??!0})}),a.enableEntityActions&&f.push({key:"actions",hideLabel:!0}),f}),h=f=>({"data-rowid":f.id,"data-testid":f.name,...a.rowAttributes(f)}),p=t.ref({}),u=f=>{var b;return(b=p.value)==null?void 0:b.$el.querySelector(`[data-rowid="${f.id}"]`)},m=f=>{const b={"data-testid":f.headerKey,...a.cellAttributes(f)};return f.colIndex===0&&(b.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),b},s=()=>{l("empty-state-cta-clicked"),S()},S=()=>{l("clear-search-input")},N=t.computed(()=>a.disableRowClick?void 0:(f,b)=>{l("click:row",b)}),g=f=>{l("sort",f)},{setTablePreferences:_,getTablePreferences:T}=Nl(),B=t.ref(T(o.value)),I=t.computed(()=>{const f=T(o.value);return{...a.initialFetcherParams,...f}}),A=f=>{B.value=f,c.value.forEach(b=>{!("hidable"in b)||!B.value.columnVisibility||b.hidable===!1&&(B.value.columnVisibility[b.key]=!0)}),o.value&&_(o.value,f)};return(f,b)=>{const x=t.resolveComponent("KButton"),V=t.resolveComponent("KDropdown"),w=t.resolveComponent("KTable"),E=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(E,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:t.withCtx(()=>[t.createVNode(w,{ref_key:"tableRefs",ref:p,"cache-identifier":o.value,"cell-attrs":m,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,error:i.value.hasError,"error-state-message":i.value.message,"error-state-title":i.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":I.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":h,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":B.value,onEmptyStateActionClick:s,"onRow:click":N.value,onSort:b[0]||(b[0]=H=>g(H)),"onUpdate:tablePreferences":A},t.createSlots({toolbar:t.withCtx(({state:H})=>[t.withDirectives(t.createElementVNode("div",$s,[t.renderSlot(f.$slots,"toolbar-filter",{},void 0,!0),f.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Us,[t.renderSlot(f.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(H)]])]),actions:t.withCtx(({row:H,rowKey:$,rowValue:U})=>[t.createElementVNode("div",{class:"actions-container","data-testid":H.name},[t.createVNode(V,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(f.$slots,"actions",{row:H,rowKey:$,rowValue:U},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(x,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:t.withCtx(()=>[t.createVNode(t.unref(xs))]),_:1})]),_:2},1032,["width"])],8,Ds)]),_:2},[t.renderList(e.tableHeaders,(H,$)=>({name:$,fn:t.withCtx(({row:U,rowKey:O,rowValue:F})=>[t.createVNode(Os,{"key-name":String($),"row-el":u(U),tooltip:H.tooltip},{default:t.withCtx(()=>[t.renderSlot(f.$slots,$,{row:U,rowKey:O,rowValue:F},()=>[t.createTextVNode(t.toDisplayString(F),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(es))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Ra=oe(Ms,[["__scopeId","data-v-71b4425a"]]),js={key:0,class:"kong-ui-entity-delete-error"},Ks={key:1,class:"description"},Ls=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:r}){const{i18nT:a}=Y.useI18n(),l=e,n=r,i=t.computed(()=>l.needConfirm?l.entityName:""),o=()=>{n("cancel")},d=()=>{n("proceed")};return(c,h)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":i.value,title:e.title,visible:e.visible,onCancel:o,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",js,[t.createVNode(p,{appearance:"danger"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Ks,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),za=oe(Ls,[["__scopeId","data-v-4361d622"]]),Ps={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Rs={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},zs=["fill"],Js={mask:"url(#mask0_180_20349)"},Ws=["fill"],Ja=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${an})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Ps,[t.createElementVNode("mask",Rs,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,zs)]),t.createElementVNode("g",Js,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ws)])]))}}),Qs={key:1,class:"kong-ui-entity-filter"},Zs={class:"kong-ui-entity-filter-menu"},Ys=["data-testid"],Gs=["onClick","onKeydown"],Xs={class:"menu-item-indicator"},ec={class:"menu-item-body"},tc=["for"],ac={class:"menu-item-buttons"},rc={class:"filter-clear-button-container"},lc=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:r}){const{i18n:{t:a}}=Y.useI18n(),l=e,n=r,i=t.ref(!1),o=t.ref({}),d=t.ref(new Set),c=t.computed(()=>{const I=[];return new URLSearchParams(l.modelValue).forEach((A,f)=>{A!==""&&I.push(f)}),I}),h=t.computed(()=>{const I=l.config.fields;return Object.keys(I).filter(A=>{var f;return(f=I==null?void 0:I[A])==null?void 0:f.searchable}).map(A=>({label:I[A].label||A,value:A,expanded:!1}))});t.watch(()=>l.modelValue,I=>{o.value={},new URLSearchParams(I).forEach((A,f)=>{o.value[f]=A})});const p=()=>{i.value=!i.value},u=I=>{d.value.has(I)?d.value.delete(I):d.value.add(I)},m=I=>{n("update:modelValue",I)},s=()=>{m("")},S=I=>`filter-${I}`,N=I=>{var A,f;return(((f=(A=l.config.schema)==null?void 0:A[I])==null?void 0:f.values)??[]).map(b=>({value:b,label:b}))},g=I=>{var A,f;return((f=(A=l.config.schema)==null?void 0:A[I])==null?void 0:f.type)??"text"},_=I=>{o.value={...o.value,[I]:""},B()},T=()=>{o.value={},B(!0)},B=(I=!1)=>{const A=Object.keys(o.value).reduce((f,b)=>(o.value[b]&&(f[b]=`${o.value[b]}`),f),{});I&&(i.value=!1),n("update:modelValue",new URLSearchParams(A).toString())};return(I,A)=>{const f=t.resolveComponent("KInput"),b=t.resolveComponent("KButton"),x=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(f,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":m},{before:t.withCtx(()=>[t.createVNode(Ja)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(ks),{class:"kong-ui-entity-filter-clear",onClick:s},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Qs,[t.createVNode(b,{appearance:"tertiary","data-testid":"filter-button",onClick:p},{default:t.withCtx(()=>[t.createVNode(Ja),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:p},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createElementVNode("div",Zs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,V=>{var w,E;return t.openBlock(),t.createElementBlock("div",{key:V.value,class:"kong-ui-entity-filter-menu-item","data-testid":V.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:d.value.has(V.value)}]),role:"button",tabindex:"0",onClick:H=>u(V.value),onKeydown:t.withKeys(H=>u(V.value),["enter"])},[t.createTextVNode(t.toDisplayString(V.label)+" ",1),t.withDirectives(t.createElementVNode("span",Xs,null,512),[[t.vShow,c.value.includes(V.value)]]),t.createVNode(t.unref(ps),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:d.value.has(V.value)}]),color:t.unref(ln)},null,8,["class","color"])],42,Gs),t.withDirectives(t.createElementVNode("div",ec,[t.createElementVNode("label",{class:"menu-item-label",for:S(V.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,tc),((E=(w=e.config.schema)==null?void 0:w[V.value])==null?void 0:E.type)==="select"?(t.openBlock(),t.createBlock(x,{key:0,id:S(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":H=>o.value[V.value]=H,items:N(V.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(f,{key:1,id:S(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":H=>o.value[V.value]=H,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:g(V.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,d.value.has(V.value)]]),t.withDirectives(t.createElementVNode("div",ac,[t.createVNode(b,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:A[0]||(A[0]=H=>B(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(b,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:H=>_(V.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,d.value.has(V.value)]])],8,Ys)}),128)),t.createElementVNode("div",rc,[t.createVNode(b,{appearance:"tertiary",size:"small",onClick:T},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,i.value]])]))}}}),nc=oe(lc,[["__scopeId","data-v-94990087"]]),he=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,i)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}});let ze;const oc=new Uint8Array(16);function ic(){if(!ze&&(ze=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ze))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ze(oc)}const X=[];for(let e=0;e<256;++e)X.push((e+256).toString(16).slice(1));function sc(e,r=0){return X[e[r+0]]+X[e[r+1]]+X[e[r+2]]+X[e[r+3]]+"-"+X[e[r+4]]+X[e[r+5]]+"-"+X[e[r+6]]+X[e[r+7]]+"-"+X[e[r+8]]+X[e[r+9]]+"-"+X[e[r+10]]+X[e[r+11]]+X[e[r+12]]+X[e[r+13]]+X[e[r+14]]+X[e[r+15]]}const cc=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Wa={randomUUID:cc};function dc(e,r,a){if(Wa.randomUUID&&!r&&!e)return Wa.randomUUID();e=e||{};const l=e.random||(e.rng||ic)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,r){a=a||0;for(let n=0;n<16;++n)r[a+n]=l[n];return r}return sc(l)}const hc=["aria-labelledby"],pc={class:"form-section-wrapper"},uc={key:1,class:"form-section-description"},fc={key:2,class:"form-section-footer"},mc={class:"form-section-content"},gc=t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(e){const r=t.useSlots(),a=dc();return(l,n)=>(t.openBlock(),t.createElementBlock("div",{"aria-labelledby":e.title?t.unref(a):void 0,class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[t.createElementVNode("div",pc,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.titleTag),{key:0,id:t.unref(a),class:"form-section-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1},8,["id"])):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",uc,[t.renderSlot(l.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",fc,[t.renderSlot(l.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",mc,[t.renderSlot(l.$slots,"default",{},void 0,!0)])])],10,hc))}}),Oe=oe(gc,[["__scopeId","data-v-b1f74200"]]),{useAxios:Je,useDeleteUrlBuilder:Qa,useErrors:Za,useExternalLinkCreator:Sd,useFetchUrlBuilder:_d,useFetcher:Ya,useDebouncedFilter:Ga,useStringHelpers:xd,useHelpers:yc,useGatewayFeatureSupported:Nd,useTruncationDetector:Vd,useValidators:Bd}=Y,We="24px",Xa=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},kc=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),bc=["aria-hidden"],Cc={key:0,"data-testid":"kui-icon-svg-title"},wc=kc(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),bt=Xa(t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:We,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return We}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Cc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),wc],8,bc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c1f7c39c"]]),Sc=e=>(t.pushScopeId("data-v-c73ebbaa"),e=e(),t.popScopeId(),e),_c=["aria-hidden"],xc={key:0,"data-testid":"kui-icon-svg-title"},Nc=Sc(()=>t.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Vc=Xa(t.defineComponent({__name:"TrashIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:We,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return We}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",xc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Nc],8,_c))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c73ebbaa"]]),Bc={upstreams:{list:{table_headers:{id:"ID",name:"Name",slots:"Slots",tags:"Tags"},empty_state:{title:"Configure a New Upstream",description:"Upstreams are used to load balance incoming requests."},toolbar_actions:{new_upstream:"New Upstream"}},title:"Upstreams",search:{placeholder:"Filter by exact name or ID"},actions:{create:"New Upstream",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete an Upstream",description:"This action cannot be reversed so make sure to check upstream usage before deleting."},errors:{general:"Upstreams could not be retrieved",delete:"The upstream 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:{errors:{name_required:"Name is required",should_be_integer:"Field should contain an integer",in_range:"Accepts an integer in the range of 10 - 65536"},general_info:{title:"General Information",help:"General information will help identify and manage this Upstream."},load_balancing:{title:"Load Balancing",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},health_check:{title:"Health Checks & Circuit Breakers",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},active_health_check:{title:"Active Health Checks",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},passive_health_check:{title:"Passive Health Checks",help:"Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},buttons:{view_documentation:"View documentation"},algorithms:{round_robin_label:"Round Robin",least_connections_label:"Least Connections",consistent_hashing_label:"Consistent Hashing",latency_label:"Latency"},hash_labels:{none:"None",consumer:"Consumer",ip:"IP",header:"Header",cookie:"Cookie",path:"Path",query_argument:"Query Argument",uri_capture:"URI Capture"},hash_tooltips:{hash_on_header:{text:"The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",hash_on:"hash_on",header:"header"},hash_on_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",hash_on:"hash_on",uri_capture:"uri_capture"},hash_on_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",hash_on:"hash_on",query_arg:"query_arg"},hash_on_cookie:{text:"The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},hash_on_cookie_path:{text:"The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},slots:{text:"The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",algorithm:"algorithm",round_robin:"round-robin",consistent_hashing:"consistent-hashing"},tags:"An optional set of strings associated with the Upstream for grouping and filtering.",hash_fallback:{text:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",hash_on:"hash_on",cookie:"cookie"},hash_fallback_header:{text:"The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",hash_fallback:"hash_fallback",header:"header"},hash_fallback_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",hash_fallback:"hash_fallback",query_arg:"query_arg"},hash_fallback_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",hash_fallback:"hash_fallback",uri_capture:"uri_capture"},host_header:{text:"The hostname to be used as {host} header when proxying requests through Kong.",host:"Host"},client_certificate:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},healthcheck_type_labels:{http:"HTTP",https:"HTTPS",tcp:"TCP",grsp:"gRPC",grsps:"gRPCs"},healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},passive_healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},passive_unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},fields:{name:{label:"Name",placeholder:"Enter or select a host",tooltip:"This is a hostname, which must be equal to the {host} of a Service.",host:"host"},host_header:{label:"Host Header"},client_certificate:{label:"Client Certificate",placeholder:"Select or enter a Certificate ID",tooltip:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Upstream for grouping and filtering."},algorithm:{label:"Algorithm",tooltip:"Which load balancing algorithm to use."},slots:{label:"Slots",help:"Accepts an integer in the range of 10 - 65536"},hash_on:{label:"Hash on",help:"What to use as hashing input.",tooltip:"What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."},hash_fallback:{label:"Hash Fallback",help:"What to use as hashing input if the primary hash_on does not return a hash",tooltip:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",hash_on:"hash_on",cookie:"cookie"},active_health_checks:{label:"Active Health Checks",help:"Actively probe the targets for their health."},passive_health_checks:{label:"Passive Health Checks / Circuit Breakers",help:"Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},healthchecks_threshold:{label:"Healthchecks Threshold"},header:{label:"Header"},headers:{label:"Headers",tooltip_active:"Header values can be separated by commas (value1, value2, value3)."},cookie:{label:"Cookie"},cookie_path:{label:"Cookie Path"},query_argument:{label:"Query Argument"},uri_capture:{label:"URI Capture"},active_healthcheck_type:{label:"Active Health Check Type"},http_path:{label:"HTTP Path"},timeout:{label:"Timeout"},concurrency:{label:"Concurrency"},https_sni:{label:"HTTPS SNI"},verify_ssl:{label:"Verify the SSL certificate when performing active health checks using HTTPS"},interval:{label:"Interval",help:"A value of zero indicates that active probes for healthy targets are disabled."},successes:{label:"Successes"},http_statuses:{label:"HTTP Statuses"},http_failures:{label:"HTTP Failures"},tcp_failures:{label:"TCP Failures"},timeouts:{label:"Timeouts"},passive_health_check_type:{label:"Passive Health Check Type"}}},labels:{created_at:"Created at"}},targets:{list:{table_headers:{id:"ID",target_address:"Target Address",weight:"Weight",tags:"Tags"},empty_state:{title:"Configure a New Target",description:"A target is an IP address/hostname with a port that identifies an instance of a backend service."},toolbar_actions:{new_target:"New Target"}},title:"Targets",actions:{create:"New Target",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",mark_healthy:"Mark Healthy",mark_unhealthy:"Mark Unhealthy"},delete:{title:"Delete a Target",description:"This action cannot be reversed so make sure to check target usage before deleting."},errors:{general:"Targets could not be retrieved",delete:"The target could not be deleted at this time.",copy:"Failed to copy to clipboard",weight:"Value must be in range 0 to 65535"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{create:{title:"New Target"},edit:{title:"Edit Target"},buttons:{save:"Save",cancel:"Cancel"},fields:{target:{label:"Target Address",placeholder:"Enter IP/hostname and port",tooltip:"The target address (IP or hostname) and port. If omitted the port defaults to 8000."},weight:{label:"Weight",tooltip:"The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}}}}};function Ic(){const e=Ue.createI18n("en-us",Bc);return{i18n:e,i18nT:Ue.i18nTComponent(e)}}function $e(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,i)=>{if(i){const o={...n};r&&(o.value=n.label),a.value.push(o)}else a.value=a.value.filter(o=>o.value!==n.value)}}}const Qe=[{label:"100",value:"100"},{label:"101",value:"101"},{label:"102",value:"102"},{label:"103",value:"103"},{label:"200",value:"200"},{label:"201",value:"201"},{label:"202",value:"202"},{label:"203",value:"203"},{label:"204",value:"204"},{label:"205",value:"205"},{label:"206",value:"206"},{label:"207",value:"207"},{label:"208",value:"208"},{label:"226",value:"226"},{label:"300",value:"300"},{label:"301",value:"301"},{label:"302",value:"302"},{label:"303",value:"303"},{label:"304",value:"304"},{label:"305",value:"305"},{label:"306",value:"306"},{label:"307",value:"307"},{label:"308",value:"308"},{label:"400",value:"400"},{label:"401",value:"401"},{label:"402",value:"402"},{label:"403",value:"403"},{label:"404",value:"404"},{label:"405",value:"405"},{label:"406",value:"406"},{label:"407",value:"407"},{label:"408",value:"408"},{label:"409",value:"409"},{label:"410",value:"410"},{label:"411",value:"411"},{label:"412",value:"412"},{label:"413",value:"413"},{label:"414",value:"414"},{label:"415",value:"415"},{label:"416",value:"416"},{label:"417",value:"417"},{label:"418",value:"418"},{label:"419",value:"419"},{label:"420",value:"420"},{label:"421",value:"421"},{label:"422",value:"422"},{label:"423",value:"423"},{label:"424",value:"424"},{label:"425",value:"425"},{label:"426",value:"426"},{label:"428",value:"428"},{label:"429",value:"429"},{label:"430",value:"430"},{label:"431",value:"431"},{label:"440",value:"440"},{label:"444",value:"444"},{label:"449",value:"449"},{label:"450",value:"450"},{label:"451",value:"451"},{label:"460",value:"460"},{label:"463",value:"463"},{label:"494",value:"494"},{label:"495",value:"495"},{label:"496",value:"496"},{label:"497",value:"497"},{label:"498",value:"498"},{label:"499",value:"499"},{label:"500",value:"500"},{label:"501",value:"501"},{label:"502",value:"502"},{label:"503",value:"503"},{label:"504",value:"504"},{label:"505",value:"505"},{label:"506",value:"506"},{label:"507",value:"507"},{label:"508",value:"508"},{label:"509",value:"509"},{label:"510",value:"510"},{label:"511",value:"511"},{label:"520",value:"520"},{label:"521",value:"521"},{label:"522",value:"522"},{label:"523",value:"523"},{label:"524",value:"524"},{label:"525",value:"525"},{label:"526",value:"526"},{label:"527",value:"527"},{label:"529",value:"529"},{label:"530",value:"530"},{label:"561",value:"561"},{label:"598",value:"598"},{label:"599",value:"599"}],Ct=10,wt=65536,Tc=0,Ac=65535,xe=0,Ne=255,er=0,tr=255,Hc=0,Ec=65535,ar=0,rr=65535,qc=0,vc=2**31,St=["200","302"],_t=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],xt=["429","404","500","501","502","503","504","505"],Nt=["429","500","503"];function Ze(){const e=c=>/^\d+$/.test(c),r=(c,h,p)=>{if(e(c)){const u=Number(c);return u>=h&&u<=p}else return!1},a=c=>c.map(h=>Number(h)),l=c=>c.map(h=>h.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:St,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:xt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:_t,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:Nt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,m,s,S,N,g,_,T,B,I,A,f,b,x,V,w,E,H,$,U,O,F,j,Z,v,D,K,k,y,C,R,M,z,ee,P,ae,ke,Te,nr,or,ir,sr,cr,dr,hr,pr,ur,fr,mr,gr,yr,kr,br,Cr,wr,Sr,_r,xr,Nr,Vr,Br,Ir,Tr,Ar,Hr,Er,qr,vr,Fr,Or,$r,Ur,Dr,Mr,jr,Kr,Lr,Pr,Rr,zr,Jr,Wr,Qr,Zr,Yr,Gr,Xr,el,tl,al,rl,ll,nl,ol,il,sl,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl;const h=n();return h.name=c.name||"",h.algorithm=c.algorithm||"round-robin",h.hostHeader=c.host_header||"",h.clientCertificate=c.client_certificate?(p=c.client_certificate)==null?void 0:p.id:"",h.tags=((u=c.tags)==null?void 0:u.join(", "))||"",h.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",h.hashOn=c.hash_on||"none",h.hashFallback=c.hash_fallback||"none",h.hashOnHeader=c.hash_on_header||"",h.hashOnCookie=c.hash_on_cookie||"",h.hashOnCookiePath=c.hash_on_cookie_path||"/",h.hashOnQueryArgument=c.hash_on_query_arg||"",h.hashOnUriCapture=c.hash_on_uri_capture||"",h.hashFallbackHeader=c.hash_fallback_header||"",h.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",h.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",h.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",h.activeHealthSwitch=((s=(m=c.healthchecks.active)==null?void 0:m.healthy)==null?void 0:s.interval)!==0||((N=(S=c.healthchecks.active)==null?void 0:S.unhealthy)==null?void 0:N.interval)!==0,h.activeHealthCheck.type=((g=c.healthchecks.active)==null?void 0:g.type)||"http",h.activeHealthCheck.httpPath=((_=c.healthchecks.active)==null?void 0:_.http_path)||"/",h.activeHealthCheck.timeout=((T=c.healthchecks.active)==null?void 0:T.timeout)!==null&&((B=c.healthchecks.active)==null?void 0:B.timeout)!==void 0?(A=(I=c.healthchecks.active)==null?void 0:I.timeout)==null?void 0:A.toString():"",h.activeHealthCheck.concurrency=((f=c.healthchecks.active)==null?void 0:f.concurrency)!==null&&((b=c.healthchecks.active)==null?void 0:b.concurrency)!==void 0?(V=(x=c.healthchecks.active)==null?void 0:x.concurrency)==null?void 0:V.toString():"",h.activeHealthCheck.httpsSni=((w=c.healthchecks.active)==null?void 0:w.https_sni)||"",h.activeHealthCheck.verifySsl=((E=c.healthchecks.active)==null?void 0:E.https_verify_certificate)||!1,h.activeHealthCheck.headers=(H=c.healthchecks.active)!=null&&H.headers&&Object.entries(($=c.healthchecks.active)==null?void 0:$.headers).length>0?Object.entries((U=c.healthchecks.active)==null?void 0:U.headers).map(([wd,Vt])=>({key:wd,values:Vt==null?void 0:Vt.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((F=(O=c.healthchecks.active)==null?void 0:O.healthy)==null?void 0:F.interval)!==null&&((Z=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:Z.interval)!==void 0?(K=(D=(v=c.healthchecks.active)==null?void 0:v.healthy)==null?void 0:D.interval)==null?void 0:K.toString():"0",h.activeHealthCheck.interval=((y=(k=c.healthchecks.active)==null?void 0:k.healthy)==null?void 0:y.interval)!==null&&((R=(C=c.healthchecks.active)==null?void 0:C.healthy)==null?void 0:R.interval)!==void 0?(ee=(z=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:z.interval)==null?void 0:ee.toString():"0",h.activeHealthCheck.successes=((ae=(P=c.healthchecks.active)==null?void 0:P.healthy)==null?void 0:ae.successes)!==null&&((Te=(ke=c.healthchecks.active)==null?void 0:ke.healthy)==null?void 0:Te.successes)!==void 0?(ir=(or=(nr=c.healthchecks.active)==null?void 0:nr.healthy)==null?void 0:or.successes)==null?void 0:ir.toString():"0",h.activeHealthCheck.httpStatuses=(cr=(sr=c.healthchecks.active)==null?void 0:sr.healthy)!=null&&cr.http_statuses?l(((hr=(dr=c.healthchecks.active)==null?void 0:dr.healthy)==null?void 0:hr.http_statuses)||[]):St,h.activeHealthCheck.unhealthyInterval=((ur=(pr=c.healthchecks.active)==null?void 0:pr.unhealthy)==null?void 0:ur.interval)!==null&&((mr=(fr=c.healthchecks.active)==null?void 0:fr.unhealthy)==null?void 0:mr.interval)!==void 0?(kr=(yr=(gr=c.healthchecks.active)==null?void 0:gr.unhealthy)==null?void 0:yr.interval)==null?void 0:kr.toString():"0",h.activeHealthCheck.httpFailures=((Cr=(br=c.healthchecks.active)==null?void 0:br.unhealthy)==null?void 0:Cr.http_failures)!==null&&((Sr=(wr=c.healthchecks.active)==null?void 0:wr.unhealthy)==null?void 0:Sr.http_failures)!==void 0?(Nr=(xr=(_r=c.healthchecks.active)==null?void 0:_r.unhealthy)==null?void 0:xr.http_failures)==null?void 0:Nr.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((Br=(Vr=c.healthchecks.active)==null?void 0:Vr.unhealthy)==null?void 0:Br.timeouts)!==null&&((Tr=(Ir=c.healthchecks.active)==null?void 0:Ir.unhealthy)==null?void 0:Tr.timeouts)!==void 0?(Er=(Hr=(Ar=c.healthchecks.active)==null?void 0:Ar.unhealthy)==null?void 0:Hr.timeouts)==null?void 0:Er.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(vr=(qr=c.healthchecks.active)==null?void 0:qr.unhealthy)!=null&&vr.http_statuses?l(((Or=(Fr=c.healthchecks.active)==null?void 0:Fr.unhealthy)==null?void 0:Or.http_statuses)||[]):xt,h.passiveHealthSwitch=((Ur=($r=c.healthchecks.passive)==null?void 0:$r.healthy)==null?void 0:Ur.successes)!==0||((Mr=(Dr=c.healthchecks.passive)==null?void 0:Dr.unhealthy)==null?void 0:Mr.timeouts)!==0||((Kr=(jr=c.healthchecks.passive)==null?void 0:jr.unhealthy)==null?void 0:Kr.tcp_failures)!==0||((Pr=(Lr=c.healthchecks.passive)==null?void 0:Lr.unhealthy)==null?void 0:Pr.http_failures)!==0,h.passiveHealthCheck.type=((Rr=c.healthchecks.passive)==null?void 0:Rr.type)||"http",h.passiveHealthCheck.successes=((Jr=(zr=c.healthchecks.passive)==null?void 0:zr.healthy)==null?void 0:Jr.successes)!==null&&((Qr=(Wr=c.healthchecks.passive)==null?void 0:Wr.healthy)==null?void 0:Qr.successes)!==void 0?(Gr=(Yr=(Zr=c.healthchecks.passive)==null?void 0:Zr.healthy)==null?void 0:Yr.successes)==null?void 0:Gr.toString():"0",h.passiveHealthCheck.httpStatuses=(el=(Xr=c.healthchecks.passive)==null?void 0:Xr.healthy)!=null&&el.http_statuses?l(((al=(tl=c.healthchecks.passive)==null?void 0:tl.healthy)==null?void 0:al.http_statuses)||[]):_t,h.passiveHealthCheck.timeouts=((ll=(rl=c.healthchecks.passive)==null?void 0:rl.unhealthy)==null?void 0:ll.timeouts)!==null&&((ol=(nl=c.healthchecks.passive)==null?void 0:nl.unhealthy)==null?void 0:ol.timeouts)!==void 0?(cl=(sl=(il=c.healthchecks.passive)==null?void 0:il.unhealthy)==null?void 0:sl.timeouts)==null?void 0:cl.toString():"0",h.passiveHealthCheck.tcpFailures=((hl=(dl=c.healthchecks.passive)==null?void 0:dl.unhealthy)==null?void 0:hl.tcp_failures)!==null&&((ul=(pl=c.healthchecks.passive)==null?void 0:pl.unhealthy)==null?void 0:ul.tcp_failures)!==void 0?(gl=(ml=(fl=c.healthchecks.passive)==null?void 0:fl.unhealthy)==null?void 0:ml.tcp_failures)==null?void 0:gl.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(kl=(yl=c.healthchecks.passive)==null?void 0:yl.unhealthy)!=null&&kl.http_statuses?l(((Cl=(bl=c.healthchecks.passive)==null?void 0:bl.unhealthy)==null?void 0:Cl.http_statuses)||[]):Nt,h},getDefaultUpstreamFields:n,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const pe={useI18n:Ic,useMultiselectCreation:$e,useHelpers:Ze},Ve="/v2/control-planes/{controlPlaneId}/core-entities",Be="/{workspace}",Ie={list:{konnect:`${Ve}/upstreams`,kongManager:`${Be}/upstreams`},form:{konnect:{getServices:`${Ve}/services`,getCertificates:`${Ve}/certificates`,validate:`${Ve}/v1/schemas/json/upstream/validate`,create:`${Ve}/upstreams`,edit:`${Ve}/upstreams/{id}`},kongManager:{getServices:`${Be}/services`,getCertificates:`${Be}/certificates`,validate:`${Be}/schemas/upstreams/validate`,create:`${Be}/upstreams`,edit:`${Be}/upstreams/{id}`}}},Fc={class:"kong-ui-entities-upstreams-list"},Oc={class:"upstream-name"},$c=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:r}){var Z;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),i=tt.useRouter(),{axiosInstance:o}=Je((Z=l.config)==null?void 0:Z.axiosRequestConfig),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var D,K;let v=`${l.config.apiBaseUrl}${Ie.list[l.config.app]}`;return l.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((D=l.config)==null?void 0:D.controlPlaneId)||""):l.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(K=l.config)!=null&&K.workspace?`/${l.config.workspace}`:"")),v}),m=t.ref(""),s=t.computed(()=>{const v=l.config.app==="konnect"||l.config.isExactMatch;if(v)return{isExactMatch:v,placeholder:n("upstreams.search.placeholder")};const{name:D,slots:K}=h;return{isExactMatch:v,fields:{name:D,slots:K},schema:l.config.filterSchema}}),{fetcher:S,fetcherState:N}=Ya(l.config,u.value),g=()=>{m.value=""},_=()=>{d.value++},T=t.ref(null),B=(v,D)=>{const K=v.id;if(!D(K)){a("copy:error",{entity:v,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:v,field:"id",message:n("upstreams.copy.success",{val:K})})},I=(v,D)=>{const K=JSON.stringify(v);if(!D(K)){a("copy:error",{entity:v,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:v,message:n("upstreams.copy.success_brief")})},A=async v=>{var K;await((K=l.canRetrieve)==null?void 0:K.call(l,v))&&i.push(l.config.getViewRoute(v.id))},f=v=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(v)}),b=v=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(v)}),x=t.ref(void 0),V=t.ref(!1),w=t.ref(!1),E=t.ref(""),H=Qa(l.config,u.value),$=v=>{x.value=v,V.value=!0},U=()=>{V.value=!1},O=async()=>{var v,D,K;if((v=x.value)!=null&&v.id){w.value=!0;try{await o.delete(H(x.value.id)),w.value=!1,V.value=!1,d.value++,a("delete:success",x.value)}catch(k){E.value=((K=(D=k.response)==null?void 0:D.data)==null?void 0:K.message)||k.message||n("upstreams.errors.delete"),a("error",k)}finally{w.value=!1}}},F=t.ref(!1);t.watch(N,v=>{var D,K,k,y;if(Array.isArray((D=v==null?void 0:v.response)==null?void 0:D.data)&&(F.value=v.response.data.length>0),v.status===fe.Error){T.value={title:n("upstreams.errors.general")},(y=(k=(K=v.error)==null?void 0:K.response)==null?void 0:k.data)!=null&&y.message&&(T.value.message=v.error.response.data.message),a("error",v.error);return}T.value=null});const j=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(j.value.title=n("upstreams.list.empty_state.title"),j.value.ctaText=n("upstreams.actions.create"))}),(v,D)=>{const K=t.resolveComponent("KButton"),k=t.resolveComponent("KBadge"),y=t.resolveComponent("KTruncate"),C=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Fc,[t.createVNode(t.unref(Ra),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":T.value,fetcher:t.unref(S),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:m.value,"table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onClearSearchInput:g,"onClick:row":D[1]||(D[1]=M=>A(M)),onSort:_},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(nc),{modelValue:m.value,"onUpdate:modelValue":D[0]||(D[0]=M=>m.value=M),config:s.value},null,8,["modelValue","config"])]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(he),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createVNode(t.unref(bt)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,F.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:t.withCtx(({rowValue:M})=>[t.createElementVNode("span",Oc,t.toDisplayString(M),1)]),tags:t.withCtx(({rowValue:M})=>[t.createVNode(y,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M,z=>(t.openBlock(),t.createBlock(k,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:M})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(C,{"data-testid":"action-entity-copy-id",onClick:ee=>B(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(C,{"data-testid":"action-entity-copy-json",onClick:ee=>I(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(he),{"auth-function":()=>e.canRetrieve(M)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-view","has-divider":"",item:f(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canEdit(M)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-edit",item:b(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canDelete(M)},{default:t.withCtx(()=>[t.createVNode(C,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>$(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(za),{"action-pending":w.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":x.value&&(x.value.name||x.value.id),"entity-type":t.unref(at).Upstream,error:E.value,title:t.unref(n)("upstreams.delete.title"),visible:V.value,onCancel:U,onProceed:O},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),ue=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Uc=ue($c,[["__scopeId","data-v-9f2efb47"]]),Ye="/v2/control-planes/{controlPlaneId}/core-entities",Ge="/{workspace}",Xe={list:{konnect:`${Ye}/upstreams/{upstreamId}/targets`,kongManager:`${Ge}/upstreams/{upstreamId}/targets`},form:{konnect:{create:`${Ye}/upstreams/{upstreamId}/targets`,edit:`${Ye}/upstreams/{upstreamId}/targets/{id}`,validate:`${Ye}/v1/schemas/json/target/validate`},kongManager:{create:`${Ge}/upstreams/{upstreamId}/targets`,edit:`${Ge}/upstreams/{upstreamId}/targets/{id}`,validate:`${Ge}/schemas/targets/validate`}}},Dc={class:"kong-ui-entities-target-form"},Mc={class:"target-form-container"},jc={key:0,class:"target-form-info"},lr=ue(t.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var A;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),{getMessageFromError:i}=Za(),{axiosInstance:o}=Je((A=l.config)==null?void 0:A.axiosRequestConfig),d=t.computed(()=>{var f;return Xe.form[l.config.app].edit.replace(/{upstreamId}/gi,((f=l.config)==null?void 0:f.upstreamId)||"")}),c=t.computed(()=>l.targetId?ie.Edit:ie.Create),h=t.computed(()=>c.value===ie.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),p=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),m={target:"",weight:100,tags:""},s=t.computed(()=>{const f=parseInt(p.fields.weight.toString(),10);return f<0||f>65535}),S=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),N=f=>{var b;p.fields.target=(f==null?void 0:f.target)||"",p.fields.weight=(f==null?void 0:f.weight)??"",p.fields.tags=((b=f==null?void 0:f.tags)==null?void 0:b.join(", "))||"",Object.assign(u,p.fields)},g=()=>{p.errorMessage="",a("cancel")},_=t.computed(()=>{var b,x;let f=`${l.config.apiBaseUrl}${Xe.form[l.config.app].validate}`;return l.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((b=l.config)==null?void 0:b.controlPlaneId)||""):l.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(x=l.config)!=null&&x.workspace?`/${l.config.workspace}`:"")),f=f.replace(/{id}/gi,l.targetId),f}),T=t.computed(()=>{var b,x,V,w;let f=`${l.config.apiBaseUrl}${Xe.form[l.config.app][c.value]}`;return l.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((b=l.config)==null?void 0:b.controlPlaneId)||"").replace(/{upstreamId}/gi,((x=l.config)==null?void 0:x.upstreamId)||""):l.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(V=l.config)!=null&&V.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((w=l.config)==null?void 0:w.upstreamId)||"")),f=f.replace(/{id}/gi,l.targetId),f}),B=t.computed(()=>{var f,b,x;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(x=(b=(f=p.fields.tags)==null?void 0:f.split(","))==null?void 0:b.map(V=>String(V||"").trim()))==null?void 0:x.filter(V=>V!==""),upstream:{id:l.config.upstreamId}}}),I=async()=>{var f,b;try{p.isReadonly=!0,p.errorMessage="";let x;if(await o.post(_.value,B.value),c.value==="create"?x=await o.post(T.value,B.value):c.value==="edit"&&(x=((f=l.config)==null?void 0:f.app)==="konnect"?await o.put(T.value,B.value):await o.patch(T.value,B.value)),x){const{data:V}=x;p.fields.target=(V==null?void 0:V.name)||"",p.fields.weight=(V==null?void 0:V.weight)??100,p.fields.tags=((b=V==null?void 0:V.tags)==null?void 0:b.join(", "))||"",a("update",V),Object.assign(p.fields,m)}}catch(x){p.errorMessage=i(x),a("error",x)}finally{p.isReadonly=!1}};return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,m)}),(f,b)=>{const x=t.resolveComponent("KInput"),V=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(V,{"action-button-disabled":!S.value||p.isReadonly,"action-button-text":t.unref(n)("targets.form.buttons.save"),"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),title:h.value,visible:e.isVisible,onCancel:g,onProceed:I},{default:t.withCtx(()=>[t.createElementVNode("div",Dc,[t.createVNode(t.unref(Pa),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":B.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":b[3]||(b[3]=w=>f.$emit("error",w)),"onFetch:success":N,onLoading:b[4]||(b[4]=w=>f.$emit("loading",w))},{default:t.withCtx(()=>[t.createElementVNode("div",Mc,[f.$slots.info?(t.openBlock(),t.createElementBlock("div",jc,[t.renderSlot(f.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(x,{modelValue:p.fields.target,"onUpdate:modelValue":b[0]||(b[0]=w=>p.fields.target=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(x,{modelValue:p.fields.weight,"onUpdate:modelValue":b[1]||(b[1]=w=>p.fields.weight=w),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:p.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(x,{modelValue:p.fields.tags,"onUpdate:modelValue":b[2]||(b[2]=w=>p.fields.tags=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-cfae2d2a"]]),Kc={class:"kong-ui-entities-targets-list"},Lc={class:"target-address"},Pc=ue(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var K;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),{axiosInstance:i}=Je((K=l.config)==null?void 0:K.axiosRequestConfig),o=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:n("targets.list.table_headers.target_address"),sortable:!0,hidable:!1},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var y,C,R,M;let k=`${l.config.apiBaseUrl}${Xe.list[l.config.app]}`;return l.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((y=l.config)==null?void 0:y.controlPlaneId)||"").replace(/{upstreamId}/gi,((C=l.config)==null?void 0:C.upstreamId)||""):l.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(R=l.config)!=null&&R.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((M=l.config)==null?void 0:M.upstreamId)||"")),k}),{fetcher:u,fetcherState:m}=Ya(l.config,p.value),s=()=>{o.value++},S=t.ref(null),N=()=>{j.value=!0},g=(k,y)=>{const C=k.id;if(!y(C)){a("copy:error",{entity:k,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:k,field:"id",message:n("targets.copy.success",{val:C})})},_=(k,y)=>{const C=JSON.stringify(k);if(!y(C)){a("copy:error",{entity:k,message:n("targets.errors.copy")});return}a("copy:success",{entity:k,message:n("targets.copy.success_brief")})},T=k=>{F.value=k,j.value=!0},B=k=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(k),I=k=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(k),A=t.ref(void 0),f=t.ref(!1),b=t.ref(!1),x=t.ref(""),V=Qa(l.config,p.value),w=k=>{A.value=k,f.value=!0},E=()=>{f.value=!1},H=async()=>{var k,y,C;if((k=A.value)!=null&&k.id){b.value=!0;try{await i.delete(V(A.value.id)),b.value=!1,f.value=!1,o.value++,a("delete:success",A.value)}catch(R){x.value=((C=(y=R.response)==null?void 0:y.data)==null?void 0:C.message)||R.message||n("targets.errors.delete"),a("error",R)}finally{b.value=!1}}},$=t.ref(!1);t.watch(m,k=>{var y,C,R,M;if(Array.isArray((y=k==null?void 0:k.response)==null?void 0:y.data)&&($.value=k.response.data.length>0),k.status===fe.Error){S.value={title:n("targets.errors.general")},(M=(R=(C=k.error)==null?void 0:C.response)==null?void 0:R.data)!=null&&M.message&&(S.value.message=k.error.response.data.message),a("error",k.error);return}S.value=null});const U=t.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(U.value.title=n("targets.list.empty_state.title"),U.value.ctaText=n("targets.actions.create"))});const O=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,axiosRequestConfig:l.config.axiosRequestConfig,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace}})),F=t.ref(""),j=t.ref(!1),Z=k=>{F.value?a("update:target",k):a("create:target",k),v()},v=()=>{D(),o.value++},D=()=>{j.value=!1,F.value=""};return(k,y)=>{const C=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),M=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),ee=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Kc,[t.createVNode(t.unref(Ra),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":U.value,"enable-entity-actions":"","error-message":S.value,fetcher:t.unref(u),"fetcher-cache-key":o.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:y[1]||(y[1]=()=>l.config.createRoute?void 0:N()),onSort:s},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(he),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(C,{appearance:"primary","data-testid":"toolbar-new-target",to:l.config.createRoute?l.config.createRoute:void 0,onClick:y[0]||(y[0]=()=>l.config.createRoute?void 0:N())},{default:t.withCtx(()=>[t.createVNode(t.unref(bt)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,$.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:P})=>[t.createElementVNode("span",Lc,t.toDisplayString(P),1)]),tags:t.withCtx(({rowValue:P})=>[t.createVNode(M,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P,ae=>(t.openBlock(),t.createBlock(R,{key:ae,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ae),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:P})=>[t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:ke=>g(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:ke=>_(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(he),{"auth-function":()=>e.canEdit(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:ae=>T(P.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>B(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:ae=>a("health-actions:healthy",P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>I(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:ae=>a("health-actions:unhealthy",P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canDelete(P)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ae=>w(P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(za),{"action-pending":b.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(at).Target,error:x.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:f.value,onCancel:E,onProceed:H},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(lr,{config:O.value,"is-visible":j.value,"target-id":F.value,onCancel:D,onUpdate:Z},t.createSlots({_:2},[k.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(k.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-e6ed1cfb"]]),Rc={key:1},zc=ue(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var E,H,$,U;const{i18nT:a,i18n:{t:l}}=pe.useI18n(),n=e,i=r,{debouncedQueryChange:o,loading:d,loadItems:c,results:h,allRecords:p}=Ga(n.config,(H=Ie.form[(E=n.config)==null?void 0:E.app])==null?void 0:H.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:m,loadItems:s,results:S}=Ga(n.config,(U=Ie.form[($=n.config)==null?void 0:$.app])==null?void 0:U.getCertificates),N=t.ref(""),g=t.computed(()=>{var O;return!!n.name&&!((O=p.value)!=null&&O.some(F=>F.host===n.name))}),_=t.computed(()=>{var F,j,Z;const O=g.value&&n.name.includes((F=N.value)==null?void 0:F.toLowerCase());return(Z=h.value)==null?void 0:Z.map(v=>({label:v.host,value:v.id})).concat(O?[{label:n.name,value:((j=I.value)==null?void 0:j.value)||n.name}]:[])}),T=t.computed(()=>{var O;return(O=S.value)==null?void 0:O.map(F=>({label:F.id,value:F.id}))}),B=t.ref(""),I=t.ref({value:"",label:""}),A=t.computed(()=>{var O,F;return((O=_.value.find(j=>j.value===B.value))==null?void 0:O.label)||((F=I.value)==null?void 0:F.label)}),f=O=>{N.value=O,o(O)},b=O=>{I.value=O},x=()=>{I.value={value:"",label:""}},V=O=>{B.value=O,i("update:name",A.value)},w=t.ref(!1);return t.onBeforeMount(async()=>{var O,F;try{w.value=!0,await c(),n.name&&(B.value=((F=(O=_.value.find(j=>j.label===n.name))==null?void 0:O.value)==null?void 0:F.toString())||n.name),await s()}finally{w.value=!1}}),(O,F)=>{const j=t.resolveComponent("KSkeleton"),Z=t.resolveComponent("KSelect"),v=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[w.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",Rc,[t.createVNode(Z,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:_.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":B.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:b,onItemRemoved:x,onQueryChange:f,"onUpdate:modelValue":V},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(v,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":F[0]||(F[0]=D=>i("update:host-header",D))},null,8,["label","model-value","readonly"]),t.createVNode(Z,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:T.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(m),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":F[1]||(F[1]=D=>i("update:client-certificate",D))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(v,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":F[2]||(F[2]=D=>i("update:tags",D))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),et={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},Jc={class:"fields-group-title"},Wc={class:"fields-group-text"},Qc={class:"fields-group-title"},Zc={class:"fields-group-text"},Yc=ue(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=pe.useI18n(),{inRange:n}=Ze(),i=e,o=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>i.hashOn,(u,m)=>{m==="header"&&u!==m&&o("update:hash-on-header",""),m==="cookie"&&u!==m&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),m==="query_arg"&&u!==m&&o("update:hash-on-query-argument",""),m==="uri_capture"&&u!==m&&o("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(o("update:hash-fallback","none"),o("update:hash-fallback-header",""),o("update:hash-fallback-query-argument",""),o("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,m)=>{m==="header"&&u!==m&&o("update:hash-fallback-header",""),m==="cookie"&&u!==m&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),m==="query_arg"&&u!==m&&o("update:hash-fallback-query-argument",""),m==="uri_capture"&&u!==m&&o("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?n(i.slots,Ct,wt)?"":l("upstreams.form.errors.in_range"):"");return(u,m)=>{const s=t.resolveComponent("KExternalLink"),S=t.resolveComponent("KSelect"),N=t.resolveComponent("KInput"),g=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(S,{class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[0]||(m[0]=_=>o("update:algorithm",_))},null,8,["items","label","model-value","readonly"]),t.createVNode(N,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(wt),min:t.unref(Ct),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":m[1]||(m[1]=_=>o("update:slots",_))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Jc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",Wc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(S,{class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[2]||(m[2]=_=>o("update:hash-on",_))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(N,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[3]||(m[3]=_=>o("update:hash-on-header",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(N,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[4]||(m[4]=_=>o("update:hash-on-cookie",_))},null,8,["label","model-value","readonly"]),t.createVNode(N,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[5]||(m[5]=_=>o("update:hash-on-cookie-path",_))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(N,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[6]||(m[6]=_=>o("update:hash-on-query-argument",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(N,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[7]||(m[7]=_=>o("update:hash-on-uri-capture",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Qc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",Zc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(S,{class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[8]||(m[8]=_=>o("update:hash-fallback",_))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(N,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[9]||(m[9]=_=>o("update:hash-fallback-header",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(N,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[10]||(m[10]=_=>o("update:hash-on-cookie",_))},null,8,["label","model-value","readonly"]),t.createVNode(N,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[11]||(m[11]=_=>o("update:hash-on-cookie-path",_))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(N,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[12]||(m[12]=_=>o("update:hash-fallback-query-argument",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(N,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[13]||(m[13]=_=>o("update:hash-fallback-uri-capture",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),Gc={class:"fields-group-title"},Xc={class:"fields-group-text"},ed={class:"fields-group-title"},td={class:"fields-group-text"},ad=ue(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),l=r;return(n,i)=>{const o=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(o,{"hide-icon":"",href:t.unref(et).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Gc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",Xc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:i[0]||(i[0]=p=>l("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",ed,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",td,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:i[1]||(i[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(Ac),min:t.unref(Tc),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),rd="#d60027",ld={key:2},nd={class:"fields-group-title"},od={class:"fields-group-text"},id={class:"fields-group-title"},sd={class:"fields-group-text"},cd=ue(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),{objectsAreEqual:l}=Ze(),n=e,i=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:h}=$e({replaceId:!0}),{trackNewItems:p}=$e({replaceId:!0});t.watch(()=>n.type,(N,g)=>{g==="tcp"&&N!==g&&i("update:tcp-failures","5"),(g==="https"||g==="grpcs")&&N!==g&&(i("update:https-sni",""),i("update:verify-ssl",!1)),g!=="tcp"&&N==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",St),i("update:unhealthy-http-statuses",xt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,N=>{l(u.value,N)||(u.value=[...N])},{immediate:!0,deep:!0});const m=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),m()},S=N=>{N===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(N,1),m()};return(N,g)=>{const _=t.resolveComponent("KExternalLink"),T=t.resolveComponent("KSelect"),B=t.resolveComponent("KInput"),I=t.resolveComponent("KCheckbox"),A=t.resolveComponent("KLabel"),f=t.resolveComponent("KButton"),b=t.resolveComponent("KMultiselect"),x=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(_,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var V;return[t.createVNode(T,{class:"active-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":g[0]||(g[0]=w=>i("update:type",w))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(B,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":g[1]||(g[1]=w=>i("update:http-path",w))},null,8,["label","model-value","readonly"])),t.createVNode(B,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(Ec),min:t.unref(Hc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":g[2]||(g[2]=w=>i("update:timeout",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(B,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(vc),min:t.unref(qc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":g[3]||(g[3]=w=>i("update:concurrency",w))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":g[4]||(g[4]=w=>i("update:https-sni",w))},null,8,["label","model-value","readonly"]),t.createVNode(I,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":g[5]||(g[5]=w=>i("update:verify-ssl",w))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((V=e.config)==null?void 0:V.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",ld,[t.createVNode(A,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(w,E)=>(t.openBlock(),t.createElementBlock("div",{key:`${w.header}_${E}`,class:t.normalizeClass(["headers-row",{"margin-top-6":E>0}])},[t.createVNode(B,{modelValue:u.value[E].key,"onUpdate:modelValue":H=>u.value[E].key=H,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${E+1}`,readonly:e.readonly,type:"text",onBlur:m},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(B,{modelValue:u.value[E].values,"onUpdate:modelValue":H=>u.value[E].values=H,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${E+1}`,readonly:e.readonly,type:"text",onBlur:m},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(f,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",disabled:u.value.length===1,icon:"",onClick:H=>S(E)},{default:t.withCtx(()=>[t.createVNode(t.unref(Vc),{class:"delete-item",color:u.value.length>1?t.unref(rd):void 0},null,8,["color"])]),_:2},1032,["disabled","onClick"]),u.value&&E===u.value.length-1?(t.openBlock(),t.createBlock(f,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",icon:"",onClick:s},{default:t.withCtx(()=>[t.createVNode(t.unref(bt))]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",nd,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",od,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(rr),min:t.unref(ar),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[6]||(g[6]=w=>i("update:interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(B,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":g[7]||(g[7]=w=>i("update:successes",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[8]||(g[8]=w=>t.unref(h)(w,!0)),onItemRemoved:g[9]||(g[9]=w=>t.unref(h)(w,!1)),"onUpdate:modelValue":g[10]||(g[10]=w=>i("update:http-statuses",w))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",id,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",sd,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(rr),min:t.unref(ar),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[11]||(g[11]=w=>i("update:unhealthy-interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[12]||(g[12]=w=>i("update:tcp-failures",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(B,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[13]||(g[13]=w=>i("update:http-failures",w))},null,8,["label","max","min","model-value","readonly"])),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(b,{key:1,autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[14]||(g[14]=w=>t.unref(p)(w,!0)),onItemRemoved:g[15]||(g[15]=w=>t.unref(p)(w,!1)),"onUpdate:modelValue":g[16]||(g[16]=w=>i("update:unhealthy-http-statuses",w))},null,8,["items","label","model-value","readonly"])),t.createVNode(B,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(tr),min:t.unref(er),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":g[17]||(g[17]=w=>i("update:unhealthy-timeouts",w))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-efccf560"]]),dd={class:"fields-group-title"},hd={class:"fields-group-text"},pd={class:"fields-group-title"},ud={class:"fields-group-text"},fd=ue(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),l=e,n=r,i=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),o=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=$e({replaceId:!0}),{trackNewItems:c}=$e({replaceId:!0});return t.watch(()=>l.type,(h,p)=>{p==="tcp"&&h!==p&&n("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(n("update:http-statuses",_t),n("update:unhealthy-http-statuses",Nt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),m=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),S=t.resolveComponent("KMultiselect"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(m,{class:"passive-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=g=>n("update:type",g))},null,8,["items","label","model-value","readonly"]),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",dd,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",hd,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=g=>n("update:successes",g))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=g=>t.unref(d)(g,!0)),onItemRemoved:p[3]||(p[3]=g=>t.unref(d)(g,!1)),"onUpdate:modelValue":p[4]||(p[4]=g=>n("update:http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",pd,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",ud,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(tr),min:t.unref(er),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=g=>n("update:timeouts",g))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(s,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=g=>n("update:tcp-failures",g))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(s,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=g=>n("update:http-failures",g))},null,8,["label","max","min","model-value","readonly"])),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:1,autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=g=>t.unref(c)(g,!0)),onItemRemoved:p[9]||(p[9]=g=>t.unref(c)(g,!1)),"onUpdate:modelValue":p[10]||(p[10]=g=>n("update:unhealthy-http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-5bd9952e"]]),md={class:"kong-ui-entities-upstreams-form"},gd=ue(t.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:r}){var K;const a=e,l=r,{inRange:n,stringToNumberArray:i,upstreamsResponseToFields:o,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=Ze(),{axiosInstance:p}=Je((K=a.config)==null?void 0:K.axiosRequestConfig),{getMessageFromError:u}=Za(),m=tt.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),S=t.reactive(d()),N=t.computed(()=>!c(s.fields,S)),g=k=>{s.fields.activeHealthCheck.interval=k?"5":"0",s.fields.activeHealthCheck.successes=k?"5":"0",s.fields.activeHealthCheck.httpFailures=k?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=k?"5":"0",s.fields.activeHealthCheck.tcpFailures=k?"5":"0"},_=k=>{s.fields.passiveHealthCheck.timeouts=k?"5":"0",s.fields.passiveHealthCheck.successes=k?"80":"0",s.fields.passiveHealthCheck.tcpFailures=k?"5":"0",s.fields.passiveHealthCheck.httpFailures=k?"5":"0"},T=t.computed(()=>s.fields.slots?n(s.fields.slots,Ct,wt):!0),B=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),I=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),A=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),f=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),b=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),x=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),V=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),w=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),E=t.computed(()=>!!s.fields.name&&T.value&&B.value&&I.value&&A.value&&f.value&&b.value&&x.value&&V.value&&w.value),H=t.computed(()=>a.upstreamId?ie.Edit:ie.Create),$=t.computed(()=>{var k,y;return(y=Ie.form[(k=a.config)==null?void 0:k.app])==null?void 0:y.edit}),U=k=>{Object.assign(s.fields,o(k)),Object.assign(S,h(s.fields))},O=()=>{var k;m.push(((k=a.config)==null?void 0:k.cancelRoute)||{name:"upstreams-list"})},F=k=>{l("loading",k)},j=k=>{l("error",k)},Z=t.computed(()=>{var y,C,R,M,z;const k={name:s.fields.name,slots:Number(s.fields.slots),algorithm:s.fields.algorithm,hash_on:s.fields.hashOn,hash_fallback:s.fields.hashFallback,healthchecks:{}};return s.fields.hostHeader&&(k.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(k.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(k.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(k.tags=(C=(y=s.fields.tags.split(","))==null?void 0:y.map(ee=>String(ee||"").trim()))==null?void 0:C.filter(ee=>ee!=="")),s.fields.hashOn==="header"&&(k.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(k.hash_on_cookie=s.fields.hashOnCookie,k.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(k.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(k.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(k.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(k.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(k.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(k.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(k.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(k.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(k.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?k.healthchecks.active.headers=[]:k.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((ee,P)=>{var ae,ke;return P.key?{...ee,[P.key]:(ke=(ae=P.values.split(","))==null?void 0:ae.map(Te=>String(Te||"").trim()))==null?void 0:ke.filter(Te=>Te!=="")}:{...ee}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(k.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(k.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(k.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(k.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(k.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(k.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(k.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(k.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.tcpFailures&&(k.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((M=a.config)==null?void 0:M.app)==="kongManager"&&H.value===ie.Edit&&(k.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0,successes:0},unhealthy:{interval:0,http_failures:0,tcp_failures:0}}),s.fields.passiveHealthSwitch?(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(k.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(k.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(k.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(k.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.tcpFailures&&(k.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&H.value===ie.Edit&&(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),k}),v=k=>{var C,R,M,z,ee,P;let y=`${(C=a.config)==null?void 0:C.apiBaseUrl}${Ie.form[(R=a.config)==null?void 0:R.app][k]}`;return((M=a.config)==null?void 0:M.app)==="konnect"?y=y.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((ee=a.config)==null?void 0:ee.app)==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(P=a.config)!=null&&P.workspace?`/${a.config.workspace}`:"")),y=y.replace(/{id}/gi,a.upstreamId),y},D=async()=>{var k;try{s.readonly=!0,await p.post(v("validate"),Z.value);let y;H.value===ie.Create?y=await p.post(v("create"),Z.value):H.value===ie.Edit&&(y=((k=a.config)==null?void 0:k.app)==="konnect"?await p.put(v("edit"),Z.value):await p.patch(v("edit"),Z.value)),l("update",y==null?void 0:y.data)}catch(y){s.errorMessage=u(y),l("error",y)}finally{s.readonly=!1}};return(k,y)=>(t.openBlock(),t.createElementBlock("div",md,[t.createVNode(t.unref(Pa),{"can-submit":E.value&&N.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":$.value,"form-fields":Z.value,"is-readonly":s.readonly,onCancel:O,"onFetch:error":j,"onFetch:success":U,onLoading:F,onSubmit:D},{default:t.withCtx(()=>[t.createVNode(zc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":y[0]||(y[0]=C=>s.fields.clientCertificate=C),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":y[1]||(y[1]=C=>s.fields.hostHeader=C),name:s.fields.name,"onUpdate:name":y[2]||(y[2]=C=>s.fields.name=C),tags:s.fields.tags,"onUpdate:tags":y[3]||(y[3]=C=>s.fields.tags=C),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(Yc,{algorithm:s.fields.algorithm,"onUpdate:algorithm":y[4]||(y[4]=C=>s.fields.algorithm=C),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":y[5]||(y[5]=C=>s.fields.hashFallback=C),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":y[6]||(y[6]=C=>s.fields.hashFallbackHeader=C),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":y[7]||(y[7]=C=>s.fields.hashFallbackQueryArgument=C),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":y[8]||(y[8]=C=>s.fields.hashFallbackUriCapture=C),"hash-on":s.fields.hashOn,"onUpdate:hashOn":y[9]||(y[9]=C=>s.fields.hashOn=C),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":y[10]||(y[10]=C=>s.fields.hashOnCookie=C),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":y[11]||(y[11]=C=>s.fields.hashOnCookiePath=C),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":y[12]||(y[12]=C=>s.fields.hashOnHeader=C),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":y[13]||(y[13]=C=>s.fields.hashOnQueryArgument=C),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":y[14]||(y[14]=C=>s.fields.hashOnUriCapture=C),slots:s.fields.slots,"onUpdate:slots":y[15]||(y[15]=C=>s.fields.slots=C),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(ad,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[y[16]||(y[16]=C=>s.fields.activeHealthSwitch=C),g],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":y[17]||(y[17]=C=>s.fields.healthchecksThreshold=C),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[y[18]||(y[18]=C=>s.fields.passiveHealthSwitch=C),_],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(cd,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":y[19]||(y[19]=C=>s.fields.activeHealthCheck.concurrency=C),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":y[20]||(y[20]=C=>s.fields.activeHealthCheck.headers=C),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":y[21]||(y[21]=C=>s.fields.activeHealthCheck.httpFailures=C),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":y[22]||(y[22]=C=>s.fields.activeHealthCheck.httpPath=C),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[23]||(y[23]=C=>s.fields.activeHealthCheck.httpStatuses=C),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":y[24]||(y[24]=C=>s.fields.activeHealthCheck.httpsSni=C),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":y[25]||(y[25]=C=>s.fields.activeHealthCheck.interval=C),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":y[26]||(y[26]=C=>s.fields.activeHealthCheck.successes=C),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[27]||(y[27]=C=>s.fields.activeHealthCheck.tcpFailures=C),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":y[28]||(y[28]=C=>s.fields.activeHealthCheck.timeout=C),type:s.fields.activeHealthCheck.type,"onUpdate:type":y[29]||(y[29]=C=>s.fields.activeHealthCheck.type=C),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[30]||(y[30]=C=>s.fields.activeHealthCheck.unhealthyHttpStatuses=C),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":y[31]||(y[31]=C=>s.fields.activeHealthCheck.unhealthyInterval=C),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":y[32]||(y[32]=C=>s.fields.activeHealthCheck.unhealthyTimeouts=C),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":y[33]||(y[33]=C=>s.fields.activeHealthCheck.verifySsl=C),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(fd,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":y[34]||(y[34]=C=>s.fields.passiveHealthCheck.httpFailures=C),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[35]||(y[35]=C=>s.fields.passiveHealthCheck.httpStatuses=C),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":y[36]||(y[36]=C=>s.fields.passiveHealthCheck.successes=C),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[37]||(y[37]=C=>s.fields.passiveHealthCheck.tcpFailures=C),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":y[38]||(y[38]=C=>s.fields.passiveHealthCheck.timeouts=C),type:s.fields.passiveHealthCheck.type,"onUpdate:type":y[39]||(y[39]=C=>s.fields.passiveHealthCheck.type=C),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[40]||(y[40]=C=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=C),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-0f247a1c"]]),yd=t.createElementVNode("code",null,"10",-1),kd=t.createElementVNode("code",null,"65536",-1),bd={"data-testid":"client_certificate-plain-text"},Cd=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=pe.useI18n(),{getPropValue:n}=yc(),i=t.computed(()=>Ie.form[r.config.app].edit),o=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:J.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:J.Basic},hash_on:{order:7,section:J.Basic},hash_on_header:{order:8,section:J.Basic},hash_on_uri_capture:{order:9,section:J.Basic},hash_on_query_arg:{order:10,section:J.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:J.Basic},hash_on_cookie_path:{order:12,section:J.Basic},healthchecks:{order:13,section:J.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(As),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":o.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onFetch:error":c[0]||(c[0]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[1]||(c[1]=h=>d.$emit("fetch:success",h)),onLoading:c[2]||(c[2]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(h.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[yd]),max:t.withCtx(()=>[kd]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",bd,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(n)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});re.TargetForm=lr,re.TargetsList=Pc,re.UpstreamsConfigCard=Cd,re.UpstreamsForm=gd,re.UpstreamsList=Uc,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
32
+ `:""}var Vi=Ni,Bi={dump:Vi};function kt(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var Ii=G,Ti=Pt,Ai=Wt,Hi=Xt,Ei=ea,qi=ct,vi=_a.load,Fi=_a.loadAll,Oi=Bi.dump,$i=le,Ui={binary:na,float:Gt,map:Jt,null:Qt,pairs:ia,set:sa,timestamp:ra,bool:Zt,int:Yt,merge:la,omap:oa,seq:zt,str:Rt},Di=kt("safeLoad","load"),Mi=kt("safeLoadAll","loadAll"),ji=kt("safeDump","dump"),Ki={Type:Ii,Schema:Ti,FAILSAFE_SCHEMA:Ai,JSON_SCHEMA:Hi,CORE_SCHEMA:Ei,DEFAULT_SCHEMA:qi,load:vi,loadAll:Fi,dump:Oi,YAMLException:$i,types:Ui,safeLoad:Di,safeLoadAll:Mi,safeDump:ji};const Li={class:"yaml-config"},La=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>{const l=Object.fromEntries(Object.entries(r.yamlRecord).filter(([,n])=>n!==null&&n!==""&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(l).length===0&&l.constructor===Object?"":Ki.dump(l).trim()});return(l,n)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Li,[r.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Pi={key:0,class:"config-card-display-form"},Ri=["data-testid"],zi={key:0,class:"config-card-prop-section-title"},Ji=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const r=e,a=t.useSlots(),{i18n:{t:l}}=Y.useI18n(),n=o=>!!(o.tooltip||a[`${o.key}-label-tooltip`]),i=t.computed(()=>{if(!r.record)return r.record;const o=JSON.parse(JSON.stringify(r.record));return delete o.created_at,delete o.updated_at,o});return(o,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Pi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,c=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${c}-props`,class:t.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(t.openBlock(),t.createElementBlock("div",zi,t.toDisplayString(c==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],h=>(t.openBlock(),t.createBlock(Dt,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(o.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[n(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Ri))),128))])):t.createCommentVNode("",!0),e.format==="json"&&r.record?(t.openBlock(),t.createBlock(Mt,{key:1,config:r.config,"fetcher-url":r.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&r.record?(t.openBlock(),t.createBlock(La,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),Wi=oe(Ji,[["__scopeId","data-v-2052238b"]]),ce="24px",Fe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Qi=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),Zi=["aria-hidden"],Yi={key:0,"data-testid":"kui-icon-svg-title"},Gi=Qi(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Xi=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Yi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Gi],8,Zi))]),_:1},8,["aria-hidden","style"]))}}),es=Fe(Xi,[["__scopeId","data-v-c1f7c39c"]]),ts=e=>(t.pushScopeId("data-v-fbe6ddff"),e=e(),t.popScopeId(),e),as=["aria-hidden"],rs={key:0,"data-testid":"kui-icon-svg-title"},ls=ts(()=>t.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),ns=t.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",rs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ls],8,as))]),_:1},8,["aria-hidden","style"]))}}),os=Fe(ns,[["__scopeId","data-v-fbe6ddff"]]),is=e=>(t.pushScopeId("data-v-745761f6"),e=e(),t.popScopeId(),e),ss=["aria-hidden"],cs={key:0,"data-testid":"kui-icon-svg-title"},ds=is(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),hs=t.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",cs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ds],8,ss))]),_:1},8,["aria-hidden","style"]))}}),ps=Fe(hs,[["__scopeId","data-v-745761f6"]]),us=e=>(t.pushScopeId("data-v-863d10eb"),e=e(),t.popScopeId(),e),fs=["aria-hidden"],ms={key:0,"data-testid":"kui-icon-svg-title"},gs=us(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),ys=t.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ms,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),gs],8,fs))]),_:1},8,["aria-hidden","style"]))}}),ks=Fe(ys,[["__scopeId","data-v-863d10eb"]]),bs=e=>(t.pushScopeId("data-v-d9894a05"),e=e(),t.popScopeId(),e),Cs=["aria-hidden"],ws={key:0,"data-testid":"kui-icon-svg-title"},Ss=bs(()=>t.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),_s=t.defineComponent({__name:"MoreIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon more-icon","data-testid":"kui-icon-wrapper-more-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-more-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ws,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Ss],8,Cs))]),_:1},8,["aria-hidden","style"]))}}),xs=Fe(_s,[["__scopeId","data-v-d9894a05"]]),Ns={class:"config-card-title","data-testid":"config-card-title"},Vs={class:"config-card-actions"},Bs=["href"],Is={class:"config-card-details-section"},Ts=t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:r}){var a;const l=r,n=e,{i18n:{t:i}}=Y.useI18n(),{getMessageFromError:o}=Y.useErrors(),{convertKeyToTitle:d}=Y.useStringHelpers(),{axiosInstance:c}=Y.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),h=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=f=>{p.value=f==null?void 0:f.value},m={id:{type:L.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:L.BadgeStatus,order:2,section:J.Basic},updated_at:{type:L.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:L.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:L.BadgeTag,order:-1,section:J.Basic}},s=t.ref(!1),S=t.ref(!1),N=t.ref(""),g=t.ref({}),_=t.computed(()=>{var f,b,x;if(!g.value)return[];const V=[],w=Object.keys(g.value).length;for(const E in g.value){const H=(b=(f=n.configSchema)==null?void 0:f[E])==null?void 0:b.order,$=(x=m[E])==null?void 0:x.order;let U=w;($||$===0)&&(U=$===-1?w+1:$),H&&(U=H===-1?w+1:H),V.push([E,U])}return V.sort(function(E,H){return E[1]-H[1]}),V.map(E=>{var H,$;const U=E[0],O=(H=g.value)==null?void 0:H[U],F=(($=n.configSchema)==null?void 0:$[U])||{},j=m[U];return{key:U,value:O,hidden:F.hidden||!1,type:F.type??((j==null?void 0:j.type)||L.Text),label:F.label??((j==null?void 0:j.label)||d(U)),tooltip:F.tooltip??((j==null?void 0:j.tooltip)||void 0),section:F.section??((j==null?void 0:j.section)||J.Advanced)}}).filter(E=>!E.hidden&&E.key!==n.pluginConfigKey)}),T=t.computed(()=>{var f,b;if(!g.value||!n.pluginConfigKey)return[];const x=g.value[n.pluginConfigKey]||{},V=Object.keys(x).length,w=[];for(const E in x){const H=(b=(f=n.pluginConfigSchema)==null?void 0:f[E])==null?void 0:b.order,$=x[E];let U=$!=null&&$!==""?V-1:V;H&&(U=H===-1?V+1:H),w.push([E,U])}return w.sort(function(E,H){return E[1]-H[1]}),w.map(E=>{var H;const $=E[0],U=x[$],O=((H=n.pluginConfigSchema)==null?void 0:H[$])||{};return{key:$,value:U,hidden:O.hidden||!1,type:O.type??L.Text,label:O.label??d($),tooltip:O.tooltip??void 0,section:J.Plugin}}).filter(E=>!E.hidden)}),I=t.computed(()=>{var f,b,x,V;return{basic:(f=_.value)==null?void 0:f.filter(w=>w.section===J.Basic),advanced:(b=_.value)==null?void 0:b.filter(w=>w.section===J.Advanced),plugin:(V=T.value)==null?void 0:V.concat((x=_.value)==null?void 0:x.filter(w=>w.section===J.Plugin))}}),B=t.computed(()=>{const f=[];return I.value.basic.length&&f.push("basic"),I.value.advanced.length&&f.push("advanced"),I.value.plugin.length&&f.push("plugin"),f}),A=t.computed(()=>{var f,b;let x=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((f=n.config)==null?void 0:f.controlPlaneId)||""):n.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(b=n.config)!=null&&b.workspace?`/${n.config.workspace}`:"")),x=x.replace(/{id}/gi,n.config.entityId),x});return t.watch(s,f=>{l("loading",f)},{immediate:!0}),t.onBeforeMount(async()=>{S.value=!1,s.value=!0;try{const{data:f}=await c.get(A.value);if(n.dataKey)if(typeof f[n.dataKey]<"u")g.value={...f[n.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:n.dataKey}));else g.value={...f};Object.keys(n.configSchema).filter(b=>n.configSchema[b].forceShow).forEach(b=>{g.value&&typeof g.value[b]>"u"&&(g.value[b]=null)}),l("fetch:success",f)}catch(f){const b=o(f);N.value=b.startsWith("code")?i("baseConfigCard.errors.load"):b,S.value=!0,l("fetch:error",f)}finally{s.value=!1}}),(f,b)=>{const x=t.resolveComponent("KLabel"),V=t.resolveComponent("KSelect"),w=t.resolveComponent("KButton"),E=t.resolveComponent("KSkeleton"),H=t.resolveComponent("KEmptyState"),$=t.resolveComponent("KCard");return t.openBlock(),t.createBlock($,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Vs,[t.renderSlot(f.$slots,"actions",{},void 0,!0),t.createVNode(x,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(V,{"data-testid":"select-config-format",items:h,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(w,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(os),{size:t.unref(on)},null,8,["size"])],8,Bs)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[s.value?(t.openBlock(),t.createBlock(E,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):S.value?(t.openBlock(),t.createBlock(H,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(N.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",Is,[t.createVNode(Wi,{config:e.config,"fetcher-url":A.value,format:p.value,"prop-list-types":B.value,"property-collections":I.value,record:g.value},t.createSlots({_:2},[t.renderList(Object.keys(f.$slots),U=>({name:U,fn:t.withCtx(({row:O,rowValue:F})=>[t.renderSlot(f.$slots,U,{row:O,rowValue:F},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("span",Ns,[t.renderSlot(f.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),As=oe(Ts,[["__scopeId","data-v-f40a683b"]]),Hs=["novalidate"],Es={class:"form-actions","data-testid":"form-actions"},qs=t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,i=tt.useRouter(),{i18n:{t:o}}=Y.useI18n(),{getMessageFromError:d}=Y.useErrors(),{axiosInstance:c}=Y.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),m=t.computed(()=>n.canSubmit===!1||n.isReadonly),s=t.ref(!1),S=t.computed(()=>{var B,A;let f=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((B=n.config)==null?void 0:B.controlPlaneId)||""):n.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(A=n.config)!=null&&A.workspace?`/${n.config.workspace}`:"")),n.editId?(f=f.replace(/{id}/gi,n.editId),f):(f=f.replace(/\/{id}/gi,""),f)}),N=()=>{s.value=!s.value},g=()=>{n.config.cancelRoute?i.push(n.config.cancelRoute):_()},_=()=>{l("cancel")},T=()=>{m.value||l("submit")},I=t.ref([{title:o("baseForm.configuration.yaml"),hash:"#yaml"},{title:o("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,B=>{l("loading",B)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{p.value=!1,h.value=!0;const{data:B}=await c.get(S.value);l("fetch:success",B)}catch(B){const A=d(B);u.value=A.startsWith("code")?o("baseForm.errors.edit"):A,p.value=!0,l("fetch:error",B)}finally{h.value=!1}}),(B,A)=>{const f=t.resolveComponent("KSkeleton"),b=t.resolveComponent("KEmptyState"),x=t.resolveComponent("KAlert"),V=t.resolveComponent("KButton"),w=t.resolveComponent("KTabs"),E=t.resolveComponent("KSlideout");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(f,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(b,{key:1,"action-button-text":t.unref(o)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:g},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:n.noValidate,onReset:t.withModifiers(_,["prevent"]),onSubmit:t.withModifiers(T,["prevent"])},[t.renderSlot(B.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(x,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Es,[t.renderSlot(B.$slots,"form-actions",{},()=>[t.createVNode(V,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:A[0]||(A[0]=H=>N())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.viewConfiguration")),1)]),_:1}),t.createVNode(V,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(V,{appearance:"primary","data-testid":"form-submit",disabled:m.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,Hs)),t.createVNode(E,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(o)("baseForm.configuration.title"),visible:s.value,onClose:A[1]||(A[1]=H=>N())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("baseForm.configuration.message")),1),t.createVNode(w,{"data-testid":"form-view-configuration-slideout-tabs",tabs:I.value},{json:t.withCtx(()=>[t.createVNode(Mt,{config:e.config,"fetcher-url":S.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(La,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Pa=oe(qs,[["__scopeId","data-v-fd05df8e"]]),vs=["data-truncate"],Fs=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const r=e,a=t.computed(()=>{var g;return((g=r.rowEl)==null?void 0:g.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var g;return((g=a.value)==null?void 0:g.querySelector('[data-truncate="true"]'))||null}),n=t.computed(()=>{var g,_;const T=(g=r.rowEl)==null?void 0:g.querySelectorAll("td");return T?((_=T[0])==null?void 0:_.getAttribute("data-testid"))===r.keyName:!0}),i=t.computed(()=>n.value||r.tooltip);let o;const d=()=>{o&&(o.disconnect(),o=void 0)},c=()=>{var g,_,T;let I=((g=a.value)==null?void 0:g.clientWidth)||0;if(a.value&&"getComputedStyle"in window){const B=window.getComputedStyle(a.value);I-=(parseFloat(B.paddingLeft)||0)+(parseFloat(B.paddingRight)||0)}p.value=((_=l.value)==null?void 0:_.getBoundingClientRect().width)||0,u.value=I,m.value=((T=h.value)==null?void 0:T.innerText)||""},h=t.ref({}),p=t.ref(0),u=t.ref(0),m=t.ref(""),s=t.computed(()=>[l.value,a.value]),S=t.watch(s,g=>{if(i.value&&(d(),"ResizeObserver"in window&&window)){o=new ResizeObserver(_=>{window.requestAnimationFrame(()=>{!Array.isArray(_)||!_.length||c()})});for(const _ of g)_&&o.observe(_)}},{immediate:!0,flush:"post",deep:!0}),N=t.computed(()=>i.value?p.value>u.value:!1);return t.onMounted(()=>{c()}),t.onUnmounted(()=>{S()}),(g,_)=>{const T=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:h,class:"content-wrapper"},[i.value?(t.openBlock(),t.createElementBlock("span",{key:0,"data-truncate":i.value||void 0},[t.createVNode(T,{"max-width":"300",placement:"bottom-start",text:N.value?m.value:""},{default:t.withCtx(()=>[t.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,vs)):t.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),Os=oe(Fs,[["__scopeId","data-v-b252463e"]]),$s={class:"toolbar-container"},Us={key:0,class:"toolbar-button-container"},Ds=["data-testid"],Ms=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},sortHandlerFunction:{type:Function,default:()=>({})},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:r}){const a=e,l=r,{i18n:{t:n}}=Y.useI18n(),i=t.computed(()=>{var f,b;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(f=a.errorMessage)==null?void 0:f.title,message:(b=a.errorMessage)==null?void 0:b.message}}),o=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=f=>f.hasData||!!a.query,c=t.computed(()=>{const f=[];return Object.keys(a.tableHeaders).forEach(b=>{const x=a.tableHeaders[b];f.push({label:x.label??b,key:b,sortable:x.sortable??!1,hidable:x.hidable??!0})}),a.enableEntityActions&&f.push({key:"actions",hideLabel:!0}),f}),h=f=>({"data-rowid":f.id,"data-testid":f.name,...a.rowAttributes(f)}),p=t.ref({}),u=f=>{var b;return(b=p.value)==null?void 0:b.$el.querySelector(`[data-rowid="${f.id}"]`)},m=f=>{const b={"data-testid":f.headerKey,...a.cellAttributes(f)};return f.colIndex===0&&(b.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),b},s=()=>{l("empty-state-cta-clicked"),S()},S=()=>{l("clear-search-input")},N=t.computed(()=>a.disableRowClick?void 0:(f,b)=>{l("click:row",b)}),g=f=>{l("sort",f)},{setTablePreferences:_,getTablePreferences:T}=Nl(),I=t.ref(T(o.value)),B=t.computed(()=>{const f=T(o.value);return{...a.initialFetcherParams,...f}}),A=f=>{I.value=f,c.value.forEach(b=>{!("hidable"in b)||!I.value.columnVisibility||b.hidable===!1&&(I.value.columnVisibility[b.key]=!0)}),o.value&&_(o.value,f)};return(f,b)=>{const x=t.resolveComponent("KButton"),V=t.resolveComponent("KDropdown"),w=t.resolveComponent("KTable"),E=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(E,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:t.withCtx(()=>[t.createVNode(w,{ref_key:"tableRefs",ref:p,"cache-identifier":o.value,"cell-attrs":m,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,error:i.value.hasError,"error-state-message":i.value.message,"error-state-title":i.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":B.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":h,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":I.value,onEmptyStateActionClick:s,"onRow:click":N.value,onSort:b[0]||(b[0]=H=>g(H)),"onUpdate:tablePreferences":A},t.createSlots({toolbar:t.withCtx(({state:H})=>[t.withDirectives(t.createElementVNode("div",$s,[t.renderSlot(f.$slots,"toolbar-filter",{},void 0,!0),f.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Us,[t.renderSlot(f.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(H)]])]),actions:t.withCtx(({row:H,rowKey:$,rowValue:U})=>[t.createElementVNode("div",{class:"actions-container","data-testid":H.name},[t.createVNode(V,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(f.$slots,"actions",{row:H,rowKey:$,rowValue:U},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(x,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:t.withCtx(()=>[t.createVNode(t.unref(xs))]),_:1})]),_:2},1032,["width"])],8,Ds)]),_:2},[t.renderList(e.tableHeaders,(H,$)=>({name:$,fn:t.withCtx(({row:U,rowKey:O,rowValue:F})=>[t.createVNode(Os,{"key-name":String($),"row-el":u(U),tooltip:H.tooltip},{default:t.withCtx(()=>[t.renderSlot(f.$slots,$,{row:U,rowKey:O,rowValue:F},()=>[t.createTextVNode(t.toDisplayString(F),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(es))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Ra=oe(Ms,[["__scopeId","data-v-71b4425a"]]),js={key:0,class:"kong-ui-entity-delete-error"},Ks={key:1,class:"description"},Ls=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:r}){const{i18nT:a}=Y.useI18n(),l=e,n=r,i=t.computed(()=>l.needConfirm?l.entityName:""),o=()=>{n("cancel")},d=()=>{n("proceed")};return(c,h)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":i.value,title:e.title,visible:e.visible,onCancel:o,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",js,[t.createVNode(p,{appearance:"danger"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Ks,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),za=oe(Ls,[["__scopeId","data-v-4361d622"]]),Ps={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Rs={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},zs=["fill"],Js={mask:"url(#mask0_180_20349)"},Ws=["fill"],Ja=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${an})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Ps,[t.createElementVNode("mask",Rs,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,zs)]),t.createElementVNode("g",Js,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ws)])]))}}),Qs={key:1,class:"kong-ui-entity-filter"},Zs={class:"kong-ui-entity-filter-menu"},Ys=["data-testid"],Gs=["onClick","onKeydown"],Xs={class:"menu-item-indicator"},ec={class:"menu-item-body"},tc=["for"],ac={class:"menu-item-buttons"},rc={class:"filter-clear-button-container"},lc=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:r}){const{i18n:{t:a}}=Y.useI18n(),l=e,n=r,i=t.ref(!1),o=t.ref({}),d=t.ref(new Set),c=t.computed(()=>{const B=[];return new URLSearchParams(l.modelValue).forEach((A,f)=>{A!==""&&B.push(f)}),B}),h=t.computed(()=>{const B=l.config.fields;return Object.keys(B).filter(A=>{var f;return(f=B==null?void 0:B[A])==null?void 0:f.searchable}).map(A=>({label:B[A].label||A,value:A,expanded:!1}))});t.watch(()=>l.modelValue,B=>{o.value={},new URLSearchParams(B).forEach((A,f)=>{o.value[f]=A})});const p=()=>{i.value=!i.value},u=B=>{d.value.has(B)?d.value.delete(B):d.value.add(B)},m=B=>{n("update:modelValue",B)},s=()=>{m("")},S=B=>`filter-${B}`,N=B=>{var A,f;return(((f=(A=l.config.schema)==null?void 0:A[B])==null?void 0:f.values)??[]).map(b=>({value:b,label:b}))},g=B=>{var A,f;return((f=(A=l.config.schema)==null?void 0:A[B])==null?void 0:f.type)??"text"},_=B=>{o.value={...o.value,[B]:""},I()},T=()=>{o.value={},I(!0)},I=(B=!1)=>{const A=Object.keys(o.value).reduce((f,b)=>(o.value[b]&&(f[b]=`${o.value[b]}`),f),{});B&&(i.value=!1),n("update:modelValue",new URLSearchParams(A).toString())};return(B,A)=>{const f=t.resolveComponent("KInput"),b=t.resolveComponent("KButton"),x=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(f,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":m},{before:t.withCtx(()=>[t.createVNode(Ja)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(ks),{class:"kong-ui-entity-filter-clear",onClick:s},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Qs,[t.createVNode(b,{appearance:"tertiary","data-testid":"filter-button",onClick:p},{default:t.withCtx(()=>[t.createVNode(Ja),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:p},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createElementVNode("div",Zs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,V=>{var w,E;return t.openBlock(),t.createElementBlock("div",{key:V.value,class:"kong-ui-entity-filter-menu-item","data-testid":V.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:d.value.has(V.value)}]),role:"button",tabindex:"0",onClick:H=>u(V.value),onKeydown:t.withKeys(H=>u(V.value),["enter"])},[t.createTextVNode(t.toDisplayString(V.label)+" ",1),t.withDirectives(t.createElementVNode("span",Xs,null,512),[[t.vShow,c.value.includes(V.value)]]),t.createVNode(t.unref(ps),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:d.value.has(V.value)}]),color:t.unref(ln)},null,8,["class","color"])],42,Gs),t.withDirectives(t.createElementVNode("div",ec,[t.createElementVNode("label",{class:"menu-item-label",for:S(V.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,tc),((E=(w=e.config.schema)==null?void 0:w[V.value])==null?void 0:E.type)==="select"?(t.openBlock(),t.createBlock(x,{key:0,id:S(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":H=>o.value[V.value]=H,items:N(V.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(f,{key:1,id:S(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":H=>o.value[V.value]=H,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:g(V.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,d.value.has(V.value)]]),t.withDirectives(t.createElementVNode("div",ac,[t.createVNode(b,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:A[0]||(A[0]=H=>I(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(b,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:H=>_(V.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,d.value.has(V.value)]])],8,Ys)}),128)),t.createElementVNode("div",rc,[t.createVNode(b,{appearance:"tertiary",size:"small",onClick:T},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,i.value]])]))}}}),nc=oe(lc,[["__scopeId","data-v-94990087"]]),he=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,i)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}});let ze;const oc=new Uint8Array(16);function ic(){if(!ze&&(ze=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ze))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ze(oc)}const X=[];for(let e=0;e<256;++e)X.push((e+256).toString(16).slice(1));function sc(e,r=0){return X[e[r+0]]+X[e[r+1]]+X[e[r+2]]+X[e[r+3]]+"-"+X[e[r+4]]+X[e[r+5]]+"-"+X[e[r+6]]+X[e[r+7]]+"-"+X[e[r+8]]+X[e[r+9]]+"-"+X[e[r+10]]+X[e[r+11]]+X[e[r+12]]+X[e[r+13]]+X[e[r+14]]+X[e[r+15]]}const cc=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Wa={randomUUID:cc};function dc(e,r,a){if(Wa.randomUUID&&!r&&!e)return Wa.randomUUID();e=e||{};const l=e.random||(e.rng||ic)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,r){a=a||0;for(let n=0;n<16;++n)r[a+n]=l[n];return r}return sc(l)}const hc=["aria-labelledby"],pc={class:"form-section-wrapper"},uc={key:1,class:"form-section-description"},fc={key:2,class:"form-section-footer"},mc={class:"form-section-content"},gc=t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(e){const r=t.useSlots(),a=dc();return(l,n)=>(t.openBlock(),t.createElementBlock("div",{"aria-labelledby":e.title?t.unref(a):void 0,class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[t.createElementVNode("div",pc,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.titleTag),{key:0,id:t.unref(a),class:"form-section-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1},8,["id"])):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",uc,[t.renderSlot(l.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",fc,[t.renderSlot(l.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",mc,[t.renderSlot(l.$slots,"default",{},void 0,!0)])])],10,hc))}}),Oe=oe(gc,[["__scopeId","data-v-b1f74200"]]),{useAxios:Je,useDeleteUrlBuilder:Qa,useErrors:Za,useExternalLinkCreator:Sd,useFetchUrlBuilder:_d,useFetcher:Ya,useDebouncedFilter:Ga,useStringHelpers:xd,useHelpers:yc,useGatewayFeatureSupported:Nd,useTruncationDetector:Vd,useValidators:Bd}=Y,We="24px",Xa=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},kc=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),bc=["aria-hidden"],Cc={key:0,"data-testid":"kui-icon-svg-title"},wc=kc(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),bt=Xa(t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:We,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return We}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Cc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),wc],8,bc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c1f7c39c"]]),Sc=e=>(t.pushScopeId("data-v-c73ebbaa"),e=e(),t.popScopeId(),e),_c=["aria-hidden"],xc={key:0,"data-testid":"kui-icon-svg-title"},Nc=Sc(()=>t.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Vc=Xa(t.defineComponent({__name:"TrashIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:We,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return We}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",xc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Nc],8,_c))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c73ebbaa"]]),Bc={upstreams:{list:{table_headers:{id:"ID",name:"Name",slots:"Slots",tags:"Tags"},empty_state:{title:"Configure a New Upstream",description:"Upstreams are used to load balance incoming requests."},toolbar_actions:{new_upstream:"New Upstream"}},title:"Upstreams",search:{placeholder:"Filter by exact name or ID"},actions:{create:"New Upstream",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete an Upstream",description:"This action cannot be reversed so make sure to check upstream usage before deleting."},errors:{general:"Upstreams could not be retrieved",delete:"The upstream 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:{errors:{name_required:"Name is required",should_be_integer:"Field should contain an integer",in_range:"Accepts an integer in the range of 10 - 65536"},general_info:{title:"General Information",help:"General information will help identify and manage this Upstream."},load_balancing:{title:"Load Balancing",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},health_check:{title:"Health Checks & Circuit Breakers",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},active_health_check:{title:"Active Health Checks",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},passive_health_check:{title:"Passive Health Checks",help:"Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},buttons:{view_documentation:"View documentation"},algorithms:{round_robin_label:"Round Robin",least_connections_label:"Least Connections",consistent_hashing_label:"Consistent Hashing",latency_label:"Latency"},hash_labels:{none:"None",consumer:"Consumer",ip:"IP",header:"Header",cookie:"Cookie",path:"Path",query_argument:"Query Argument",uri_capture:"URI Capture"},hash_tooltips:{hash_on_header:{text:"The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",hash_on:"hash_on",header:"header"},hash_on_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",hash_on:"hash_on",uri_capture:"uri_capture"},hash_on_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",hash_on:"hash_on",query_arg:"query_arg"},hash_on_cookie:{text:"The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},hash_on_cookie_path:{text:"The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},slots:{text:"The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",algorithm:"algorithm",round_robin:"round-robin",consistent_hashing:"consistent-hashing"},tags:"An optional set of strings associated with the Upstream for grouping and filtering.",hash_fallback:{text:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",hash_on:"hash_on",cookie:"cookie"},hash_fallback_header:{text:"The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",hash_fallback:"hash_fallback",header:"header"},hash_fallback_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",hash_fallback:"hash_fallback",query_arg:"query_arg"},hash_fallback_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",hash_fallback:"hash_fallback",uri_capture:"uri_capture"},host_header:{text:"The hostname to be used as {host} header when proxying requests through Kong.",host:"Host"},client_certificate:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},healthcheck_type_labels:{http:"HTTP",https:"HTTPS",tcp:"TCP",grsp:"gRPC",grsps:"gRPCs"},healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},passive_healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},passive_unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},fields:{name:{label:"Name",placeholder:"Enter or select a host",tooltip:"This is a hostname, which must be equal to the {host} of a Service.",host:"host"},host_header:{label:"Host Header"},client_certificate:{label:"Client Certificate",placeholder:"Select or enter a Certificate ID",tooltip:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Upstream for grouping and filtering."},algorithm:{label:"Algorithm",tooltip:"Which load balancing algorithm to use."},slots:{label:"Slots",help:"Accepts an integer in the range of 10 - 65536"},hash_on:{label:"Hash on",help:"What to use as hashing input.",tooltip:"What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."},hash_fallback:{label:"Hash Fallback",help:"What to use as hashing input if the primary hash_on does not return a hash",tooltip:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",hash_on:"hash_on",cookie:"cookie"},active_health_checks:{label:"Active Health Checks",help:"Actively probe the targets for their health."},passive_health_checks:{label:"Passive Health Checks / Circuit Breakers",help:"Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},healthchecks_threshold:{label:"Healthchecks Threshold"},header:{label:"Header"},headers:{label:"Headers",tooltip_active:"Header values can be separated by commas (value1, value2, value3)."},cookie:{label:"Cookie"},cookie_path:{label:"Cookie Path"},query_argument:{label:"Query Argument"},uri_capture:{label:"URI Capture"},active_healthcheck_type:{label:"Active Health Check Type"},http_path:{label:"HTTP Path"},timeout:{label:"Timeout"},concurrency:{label:"Concurrency"},https_sni:{label:"HTTPS SNI"},verify_ssl:{label:"Verify the SSL certificate when performing active health checks using HTTPS"},interval:{label:"Interval",help:"A value of zero indicates that active probes for healthy targets are disabled."},successes:{label:"Successes"},http_statuses:{label:"HTTP Statuses"},http_failures:{label:"HTTP Failures"},tcp_failures:{label:"TCP Failures"},timeouts:{label:"Timeouts"},passive_health_check_type:{label:"Passive Health Check Type"}}},labels:{created_at:"Created at"}},targets:{list:{table_headers:{id:"ID",target_address:"Target Address",weight:"Weight",tags:"Tags"},empty_state:{title:"Configure a New Target",description:"A target is an IP address/hostname with a port that identifies an instance of a backend service."},toolbar_actions:{new_target:"New Target"}},title:"Targets",actions:{create:"New Target",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",mark_healthy:"Mark Healthy",mark_unhealthy:"Mark Unhealthy"},delete:{title:"Delete a Target",description:"This action cannot be reversed so make sure to check target usage before deleting."},errors:{general:"Targets could not be retrieved",delete:"The target could not be deleted at this time.",copy:"Failed to copy to clipboard",weight:"Value must be in range 0 to 65535"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{create:{title:"New Target"},edit:{title:"Edit Target"},buttons:{save:"Save",cancel:"Cancel"},fields:{target:{label:"Target Address",placeholder:"Enter IP/hostname and port",tooltip:"The target address (IP or hostname) and port. If omitted the port defaults to 8000."},weight:{label:"Weight",tooltip:"The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}}}}};function Ic(){const e=Ue.createI18n("en-us",Bc);return{i18n:e,i18nT:Ue.i18nTComponent(e)}}function $e(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,i)=>{if(i){const o={...n};r&&(o.value=n.label),a.value.push(o)}else a.value=a.value.filter(o=>o.value!==n.value)}}}const Qe=[{label:"100",value:"100"},{label:"101",value:"101"},{label:"102",value:"102"},{label:"103",value:"103"},{label:"200",value:"200"},{label:"201",value:"201"},{label:"202",value:"202"},{label:"203",value:"203"},{label:"204",value:"204"},{label:"205",value:"205"},{label:"206",value:"206"},{label:"207",value:"207"},{label:"208",value:"208"},{label:"226",value:"226"},{label:"300",value:"300"},{label:"301",value:"301"},{label:"302",value:"302"},{label:"303",value:"303"},{label:"304",value:"304"},{label:"305",value:"305"},{label:"306",value:"306"},{label:"307",value:"307"},{label:"308",value:"308"},{label:"400",value:"400"},{label:"401",value:"401"},{label:"402",value:"402"},{label:"403",value:"403"},{label:"404",value:"404"},{label:"405",value:"405"},{label:"406",value:"406"},{label:"407",value:"407"},{label:"408",value:"408"},{label:"409",value:"409"},{label:"410",value:"410"},{label:"411",value:"411"},{label:"412",value:"412"},{label:"413",value:"413"},{label:"414",value:"414"},{label:"415",value:"415"},{label:"416",value:"416"},{label:"417",value:"417"},{label:"418",value:"418"},{label:"419",value:"419"},{label:"420",value:"420"},{label:"421",value:"421"},{label:"422",value:"422"},{label:"423",value:"423"},{label:"424",value:"424"},{label:"425",value:"425"},{label:"426",value:"426"},{label:"428",value:"428"},{label:"429",value:"429"},{label:"430",value:"430"},{label:"431",value:"431"},{label:"440",value:"440"},{label:"444",value:"444"},{label:"449",value:"449"},{label:"450",value:"450"},{label:"451",value:"451"},{label:"460",value:"460"},{label:"463",value:"463"},{label:"494",value:"494"},{label:"495",value:"495"},{label:"496",value:"496"},{label:"497",value:"497"},{label:"498",value:"498"},{label:"499",value:"499"},{label:"500",value:"500"},{label:"501",value:"501"},{label:"502",value:"502"},{label:"503",value:"503"},{label:"504",value:"504"},{label:"505",value:"505"},{label:"506",value:"506"},{label:"507",value:"507"},{label:"508",value:"508"},{label:"509",value:"509"},{label:"510",value:"510"},{label:"511",value:"511"},{label:"520",value:"520"},{label:"521",value:"521"},{label:"522",value:"522"},{label:"523",value:"523"},{label:"524",value:"524"},{label:"525",value:"525"},{label:"526",value:"526"},{label:"527",value:"527"},{label:"529",value:"529"},{label:"530",value:"530"},{label:"561",value:"561"},{label:"598",value:"598"},{label:"599",value:"599"}],Ct=10,wt=65536,Tc=0,Ac=65535,xe=0,Ne=255,er=0,tr=255,Hc=0,Ec=65535,ar=0,rr=65535,qc=0,vc=2**31,St=["200","302"],_t=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],xt=["429","404","500","501","502","503","504","505"],Nt=["429","500","503"];function Ze(){const e=c=>/^\d+$/.test(c),r=(c,h,p)=>{if(e(c)){const u=Number(c);return u>=h&&u<=p}else return!1},a=c=>c.map(h=>Number(h)),l=c=>c.map(h=>h.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:St,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:xt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:_t,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:Nt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,m,s,S,N,g,_,T,I,B,A,f,b,x,V,w,E,H,$,U,O,F,j,Z,v,D,K,k,y,C,R,M,z,ee,P,ae,ke,Te,nr,or,ir,sr,cr,dr,hr,pr,ur,fr,mr,gr,yr,kr,br,Cr,wr,Sr,_r,xr,Nr,Vr,Br,Ir,Tr,Ar,Hr,Er,qr,vr,Fr,Or,$r,Ur,Dr,Mr,jr,Kr,Lr,Pr,Rr,zr,Jr,Wr,Qr,Zr,Yr,Gr,Xr,el,tl,al,rl,ll,nl,ol,il,sl,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl;const h=n();return h.name=c.name||"",h.algorithm=c.algorithm||"round-robin",h.hostHeader=c.host_header||"",h.clientCertificate=c.client_certificate?(p=c.client_certificate)==null?void 0:p.id:"",h.tags=((u=c.tags)==null?void 0:u.join(", "))||"",h.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",h.hashOn=c.hash_on||"none",h.hashFallback=c.hash_fallback||"none",h.hashOnHeader=c.hash_on_header||"",h.hashOnCookie=c.hash_on_cookie||"",h.hashOnCookiePath=c.hash_on_cookie_path||"/",h.hashOnQueryArgument=c.hash_on_query_arg||"",h.hashOnUriCapture=c.hash_on_uri_capture||"",h.hashFallbackHeader=c.hash_fallback_header||"",h.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",h.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",h.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",h.activeHealthSwitch=((s=(m=c.healthchecks.active)==null?void 0:m.healthy)==null?void 0:s.interval)!==0||((N=(S=c.healthchecks.active)==null?void 0:S.unhealthy)==null?void 0:N.interval)!==0,h.activeHealthCheck.type=((g=c.healthchecks.active)==null?void 0:g.type)||"http",h.activeHealthCheck.httpPath=((_=c.healthchecks.active)==null?void 0:_.http_path)||"/",h.activeHealthCheck.timeout=((T=c.healthchecks.active)==null?void 0:T.timeout)!==null&&((I=c.healthchecks.active)==null?void 0:I.timeout)!==void 0?(A=(B=c.healthchecks.active)==null?void 0:B.timeout)==null?void 0:A.toString():"",h.activeHealthCheck.concurrency=((f=c.healthchecks.active)==null?void 0:f.concurrency)!==null&&((b=c.healthchecks.active)==null?void 0:b.concurrency)!==void 0?(V=(x=c.healthchecks.active)==null?void 0:x.concurrency)==null?void 0:V.toString():"",h.activeHealthCheck.httpsSni=((w=c.healthchecks.active)==null?void 0:w.https_sni)||"",h.activeHealthCheck.verifySsl=((E=c.healthchecks.active)==null?void 0:E.https_verify_certificate)||!1,h.activeHealthCheck.headers=(H=c.healthchecks.active)!=null&&H.headers&&Object.entries(($=c.healthchecks.active)==null?void 0:$.headers).length>0?Object.entries((U=c.healthchecks.active)==null?void 0:U.headers).map(([wd,Vt])=>({key:wd,values:Vt==null?void 0:Vt.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((F=(O=c.healthchecks.active)==null?void 0:O.healthy)==null?void 0:F.interval)!==null&&((Z=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:Z.interval)!==void 0?(K=(D=(v=c.healthchecks.active)==null?void 0:v.healthy)==null?void 0:D.interval)==null?void 0:K.toString():"0",h.activeHealthCheck.interval=((y=(k=c.healthchecks.active)==null?void 0:k.healthy)==null?void 0:y.interval)!==null&&((R=(C=c.healthchecks.active)==null?void 0:C.healthy)==null?void 0:R.interval)!==void 0?(ee=(z=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:z.interval)==null?void 0:ee.toString():"0",h.activeHealthCheck.successes=((ae=(P=c.healthchecks.active)==null?void 0:P.healthy)==null?void 0:ae.successes)!==null&&((Te=(ke=c.healthchecks.active)==null?void 0:ke.healthy)==null?void 0:Te.successes)!==void 0?(ir=(or=(nr=c.healthchecks.active)==null?void 0:nr.healthy)==null?void 0:or.successes)==null?void 0:ir.toString():"0",h.activeHealthCheck.httpStatuses=(cr=(sr=c.healthchecks.active)==null?void 0:sr.healthy)!=null&&cr.http_statuses?l(((hr=(dr=c.healthchecks.active)==null?void 0:dr.healthy)==null?void 0:hr.http_statuses)||[]):St,h.activeHealthCheck.unhealthyInterval=((ur=(pr=c.healthchecks.active)==null?void 0:pr.unhealthy)==null?void 0:ur.interval)!==null&&((mr=(fr=c.healthchecks.active)==null?void 0:fr.unhealthy)==null?void 0:mr.interval)!==void 0?(kr=(yr=(gr=c.healthchecks.active)==null?void 0:gr.unhealthy)==null?void 0:yr.interval)==null?void 0:kr.toString():"0",h.activeHealthCheck.httpFailures=((Cr=(br=c.healthchecks.active)==null?void 0:br.unhealthy)==null?void 0:Cr.http_failures)!==null&&((Sr=(wr=c.healthchecks.active)==null?void 0:wr.unhealthy)==null?void 0:Sr.http_failures)!==void 0?(Nr=(xr=(_r=c.healthchecks.active)==null?void 0:_r.unhealthy)==null?void 0:xr.http_failures)==null?void 0:Nr.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((Br=(Vr=c.healthchecks.active)==null?void 0:Vr.unhealthy)==null?void 0:Br.timeouts)!==null&&((Tr=(Ir=c.healthchecks.active)==null?void 0:Ir.unhealthy)==null?void 0:Tr.timeouts)!==void 0?(Er=(Hr=(Ar=c.healthchecks.active)==null?void 0:Ar.unhealthy)==null?void 0:Hr.timeouts)==null?void 0:Er.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(vr=(qr=c.healthchecks.active)==null?void 0:qr.unhealthy)!=null&&vr.http_statuses?l(((Or=(Fr=c.healthchecks.active)==null?void 0:Fr.unhealthy)==null?void 0:Or.http_statuses)||[]):xt,h.passiveHealthSwitch=((Ur=($r=c.healthchecks.passive)==null?void 0:$r.healthy)==null?void 0:Ur.successes)!==0||((Mr=(Dr=c.healthchecks.passive)==null?void 0:Dr.unhealthy)==null?void 0:Mr.timeouts)!==0||((Kr=(jr=c.healthchecks.passive)==null?void 0:jr.unhealthy)==null?void 0:Kr.tcp_failures)!==0||((Pr=(Lr=c.healthchecks.passive)==null?void 0:Lr.unhealthy)==null?void 0:Pr.http_failures)!==0,h.passiveHealthCheck.type=((Rr=c.healthchecks.passive)==null?void 0:Rr.type)||"http",h.passiveHealthCheck.successes=((Jr=(zr=c.healthchecks.passive)==null?void 0:zr.healthy)==null?void 0:Jr.successes)!==null&&((Qr=(Wr=c.healthchecks.passive)==null?void 0:Wr.healthy)==null?void 0:Qr.successes)!==void 0?(Gr=(Yr=(Zr=c.healthchecks.passive)==null?void 0:Zr.healthy)==null?void 0:Yr.successes)==null?void 0:Gr.toString():"0",h.passiveHealthCheck.httpStatuses=(el=(Xr=c.healthchecks.passive)==null?void 0:Xr.healthy)!=null&&el.http_statuses?l(((al=(tl=c.healthchecks.passive)==null?void 0:tl.healthy)==null?void 0:al.http_statuses)||[]):_t,h.passiveHealthCheck.timeouts=((ll=(rl=c.healthchecks.passive)==null?void 0:rl.unhealthy)==null?void 0:ll.timeouts)!==null&&((ol=(nl=c.healthchecks.passive)==null?void 0:nl.unhealthy)==null?void 0:ol.timeouts)!==void 0?(cl=(sl=(il=c.healthchecks.passive)==null?void 0:il.unhealthy)==null?void 0:sl.timeouts)==null?void 0:cl.toString():"0",h.passiveHealthCheck.tcpFailures=((hl=(dl=c.healthchecks.passive)==null?void 0:dl.unhealthy)==null?void 0:hl.tcp_failures)!==null&&((ul=(pl=c.healthchecks.passive)==null?void 0:pl.unhealthy)==null?void 0:ul.tcp_failures)!==void 0?(gl=(ml=(fl=c.healthchecks.passive)==null?void 0:fl.unhealthy)==null?void 0:ml.tcp_failures)==null?void 0:gl.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(kl=(yl=c.healthchecks.passive)==null?void 0:yl.unhealthy)!=null&&kl.http_statuses?l(((Cl=(bl=c.healthchecks.passive)==null?void 0:bl.unhealthy)==null?void 0:Cl.http_statuses)||[]):Nt,h},getDefaultUpstreamFields:n,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const pe={useI18n:Ic,useMultiselectCreation:$e,useHelpers:Ze},Ve="/v2/control-planes/{controlPlaneId}/core-entities",Be="/{workspace}",Ie={list:{konnect:`${Ve}/upstreams`,kongManager:`${Be}/upstreams`},form:{konnect:{getServices:`${Ve}/services`,getCertificates:`${Ve}/certificates`,validate:`${Ve}/v1/schemas/json/upstream/validate`,create:`${Ve}/upstreams`,edit:`${Ve}/upstreams/{id}`},kongManager:{getServices:`${Be}/services`,getCertificates:`${Be}/certificates`,validate:`${Be}/schemas/upstreams/validate`,create:`${Be}/upstreams`,edit:`${Be}/upstreams/{id}`}}},Fc={class:"kong-ui-entities-upstreams-list"},Oc={class:"upstream-name"},$c=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:r}){var Z;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),i=tt.useRouter(),{axiosInstance:o}=Je((Z=l.config)==null?void 0:Z.axiosRequestConfig),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var D,K;let v=`${l.config.apiBaseUrl}${Ie.list[l.config.app]}`;return l.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((D=l.config)==null?void 0:D.controlPlaneId)||""):l.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(K=l.config)!=null&&K.workspace?`/${l.config.workspace}`:"")),v}),m=t.ref(""),s=t.computed(()=>{const v=l.config.app==="konnect"||l.config.isExactMatch;if(v)return{isExactMatch:v,placeholder:n("upstreams.search.placeholder")};const{name:D,slots:K}=h;return{isExactMatch:v,fields:{name:D,slots:K},schema:l.config.filterSchema}}),{fetcher:S,fetcherState:N}=Ya(l.config,u.value),g=()=>{m.value=""},_=()=>{d.value++},T=t.ref(null),I=(v,D)=>{const K=v.id;if(!D(K)){a("copy:error",{entity:v,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:v,field:"id",message:n("upstreams.copy.success",{val:K})})},B=(v,D)=>{const K=JSON.stringify(v);if(!D(K)){a("copy:error",{entity:v,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:v,message:n("upstreams.copy.success_brief")})},A=async v=>{var K;await((K=l.canRetrieve)==null?void 0:K.call(l,v))&&i.push(l.config.getViewRoute(v.id))},f=v=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(v)}),b=v=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(v)}),x=t.ref(void 0),V=t.ref(!1),w=t.ref(!1),E=t.ref(""),H=Qa(l.config,u.value),$=v=>{x.value=v,V.value=!0},U=()=>{V.value=!1},O=async()=>{var v,D,K;if((v=x.value)!=null&&v.id){w.value=!0;try{await o.delete(H(x.value.id)),w.value=!1,V.value=!1,d.value++,a("delete:success",x.value)}catch(k){E.value=((K=(D=k.response)==null?void 0:D.data)==null?void 0:K.message)||k.message||n("upstreams.errors.delete"),a("error",k)}finally{w.value=!1}}},F=t.ref(!1);t.watch(N,v=>{var D,K,k,y;if(Array.isArray((D=v==null?void 0:v.response)==null?void 0:D.data)&&(F.value=v.response.data.length>0),v.status===fe.Error){T.value={title:n("upstreams.errors.general")},(y=(k=(K=v.error)==null?void 0:K.response)==null?void 0:k.data)!=null&&y.message&&(T.value.message=v.error.response.data.message),a("error",v.error);return}T.value=null});const j=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(j.value.title=n("upstreams.list.empty_state.title"),j.value.ctaText=n("upstreams.actions.create"))}),(v,D)=>{const K=t.resolveComponent("KButton"),k=t.resolveComponent("KBadge"),y=t.resolveComponent("KTruncate"),C=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Fc,[t.createVNode(t.unref(Ra),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":T.value,fetcher:t.unref(S),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:m.value,"table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onClearSearchInput:g,"onClick:row":D[1]||(D[1]=M=>A(M)),onSort:_},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(nc),{modelValue:m.value,"onUpdate:modelValue":D[0]||(D[0]=M=>m.value=M),config:s.value},null,8,["modelValue","config"])]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(he),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createVNode(t.unref(bt)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,F.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:t.withCtx(({rowValue:M})=>[t.createElementVNode("span",Oc,t.toDisplayString(M),1)]),tags:t.withCtx(({rowValue:M})=>[t.createVNode(y,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M,z=>(t.openBlock(),t.createBlock(k,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:M})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(C,{"data-testid":"action-entity-copy-id",onClick:ee=>I(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(C,{"data-testid":"action-entity-copy-json",onClick:ee=>B(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(he),{"auth-function":()=>e.canRetrieve(M)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-view","has-divider":"",item:f(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canEdit(M)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-edit",item:b(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canDelete(M)},{default:t.withCtx(()=>[t.createVNode(C,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>$(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(za),{"action-pending":w.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":x.value&&(x.value.name||x.value.id),"entity-type":t.unref(at).Upstream,error:E.value,title:t.unref(n)("upstreams.delete.title"),visible:V.value,onCancel:U,onProceed:O},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),ue=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Uc=ue($c,[["__scopeId","data-v-9f2efb47"]]),Ye="/v2/control-planes/{controlPlaneId}/core-entities",Ge="/{workspace}",Xe={list:{konnect:`${Ye}/upstreams/{upstreamId}/targets`,kongManager:`${Ge}/upstreams/{upstreamId}/targets`},form:{konnect:{create:`${Ye}/upstreams/{upstreamId}/targets`,edit:`${Ye}/upstreams/{upstreamId}/targets/{id}`,validate:`${Ye}/v1/schemas/json/target/validate`},kongManager:{create:`${Ge}/upstreams/{upstreamId}/targets`,edit:`${Ge}/upstreams/{upstreamId}/targets/{id}`,validate:`${Ge}/schemas/targets/validate`}}},Dc={class:"kong-ui-entities-target-form"},Mc={class:"target-form-container"},jc={key:0,class:"target-form-info"},lr=ue(t.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var A;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),{getMessageFromError:i}=Za(),{axiosInstance:o}=Je((A=l.config)==null?void 0:A.axiosRequestConfig),d=t.computed(()=>{var f;return Xe.form[l.config.app].edit.replace(/{upstreamId}/gi,((f=l.config)==null?void 0:f.upstreamId)||"")}),c=t.computed(()=>l.targetId?ie.Edit:ie.Create),h=t.computed(()=>c.value===ie.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),p=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),m={target:"",weight:100,tags:""},s=t.computed(()=>{const f=parseInt(p.fields.weight.toString(),10);return f<0||f>65535}),S=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),N=f=>{var b;p.fields.target=(f==null?void 0:f.target)||"",p.fields.weight=(f==null?void 0:f.weight)??"",p.fields.tags=((b=f==null?void 0:f.tags)==null?void 0:b.join(", "))||"",Object.assign(u,p.fields)},g=()=>{p.errorMessage="",a("cancel")},_=t.computed(()=>{var b,x;let f=`${l.config.apiBaseUrl}${Xe.form[l.config.app].validate}`;return l.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((b=l.config)==null?void 0:b.controlPlaneId)||""):l.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(x=l.config)!=null&&x.workspace?`/${l.config.workspace}`:"")),f=f.replace(/{id}/gi,l.targetId),f}),T=t.computed(()=>{var b,x,V,w;let f=`${l.config.apiBaseUrl}${Xe.form[l.config.app][c.value]}`;return l.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((b=l.config)==null?void 0:b.controlPlaneId)||"").replace(/{upstreamId}/gi,((x=l.config)==null?void 0:x.upstreamId)||""):l.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(V=l.config)!=null&&V.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((w=l.config)==null?void 0:w.upstreamId)||"")),f=f.replace(/{id}/gi,l.targetId),f}),I=t.computed(()=>{var f,b,x;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(x=(b=(f=p.fields.tags)==null?void 0:f.split(","))==null?void 0:b.map(V=>String(V||"").trim()))==null?void 0:x.filter(V=>V!==""),upstream:{id:l.config.upstreamId}}}),B=async()=>{var f,b;try{p.isReadonly=!0,p.errorMessage="";let x;if(await o.post(_.value,I.value),c.value==="create"?x=await o.post(T.value,I.value):c.value==="edit"&&(x=((f=l.config)==null?void 0:f.app)==="konnect"?await o.put(T.value,I.value):await o.patch(T.value,I.value)),x){const{data:V}=x;p.fields.target=(V==null?void 0:V.name)||"",p.fields.weight=(V==null?void 0:V.weight)??100,p.fields.tags=((b=V==null?void 0:V.tags)==null?void 0:b.join(", "))||"",a("update",V),Object.assign(p.fields,m)}}catch(x){p.errorMessage=i(x),a("error",x)}finally{p.isReadonly=!1}};return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,m)}),(f,b)=>{const x=t.resolveComponent("KInput"),V=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(V,{"action-button-disabled":!S.value||p.isReadonly,"action-button-text":t.unref(n)("targets.form.buttons.save"),"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),title:h.value,visible:e.isVisible,onCancel:g,onProceed:B},{default:t.withCtx(()=>[t.createElementVNode("div",Dc,[t.createVNode(t.unref(Pa),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":I.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":b[3]||(b[3]=w=>f.$emit("error",w)),"onFetch:success":N,onLoading:b[4]||(b[4]=w=>f.$emit("loading",w))},{default:t.withCtx(()=>[t.createElementVNode("div",Mc,[f.$slots.info?(t.openBlock(),t.createElementBlock("div",jc,[t.renderSlot(f.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(x,{modelValue:p.fields.target,"onUpdate:modelValue":b[0]||(b[0]=w=>p.fields.target=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(x,{modelValue:p.fields.weight,"onUpdate:modelValue":b[1]||(b[1]=w=>p.fields.weight=w),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:p.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(x,{modelValue:p.fields.tags,"onUpdate:modelValue":b[2]||(b[2]=w=>p.fields.tags=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-cfae2d2a"]]),Kc={class:"kong-ui-entities-targets-list"},Lc={class:"target-address"},Pc=ue(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var K;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),{axiosInstance:i}=Je((K=l.config)==null?void 0:K.axiosRequestConfig),o=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:n("targets.list.table_headers.target_address"),sortable:!0,hidable:!1},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var y,C,R,M;let k=`${l.config.apiBaseUrl}${Xe.list[l.config.app]}`;return l.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((y=l.config)==null?void 0:y.controlPlaneId)||"").replace(/{upstreamId}/gi,((C=l.config)==null?void 0:C.upstreamId)||""):l.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(R=l.config)!=null&&R.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((M=l.config)==null?void 0:M.upstreamId)||"")),k}),{fetcher:u,fetcherState:m}=Ya(l.config,p.value),s=()=>{o.value++},S=t.ref(null),N=()=>{j.value=!0},g=(k,y)=>{const C=k.id;if(!y(C)){a("copy:error",{entity:k,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:k,field:"id",message:n("targets.copy.success",{val:C})})},_=(k,y)=>{const C=JSON.stringify(k);if(!y(C)){a("copy:error",{entity:k,message:n("targets.errors.copy")});return}a("copy:success",{entity:k,message:n("targets.copy.success_brief")})},T=k=>{F.value=k,j.value=!0},I=k=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(k),B=k=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(k),A=t.ref(void 0),f=t.ref(!1),b=t.ref(!1),x=t.ref(""),V=Qa(l.config,p.value),w=k=>{A.value=k,f.value=!0},E=()=>{f.value=!1},H=async()=>{var k,y,C;if((k=A.value)!=null&&k.id){b.value=!0;try{await i.delete(V(A.value.id)),b.value=!1,f.value=!1,o.value++,a("delete:success",A.value)}catch(R){x.value=((C=(y=R.response)==null?void 0:y.data)==null?void 0:C.message)||R.message||n("targets.errors.delete"),a("error",R)}finally{b.value=!1}}},$=t.ref(!1);t.watch(m,k=>{var y,C,R,M;if(Array.isArray((y=k==null?void 0:k.response)==null?void 0:y.data)&&($.value=k.response.data.length>0),k.status===fe.Error){S.value={title:n("targets.errors.general")},(M=(R=(C=k.error)==null?void 0:C.response)==null?void 0:R.data)!=null&&M.message&&(S.value.message=k.error.response.data.message),a("error",k.error);return}S.value=null});const U=t.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(U.value.title=n("targets.list.empty_state.title"),U.value.ctaText=n("targets.actions.create"))});const O=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,axiosRequestConfig:l.config.axiosRequestConfig,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace}})),F=t.ref(""),j=t.ref(!1),Z=k=>{F.value?a("update:target",k):a("create:target",k),v()},v=()=>{D(),o.value++},D=()=>{j.value=!1,F.value=""};return(k,y)=>{const C=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),M=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),ee=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Kc,[t.createVNode(t.unref(Ra),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":U.value,"enable-entity-actions":"","error-message":S.value,fetcher:t.unref(u),"fetcher-cache-key":o.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:y[1]||(y[1]=()=>l.config.createRoute?void 0:N()),onSort:s},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(he),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(C,{appearance:"primary","data-testid":"toolbar-new-target",to:l.config.createRoute?l.config.createRoute:void 0,onClick:y[0]||(y[0]=()=>l.config.createRoute?void 0:N())},{default:t.withCtx(()=>[t.createVNode(t.unref(bt)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,$.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:P})=>[t.createElementVNode("span",Lc,t.toDisplayString(P),1)]),tags:t.withCtx(({rowValue:P})=>[t.createVNode(M,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P,ae=>(t.openBlock(),t.createBlock(R,{key:ae,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ae),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:P})=>[t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:ke=>g(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:ke=>_(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(he),{"auth-function":()=>e.canEdit(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:ae=>T(P.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>I(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:ae=>a("health-actions:healthy",P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>B(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:ae=>a("health-actions:unhealthy",P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canDelete(P)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ae=>w(P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(za),{"action-pending":b.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(at).Target,error:x.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:f.value,onCancel:E,onProceed:H},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(lr,{config:O.value,"is-visible":j.value,"target-id":F.value,onCancel:D,onUpdate:Z},t.createSlots({_:2},[k.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(k.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-e6ed1cfb"]]),Rc={key:1},zc=ue(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var E,H,$,U;const{i18nT:a,i18n:{t:l}}=pe.useI18n(),n=e,i=r,{debouncedQueryChange:o,loading:d,loadItems:c,results:h,allRecords:p}=Ga(n.config,(H=Ie.form[(E=n.config)==null?void 0:E.app])==null?void 0:H.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:m,loadItems:s,results:S}=Ga(n.config,(U=Ie.form[($=n.config)==null?void 0:$.app])==null?void 0:U.getCertificates),N=t.ref(""),g=t.computed(()=>{var O;return!!n.name&&!((O=p.value)!=null&&O.some(F=>F.host===n.name))}),_=t.computed(()=>{var F,j,Z;const O=g.value&&n.name.includes((F=N.value)==null?void 0:F.toLowerCase());return(Z=h.value)==null?void 0:Z.map(v=>({label:v.host,value:v.id})).concat(O?[{label:n.name,value:((j=B.value)==null?void 0:j.value)||n.name}]:[])}),T=t.computed(()=>{var O;return(O=S.value)==null?void 0:O.map(F=>({label:F.id,value:F.id}))}),I=t.ref(""),B=t.ref({value:"",label:""}),A=t.computed(()=>{var O,F;return((O=_.value.find(j=>j.value===I.value))==null?void 0:O.label)||((F=B.value)==null?void 0:F.label)}),f=O=>{N.value=O,o(O)},b=O=>{B.value=O},x=()=>{B.value={value:"",label:""}},V=O=>{I.value=O,i("update:name",A.value)},w=t.ref(!1);return t.onBeforeMount(async()=>{var O,F;try{w.value=!0,await c(),n.name&&(I.value=((F=(O=_.value.find(j=>j.label===n.name))==null?void 0:O.value)==null?void 0:F.toString())||n.name),await s()}finally{w.value=!1}}),(O,F)=>{const j=t.resolveComponent("KSkeleton"),Z=t.resolveComponent("KSelect"),v=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[w.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",Rc,[t.createVNode(Z,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:_.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":I.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:b,onItemRemoved:x,onQueryChange:f,"onUpdate:modelValue":V},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(v,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":F[0]||(F[0]=D=>i("update:host-header",D))},null,8,["label","model-value","readonly"]),t.createVNode(Z,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:T.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(m),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":F[1]||(F[1]=D=>i("update:client-certificate",D))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(v,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":F[2]||(F[2]=D=>i("update:tags",D))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),et={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},Jc={class:"fields-group-title"},Wc={class:"fields-group-text"},Qc={class:"fields-group-title"},Zc={class:"fields-group-text"},Yc=ue(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=pe.useI18n(),{inRange:n}=Ze(),i=e,o=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>i.hashOn,(u,m)=>{m==="header"&&u!==m&&o("update:hash-on-header",""),m==="cookie"&&u!==m&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),m==="query_arg"&&u!==m&&o("update:hash-on-query-argument",""),m==="uri_capture"&&u!==m&&o("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(o("update:hash-fallback","none"),o("update:hash-fallback-header",""),o("update:hash-fallback-query-argument",""),o("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,m)=>{m==="header"&&u!==m&&o("update:hash-fallback-header",""),m==="cookie"&&u!==m&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),m==="query_arg"&&u!==m&&o("update:hash-fallback-query-argument",""),m==="uri_capture"&&u!==m&&o("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?n(i.slots,Ct,wt)?"":l("upstreams.form.errors.in_range"):"");return(u,m)=>{const s=t.resolveComponent("KExternalLink"),S=t.resolveComponent("KSelect"),N=t.resolveComponent("KInput"),g=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(S,{class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[0]||(m[0]=_=>o("update:algorithm",_))},null,8,["items","label","model-value","readonly"]),t.createVNode(N,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(wt),min:t.unref(Ct),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":m[1]||(m[1]=_=>o("update:slots",_))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Jc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",Wc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(S,{class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[2]||(m[2]=_=>o("update:hash-on",_))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(N,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[3]||(m[3]=_=>o("update:hash-on-header",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(N,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[4]||(m[4]=_=>o("update:hash-on-cookie",_))},null,8,["label","model-value","readonly"]),t.createVNode(N,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[5]||(m[5]=_=>o("update:hash-on-cookie-path",_))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(N,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[6]||(m[6]=_=>o("update:hash-on-query-argument",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(N,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[7]||(m[7]=_=>o("update:hash-on-uri-capture",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Qc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",Zc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(S,{class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[8]||(m[8]=_=>o("update:hash-fallback",_))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(N,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[9]||(m[9]=_=>o("update:hash-fallback-header",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(N,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[10]||(m[10]=_=>o("update:hash-on-cookie",_))},null,8,["label","model-value","readonly"]),t.createVNode(N,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[11]||(m[11]=_=>o("update:hash-on-cookie-path",_))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(N,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[12]||(m[12]=_=>o("update:hash-fallback-query-argument",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(N,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[13]||(m[13]=_=>o("update:hash-fallback-uri-capture",_))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),Gc={class:"fields-group-title"},Xc={class:"fields-group-text"},ed={class:"fields-group-title"},td={class:"fields-group-text"},ad=ue(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),l=r;return(n,i)=>{const o=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(o,{"hide-icon":"",href:t.unref(et).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Gc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",Xc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:i[0]||(i[0]=p=>l("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",ed,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",td,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:i[1]||(i[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(Ac),min:t.unref(Tc),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),rd="#d60027",ld={key:2},nd={class:"fields-group-title"},od={class:"fields-group-text"},id={class:"fields-group-title"},sd={class:"fields-group-text"},cd=ue(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),{objectsAreEqual:l}=Ze(),n=e,i=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:h}=$e({replaceId:!0}),{trackNewItems:p}=$e({replaceId:!0});t.watch(()=>n.type,(N,g)=>{g==="tcp"&&N!==g&&i("update:tcp-failures","5"),(g==="https"||g==="grpcs")&&N!==g&&(i("update:https-sni",""),i("update:verify-ssl",!1)),g!=="tcp"&&N==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",St),i("update:unhealthy-http-statuses",xt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,N=>{l(u.value,N)||(u.value=[...N])},{immediate:!0,deep:!0});const m=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),m()},S=N=>{N===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(N,1),m()};return(N,g)=>{const _=t.resolveComponent("KExternalLink"),T=t.resolveComponent("KSelect"),I=t.resolveComponent("KInput"),B=t.resolveComponent("KCheckbox"),A=t.resolveComponent("KLabel"),f=t.resolveComponent("KButton"),b=t.resolveComponent("KMultiselect"),x=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(_,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var V;return[t.createVNode(T,{class:"active-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":g[0]||(g[0]=w=>i("update:type",w))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":g[1]||(g[1]=w=>i("update:http-path",w))},null,8,["label","model-value","readonly"])),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(Ec),min:t.unref(Hc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":g[2]||(g[2]=w=>i("update:timeout",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(vc),min:t.unref(qc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":g[3]||(g[3]=w=>i("update:concurrency",w))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":g[4]||(g[4]=w=>i("update:https-sni",w))},null,8,["label","model-value","readonly"]),t.createVNode(B,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":g[5]||(g[5]=w=>i("update:verify-ssl",w))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((V=e.config)==null?void 0:V.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",ld,[t.createVNode(A,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(w,E)=>(t.openBlock(),t.createElementBlock("div",{key:`${w.header}_${E}`,class:t.normalizeClass(["headers-row",{"margin-top-6":E>0}])},[t.createVNode(I,{modelValue:u.value[E].key,"onUpdate:modelValue":H=>u.value[E].key=H,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${E+1}`,readonly:e.readonly,type:"text",onBlur:m},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(I,{modelValue:u.value[E].values,"onUpdate:modelValue":H=>u.value[E].values=H,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${E+1}`,readonly:e.readonly,type:"text",onBlur:m},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(f,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",disabled:u.value.length===1,icon:"",onClick:H=>S(E)},{default:t.withCtx(()=>[t.createVNode(t.unref(Vc),{class:"delete-item",color:u.value.length>1?t.unref(rd):void 0},null,8,["color"])]),_:2},1032,["disabled","onClick"]),u.value&&E===u.value.length-1?(t.openBlock(),t.createBlock(f,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",icon:"",onClick:s},{default:t.withCtx(()=>[t.createVNode(t.unref(bt))]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",nd,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",od,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(rr),min:t.unref(ar),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[6]||(g[6]=w=>i("update:interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":g[7]||(g[7]=w=>i("update:successes",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[8]||(g[8]=w=>t.unref(h)(w,!0)),onItemRemoved:g[9]||(g[9]=w=>t.unref(h)(w,!1)),"onUpdate:modelValue":g[10]||(g[10]=w=>i("update:http-statuses",w))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",id,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",sd,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(rr),min:t.unref(ar),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[11]||(g[11]=w=>i("update:unhealthy-interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[12]||(g[12]=w=>i("update:tcp-failures",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[13]||(g[13]=w=>i("update:http-failures",w))},null,8,["label","max","min","model-value","readonly"])),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(b,{key:1,autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[14]||(g[14]=w=>t.unref(p)(w,!0)),onItemRemoved:g[15]||(g[15]=w=>t.unref(p)(w,!1)),"onUpdate:modelValue":g[16]||(g[16]=w=>i("update:unhealthy-http-statuses",w))},null,8,["items","label","model-value","readonly"])),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(tr),min:t.unref(er),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":g[17]||(g[17]=w=>i("update:unhealthy-timeouts",w))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-efccf560"]]),dd={class:"fields-group-title"},hd={class:"fields-group-text"},pd={class:"fields-group-title"},ud={class:"fields-group-text"},fd=ue(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),l=e,n=r,i=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),o=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=$e({replaceId:!0}),{trackNewItems:c}=$e({replaceId:!0});return t.watch(()=>l.type,(h,p)=>{p==="tcp"&&h!==p&&n("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(n("update:http-statuses",_t),n("update:unhealthy-http-statuses",Nt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),m=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),S=t.resolveComponent("KMultiselect"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(m,{class:"passive-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=g=>n("update:type",g))},null,8,["items","label","model-value","readonly"]),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",dd,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",hd,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=g=>n("update:successes",g))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=g=>t.unref(d)(g,!0)),onItemRemoved:p[3]||(p[3]=g=>t.unref(d)(g,!1)),"onUpdate:modelValue":p[4]||(p[4]=g=>n("update:http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",pd,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",ud,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(tr),min:t.unref(er),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=g=>n("update:timeouts",g))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(s,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=g=>n("update:tcp-failures",g))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(s,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=g=>n("update:http-failures",g))},null,8,["label","max","min","model-value","readonly"])),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:1,autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=g=>t.unref(c)(g,!0)),onItemRemoved:p[9]||(p[9]=g=>t.unref(c)(g,!1)),"onUpdate:modelValue":p[10]||(p[10]=g=>n("update:unhealthy-http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-5bd9952e"]]),md={class:"kong-ui-entities-upstreams-form"},gd=ue(t.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:r}){var K;const a=e,l=r,{inRange:n,stringToNumberArray:i,upstreamsResponseToFields:o,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=Ze(),{axiosInstance:p}=Je((K=a.config)==null?void 0:K.axiosRequestConfig),{getMessageFromError:u}=Za(),m=tt.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),S=t.reactive(d()),N=t.computed(()=>!c(s.fields,S)),g=k=>{s.fields.activeHealthCheck.interval=k?"5":"0",s.fields.activeHealthCheck.successes=k?"5":"0",s.fields.activeHealthCheck.httpFailures=k?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=k?"5":"0",s.fields.activeHealthCheck.tcpFailures=k?"5":"0"},_=k=>{s.fields.passiveHealthCheck.timeouts=k?"5":"0",s.fields.passiveHealthCheck.successes=k?"80":"0",s.fields.passiveHealthCheck.tcpFailures=k?"5":"0",s.fields.passiveHealthCheck.httpFailures=k?"5":"0"},T=t.computed(()=>s.fields.slots?n(s.fields.slots,Ct,wt):!0),I=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),B=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),A=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),f=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),b=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),x=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),V=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),w=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),E=t.computed(()=>!!s.fields.name&&T.value&&I.value&&B.value&&A.value&&f.value&&b.value&&x.value&&V.value&&w.value),H=t.computed(()=>a.upstreamId?ie.Edit:ie.Create),$=t.computed(()=>{var k,y;return(y=Ie.form[(k=a.config)==null?void 0:k.app])==null?void 0:y.edit}),U=k=>{Object.assign(s.fields,o(k)),Object.assign(S,h(s.fields))},O=()=>{var k;m.push(((k=a.config)==null?void 0:k.cancelRoute)||{name:"upstreams-list"})},F=k=>{l("loading",k)},j=k=>{l("error",k)},Z=t.computed(()=>{var y,C,R,M,z;const k={name:s.fields.name,slots:Number(s.fields.slots),algorithm:s.fields.algorithm,hash_on:s.fields.hashOn,hash_fallback:s.fields.hashFallback,healthchecks:{}};return s.fields.hostHeader&&(k.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(k.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(k.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(k.tags=(C=(y=s.fields.tags.split(","))==null?void 0:y.map(ee=>String(ee||"").trim()))==null?void 0:C.filter(ee=>ee!=="")),s.fields.hashOn==="header"&&(k.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(k.hash_on_cookie=s.fields.hashOnCookie,k.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(k.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(k.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(k.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(k.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(k.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(k.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(k.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(k.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(k.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?k.healthchecks.active.headers=[]:k.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((ee,P)=>{var ae,ke;return P.key?{...ee,[P.key]:(ke=(ae=P.values.split(","))==null?void 0:ae.map(Te=>String(Te||"").trim()))==null?void 0:ke.filter(Te=>Te!=="")}:{...ee}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(k.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(k.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(k.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(k.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(k.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(k.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(k.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(k.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.tcpFailures&&(k.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((M=a.config)==null?void 0:M.app)==="kongManager"&&H.value===ie.Edit&&(k.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0,successes:0},unhealthy:{interval:0,http_failures:0,tcp_failures:0}}),s.fields.passiveHealthSwitch?(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(k.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(k.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(k.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(k.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.tcpFailures&&(k.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&H.value===ie.Edit&&(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),k}),v=k=>{var C,R,M,z,ee,P;let y=`${(C=a.config)==null?void 0:C.apiBaseUrl}${Ie.form[(R=a.config)==null?void 0:R.app][k]}`;return((M=a.config)==null?void 0:M.app)==="konnect"?y=y.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((ee=a.config)==null?void 0:ee.app)==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(P=a.config)!=null&&P.workspace?`/${a.config.workspace}`:"")),y=y.replace(/{id}/gi,a.upstreamId),y},D=async()=>{var k;try{s.readonly=!0,await p.post(v("validate"),Z.value);let y;H.value===ie.Create?y=await p.post(v("create"),Z.value):H.value===ie.Edit&&(y=((k=a.config)==null?void 0:k.app)==="konnect"?await p.put(v("edit"),Z.value):await p.patch(v("edit"),Z.value)),l("update",y==null?void 0:y.data)}catch(y){s.errorMessage=u(y),l("error",y)}finally{s.readonly=!1}};return(k,y)=>(t.openBlock(),t.createElementBlock("div",md,[t.createVNode(t.unref(Pa),{"can-submit":E.value&&N.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":$.value,"form-fields":Z.value,"is-readonly":s.readonly,onCancel:O,"onFetch:error":j,"onFetch:success":U,onLoading:F,onSubmit:D},{default:t.withCtx(()=>[t.createVNode(zc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":y[0]||(y[0]=C=>s.fields.clientCertificate=C),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":y[1]||(y[1]=C=>s.fields.hostHeader=C),name:s.fields.name,"onUpdate:name":y[2]||(y[2]=C=>s.fields.name=C),tags:s.fields.tags,"onUpdate:tags":y[3]||(y[3]=C=>s.fields.tags=C),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(Yc,{algorithm:s.fields.algorithm,"onUpdate:algorithm":y[4]||(y[4]=C=>s.fields.algorithm=C),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":y[5]||(y[5]=C=>s.fields.hashFallback=C),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":y[6]||(y[6]=C=>s.fields.hashFallbackHeader=C),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":y[7]||(y[7]=C=>s.fields.hashFallbackQueryArgument=C),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":y[8]||(y[8]=C=>s.fields.hashFallbackUriCapture=C),"hash-on":s.fields.hashOn,"onUpdate:hashOn":y[9]||(y[9]=C=>s.fields.hashOn=C),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":y[10]||(y[10]=C=>s.fields.hashOnCookie=C),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":y[11]||(y[11]=C=>s.fields.hashOnCookiePath=C),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":y[12]||(y[12]=C=>s.fields.hashOnHeader=C),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":y[13]||(y[13]=C=>s.fields.hashOnQueryArgument=C),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":y[14]||(y[14]=C=>s.fields.hashOnUriCapture=C),slots:s.fields.slots,"onUpdate:slots":y[15]||(y[15]=C=>s.fields.slots=C),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(ad,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[y[16]||(y[16]=C=>s.fields.activeHealthSwitch=C),g],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":y[17]||(y[17]=C=>s.fields.healthchecksThreshold=C),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[y[18]||(y[18]=C=>s.fields.passiveHealthSwitch=C),_],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(cd,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":y[19]||(y[19]=C=>s.fields.activeHealthCheck.concurrency=C),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":y[20]||(y[20]=C=>s.fields.activeHealthCheck.headers=C),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":y[21]||(y[21]=C=>s.fields.activeHealthCheck.httpFailures=C),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":y[22]||(y[22]=C=>s.fields.activeHealthCheck.httpPath=C),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[23]||(y[23]=C=>s.fields.activeHealthCheck.httpStatuses=C),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":y[24]||(y[24]=C=>s.fields.activeHealthCheck.httpsSni=C),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":y[25]||(y[25]=C=>s.fields.activeHealthCheck.interval=C),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":y[26]||(y[26]=C=>s.fields.activeHealthCheck.successes=C),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[27]||(y[27]=C=>s.fields.activeHealthCheck.tcpFailures=C),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":y[28]||(y[28]=C=>s.fields.activeHealthCheck.timeout=C),type:s.fields.activeHealthCheck.type,"onUpdate:type":y[29]||(y[29]=C=>s.fields.activeHealthCheck.type=C),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[30]||(y[30]=C=>s.fields.activeHealthCheck.unhealthyHttpStatuses=C),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":y[31]||(y[31]=C=>s.fields.activeHealthCheck.unhealthyInterval=C),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":y[32]||(y[32]=C=>s.fields.activeHealthCheck.unhealthyTimeouts=C),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":y[33]||(y[33]=C=>s.fields.activeHealthCheck.verifySsl=C),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(fd,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":y[34]||(y[34]=C=>s.fields.passiveHealthCheck.httpFailures=C),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[35]||(y[35]=C=>s.fields.passiveHealthCheck.httpStatuses=C),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":y[36]||(y[36]=C=>s.fields.passiveHealthCheck.successes=C),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[37]||(y[37]=C=>s.fields.passiveHealthCheck.tcpFailures=C),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":y[38]||(y[38]=C=>s.fields.passiveHealthCheck.timeouts=C),type:s.fields.passiveHealthCheck.type,"onUpdate:type":y[39]||(y[39]=C=>s.fields.passiveHealthCheck.type=C),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[40]||(y[40]=C=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=C),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-0f247a1c"]]),yd=t.createElementVNode("code",null,"10",-1),kd=t.createElementVNode("code",null,"65536",-1),bd={"data-testid":"client_certificate-plain-text"},Cd=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=pe.useI18n(),{getPropValue:n}=yc(),i=t.computed(()=>Ie.form[r.config.app].edit),o=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:J.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:J.Basic},hash_on:{order:7,section:J.Basic},hash_on_header:{order:8,section:J.Basic},hash_on_uri_capture:{order:9,section:J.Basic},hash_on_query_arg:{order:10,section:J.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:J.Basic},hash_on_cookie_path:{order:12,section:J.Basic},healthchecks:{order:13,section:J.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(As),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":o.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onFetch:error":c[0]||(c[0]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[1]||(c[1]=h=>d.$emit("fetch:success",h)),onLoading:c[2]||(c[2]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(h.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[yd]),max:t.withCtx(()=>[kd]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",bd,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(n)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});re.TargetForm=lr,re.TargetsList=Pc,re.UpstreamsConfigCard=Cd,re.UpstreamsForm=gd,re.UpstreamsList=Uc,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});