@kong-ui-public/entities-upstreams-targets 2.1.4 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(te,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):(te=typeof globalThis<"u"?globalThis:te||self,t(te["kong-ui-entities-upstreams-targets"]={},te.Vue,te.axios,te["kong-ui-public-i18n"],te.Kongponents,te.VueRouter))})(this,function(te,t,pr,Be,ur,ze){"use strict";var Je=(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))(Je||{}),oe=(e=>(e.Edit="edit",e.Create="create",e))(oe||{}),he=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(he||{}),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.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 We(e={}){return{axiosInstance:pr.create({withCredentials:!0,timeout:3e4,...e})}}function fr(){return{debounce:(e,l)=>{let a;return(...r)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...r)},l)}}}}const Qe="khcp-user-table-preferences",mr={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function gr(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},l=()=>{const a=e(localStorage.getItem(Qe));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,r)=>{try{const o=l();o.set(a,r),localStorage.setItem(Qe,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:a=>{const r=l();return(r==null?void 0:r.get(a))||void 0||mr},deleteAllTablePreferences:()=>{localStorage.removeItem(Qe)}}}const yr={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},kr={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},br={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Cr={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},_r={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"}},wr={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Sr={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},xr={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Nr={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"}},Vr={global:yr,deleteModal:kr,baseForm:br,baseTable:Cr,baseConfigCard:_r,filter:wr,debouncedFilter:Sr,errors:xr,toggleModal:Nr};function Ye(){const e=Be.createI18n("en-us",Vr);return{i18n:e,i18nT:Be.i18nTComponent(e)}}function bt(){const e=(a,r)=>(r==null?void 0:r[a])??void 0,l=(a,r)=>{if(a.length!==r.length)return!1;const o=new Set([...a,...r]);for(const s of o){const c=a.filter(i=>i===s).length,h=r.filter(i=>i===s).length;if(c!==h)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,r,o)=>{if(o){if(Object.keys(a).length===Object.keys(r).length)for(const s in a)if(Array.isArray(a[s])&&Array.isArray(r[s])){if(l(a[s],r[s]))continue;return!1}else{if(a[s]===r[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(r)}catch{return!1}},sortAlpha:a=>(r,o)=>{let s=r[a]===void 0||r[a]===null?"":r[a],c=o[a]===void 0||o[a]===null?"":o[a];return Array.isArray(r[a])&&(s=r[a][0]),Array.isArray(o[a])&&(c=o[a][0]),s.localeCompare(c)},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 Br(e,l,a,r={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:o}=We({headers:e.requestHeaders}),{i18n:{t:s}}=Ye(),{debounce:c}=fr(),h=c(async S=>{await O(S)},200),i=t.ref(!1),d=t.ref(""),u=t.ref(""),p=t.ref([]),n=t.ref([]),k=t.ref(void 0),C=t.unref(l);let f=`${e.apiBaseUrl}${C}`;e.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=bt(),V=async()=>{try{i.value=!0;const{data:S}=await o.get(`${f}?size=${a}`);S!=null&&S.next||(k.value=r.fetchedItemsKey in S?S[r.fetchedItemsKey]:[]),n.value=r.fetchedItemsKey in S?S[r.fetchedItemsKey]:[],p.value=n.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{i.value=!1}},_=t.ref(""),O=async S=>{var x,q,A;if(_.value!==S)if(_.value=S||"",k.value===void 0)try{if(i.value=!0,d.value="",u.value="",e.app==="konnect"){let N=f+"";S&&(N+=`/${S}`);const{data:I}=await o.get(`${N}?size=${a}`);r.fetchedItemsKey in I?p.value=I[r.fetchedItemsKey]:I!=null&&I.id?p.value=[I]:p.value=[]}else if(S){const N=[];m(S)&&r.searchKeys.includes("id")?N.push((async()=>{const{data:T}=await o.get(`${f}/${S}`);return[T[r.fetchedItemsKey]??T]})()):N.push(...r.searchKeys.filter(T=>T!=="id").map(async T=>{const{data:H}=await o.get(`${f}?${T}=${S}`);return H[r.fetchedItemsKey]}));const I=await Promise.all(N),w=new Set;p.value=[],(x=I==null?void 0:I.forEach)==null||x.call(I,T=>{var H;(H=T==null?void 0:T.forEach)==null||H.call(T,$=>{w.has($.id)||(w.add($.id),p.value.push($))})})}else p.value=n.value}catch(N){((q=N==null?void 0:N.response)==null?void 0:q.status)===404?u.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{i.value=!1}else i.value=!0,u.value="",S?(p.value=(A=k.value)==null?void 0:A.filter(N=>{var I;let w=!1;for(const T of r.searchKeys){const H=typeof N[T]=="string"?(I=N[T])==null?void 0:I.toLowerCase():N[T];H!=null&&H.includes(S.toLowerCase())&&(w=!0)}return w}),(!p.value||!p.value.length)&&(u.value=s("debouncedFilter.errors.invalid"))):p.value=k.value,i.value=!1};return{loading:i,error:d,validationError:u,results:p,allRecords:k,loadItems:V,debouncedQueryChange:h}}function Ir(e,l){const a=t.unref(l),r=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return r.value.search="",o=>`${r.value.href}/${o}`}function Tr(){const{i18n:{t:e}}=Ye();return{getMessageFromError:l=>{var a,r,o;if(!l)return e("errors.unexpected");if((a=l==null?void 0:l.response)!=null&&a.data){if(l.response.data.detail)return l.response.data.detail;if((r=l.response.data.details)!=null&&r.length)return l.response.data.details.map(s=>{let c=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(c=s.messages.join(", ")),s.field?`${s.field} - ${c}`:c}).join("; ");if(l.response.data.message){const{message:s}=l.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof l.response.data=="string")return l.response.data;if(typeof l.response.data=="object")return Object.keys(l.response.data).map(s=>`${s} ${l.response.data[s]}`).join(", ")}return l.message||e("errors.unexpected")}}}function Hr(e){const l=window.location.origin,a=l.endsWith("/")?l:`${l}/`;try{const r=e.join("/"),o=`${a}${r}`,s=e.some(c=>c.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${a}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function Ct(e,l){const a=t.ref(t.unref(e)),r=t.ref(t.unref(l)),o=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),s=t.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return c=>{const{page:h,pageSize:i,offset:d,sortColumnKey:u,sortColumnOrder:p,query:n}=c;try{let k=new URL(s.value.href);return o.value&&n?(k.search="",k=new URL(`${k.href}?filter[name][contains]=${n}`)):(o.value||new URLSearchParams(n).forEach((C,f)=>{k.searchParams.append(f,C)}),u&&k.searchParams.append("sort_by",u),p==="desc"&&k.searchParams.append("sort_desc","1"),k.searchParams.append("size",String(i))),d&&h!==1&&k.searchParams.append("offset",String(d)),k.href}catch(k){return console.error("RouteList(fetcher)",k),r.value}}}function Er(e,l,a="data"){const r=t.unref(l),{axiosInstance:o}=We({headers:e.requestHeaders}),s=Ct(e,r),c=t.ref({status:he.Idle});return{fetcher:async h=>{try{c.value={status:he.Loading};const i=s(h),{data:d}=await o.get(i),u=a&&a.replace(/[^\w-_]/gi,"");let p;d[u]&&Array.isArray(d[u])?p=d[u]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const n={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return c.value={status:he.Idle,response:n},n}catch(i){const d={data:[],total:0};return h.query&&i.response.status===404?(c.value={status:he.NoResults,response:d,error:i},d):(c.value={status:he.Error,response:d,error:i},d)}},fetcherState:c}}function Ar(){const e=(a,r="_")=>a?a.split(r).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",l=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(l,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const _t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,wt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const l=e.match(_t);if(!l)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return l.shift(),l},St=e=>e==="*"||e==="x"||e==="X",xt=e=>{const l=parseInt(e,10);return isNaN(l)?e:l},Fr=(e,l)=>typeof e!=typeof l?[String(e),String(l)]:[e,l],Or=(e,l)=>{if(St(e)||St(l))return 0;const[a,r]=Fr(xt(e),xt(l));return a>r?1:a<r?-1:0},Nt=(e,l)=>{for(let a=0;a<Math.max(e.length,l.length);a++){const r=Or(e[a]||"0",l[a]||"0");if(r!==0)return r}return 0},qr=(e,l)=>{const a=wt(e),r=wt(l),o=a.pop(),s=r.pop(),c=Nt(a,r);return c!==0?c:o&&s?Nt(o.split("."),s.split(".")):o||s?o?-1:1:0},Vt=(e,l,a)=>{vr(a);const r=qr(e,l);return Bt[a].includes(r)},Bt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},It=Object.keys(Bt),vr=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(It.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${It.join("|")}`)},Ur=e=>typeof e=="string"&&/^[v\d]/.test(e)&&_t.test(e);function $r(e){const{gatewayInfo:l,supportedRange:a}=e;if(!l)return!0;const{edition:r,version:o}=l;if(!Ur(o))return console.error("Invalid version"),!1;const s=a[r];if(!s)return!1;const[c,h]=s;return!(c&&Vt(o,c,"<")||h&&Vt(o,h,">"))}function Dr(e){const l=t.ref(0),a=t.ref(0),r=t.ref(!1);return t.watch(e,o=>{o&&!r.value&&(l.value=o.offsetWidth,a.value=o.scrollWidth,r.value=!0)}),{isTruncated:t.computed(()=>l.value<a.value)}}const Y={useAxios:We,useDebouncedFilter:Br,useDeleteUrlBuilder:Ir,useErrors:Tr,useExternalLinkCreator:Hr,useFetcher:Er,useFetchUrlBuilder:Ct,useHelpers:bt,useStringHelpers:Ar,useI18n:Ye,useGatewayFeatureSupported:$r,useTruncationDetector:Dr},Mr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},jr="Copy to clipboard",Kr={message:Mr,iconTitle:jr},Pr="kong-ui-copy-uuid-notify",Tt="24px",Lr=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Rr=e=>(t.pushScopeId("data-v-243f8fec"),e=e(),t.popScopeId(),e),zr=["aria-hidden"],Jr={key:0,"data-testid":"kui-icon-svg-title"},Wr=Rr(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Qr=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Tt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Tt}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Jr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Wr],8,zr))]),_:1},8,["aria-hidden","style"]))}}),Yr=Lr(Qr,[["__scopeId","data-v-243f8fec"]]),Gr="16px",Zr={class:"kong-ui-copy-uuid"},Xr=["onClick"],Ht=15,eo=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:l}){const a=e,{t:r}=Be.createI18n("en-us",Kr),o=a.notify||t.inject(Pr,()=>{}),s=t.computed(()=>a.idTooltip?{label:a.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:a.uuid}),c=t.computed(()=>!!(a.tooltip&&a.successTooltip)),h=t.ref(a.tooltip),i=t.computed(()=>a.tooltip?{label:h.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=t.computed(()=>{var n;return a.format==="redacted"?"*****":a.format==="deleted"?`*${(n=a.uuid)==null?void 0:n.substring(0,5)}`:a.uuid}),u=n=>{h.value=n,setTimeout(()=>{h.value=a.tooltip},1800)},p=n=>{var k,C;if(!n(a.uuid)){typeof o=="function"&&o({type:"error",message:r("message.fail")}),c.value?u(r("message.fail")):l("error",a.uuid);return}const f=((k=a.uuid)==null?void 0:k.length)>Ht,m=a.format==="hidden"||a.format==="redacted"?r("message.success.prefix"):`"${((C=a.uuid)==null?void 0:C.substring(0,Ht))+(f?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${m}${r("message.success.content")}`}),c.value?u(a.successTooltip):l("success",a.uuid)};return(n,k)=>{const C=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Zr,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(d.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(i.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(C,null,{default:t.withCtx(({copyToClipboard:f})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(m=>p(f),["stop"])},[t.createVNode(t.unref(Yr),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(Gr),title:t.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Xr)]),_:1})]),_:1},16))])}}}),to=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Et=to(eo,[["__scopeId","data-v-0c07874b"]]),ao={key:0,class:"config-card-fieldset-title"},lo=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const l=e,{i18n:{t:a}}=Y.useI18n(),{convertKeyToTitle:r}=Y.useStringHelpers(),o=t.computed(()=>l.item.key??"json-array-item"),s=t.computed(()=>l.item.value??l.item),c=t.computed(()=>{const i=JSON.parse(JSON.stringify(s.value));return l.isArrayItem&&delete i.name,i}),h=t.computed(()=>{var i;return l.isArrayItem?(i=s.value)!=null&&i.name?r(s.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:l.index}):""});return(i,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",ao,[t.createElementVNode("b",null,t.toDisplayString(h.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(c.value),(u,p)=>(t.openBlock(),t.createBlock(Ge,{key:`${o.value}-property-${p}`,item:{key:u,label:t.unref(r)(u),value:c.value[u]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),re=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},At=re(lo,[["__scopeId","data-v-68ca83ec"]]),ro=re(t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:l}}=Y.useI18n();return(a,r)=>{const o=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=s=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(l)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-c96811e5"]]),oo=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:l}}=Y.useI18n();return(a,r)=>{const o=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(o,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(l)("baseConfigCard.statusBadge.enabledLabel"):t.unref(l)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),no="#0044f4",so="#e0e4ea",io="#3a3f51",co="1px",ho="20px",po={class:"config-card-details-row"},uo=["data-testid"],fo=["data-testid"],mo=["data-testid"],go=["data-testid"],yo={key:1},ko=["data-testid"],bo=["data-testid"],Co=["data-testid"],_o=["data-testid"],wo={name:"ConfigCardItem",components:{CopyUuid:Et,JsonCardItem:At,StatusBadge:oo,InternalLinkItem:ro}},So=t.defineComponent({...wo,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:l}){const a=e;t.useCssVars(k=>({"23f3018c":d.value?"none":`solid ${t.unref(co)} ${t.unref(so)}`,"3815ec6d":i.value&&c.value?"block":"flex","1957f153":i.value&&c.value?"100%":a.slim?"50%":"25%","195a372e":i.value&&c.value?"100%":a.slim?"50%":"75%"}));const r=t.useSlots(),{i18n:{t:o,formatUnixTimeStamp:s}}=Y.useI18n(),c=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),h=t.computed(()=>!!(a.item.tooltip||r["label-tooltip"])),i=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),d=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:s(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.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:k=>{l("navigation-click",k)}}};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}}}),p=t.ref(),{isTruncated:n}=Y.useTruncationDetector(p);return(k,C)=>{const f=t.resolveComponent("KLabel"),m=t.resolveComponent("KBadge"),V=t.resolveComponent("KMethodBadge"),_=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",po,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(k.$slots,"label",{item:e.item},()=>[t.createVNode(f,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[h.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(k.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,fo)]),key:"0"}:void 0]),1024)],!0)],8,uo),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(k.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(t.openBlock(),t.createElementBlock("div",yo,[(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,(O,S)=>(t.openBlock(),t.createBlock(m,{key:`${e.item.key}-badge-tag-${S}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${S}`,"truncation-tooltip":O},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(O),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,ko)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(O,S)=>(t.openBlock(),t.createBlock(t.unref(Et),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${S}`,"data-testid":`${e.item.key}-copy-uuid-${S}`,uuid:O}),null,16,["data-testid","uuid"]))),128))],8,bo)):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,(O,S)=>(t.openBlock(),t.createBlock(V,{key:`${e.item.key}-badge-method-${S}`,class:"config-badge","data-testid":`${e.item.key}-badge-method-${S}`,"is-rounded":"",label:O,method:t.unref(ur.MethodsArray).includes(O.toLowerCase())?O.toLowerCase():"custom"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(O),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,Co)):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,(O,S)=>(t.openBlock(),t.createBlock(At,{key:`json-array-item-${S}`,index:S,"is-array-item":"",item:O},null,8,["index","item"]))),128))],8,_o)):(t.openBlock(),t.createBlock(_,{key:4,label:t.unref(n)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:p,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,go))],!0)],8,mo)])}}}),Ge=re(So,[["__scopeId","data-v-e851fc7c"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ft(e){return typeof e>"u"||e===null}function xo(e){return typeof e=="object"&&e!==null}function No(e){return Array.isArray(e)?e:Ft(e)?[]:[e]}function Vo(e,l){var a,r,o,s;if(l)for(s=Object.keys(l),a=0,r=s.length;a<r;a+=1)o=s[a],e[o]=l[o];return e}function Bo(e,l){var a="",r;for(r=0;r<l;r+=1)a+=e;return a}function Io(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var To=Ft,Ho=xo,Eo=No,Ao=Bo,Fo=Io,Oo=Vo,Q={isNothing:To,isObject:Ho,toArray:Eo,repeat:Ao,isNegativeZero:Fo,extend:Oo};function Ot(e,l){var a="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!l&&e.mark.snippet&&(a+=`
1
+ (function(te,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):(te=typeof globalThis<"u"?globalThis:te||self,t(te["kong-ui-entities-upstreams-targets"]={},te.Vue,te.axios,te["kong-ui-public-i18n"],te.Kongponents,te.VueRouter))})(this,function(te,t,pr,Be,ur,ze){"use strict";var Je=(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))(Je||{}),oe=(e=>(e.Edit="edit",e.Create="create",e))(oe||{}),he=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(he||{}),P=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(P||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function We(e={}){return{axiosInstance:pr.create({withCredentials:!0,timeout:3e4,...e})}}function fr(){return{debounce:(e,l)=>{let a;return(...r)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...r)},l)}}}}const Qe="khcp-user-table-preferences",mr={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function gr(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},l=()=>{const a=e(localStorage.getItem(Qe));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,r)=>{try{const o=l();o.set(a,r),localStorage.setItem(Qe,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:a=>{const r=l();return(r==null?void 0:r.get(a))||void 0||mr},deleteAllTablePreferences:()=>{localStorage.removeItem(Qe)}}}const yr={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},kr={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},br={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Cr={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},_r={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"}},wr={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Sr={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},xr={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Nr={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"}},Vr={global:yr,deleteModal:kr,baseForm:br,baseTable:Cr,baseConfigCard:_r,filter:wr,debouncedFilter:Sr,errors:xr,toggleModal:Nr};function Ye(){const e=Be.createI18n("en-us",Vr);return{i18n:e,i18nT:Be.i18nTComponent(e)}}function bt(){const e=(a,r)=>(r==null?void 0:r[a])??void 0,l=(a,r)=>{if(a.length!==r.length)return!1;const o=new Set([...a,...r]);for(const s of o){const c=a.filter(i=>i===s).length,h=r.filter(i=>i===s).length;if(c!==h)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,r,o)=>{if(o){if(Object.keys(a).length===Object.keys(r).length)for(const s in a)if(Array.isArray(a[s])&&Array.isArray(r[s])){if(l(a[s],r[s]))continue;return!1}else{if(a[s]===r[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(r)}catch{return!1}},sortAlpha:a=>(r,o)=>{let s=r[a]===void 0||r[a]===null?"":r[a],c=o[a]===void 0||o[a]===null?"":o[a];return Array.isArray(r[a])&&(s=r[a][0]),Array.isArray(o[a])&&(c=o[a][0]),s.localeCompare(c)},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 Br(e,l,a,r={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:o}=We({headers:e.requestHeaders}),{i18n:{t:s}}=Ye(),{debounce:c}=fr(),h=c(async S=>{await O(S)},200),i=t.ref(!1),d=t.ref(""),u=t.ref(""),p=t.ref([]),n=t.ref([]),k=t.ref(void 0),C=t.unref(l);let f=`${e.apiBaseUrl}${C}`;e.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=bt(),V=async()=>{try{i.value=!0;const{data:S}=await o.get(`${f}?size=${a}`);S!=null&&S.next||(k.value=r.fetchedItemsKey in S?S[r.fetchedItemsKey]:[]),n.value=r.fetchedItemsKey in S?S[r.fetchedItemsKey]:[],p.value=n.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{i.value=!1}},_=t.ref(""),O=async S=>{var x,q,A;if(_.value!==S)if(_.value=S||"",k.value===void 0)try{if(i.value=!0,d.value="",u.value="",e.app==="konnect"){let N=f+"";S&&(N+=`/${S}`);const{data:I}=await o.get(`${N}?size=${a}`);r.fetchedItemsKey in I?p.value=I[r.fetchedItemsKey]:I!=null&&I.id?p.value=[I]:p.value=[]}else if(S){const N=[];m(S)&&r.searchKeys.includes("id")?N.push((async()=>{const{data:T}=await o.get(`${f}/${S}`);return[T[r.fetchedItemsKey]??T]})()):N.push(...r.searchKeys.filter(T=>T!=="id").map(async T=>{const{data:H}=await o.get(`${f}?${T}=${S}`);return H[r.fetchedItemsKey]}));const I=await Promise.all(N),w=new Set;p.value=[],(x=I==null?void 0:I.forEach)==null||x.call(I,T=>{var H;(H=T==null?void 0:T.forEach)==null||H.call(T,$=>{w.has($.id)||(w.add($.id),p.value.push($))})})}else p.value=n.value}catch(N){((q=N==null?void 0:N.response)==null?void 0:q.status)===404?u.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{i.value=!1}else i.value=!0,u.value="",S?(p.value=(A=k.value)==null?void 0:A.filter(N=>{var I;let w=!1;for(const T of r.searchKeys){const H=typeof N[T]=="string"?(I=N[T])==null?void 0:I.toLowerCase():N[T];H!=null&&H.includes(S.toLowerCase())&&(w=!0)}return w}),(!p.value||!p.value.length)&&(u.value=s("debouncedFilter.errors.invalid"))):p.value=k.value,i.value=!1};return{loading:i,error:d,validationError:u,results:p,allRecords:k,loadItems:V,debouncedQueryChange:h}}function Ir(e,l){const a=t.unref(l),r=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return r.value.search="",o=>`${r.value.href}/${o}`}function Tr(){const{i18n:{t:e}}=Ye();return{getMessageFromError:l=>{var a,r,o;if(!l)return e("errors.unexpected");if((a=l==null?void 0:l.response)!=null&&a.data){if(l.response.data.detail)return l.response.data.detail;if((r=l.response.data.details)!=null&&r.length)return l.response.data.details.map(s=>{let c=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(c=s.messages.join(", ")),s.field?`${s.field} - ${c}`:c}).join("; ");if(l.response.data.message){const{message:s}=l.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof l.response.data=="string")return l.response.data;if(typeof l.response.data=="object")return Object.keys(l.response.data).map(s=>`${s} ${l.response.data[s]}`).join(", ")}return l.message||e("errors.unexpected")}}}function Hr(e){const l=window.location.origin,a=l.endsWith("/")?l:`${l}/`;try{const r=e.join("/"),o=`${a}${r}`,s=e.some(c=>c.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${a}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function Ct(e,l){const a=t.ref(t.unref(e)),r=t.ref(t.unref(l)),o=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),s=t.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return c=>{const{page:h,pageSize:i,offset:d,sortColumnKey:u,sortColumnOrder:p,query:n}=c;try{let k=new URL(s.value.href);return o.value&&n?(k.search="",k=new URL(`${k.href}?filter[name][contains]=${n}`)):(o.value||new URLSearchParams(n).forEach((C,f)=>{k.searchParams.append(f,C)}),u&&k.searchParams.append("sort_by",u),p==="desc"&&k.searchParams.append("sort_desc","1"),k.searchParams.append("size",String(i))),d&&h!==1&&k.searchParams.append("offset",String(d)),k.href}catch(k){return console.error("RouteList(fetcher)",k),r.value}}}function Er(e,l,a="data"){const r=t.unref(l),{axiosInstance:o}=We({headers:e.requestHeaders}),s=Ct(e,r),c=t.ref({status:he.Idle});return{fetcher:async h=>{try{c.value={status:he.Loading};const i=s(h),{data:d}=await o.get(i),u=a&&a.replace(/[^\w-_]/gi,"");let p;d[u]&&Array.isArray(d[u])?p=d[u]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const n={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return c.value={status:he.Idle,response:n},n}catch(i){const d={data:[],total:0};return h.query&&i.response.status===404?(c.value={status:he.NoResults,response:d,error:i},d):(c.value={status:he.Error,response:d,error:i},d)}},fetcherState:c}}function Ar(){const e=(a,r="_")=>a?a.split(r).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",l=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(l,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const _t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,wt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const l=e.match(_t);if(!l)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return l.shift(),l},St=e=>e==="*"||e==="x"||e==="X",xt=e=>{const l=parseInt(e,10);return isNaN(l)?e:l},Fr=(e,l)=>typeof e!=typeof l?[String(e),String(l)]:[e,l],Or=(e,l)=>{if(St(e)||St(l))return 0;const[a,r]=Fr(xt(e),xt(l));return a>r?1:a<r?-1:0},Nt=(e,l)=>{for(let a=0;a<Math.max(e.length,l.length);a++){const r=Or(e[a]||"0",l[a]||"0");if(r!==0)return r}return 0},qr=(e,l)=>{const a=wt(e),r=wt(l),o=a.pop(),s=r.pop(),c=Nt(a,r);return c!==0?c:o&&s?Nt(o.split("."),s.split(".")):o||s?o?-1:1:0},Vt=(e,l,a)=>{vr(a);const r=qr(e,l);return Bt[a].includes(r)},Bt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},It=Object.keys(Bt),vr=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(It.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${It.join("|")}`)},Ur=e=>typeof e=="string"&&/^[v\d]/.test(e)&&_t.test(e);function $r(e){const{gatewayInfo:l,supportedRange:a}=e;if(!l)return!0;const{edition:r,version:o}=l;if(!Ur(o))return console.error("Invalid version"),!1;const s=a[r];if(!s)return!1;const[c,h]=s;return!(c&&Vt(o,c,"<")||h&&Vt(o,h,">"))}function Dr(e){const l=t.ref(0),a=t.ref(0),r=t.ref(!1);return t.watch(e,o=>{o&&!r.value&&(l.value=o.offsetWidth,a.value=o.scrollWidth,r.value=!0)}),{isTruncated:t.computed(()=>l.value<a.value)}}const Y={useAxios:We,useDebouncedFilter:Br,useDeleteUrlBuilder:Ir,useErrors:Tr,useExternalLinkCreator:Hr,useFetcher:Er,useFetchUrlBuilder:Ct,useHelpers:bt,useStringHelpers:Ar,useI18n:Ye,useGatewayFeatureSupported:$r,useTruncationDetector:Dr},Mr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},jr="Copy to clipboard",Kr={message:Mr,iconTitle:jr},Pr="kong-ui-copy-uuid-notify",Tt="24px",Lr=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Rr=e=>(t.pushScopeId("data-v-77afb926"),e=e(),t.popScopeId(),e),zr=["aria-hidden"],Jr={key:0,"data-testid":"kui-icon-svg-title"},Wr=Rr(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Qr=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Tt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Tt}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Jr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Wr],8,zr))]),_:1},8,["aria-hidden","style"]))}}),Yr=Lr(Qr,[["__scopeId","data-v-77afb926"]]),Gr="16px",Zr={class:"kong-ui-copy-uuid"},Xr=["onClick"],Ht=15,eo=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:l}){const a=e,{t:r}=Be.createI18n("en-us",Kr),o=a.notify||t.inject(Pr,()=>{}),s=t.computed(()=>a.idTooltip?{label:a.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:a.uuid}),c=t.computed(()=>!!(a.tooltip&&a.successTooltip)),h=t.ref(a.tooltip),i=t.computed(()=>a.tooltip?{label:h.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=t.computed(()=>{var n;return a.format==="redacted"?"*****":a.format==="deleted"?`*${(n=a.uuid)==null?void 0:n.substring(0,5)}`:a.uuid}),u=n=>{h.value=n,setTimeout(()=>{h.value=a.tooltip},1800)},p=n=>{var k,C;if(!n(a.uuid)){typeof o=="function"&&o({type:"error",message:r("message.fail")}),c.value?u(r("message.fail")):l("error",a.uuid);return}const f=((k=a.uuid)==null?void 0:k.length)>Ht,m=a.format==="hidden"||a.format==="redacted"?r("message.success.prefix"):`"${((C=a.uuid)==null?void 0:C.substring(0,Ht))+(f?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${m}${r("message.success.content")}`}),c.value?u(a.successTooltip):l("success",a.uuid)};return(n,k)=>{const C=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Zr,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(d.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(i.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(C,null,{default:t.withCtx(({copyToClipboard:f})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(m=>p(f),["stop"])},[t.createVNode(t.unref(Yr),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(Gr),title:t.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Xr)]),_:1})]),_:1},16))])}}}),to=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Et=to(eo,[["__scopeId","data-v-0c07874b"]]),ao={key:0,class:"config-card-fieldset-title"},lo=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const l=e,{i18n:{t:a}}=Y.useI18n(),{convertKeyToTitle:r}=Y.useStringHelpers(),o=t.computed(()=>l.item.key??"json-array-item"),s=t.computed(()=>l.item.value??l.item),c=t.computed(()=>{const i=JSON.parse(JSON.stringify(s.value));return l.isArrayItem&&delete i.name,i}),h=t.computed(()=>{var i;return l.isArrayItem?(i=s.value)!=null&&i.name?r(s.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:l.index}):""});return(i,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",ao,[t.createElementVNode("b",null,t.toDisplayString(h.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(c.value),(u,p)=>(t.openBlock(),t.createBlock(Ge,{key:`${o.value}-property-${p}`,item:{key:u,label:t.unref(r)(u),value:c.value[u]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),re=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},At=re(lo,[["__scopeId","data-v-68ca83ec"]]),ro=re(t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:l}}=Y.useI18n();return(a,r)=>{const o=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=s=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(l)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-c96811e5"]]),oo=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:l}}=Y.useI18n();return(a,r)=>{const o=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(o,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(l)("baseConfigCard.statusBadge.enabledLabel"):t.unref(l)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),no="#0044f4",so="#e0e4ea",io="#3a3f51",co="1px",ho="20px",po={class:"config-card-details-row"},uo=["data-testid"],fo=["data-testid"],mo=["data-testid"],go=["data-testid"],yo={key:1},ko=["data-testid"],bo=["data-testid"],Co=["data-testid"],_o=["data-testid"],wo={name:"ConfigCardItem",components:{CopyUuid:Et,JsonCardItem:At,StatusBadge:oo,InternalLinkItem:ro}},So=t.defineComponent({...wo,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:l}){const a=e;t.useCssVars(k=>({"23f3018c":d.value?"none":`solid ${t.unref(co)} ${t.unref(so)}`,"3815ec6d":i.value&&c.value?"block":"flex","1957f153":i.value&&c.value?"100%":a.slim?"50%":"25%","195a372e":i.value&&c.value?"100%":a.slim?"50%":"75%"}));const r=t.useSlots(),{i18n:{t:o,formatUnixTimeStamp:s}}=Y.useI18n(),c=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),h=t.computed(()=>!!(a.item.tooltip||r["label-tooltip"])),i=t.computed(()=>a.item.type===P.Json||a.item.type===P.JsonArray),d=t.computed(()=>a.item.type===P.JsonArray),u=t.computed(()=>{switch(a.item.type){case P.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case P.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case P.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case P.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case P.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:s(a.item.value)};case P.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case P.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case P.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case P.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:k=>{l("navigation-click",k)}}};case P.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case P.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case P.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}}}),p=t.ref(),{isTruncated:n}=Y.useTruncationDetector(p);return(k,C)=>{const f=t.resolveComponent("KLabel"),m=t.resolveComponent("KBadge"),V=t.resolveComponent("KMethodBadge"),_=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",po,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(k.$slots,"label",{item:e.item},()=>[t.createVNode(f,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[h.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(k.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,fo)]),key:"0"}:void 0]),1024)],!0)],8,uo),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(k.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(t.openBlock(),t.createElementBlock("div",yo,[(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,(O,S)=>(t.openBlock(),t.createBlock(m,{key:`${e.item.key}-badge-tag-${S}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${S}`,"truncation-tooltip":O},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(O),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,ko)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(O,S)=>(t.openBlock(),t.createBlock(t.unref(Et),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${S}`,"data-testid":`${e.item.key}-copy-uuid-${S}`,uuid:O}),null,16,["data-testid","uuid"]))),128))],8,bo)):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,(O,S)=>(t.openBlock(),t.createBlock(V,{key:`${e.item.key}-badge-method-${S}`,class:"config-badge","data-testid":`${e.item.key}-badge-method-${S}`,"is-rounded":"",label:O,method:t.unref(ur.MethodsArray).includes(O.toLowerCase())?O.toLowerCase():"custom"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(O),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,Co)):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,(O,S)=>(t.openBlock(),t.createBlock(At,{key:`json-array-item-${S}`,index:S,"is-array-item":"",item:O},null,8,["index","item"]))),128))],8,_o)):(t.openBlock(),t.createBlock(_,{key:4,label:t.unref(n)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:p,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,go))],!0)],8,mo)])}}}),Ge=re(So,[["__scopeId","data-v-e851fc7c"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ft(e){return typeof e>"u"||e===null}function xo(e){return typeof e=="object"&&e!==null}function No(e){return Array.isArray(e)?e:Ft(e)?[]:[e]}function Vo(e,l){var a,r,o,s;if(l)for(s=Object.keys(l),a=0,r=s.length;a<r;a+=1)o=s[a],e[o]=l[o];return e}function Bo(e,l){var a="",r;for(r=0;r<l;r+=1)a+=e;return a}function Io(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var To=Ft,Ho=xo,Eo=No,Ao=Bo,Fo=Io,Oo=Vo,Q={isNothing:To,isObject:Ho,toArray:Eo,repeat:Ao,isNegativeZero:Fo,extend:Oo};function Ot(e,l){var a="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!l&&e.mark.snippet&&(a+=`
2
2
 
3
3
  `+e.mark.snippet),r+" "+a):r}function Ie(e,l){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=l,this.message=Ot(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ie.prototype=Object.create(Error.prototype),Ie.prototype.constructor=Ie,Ie.prototype.toString=function(e){return this.name+": "+Ot(this,e)};var ae=Ie;function Ze(e,l,a,r,o){var s="",c="",h=Math.floor(o/2)-1;return r-l>h&&(s=" ... ",l=r-h+s.length),a-r>h&&(c=" ...",a=r+h-c.length),{str:s+e.slice(l,a).replace(/\t/g,"→")+c,pos:r-l+s.length}}function Xe(e,l){return Q.repeat(" ",l-e.length)+e}function qo(e,l){if(l=Object.create(l||null),!e.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);for(var a=/\r?\n|\r|\0/g,r=[0],o=[],s,c=-1;s=a.exec(e.buffer);)o.push(s.index),r.push(s.index+s[0].length),e.position<=s.index&&c<0&&(c=r.length-2);c<0&&(c=r.length-1);var h="",i,d,u=Math.min(e.line+l.linesAfter,o.length).toString().length,p=l.maxLength-(l.indent+u+3);for(i=1;i<=l.linesBefore&&!(c-i<0);i++)d=Ze(e.buffer,r[c-i],o[c-i],e.position-(r[c]-r[c-i]),p),h=Q.repeat(" ",l.indent)+Xe((e.line-i+1).toString(),u)+" | "+d.str+`
4
4
  `+h;for(d=Ze(e.buffer,r[c],o[c],e.position,p),h+=Q.repeat(" ",l.indent)+Xe((e.line+1).toString(),u)+" | "+d.str+`
@@ -29,4 +29,4 @@
29
29
  `+e.slice(o,s),o=s+1),c=h;return i+=`
30
30
  `,e.length-o>l&&c>o?i+=e.slice(o,c)+`
31
31
  `+e.slice(c+1):i+=e.slice(o),i.slice(1)}function ws(e){for(var l="",a=0,r,o=0;o<e.length;a>=65536?o+=2:o++)a=Ae(e,o),r=X[a],!r&&Ee(a)?(l+=e[o],a>=65536&&(l+=e[o+1])):l+=r||us(a);return l}function Ss(e,l,a){var r="",o=e.tag,s,c,h;for(s=0,c=a.length;s<c;s+=1)h=a[s],e.replacer&&(h=e.replacer.call(a,String(s),h)),(se(e,l,h,!1,!1)||typeof h>"u"&&se(e,l,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=o,e.dump="["+r+"]"}function Fa(e,l,a,r){var o="",s=e.tag,c,h,i;for(c=0,h=a.length;c<h;c+=1)i=a[c],e.replacer&&(i=e.replacer.call(a,String(c),i)),(se(e,l+1,i,!0,!0,!1,!0)||typeof i>"u"&&se(e,l+1,null,!0,!0,!1,!0))&&((!r||o!=="")&&(o+=it(e,l)),e.dump&&Te===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function xs(e,l,a){var r="",o=e.tag,s=Object.keys(a),c,h,i,d,u;for(c=0,h=s.length;c<h;c+=1)u="",r!==""&&(u+=", "),e.condenseFlow&&(u+='"'),i=s[c],d=a[i],e.replacer&&(d=e.replacer.call(a,i,d)),se(e,l,i,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),se(e,l,d,!1,!1)&&(u+=e.dump,r+=u));e.tag=o,e.dump="{"+r+"}"}function Ns(e,l,a,r){var o="",s=e.tag,c=Object.keys(a),h,i,d,u,p,n;if(e.sortKeys===!0)c.sort();else if(typeof e.sortKeys=="function")c.sort(e.sortKeys);else if(e.sortKeys)throw new ae("sortKeys must be a boolean or a function");for(h=0,i=c.length;h<i;h+=1)n="",(!r||o!=="")&&(n+=it(e,l)),d=c[h],u=a[d],e.replacer&&(u=e.replacer.call(a,d,u)),se(e,l+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Te===e.dump.charCodeAt(0)?n+="?":n+="? "),n+=e.dump,p&&(n+=it(e,l)),se(e,l+1,u,!0,p)&&(e.dump&&Te===e.dump.charCodeAt(0)?n+=":":n+=": ",n+=e.dump,o+=n));e.tag=s,e.dump=o||"{}"}function Oa(e,l,a){var r,o,s,c,h,i;for(o=a?e.explicitTypes:e.implicitTypes,s=0,c=o.length;s<c;s+=1)if(h=o[s],(h.instanceOf||h.predicate)&&(!h.instanceOf||typeof l=="object"&&l instanceof h.instanceOf)&&(!h.predicate||h.predicate(l))){if(a?h.multi&&h.representName?e.tag=h.representName(l):e.tag=h.tag:e.tag="?",h.represent){if(i=e.styleMap[h.tag]||h.defaultStyle,ga.call(h.represent)==="[object Function]")r=h.represent(l,i);else if(ya.call(h.represent,i))r=h.represent[i](l,i);else throw new ae("!<"+h.tag+'> tag resolver accepts not "'+i+'" style');e.dump=r}return!0}return!1}function se(e,l,a,r,o,s,c){e.tag=null,e.dump=a,Oa(e,a,!1)||Oa(e,a,!0);var h=ga.call(e.dump),i=r,d;r&&(r=e.flowLevel<0||e.flowLevel>l);var u=h==="[object Object]"||h==="[object Array]",p,n;if(u&&(p=e.duplicates.indexOf(a),n=p!==-1),(e.tag!==null&&e.tag!=="?"||n||e.indent!==2&&l>0)&&(o=!1),n&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(u&&n&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),h==="[object Object]")r&&Object.keys(e.dump).length!==0?(Ns(e,l,e.dump,o),n&&(e.dump="&ref_"+p+e.dump)):(xs(e,l,e.dump),n&&(e.dump="&ref_"+p+" "+e.dump));else if(h==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!c&&l>0?Fa(e,l-1,e.dump,o):Fa(e,l,e.dump,o),n&&(e.dump="&ref_"+p+e.dump)):(Ss(e,l,e.dump),n&&(e.dump="&ref_"+p+" "+e.dump));else if(h==="[object String]")e.tag!=="?"&&Cs(e,e.dump,l,s,i);else{if(h==="[object Undefined]"||e.skipInvalid)return!1;throw new ae("unacceptable kind of an object to dump "+h)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function Vs(e,l){var a=[],r=[],o,s;for(dt(e,a,r),o=0,s=r.length;o<s;o+=1)l.duplicates.push(a[r[o]]);l.usedDuplicates=new Array(s)}function dt(e,l,a){var r,o,s;if(e!==null&&typeof e=="object")if(o=l.indexOf(e),o!==-1)a.indexOf(o)===-1&&a.push(o);else if(l.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)dt(e[o],l,a);else for(r=Object.keys(e),o=0,s=r.length;o<s;o+=1)dt(e[r[o]],l,a)}function Bs(e,l){l=l||{};var a=new ms(l);a.noRefs||Vs(e,a);var r=e;return a.replacer&&(r=a.replacer.call({"":r},"",r)),se(a,0,r,!0,!0)?a.dump+`
32
- `:""}var Is=Bs,Ts={dump:Is};function ht(e,l){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+l+" instead, which is now safe by default.")}}var Hs=G,Es=vt,As=Mt,Fs=Rt,Os=zt,qs=at,vs=ma.load,Us=ma.loadAll,$s=Ts.dump,Ds=ae,Ms={binary:Gt,float:Lt,map:Dt,null:jt,pairs:Xt,set:ea,timestamp:Qt,bool:Kt,int:Pt,merge:Yt,omap:Zt,seq:$t,str:Ut},js=ht("safeLoad","load"),Ks=ht("safeLoadAll","loadAll"),Ps=ht("safeDump","dump"),Ls={Type:Hs,Schema:Es,FAILSAFE_SCHEMA:As,JSON_SCHEMA:Fs,CORE_SCHEMA:Os,DEFAULT_SCHEMA:qs,load:vs,loadAll:Us,dump:$s,YAMLException:Ds,types:Ms,safeLoad:js,safeLoadAll:Ks,safeDump:Ps};const Rs={key:0,class:"config-card-display-form"},zs=["data-testid"],Js={key:0,class:"config-card-prop-section-title"},Ws={key:1,class:"config-card-display-json"},Qs={key:2,class:"config-card-display-yaml"},Ys=re(t.defineComponent({__name:"ConfigCardDisplay",props:{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:()=>null}},setup(e){const l=e,a=t.useSlots(),{i18n:{t:r}}=Y.useI18n(),o=h=>!!(h.tooltip||a[`${h.key}-label-tooltip`]),s=t.ref(""),c=t.ref("");return t.watch(()=>l.format,h=>{if(h!=="structured"){const i=JSON.parse(JSON.stringify(l.record));delete i.created_at,delete i.updated_at,h==="json"?s.value=JSON.stringify(i,null,2):h==="yaml"&&(c.value=Ls.dump(i))}},{immediate:!0}),(h,i)=>{const d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Rs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,u=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${u}-props`,class:t.normalizeClass(`config-card-details-${u}-props`),"data-testid":`config-card-details-${u}-props`},[u!=="basic"?(t.openBlock(),t.createElementBlock("div",Js,t.toDisplayString(u==="advanced"?t.unref(r)("baseConfigCard.sections.advanced"):t.unref(r)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[u],p=>(t.openBlock(),t.createBlock(Ge,{key:p.key,item:p},t.createSlots({label:t.withCtx(()=>[t.renderSlot(h.$slots,`${p.key}-label`,{row:p},void 0,!0)]),[p.key]:t.withCtx(({rowValue:n})=>[t.renderSlot(h.$slots,p.key,{row:p,rowValue:n},void 0,!0)]),_:2},[o(p)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(h.$slots,`${p.key}-label-tooltip`,{row:p},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,zs))),128))])):t.createCommentVNode("",!0),e.format==="json"?(t.openBlock(),t.createElementBlock("div",Ws,[t.createVNode(d,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),e.format==="yaml"?(t.openBlock(),t.createElementBlock("div",Qs,[t.createVNode(d,{id:"config-card-codeblock",code:c.value,language:"yaml",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-c914c7e4"]]),qa="24px",Gs=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Zs=e=>(t.pushScopeId("data-v-81457922"),e=e(),t.popScopeId(),e),Xs=["aria-hidden"],ei={key:0,"data-testid":"kui-icon-svg-title"},ti=Zs(()=>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)),ai=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:qa,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qa}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,s)=>(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(r.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",ei,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ti],8,Xs))]),_:1},8,["aria-hidden","style"]))}}),li=Gs(ai,[["__scopeId","data-v-81457922"]]),ri={"data-testid":"config-card-title"},oi={class:"config-card-actions"},ni=["href"],si={key:2,class:"config-card-details-section"},ii={key:3,class:"config-card-details-section"},ci=["data-testid"],di={key:0,class:"config-card-prop-section-title"},hi=re(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}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:l}){var a;const r=e,o=t.useSlots(),{i18n:{t:s}}=Y.useI18n(),{getMessageFromError:c}=Y.useErrors(),{convertKeyToTitle:h}=Y.useStringHelpers(),{axiosInstance:i}=Y.useAxios({headers:(a=r.config)==null?void 0:a.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=t.ref("structured"),p=N=>{u.value=N==null?void 0:N.value},n={id:{type:L.ID,label:s("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:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:L.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:L.BadgeTag,order:-1,section:J.Basic}},k=t.ref(!1),C=t.ref(!1),f=t.ref(""),m=t.ref(),V=t.computed(()=>{var N,I,w;if(!m.value)return[];const T=[],H=Object.keys(m.value).length;for(const $ in m.value){const v=(I=(N=r.configSchema)==null?void 0:N[$])==null?void 0:I.order,F=(w=n[$])==null?void 0:w.order;let D=H;(F||F===0)&&(D=F===-1?H+1:F),v&&(D=v===-1?H+1:v),T.push([$,D])}return T.sort(function($,v){return $[1]-v[1]}),T.map($=>{var v,F;const D=$[0],M=(v=m.value)==null?void 0:v[D],B=((F=r.configSchema)==null?void 0:F[D])||{},U=n[D];return{key:D,value:M,hidden:B.hidden||!1,type:B.type??((U==null?void 0:U.type)||L.Text),label:B.label??((U==null?void 0:U.label)||h(D)),tooltip:B.tooltip??((U==null?void 0:U.tooltip)||void 0),section:B.section??((U==null?void 0:U.section)||J.Advanced)}}).filter($=>!$.hidden&&$.key!==r.pluginConfigKey)}),_=t.computed(()=>{var N,I;if(!m.value||!r.pluginConfigKey)return[];const w=m.value[r.pluginConfigKey]||{},T=Object.keys(w).length,H=[];for(const $ in w){const v=(I=(N=r.pluginConfigSchema)==null?void 0:N[$])==null?void 0:I.order,F=w[$];let D=F!=null&&F!==""?T-1:T;v&&(D=v===-1?T+1:v),H.push([$,D])}return H.sort(function($,v){return $[1]-v[1]}),H.map($=>{var v;const F=$[0],D=w[F],M=((v=r.pluginConfigSchema)==null?void 0:v[F])||{};return{key:F,value:D,hidden:M.hidden||!1,type:M.type??L.Text,label:M.label??h(F),tooltip:M.tooltip??void 0,section:J.Plugin}}).filter($=>!$.hidden)}),O=t.computed(()=>{var N,I,w,T;return{basic:(N=V.value)==null?void 0:N.filter(H=>H.section===J.Basic),advanced:(I=V.value)==null?void 0:I.filter(H=>H.section===J.Advanced),plugin:(T=_.value)==null?void 0:T.concat((w=V.value)==null?void 0:w.filter(H=>H.section===J.Plugin))}}),S=t.computed(()=>{const N=[];return O.value.basic.length&&N.push("basic"),O.value.advanced.length&&N.push("advanced"),O.value.plugin.length&&N.push("plugin"),N}),x=N=>!!(N.tooltip||o[`${N.key}-label-tooltip`]),q=t.computed(()=>{var N,I;let w=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((N=r.config)==null?void 0:N.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(I=r.config)!=null&&I.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.config.entityId),w}),A=N=>{m.value&&N(JSON.stringify(m.value))?l("copy:success",m.value):l("copy:error")};return t.watch(k,N=>{l("loading",N)},{immediate:!0}),t.onBeforeMount(async()=>{C.value=!1,k.value=!0;try{const{data:N}=await i.get(q.value);if(r.dataKey)if(typeof N[r.dataKey]<"u")m.value={...N[r.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:r.dataKey}));else m.value={...N};Object.keys(r.configSchema).filter(I=>r.configSchema[I].forceShow).forEach(I=>{m.value&&typeof m.value[I]>"u"&&(m.value[I]=null)}),l("fetch:success",N)}catch(N){const I=c(N);f.value=I.startsWith("code")?s("baseConfigCard.errors.load"):I,C.value=!0,l("fetch:error",N)}finally{k.value=!1}}),(N,I)=>{const w=t.resolveComponent("KLabel"),T=t.resolveComponent("KSelect"),H=t.resolveComponent("KButton"),$=t.resolveComponent("KClipboardProvider"),v=t.resolveComponent("KSkeleton"),F=t.resolveComponent("KEmptyState"),D=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(D,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",oi,[t.renderSlot(N.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(w,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(T,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:p})):t.createCommentVNode("",!0),r.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock(H,{key:2,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(li),{size:t.unref(ho)},null,8,["size"])],8,ni)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock($,{key:3},{default:t.withCtx(({copyToClipboard:M})=>[!k.value&&!C.value?(t.openBlock(),t.createBlock(H,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:B=>A(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),body:t.withCtx(()=>[k.value?(t.openBlock(),t.createBlock(v,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):C.value?(t.openBlock(),t.createBlock(F,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(f.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",si,[t.createVNode(Ys,{format:u.value,"prop-list-types":S.value,"property-collections":O.value,record:m.value},t.createSlots({_:2},[t.renderList(Object.keys(N.$slots),M=>({name:M,fn:t.withCtx(({row:B,rowValue:U})=>[t.renderSlot(N.$slots,M,{row:B,rowValue:U},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",ii,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(S.value,M=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${M}-props`,class:t.normalizeClass(`config-card-details-${M}-props`),"data-testid":`config-card-details-${M}-props`},[M!=="basic"?(t.openBlock(),t.createElementBlock("div",di,t.toDisplayString(M==="advanced"?t.unref(s)("baseConfigCard.sections.advanced"):t.unref(s)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.value[M],B=>(t.openBlock(),t.createBlock(Ge,{key:B.key,item:B},t.createSlots({label:t.withCtx(()=>[t.renderSlot(N.$slots,`${B.key}-label`,{row:B},void 0,!0)]),[B.key]:t.withCtx(({rowValue:U})=>[t.renderSlot(N.$slots,B.key,{row:B,rowValue:U},void 0,!0)]),_:2},[x(B)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(N.$slots,`${B.key}-label-tooltip`,{row:B},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,ci))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",ri,[t.renderSlot(N.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-b3999889"]]),pi=["onReset","onSubmit"],ui={class:"form-actions","data-testid":"form-actions"},va=re(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:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:l}){var a;const r=e,o=ze.useRouter(),{i18n:{t:s}}=Y.useI18n(),{getMessageFromError:c}=Y.useErrors(),{axiosInstance:h}=Y.useAxios({headers:(a=r.config)==null?void 0:a.requestHeaders}),i=t.ref(!1),d=t.ref(!1),u=t.ref(""),p=t.computed(()=>r.canSubmit===!1||r.isReadonly),n=t.computed(()=>{var m,V;if(!r.editId)return"";let _=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"")),_=_.replace(/{id}/gi,r.editId),_}),k=()=>{r.config.cancelRoute?o.push(r.config.cancelRoute):C()},C=()=>{l("cancel")},f=()=>{p.value||l("submit")};return t.watch(()=>i.value,m=>{l("loading",m)},{immediate:!0}),t.onBeforeMount(async()=>{if(r.editId)try{d.value=!1,i.value=!0;const{data:m}=await h.get(n.value);l("fetch:success",m)}catch(m){const V=c(m);u.value=V.startsWith("code")?s("baseForm.errors.edit"):V,d.value=!0,l("fetch:error",m)}finally{i.value=!1}}),(m,V)=>{const _=t.resolveComponent("KSkeleton"),O=t.resolveComponent("KEmptyState"),S=t.resolveComponent("KAlert"),x=t.resolveComponent("KButton"),q=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(q,{class:"kong-ui-entity-base-form"},{body:t.withCtx(()=>[i.value?(t.openBlock(),t.createBlock(_,{key:0,type:"form"})):d.value?(t.openBlock(),t.createBlock(O,{key:1,"cta-text":t.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":k,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(C,["prevent"]),onSubmit:t.withModifiers(f,["prevent"])},[t.renderSlot(m.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(S,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",ui,[t.renderSlot(m.$slots,"form-actions",{},()=>[t.createVNode(x,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(x,{appearance:"primary","data-testid":"form-submit",disabled:p.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,pi))]),_:3})}}}),[["__scopeId","data-v-81612aef"]]),fi={key:0,"data-testid":"first-col"},mi=re(t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const l=e,a=t.computed(()=>{var f;return((f=l.rowEl)==null?void 0:f.querySelector(`[data-testid="${l.keyName}"]`))||null}),r=t.computed(()=>{var f;return((f=a.value)==null?void 0:f.querySelector('[data-testid="first-col"]'))||null}),o=t.computed(()=>{var f,m;const V=(f=l.rowEl)==null?void 0:f.querySelectorAll("td");return V?((m=V[0])==null?void 0:m.getAttribute("data-testid"))===l.keyName:!1});let s;const c=()=>{s&&(s.disconnect(),s=void 0)},h=()=>{var f,m,V;d.value=((f=r.value)==null?void 0:f.getBoundingClientRect().width)||0,u.value=((m=a.value)==null?void 0:m.clientWidth)||0,p.value=((V=i.value)==null?void 0:V.innerText)||""},i=t.ref({}),d=t.ref(0),u=t.ref(0),p=t.ref(""),n=t.computed(()=>[r.value,a.value]),k=t.watch(n,f=>{if(o.value&&(c(),"ResizeObserver"in window&&window)){s=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||h()})});for(const m of f)m&&s.observe(m)}},{immediate:!0,flush:"post",deep:!0}),C=t.computed(()=>o.value?d.value>u.value:!1);return t.onMounted(()=>{h()}),t.onUnmounted(()=>{k()}),(f,m)=>{const V=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:i,class:"content-wrapper"},[o.value?(t.openBlock(),t.createElementBlock("span",fi,[t.createVNode(V,{label:C.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(f.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-e42a20c9"]]),gi={class:"toolbar-container"},yi={key:0,class:"toolbar-button-container"},ki=["data-testid"],Ua=re(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},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:l}){const a=e,{i18n:{t:r}}=Y.useI18n(),o=t.computed(()=>{var S,x;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(S=a.errorMessage)==null?void 0:S.title,message:(x=a.errorMessage)==null?void 0:x.message}}),s=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),c=S=>S.hasData||!!a.query,h=t.computed(()=>{const S=[];return Object.keys(a.tableHeaders).forEach(x=>{const q=a.tableHeaders[x];S.push({label:q.label??x,key:x,sortable:q.sortable??!1})}),a.enableEntityActions&&S.push({key:"actions",hideLabel:!0}),S}),i=S=>({"data-rowid":S.id,"data-testid":S.name,...a.rowAttributes(S)}),d=t.ref({}),u=S=>{var x;return(x=d.value)==null?void 0:x.$el.querySelector(`[data-rowid="${S.id}"]`)},p=S=>{const x={"data-testid":S.headerKey,...a.cellAttributes(S)};return S.colIndex===0&&(x.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),x},n=()=>{l("empty-state-cta-clicked"),k()},k=()=>{l("clear-search-input")},C=t.computed(()=>a.disableRowClick?void 0:(S,x)=>{l("click:row",x)}),f=S=>{l("sort",S)},{setTablePreferences:m,getTablePreferences:V}=gr(),_=t.computed(()=>{const S=V(a.preferencesStorageKey);return{...a.initialFetcherParams,...S}}),O=S=>{a.preferencesStorageKey&&m(a.preferencesStorageKey,S)};return(S,x)=>{const q=t.resolveComponent("KIcon"),A=t.resolveComponent("KButton"),N=t.resolveComponent("KDropdown"),I=t.resolveComponent("KTable"),w=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(w,{class:"kong-ui-entity-base-table",title:e.title},{body:t.withCtx(()=>[t.createVNode(I,{ref_key:"tableRefs",ref:d,"cache-identifier":s.value,"cell-attrs":p,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":o.value.message,"error-state-title":o.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":o.value.hasError,headers:h.value,"hide-pagination-when-optional":"","initial-fetcher-params":_.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":i,"search-input":e.query,onKtableEmptyStateCtaClicked:n,"onRow:click":C.value,onSort:x[0]||(x[0]=T=>f(T)),"onUpdate:tablePreferences":O},t.createSlots({toolbar:t.withCtx(({state:T})=>[t.withDirectives(t.createElementVNode("div",gi,[t.renderSlot(S.$slots,"toolbar-filter",{},void 0,!0),S.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",yi,[t.renderSlot(S.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,c(T)]])]),actions:t.withCtx(({row:T,rowKey:H,rowValue:$})=>[t.createElementVNode("div",{class:"actions-container","data-testid":T.name},[t.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(S.$slots,"actions",{row:T,rowKey:H,rowValue:$},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(A,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(q,{color:t.unref(io),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,ki)]),_:2},[t.renderList(e.tableHeaders,(T,H)=>({name:H,fn:t.withCtx(({row:$,rowKey:v,rowValue:F})=>[t.createVNode(mi,{"key-name":String(H),"row-el":u($)},{default:t.withCtx(()=>[t.renderSlot(S.$slots,H,{row:$,rowKey:v,rowValue:F},()=>[t.createTextVNode(t.toDisplayString(F),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-499a771c"]]),bi={key:0,class:"kong-ui-entity-delete-error"},Ci={key:1,class:"description"},$a=re(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:l}){const a=e,{i18nT:r}=Y.useI18n(),o=t.computed(()=>a.needConfirm?a.entityName:""),s=()=>{l("cancel")},c=()=>{l("proceed")};return(h,i)=>{const d=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:s,onProceed:c},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",bi,[t.createVNode(d,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(r),{class:"message",keypath:a.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a.entityType),1)]),_:2},[a.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(a.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),a.description||h.$slots.description?(t.openBlock(),t.createElementBlock("div",Ci,[t.renderSlot(h.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(a.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),_i={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},wi={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Si=["fill"],xi={mask:"url(#mask0_180_20349)"},Ni=["fill"],Da=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${no})`}},setup(e){return(l,a)=>(t.openBlock(),t.createElementBlock("svg",_i,[t.createElementVNode("mask",wi,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Si)]),t.createElementVNode("g",xi,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ni)])]))}}),Vi={key:1,class:"kong-ui-entity-filter"},Bi={class:"menu-item-title"},Ii={class:"menu-item-indicator"},Ti={class:"menu-item-body"},Hi=["for"],Ei={class:"menu-item-buttons"},Ai={class:"filter-clear-button-container"},Fi=re(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:l}){const a=e,{i18n:{t:r}}=Y.useI18n(),o=t.ref(!1),s=t.ref({}),c=t.computed(()=>{const m=[];return new URLSearchParams(a.modelValue).forEach((V,_)=>{V!==""&&m.push(_)}),m}),h=t.computed(()=>{const m=a.config.fields;return Object.keys(m).filter(V=>m[V].searchable).map(V=>({label:m[V].label||V,value:V}))});t.watch(()=>a.modelValue,m=>{s.value={},new URLSearchParams(m).forEach((V,_)=>{s.value[_]=V})});const i=()=>{o.value=!o.value},d=m=>{l("update:modelValue",m)},u=m=>`filter-${m}`,p=m=>{var V,_;return(((_=(V=a.config.schema)==null?void 0:V[m])==null?void 0:_.values)??[]).map(O=>({value:O,label:O}))},n=m=>{var V,_;return((_=(V=a.config.schema)==null?void 0:V[m])==null?void 0:_.type)??"text"},k=m=>{s.value={...s.value,[m]:""},f()},C=()=>{s.value={},f(!0)},f=(m=!1)=>{const V=Object.keys(s.value).reduce((_,O)=>(s.value[O]&&(_[O]=`${s.value[O]}`),_),{});m&&(o.value=!1),l("update:modelValue",new URLSearchParams(V).toString())};return(m,V)=>{const _=t.resolveComponent("KInput"),O=t.resolveComponent("KButton"),S=t.resolveComponent("KSelect"),x=t.resolveComponent("KMenuItem"),q=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(_,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{before:t.withCtx(()=>[t.createVNode(Da)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Vi,[t.createVNode(O,{appearance:"tertiary","data-testid":"filter-button",onClick:i},{default:t.withCtx(()=>[t.createVNode(Da),t.createTextVNode(" "+t.toDisplayString(t.unref(r)("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:i},null,512),[[t.vShow,o.value]]),t.withDirectives(t.createVNode(q,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,(A,N)=>(t.openBlock(),t.createBlock(x,{key:A.value,"data-testid":A.value,expandable:"","last-menu-item":N===h.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",Bi,[t.createTextVNode(t.toDisplayString(A.label)+" ",1),t.withDirectives(t.createElementVNode("span",Ii,null,512),[[t.vShow,c.value.includes(A.value)]])])]),itemBody:t.withCtx(()=>{var I,w;return[t.createElementVNode("div",Ti,[t.createElementVNode("label",{class:"menu-item-label",for:u(A.value)},t.toDisplayString(t.unref(r)("filter.fieldLabel")),9,Hi),((w=(I=e.config.schema)==null?void 0:I[A.value])==null?void 0:w.type)==="select"?(t.openBlock(),t.createBlock(S,{key:0,id:u(A.value),modelValue:s.value[A.value],"onUpdate:modelValue":T=>s.value[A.value]=T,appearance:"select",items:p(A.value),placeholder:t.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(_,{key:1,id:u(A.value),modelValue:s.value[A.value],"onUpdate:modelValue":T=>s.value[A.value]=T,autocomplete:"off",placeholder:t.unref(r)("filter.inputPlaceholder"),type:n(A.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",Ei,[t.createVNode(O,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:V[0]||(V[0]=T=>f(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.applyButtonText")),1)]),_:1}),t.createVNode(O,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:T=>k(A.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",Ai,[t.createVNode(O,{appearance:"tertiary",size:"small",onClick:C},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,o.value]])]))}}}),[["__scopeId","data-v-15962ee2"]]),ie=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const l=e,a=t.ref(void 0),r=t.computed(()=>a.value===!0||a.value!==void 0&&l.forceShow===!0);return t.watch(()=>l.authFunction,async()=>{a.value=await l.authFunction()},{immediate:!0}),(o,s)=>r.value?t.renderSlot(o.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Oi={class:"form-section-wrapper"},qi={key:0,class:"form-section-title"},vi={key:1,class:"form-section-description"},Ui={key:2,class:"form-section-footer"},$i={class:"form-section-content"},Fe=re(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}},setup(e){const l=t.useSlots();return(a,r)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Oi,[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.createElementBlock("h4",qi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(l).description?(t.openBlock(),t.createElementBlock("div",vi,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(l).footer?(t.openBlock(),t.createElementBlock("div",Ui,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",$i,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:je,useDeleteUrlBuilder:Ma,useErrors:ja,useExternalLinkCreator:Gc,useFetchUrlBuilder:Zc,useFetcher:Ka,useDebouncedFilter:Pa,useStringHelpers:Xc,useHelpers:Di,useGatewayFeatureSupported:ed,useTruncationDetector:td}=Y,Mi={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 ji(){const e=Be.createI18n("en-us",Mi);return{i18n:e,i18nT:Be.i18nTComponent(e)}}function Oe(e){const{replaceId:l=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(o,s)=>{if(s){const c={...o};l&&(c.value=o.label),a.value.push(c)}else a.value=a.value.filter(c=>c.value!==o.value)}}}const Ke=[{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"}],pt=10,ut=65536,Ki=0,Pi=65535,_e=0,we=255,La=0,Ra=255,Li=0,Ri=65535,za=0,Ja=65535,zi=0,Ji=2**31,ft=["200","302"],mt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],gt=["429","404","500","501","502","503","504","505"],yt=["429","500","503"];function Pe(){const e=i=>/^\d+$/.test(i),l=(i,d,u)=>{if(e(i)){const p=Number(i);return p>=d&&p<=u}else return!1},a=i=>i.map(d=>Number(d)),r=i=>i.map(d=>d.toString()),o=()=>({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:ft,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:gt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:mt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:yt,tcpFailures:"5"}});return{isInteger:e,inRange:l,stringToNumberArray:a,numberToStringArray:r,upstreamsResponseToFields:i=>{var u,p,n,k,C,f,m,V,_,O,S,x,q,A,N,I,w,T,H,$,v,F,D,M,B,U,K,y,g,b,z,j,P,Z,R,ee,me,Ve,Qa,Ya,Ga,Za,Xa,el,tl,al,ll,rl,ol,nl,sl,il,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,_l,wl,Sl,xl,Nl,Vl,Bl,Il,Tl,Hl,El,Al,Fl,Ol,ql,vl,Ul,$l,Dl,Ml,jl,Kl,Pl,Ll,Rl,zl,Jl,Wl,Ql,Yl,Gl,Zl,Xl,er,tr,ar,lr,rr,or,nr,sr,ir,cr,dr,hr;const d=o();return d.name=i.name||"",d.algorithm=i.algorithm||"round-robin",d.hostHeader=i.host_header||"",d.clientCertificate=i.client_certificate?(u=i.client_certificate)==null?void 0:u.id:"",d.tags=((p=i.tags)==null?void 0:p.join(", "))||"",d.slots=i.slots!==null&&i.slots!==void 0?i.slots.toString():"10000",d.hashOn=i.hash_on||"none",d.hashFallback=i.hash_fallback||"none",d.hashOnHeader=i.hash_on_header||"",d.hashOnCookie=i.hash_on_cookie||"",d.hashOnCookiePath=i.hash_on_cookie_path||"/",d.hashOnQueryArgument=i.hash_on_query_arg||"",d.hashOnUriCapture=i.hash_on_uri_capture||"",d.hashFallbackHeader=i.hash_fallback_header||"",d.hashFallbackQueryArgument=i.hash_fallback_query_arg||"",d.hashFallbackUriCapture=i.hash_fallback_uri_capture||"",d.healthchecksThreshold=i.healthchecks.threshold!==null&&i.healthchecks.threshold!==void 0?i.healthchecks.threshold.toString():"",d.activeHealthSwitch=((k=(n=i.healthchecks.active)==null?void 0:n.healthy)==null?void 0:k.interval)!==0||((f=(C=i.healthchecks.active)==null?void 0:C.unhealthy)==null?void 0:f.interval)!==0,d.activeHealthCheck.type=((m=i.healthchecks.active)==null?void 0:m.type)||"http",d.activeHealthCheck.httpPath=((V=i.healthchecks.active)==null?void 0:V.http_path)||"/",d.activeHealthCheck.timeout=((_=i.healthchecks.active)==null?void 0:_.timeout)!==null&&((O=i.healthchecks.active)==null?void 0:O.timeout)!==void 0?(x=(S=i.healthchecks.active)==null?void 0:S.timeout)==null?void 0:x.toString():"",d.activeHealthCheck.concurrency=((q=i.healthchecks.active)==null?void 0:q.concurrency)!==null&&((A=i.healthchecks.active)==null?void 0:A.concurrency)!==void 0?(I=(N=i.healthchecks.active)==null?void 0:N.concurrency)==null?void 0:I.toString():"",d.activeHealthCheck.httpsSni=((w=i.healthchecks.active)==null?void 0:w.https_sni)||"",d.activeHealthCheck.verifySsl=((T=i.healthchecks.active)==null?void 0:T.https_verify_certificate)||!1,d.activeHealthCheck.headers=(H=i.healthchecks.active)!=null&&H.headers&&Object.entries(($=i.healthchecks.active)==null?void 0:$.headers).length>0?Object.entries((v=i.healthchecks.active)==null?void 0:v.headers).map(([jc,kt])=>({key:jc,values:kt==null?void 0:kt.join(", ")})):[{key:"",values:""}],d.activeHealthCheck.interval=((D=(F=i.healthchecks.active)==null?void 0:F.healthy)==null?void 0:D.interval)!==null&&((B=(M=i.healthchecks.active)==null?void 0:M.healthy)==null?void 0:B.interval)!==void 0?(y=(K=(U=i.healthchecks.active)==null?void 0:U.healthy)==null?void 0:K.interval)==null?void 0:y.toString():"0",d.activeHealthCheck.interval=((b=(g=i.healthchecks.active)==null?void 0:g.healthy)==null?void 0:b.interval)!==null&&((j=(z=i.healthchecks.active)==null?void 0:z.healthy)==null?void 0:j.interval)!==void 0?(R=(Z=(P=i.healthchecks.active)==null?void 0:P.healthy)==null?void 0:Z.interval)==null?void 0:R.toString():"0",d.activeHealthCheck.successes=((me=(ee=i.healthchecks.active)==null?void 0:ee.healthy)==null?void 0:me.successes)!==null&&((Qa=(Ve=i.healthchecks.active)==null?void 0:Ve.healthy)==null?void 0:Qa.successes)!==void 0?(Za=(Ga=(Ya=i.healthchecks.active)==null?void 0:Ya.healthy)==null?void 0:Ga.successes)==null?void 0:Za.toString():"0",d.activeHealthCheck.httpStatuses=(el=(Xa=i.healthchecks.active)==null?void 0:Xa.healthy)!=null&&el.http_statuses?r(((al=(tl=i.healthchecks.active)==null?void 0:tl.healthy)==null?void 0:al.http_statuses)||[]):ft,d.activeHealthCheck.unhealthyInterval=((rl=(ll=i.healthchecks.active)==null?void 0:ll.unhealthy)==null?void 0:rl.interval)!==null&&((nl=(ol=i.healthchecks.active)==null?void 0:ol.unhealthy)==null?void 0:nl.interval)!==void 0?(cl=(il=(sl=i.healthchecks.active)==null?void 0:sl.unhealthy)==null?void 0:il.interval)==null?void 0:cl.toString():"0",d.activeHealthCheck.httpFailures=((hl=(dl=i.healthchecks.active)==null?void 0:dl.unhealthy)==null?void 0:hl.http_failures)!==null&&((ul=(pl=i.healthchecks.active)==null?void 0:pl.unhealthy)==null?void 0:ul.http_failures)!==void 0?(gl=(ml=(fl=i.healthchecks.active)==null?void 0:fl.unhealthy)==null?void 0:ml.http_failures)==null?void 0:gl.toString():"0",d.activeHealthCheck.unhealthyTimeouts=((kl=(yl=i.healthchecks.active)==null?void 0:yl.unhealthy)==null?void 0:kl.timeouts)!==null&&((Cl=(bl=i.healthchecks.active)==null?void 0:bl.unhealthy)==null?void 0:Cl.timeouts)!==void 0?(Sl=(wl=(_l=i.healthchecks.active)==null?void 0:_l.unhealthy)==null?void 0:wl.timeouts)==null?void 0:Sl.toString():"0",d.activeHealthCheck.unhealthyHttpStatuses=(Nl=(xl=i.healthchecks.active)==null?void 0:xl.unhealthy)!=null&&Nl.http_statuses?r(((Bl=(Vl=i.healthchecks.active)==null?void 0:Vl.unhealthy)==null?void 0:Bl.http_statuses)||[]):gt,d.passiveHealthSwitch=((Tl=(Il=i.healthchecks.passive)==null?void 0:Il.healthy)==null?void 0:Tl.successes)!==0||((El=(Hl=i.healthchecks.passive)==null?void 0:Hl.unhealthy)==null?void 0:El.timeouts)!==0||((Fl=(Al=i.healthchecks.passive)==null?void 0:Al.unhealthy)==null?void 0:Fl.tcp_failures)!==0||((ql=(Ol=i.healthchecks.passive)==null?void 0:Ol.unhealthy)==null?void 0:ql.http_failures)!==0,d.passiveHealthCheck.type=((vl=i.healthchecks.passive)==null?void 0:vl.type)||"http",d.passiveHealthCheck.successes=(($l=(Ul=i.healthchecks.passive)==null?void 0:Ul.healthy)==null?void 0:$l.successes)!==null&&((Ml=(Dl=i.healthchecks.passive)==null?void 0:Dl.healthy)==null?void 0:Ml.successes)!==void 0?(Pl=(Kl=(jl=i.healthchecks.passive)==null?void 0:jl.healthy)==null?void 0:Kl.successes)==null?void 0:Pl.toString():"0",d.passiveHealthCheck.httpStatuses=(Rl=(Ll=i.healthchecks.passive)==null?void 0:Ll.healthy)!=null&&Rl.http_statuses?r(((Jl=(zl=i.healthchecks.passive)==null?void 0:zl.healthy)==null?void 0:Jl.http_statuses)||[]):mt,d.passiveHealthCheck.timeouts=((Ql=(Wl=i.healthchecks.passive)==null?void 0:Wl.unhealthy)==null?void 0:Ql.timeouts)!==null&&((Gl=(Yl=i.healthchecks.passive)==null?void 0:Yl.unhealthy)==null?void 0:Gl.timeouts)!==void 0?(er=(Xl=(Zl=i.healthchecks.passive)==null?void 0:Zl.unhealthy)==null?void 0:Xl.timeouts)==null?void 0:er.toString():"0",d.passiveHealthCheck.tcpFailures=((ar=(tr=i.healthchecks.passive)==null?void 0:tr.unhealthy)==null?void 0:ar.tcp_failures)!==null&&((rr=(lr=i.healthchecks.passive)==null?void 0:lr.unhealthy)==null?void 0:rr.tcp_failures)!==void 0?(sr=(nr=(or=i.healthchecks.passive)==null?void 0:or.unhealthy)==null?void 0:nr.tcp_failures)==null?void 0:sr.toString():"",d.passiveHealthCheck.unhealthyHttpStatuses=(cr=(ir=i.healthchecks.passive)==null?void 0:ir.unhealthy)!=null&&cr.http_statuses?r(((hr=(dr=i.healthchecks.passive)==null?void 0:dr.unhealthy)==null?void 0:hr.http_statuses)||[]):yt,d},getDefaultUpstreamFields:o,objectsAreEqual:(i,d)=>{try{return JSON.stringify(i)===JSON.stringify(d)}catch{return!1}},cloneDeep:i=>JSON.parse(JSON.stringify(i))}}const ce={useI18n:ji,useMultiselectCreation:Oe,useHelpers:Pe},Se="/api/runtime_groups/{controlPlaneId}",xe="/{workspace}",Ne={list:{konnect:`${Se}/upstreams`,kongManager:`${xe}/upstreams`},form:{konnect:{getServices:`${Se}/services`,getCertificates:`${Se}/certificates`,validate:`${Se}/v1/schemas/json/upstream/validate`,create:`${Se}/upstreams`,edit:`${Se}/upstreams/{id}`},kongManager:{getServices:`${xe}/services`,getCertificates:`${xe}/certificates`,validate:`${xe}/schemas/upstreams/validate`,create:`${xe}/upstreams`,edit:`${xe}/upstreams/{id}`}}},rd="",Wi={class:"kong-ui-entities-upstreams-list"},Qi={class:"upstream-name"},Yi=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:l}){var M;const a=e,{i18n:{t:r}}=ce.useI18n(),o=ze.useRouter(),{axiosInstance:s}=je({headers:(M=a.config)==null?void 0:M.requestHeaders}),c=t.ref(1),h=t.computed(()=>a.config.app!=="kongManager"||!!a.config.disableSorting),i={name:{label:r("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:r("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:r("upstreams.list.table_headers.tags"),sortable:!1}},d=i,u=t.computed(()=>{var U,K;let B=`${a.config.apiBaseUrl}${Ne.list[a.config.app]}`;return a.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((U=a.config)==null?void 0:U.controlPlaneId)||""):a.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(K=a.config)!=null&&K.workspace?`/${a.config.workspace}`:"")),B}),p=t.ref(""),n=t.computed(()=>{const B=a.config.app==="konnect"||a.config.isExactMatch;if(B)return{isExactMatch:B,placeholder:r("upstreams.search.placeholder")};const{name:U,slots:K}=i;return{isExactMatch:B,fields:{name:U,slots:K},schema:a.config.filterSchema}}),{fetcher:k,fetcherState:C}=Ka(a.config,u.value),f=()=>{p.value=""},m=()=>{c.value++},V=t.ref(null),_=(B,U)=>{const K=B.id;if(!U(K)){l("copy:error",{entity:B,field:"id",message:r("upstreams.errors.copy")});return}l("copy:success",{entity:B,field:"id",message:r("upstreams.copy.success",{val:K})})},O=(B,U)=>{const K=JSON.stringify(B);if(!U(K)){l("copy:error",{entity:B,message:r("upstreams.errors.copy")});return}l("copy:success",{entity:B,message:r("upstreams.copy.success_brief")})},S=async B=>{var K;await((K=a.canRetrieve)==null?void 0:K.call(a,B))&&o.push(a.config.getViewRoute(B.id))},x=B=>({label:r("upstreams.actions.view"),to:a.config.getViewRoute(B)}),q=B=>({label:r("upstreams.actions.edit"),to:a.config.getEditRoute(B)}),A=t.ref(void 0),N=t.ref(!1),I=t.ref(!1),w=t.ref(""),T=Ma(a.config,u.value),H=B=>{A.value=B,N.value=!0},$=()=>{N.value=!1},v=async()=>{var B,U,K;if((B=A.value)!=null&&B.id){I.value=!0;try{await s.delete(T(A.value.id)),I.value=!1,N.value=!1,c.value++,l("delete:success",A.value)}catch(y){w.value=((K=(U=y.response)==null?void 0:U.data)==null?void 0:K.message)||y.message||r("upstreams.errors.delete"),l("error",y)}finally{I.value=!1}}},F=t.ref(!0);t.watch(C,B=>{var U,K,y,g,b;if(((K=(U=B==null?void 0:B.response)==null?void 0:U.data)==null?void 0:K.length)===0&&(F.value=!1),B.status===he.Error){V.value={title:r("upstreams.errors.general")},(b=(g=(y=B.error)==null?void 0:y.response)==null?void 0:g.data)!=null&&b.message&&(V.value.message=B.error.response.data.message),l("error",B.error);return}V.value=null});const D=t.ref({ctaPath:a.config.createRoute,ctaText:void 0,message:r("upstreams.list.empty_state.description"),title:r("upstreams.title")});return t.onBeforeMount(async()=>{await a.canCreate()&&(D.value.title=r("upstreams.list.empty_state.title"),D.value.ctaText=r("upstreams.actions.create"))}),(B,U)=>{const K=t.resolveComponent("KButton"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KTruncate"),b=t.resolveComponent("KDropdownItem"),z=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Wi,[t.createVNode(t.unref(Ua),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":h.value,"empty-state-options":D.value,"enable-entity-actions":"","error-message":V.value,fetcher:t.unref(k),"fetcher-cache-key":c.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:p.value,"table-headers":t.unref(d),"use-action-outside":e.useActionOutside,onClearSearchInput:f,"onClick:row":U[1]||(U[1]=j=>S(j)),onSort:m},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Fi),{modelValue:p.value,"onUpdate:modelValue":U[0]||(U[0]=j=>p.value=j),config:n.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(ie),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,F.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:t.withCtx(({rowValue:j})=>[t.createElementVNode("span",Qi,t.toDisplayString(j),1)]),tags:t.withCtx(({rowValue:j})=>[t.createVNode(g,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j,P=>(t.openBlock(),t.createBlock(y,{key:P,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(P),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:j})=>[t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:P})=>[t.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:Z=>_(j,P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:P})=>[t.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:Z=>O(j,P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ie),{"auth-function":()=>e.canRetrieve(j)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:x(j.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canEdit(j)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-edit",item:q(j.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canDelete(j)},{default:t.withCtx(()=>[t.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:P=>H(j)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("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($a),{"action-pending":I.value,description:t.unref(r)("upstreams.delete.description"),"entity-name":A.value&&(A.value.name||A.value.id),"entity-type":t.unref(Je).Upstream,error:w.value,title:t.unref(r)("upstreams.delete.title"),visible:N.value,onCancel:$,onProceed:v},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),od="",de=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Gi=de(Yi,[["__scopeId","data-v-0dc82811"]]),Le={list:{konnect:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",kongManager:"/{workspace}/upstreams/{upstreamId}/targets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",edit:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/target/validate"},kongManager:{create:"/{workspace}/upstreams/{upstreamId}/targets",edit:"/{workspace}/upstreams/{upstreamId}/targets/{id}",validate:"/{workspace}/schemas/targets/validate"}}},Zi={class:"kong-ui-entities-target-form"},Xi={class:"target-form-container"},ec={key:0,class:"target-form-info"},tc=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:l}){var S;const a=e;t.useCssVars(x=>({"36f73404":O.value}));const{i18n:{t:r}}=ce.useI18n(),{getMessageFromError:o}=ja(),{axiosInstance:s}=je({headers:(S=a.config)==null?void 0:S.requestHeaders}),c=t.computed(()=>{var x;return Le.form[a.config.app].edit.replace(/{upstreamId}/gi,((x=a.config)==null?void 0:x.upstreamId)||"")}),h=t.computed(()=>a.targetId?oe.Edit:oe.Create),i=t.computed(()=>h.value===oe.Edit?r("targets.form.edit.title"):r("targets.form.create.title")),d=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),p={target:"",weight:100,tags:""},n=t.computed(()=>{const x=parseInt(d.fields.weight.toString(),10);return x<0||x>65535}),k=t.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(u)&&!!d.fields.target&&!!d.fields.weight&&!n.value),C=x=>{var q;d.fields.target=(x==null?void 0:x.target)||"",d.fields.weight=(x==null?void 0:x.weight)??"",d.fields.tags=((q=x==null?void 0:x.tags)==null?void 0:q.join(", "))||"",Object.assign(u,d.fields)},f=()=>{d.errorMessage="",l("cancel")},m=t.computed(()=>{var q,A;let x=`${a.config.apiBaseUrl}${Le.form[a.config.app].validate}`;return a.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((q=a.config)==null?void 0:q.controlPlaneId)||""):a.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(A=a.config)!=null&&A.workspace?`/${a.config.workspace}`:"")),x=x.replace(/{id}/gi,a.targetId),x}),V=t.computed(()=>{var q,A,N,I;let x=`${a.config.apiBaseUrl}${Le.form[a.config.app][h.value]}`;return a.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((q=a.config)==null?void 0:q.controlPlaneId)||"").replace(/{upstreamId}/gi,((A=a.config)==null?void 0:A.upstreamId)||""):a.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(N=a.config)!=null&&N.workspace?`/${a.config.workspace}`:"").replace(/{upstreamId}/gi,((I=a.config)==null?void 0:I.upstreamId)||"")),x=x.replace(/{id}/gi,a.targetId),x}),_=async()=>{var x,q,A,N,I;try{d.isReadonly=!0,d.errorMessage="";const w={target:d.fields.target,weight:parseInt(d.fields.weight),tags:(A=(q=(x=d.fields.tags)==null?void 0:x.split(","))==null?void 0:q.map(H=>String(H||"").trim()))==null?void 0:A.filter(H=>H!==""),upstream:{id:a.config.upstreamId}};let T;if(await s.post(m.value,w),h.value==="create"?T=await s.post(V.value,w):h.value==="edit"&&(T=((N=a.config)==null?void 0:N.app)==="konnect"?await s.put(V.value,w):await s.patch(V.value,w)),T){const{data:H}=T;d.fields.target=(H==null?void 0:H.name)||"",d.fields.weight=(H==null?void 0:H.weight)??100,d.fields.tags=((I=H==null?void 0:H.tags)==null?void 0:I.join(", "))||"",l("update",H),Object.assign(d.fields,p)}}catch(w){d.errorMessage=o(w),l("error",w)}finally{d.isReadonly=!1}},O=t.computed(()=>d.isReadonly?"inline-flex":"none");return t.watch(()=>a.targetId,()=>{Object.assign(d.fields,p)}),(x,q)=>{const A=t.resolveComponent("KInput"),N=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(N,{"action-button-text":t.unref(r)("targets.form.buttons.save"),"action-pending":!k.value||d.isReadonly,"cancel-button-text":t.unref(r)("targets.form.buttons.cancel"),"is-visible":e.isVisible,title:i.value,onCanceled:f,onProceed:_},{"body-content":t.withCtx(()=>[t.createElementVNode("div",Zi,[t.createVNode(t.unref(va),{config:e.config,"edit-id":e.targetId,"error-message":d.errorMessage,"fetch-url":c.value,"is-readonly":d.isReadonly,onCancel:f,"onFetch:error":q[3]||(q[3]=I=>x.$emit("error",I)),"onFetch:success":C,onLoading:q[4]||(q[4]=I=>x.$emit("loading",I))},{default:t.withCtx(()=>[t.createElementVNode("div",Xi,[x.$slots.info?(t.openBlock(),t.createElementBlock("div",ec,[t.renderSlot(x.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(A,{modelValue:d.fields.target,"onUpdate:modelValue":q[0]||(q[0]=I=>d.fields.target=I),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(r)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(r)("targets.form.fields.target.tooltip")},placeholder:t.unref(r)("targets.form.fields.target.placeholder"),readonly:d.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(A,{modelValue:d.fields.weight,"onUpdate:modelValue":q[1]||(q[1]=I=>d.fields.weight=I),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:n.value,"error-message":t.unref(r)("targets.errors.weight"),label:t.unref(r)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(r)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:d.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(A,{modelValue:d.fields.tags,"onUpdate:modelValue":q[2]||(q[2]=I=>d.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(r)("targets.form.fields.tags.help"),label:t.unref(r)("targets.form.fields.tags.label"),placeholder:t.unref(r)("targets.form.fields.tags.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","is-readonly"])])]),_:3},8,["action-button-text","action-pending","cancel-button-text","is-visible","title"])}}}),nd="",Wa=de(tc,[["__scopeId","data-v-d291c3d9"]]),ac={class:"kong-ui-entities-targets-list"},lc={class:"target-address"},rc=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:l}){var K;const a=e,{i18n:{t:r}}=ce.useI18n(),{axiosInstance:o}=je({headers:(K=a.config)==null?void 0:K.requestHeaders}),s=t.ref(1),c=t.computed(()=>a.config.app!=="kongManager"||!!a.config.disableSorting),i={target:{label:r("targets.list.table_headers.target_address"),sortable:!0},weight:{label:r("targets.list.table_headers.weight"),sortable:!0},tags:{label:r("targets.list.table_headers.tags"),sortable:!1}},d=t.computed(()=>{var g,b,z,j;let y=`${a.config.apiBaseUrl}${Le.list[a.config.app]}`;return a.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((g=a.config)==null?void 0:g.controlPlaneId)||"").replace(/{upstreamId}/gi,((b=a.config)==null?void 0:b.upstreamId)||""):a.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(z=a.config)!=null&&z.workspace?`/${a.config.workspace}`:"").replace(/{upstreamId}/gi,((j=a.config)==null?void 0:j.upstreamId)||"")),y}),{fetcher:u,fetcherState:p}=Ka(a.config,d.value),n=()=>{s.value++},k=t.ref(null),C=()=>{D.value=!0},f=(y,g)=>{const b=y.id;if(!g(b)){l("copy:error",{entity:y,field:"id",message:r("targets.errors.copy")});return}l("copy:success",{entity:y,field:"id",message:r("targets.copy.success",{val:b})})},m=(y,g)=>{const b=JSON.stringify(y);if(!g(b)){l("copy:error",{entity:y,message:r("targets.errors.copy")});return}l("copy:success",{entity:y,message:r("targets.copy.success_brief")})},V=y=>{F.value=y,D.value=!0},_=y=>a.config.app==="konnect"?!1:a.config.canMarkHealthy(y),O=y=>a.config.app==="konnect"?!1:a.config.canMarkUnhealthy(y),S=t.ref(void 0),x=t.ref(!1),q=t.ref(!1),A=t.ref(""),N=Ma(a.config,d.value),I=y=>{S.value=y,x.value=!0},w=()=>{x.value=!1},T=async()=>{var y,g,b;if((y=S.value)!=null&&y.id){q.value=!0;try{await o.delete(N(S.value.id)),q.value=!1,x.value=!1,s.value++,l("delete:success",S.value)}catch(z){A.value=((b=(g=z.response)==null?void 0:g.data)==null?void 0:b.message)||z.message||r("targets.errors.delete"),l("error",z)}finally{q.value=!1}}},H=t.ref(!0);t.watch(p,y=>{var g,b,z,j,P;if(((b=(g=y==null?void 0:y.response)==null?void 0:g.data)==null?void 0:b.length)===0&&(H.value=!1),y.status===he.Error){k.value={title:r("targets.errors.general")},(P=(j=(z=y.error)==null?void 0:z.response)==null?void 0:j.data)!=null&&P.message&&(k.value.message=y.error.response.data.message),l("error",y.error);return}k.value=null});const $=t.ref({ctaText:void 0,message:r("targets.list.empty_state.description"),title:r("targets.title"),...a.config.createRoute&&{ctaPath:a.config.createRoute}});t.onBeforeMount(async()=>{await a.canCreate()&&($.value.title=r("targets.list.empty_state.title"),$.value.ctaText=r("targets.actions.create"))});const v=t.computed(()=>({app:a.config.app,apiBaseUrl:a.config.apiBaseUrl,upstreamId:a.config.upstreamId,...a.config.app==="konnect"&&{controlPlaneId:a.config.controlPlaneId},...a.config.app==="kongManager"&&{workspace:a.config.workspace,requestHeaders:a.config.requestHeaders}})),F=t.ref(""),D=t.ref(!1),M=y=>{F.value?l("update:target",y):l("create:target",y),B()},B=()=>{U(),s.value++},U=()=>{D.value=!1,F.value=""};return(y,g)=>{const b=t.resolveComponent("KButton"),z=t.resolveComponent("KBadge"),j=t.resolveComponent("KTruncate"),P=t.resolveComponent("KDropdownItem"),Z=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",ac,[t.createVNode(t.unref(Ua),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":$.value,"enable-entity-actions":"","error-message":k.value,fetcher:t.unref(u),"fetcher-cache-key":s.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(i),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:g[1]||(g[1]=()=>a.config.createRoute?void 0:C()),onSort:n},{"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(ie),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(b,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:a.config.createRoute?a.config.createRoute:void 0,onClick:g[0]||(g[0]=()=>a.config.createRoute?void 0:C())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,H.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:R})=>[t.createElementVNode("span",lc,t.toDisplayString(R),1)]),tags:t.withCtx(({rowValue:R})=>[t.createVNode(j,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R,ee=>(t.openBlock(),t.createBlock(z,{key:ee,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ee),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:R})=>[t.createVNode(Z,null,{default:t.withCtx(({copyToClipboard:ee})=>[t.createVNode(P,{"data-testid":"action-entity-copy-id",onClick:me=>f(R,ee)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(Z,null,{default:t.withCtx(({copyToClipboard:ee})=>[t.createVNode(P,{"data-testid":"action-entity-copy-json",onClick:me=>m(R,ee)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ie),{"auth-function":()=>e.canEdit(R)},{default:t.withCtx(()=>[t.createVNode(P,{"data-testid":"action-entity-edit","has-divider":"",onClick:ee=>V(R.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>_(R)},{default:t.withCtx(()=>[t.createVNode(P,{"data-testid":"action-target-mark-healthy",onClick:ee=>l("health-actions:healthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>O(R)},{default:t.withCtx(()=>[t.createVNode(P,{"data-testid":"action-target-mark-unhealthy",onClick:ee=>l("health-actions:unhealthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canDelete(R)},{default:t.withCtx(()=>[t.createVNode(P,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ee=>I(R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("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($a),{"action-pending":q.value,description:t.unref(r)("targets.delete.description"),"entity-type":t.unref(Je).Target,error:A.value,"need-confirm":!1,title:t.unref(r)("targets.delete.title"),visible:x.value,onCancel:w,onProceed:T},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Wa,{config:v.value,"is-visible":D.value,"target-id":F.value,onCancel:U,onUpdate:M},t.createSlots({_:2},[y.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),sd="",oc=de(rc,[["__scopeId","data-v-ae107100"]]),nc={key:1},sc=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:l}){var w,T,H,$;const a=e,{i18nT:r,i18n:{t:o}}=ce.useI18n(),{debouncedQueryChange:s,loading:c,loadItems:h,results:i,allRecords:d}=Pa(a.config,(T=Ne.form[(w=a.config)==null?void 0:w.app])==null?void 0:T.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:p,loadItems:n,results:k}=Pa(a.config,($=Ne.form[(H=a.config)==null?void 0:H.app])==null?void 0:$.getCertificates),C=t.ref(""),f=t.computed(()=>{var v;return!!a.name&&!((v=d.value)!=null&&v.some(F=>F.host===a.name))}),m=t.computed(()=>{var F,D,M;const v=f.value&&a.name.includes((F=C.value)==null?void 0:F.toLowerCase());return(M=i.value)==null?void 0:M.map(B=>({label:B.host,value:B.id})).concat(v?[{label:a.name,value:((D=O.value)==null?void 0:D.value)||a.name}]:[])}),V=t.computed(()=>{var v;return(v=k.value)==null?void 0:v.map(F=>({label:F.id,value:F.id}))}),_=t.ref(""),O=t.ref({value:"",label:""}),S=t.computed(()=>{var v,F;return((v=m.value.find(D=>D.value===_.value))==null?void 0:v.label)||((F=O.value)==null?void 0:F.label)}),x=v=>{C.value=v,s(v)},q=v=>{O.value=v},A=()=>{O.value={value:"",label:""}},N=v=>{_.value=v,l("update:name",S.value)},I=t.ref(!1);return t.onBeforeMount(async()=>{var v,F;try{I.value=!0,await h(),a.name&&(_.value=((F=(v=m.value.find(D=>D.label===a.name))==null?void 0:v.value)==null?void 0:F.toString())||a.name),await n()}finally{I.value=!1}}),(v,F)=>{const D=t.resolveComponent("KSkeleton"),M=t.resolveComponent("KSelect"),B=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(o)("upstreams.form.general_info.help"),title:t.unref(o)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[I.value?(t.openBlock(),t.createBlock(D,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",nc,[t.createVNode(M,{appearance:"select",autosuggest:"",class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"",items:m.value,label:t.unref(o)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(c),"model-value":_.value,placeholder:t.unref(o)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%","onItem:added":q,"onItem:removed":A,onQueryChange:x,"onUpdate:modelValue":N},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(o)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":F[0]||(F[0]=U=>l("update:host-header",U))},null,8,["label","model-value","readonly"]),t.createVNode(M,{appearance:"select",autosuggest:"",class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"",items:V.value,label:t.unref(o)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(o)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(p),"model-value":e.clientCertificate,placeholder:t.unref(o)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":F[1]||(F[1]=U=>l("update:client-certificate",U))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(B,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(o)("upstreams.form.fields.tags.help"),label:t.unref(o)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(o)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(o)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":F[2]||(F[2]=U=>l("update:tags",U))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),id="",ic=de(sc,[["__scopeId","data-v-02065a3d"]]),Re={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},cc={class:"fields-group-title"},dc={class:"fields-group-text"},hc={class:"fields-group-title"},pc={class:"fields-group-text"},uc=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:l}){const a=e,{i18nT:r,i18n:{t:o}}=ce.useI18n(),{inRange:s}=Pe(),c=t.ref([{label:o("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:o("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:o("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:o("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),h=t.ref([{label:o("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:o("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:o("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:o("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:o("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:o("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:o("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:o("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>a.hashOn,(u,p)=>{p==="header"&&u!==p&&l("update:hash-on-header",""),p==="cookie"&&u!==p&&(l("update:hash-on-cookie",""),l("update:hash-on-cookie-path","/")),p==="query_arg"&&u!==p&&l("update:hash-on-query-argument",""),p==="uri_capture"&&u!==p&&l("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(l("update:hash-fallback","none"),l("update:hash-fallback-header",""),l("update:hash-fallback-query-argument",""),l("update:hash-fallback-uri-capture",""))}),t.watch(()=>a.hashFallback,(u,p)=>{p==="header"&&u!==p&&l("update:hash-fallback-header",""),p==="cookie"&&u!==p&&(l("update:hash-on-cookie",""),l("update:hash-on-cookie-path","/")),p==="query_arg"&&u!==p&&l("update:hash-fallback-query-argument",""),p==="uri_capture"&&u!==p&&l("update:hash-fallback-uri-capture","")});const i=t.computed(()=>a.hashOn==="cookie"||a.hashOn==="none"),d=t.computed(()=>a.slots?s(a.slots,pt,ut)?"":o("upstreams.form.errors.in_range"):"");return(u,p)=>{const n=t.resolveComponent("KExternalLink"),k=t.resolveComponent("KSelect"),C=t.resolveComponent("KInput"),f=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(o)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(n,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(k,{appearance:"select",class:"algorithm-select",items:c.value,label:t.unref(o)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=m=>l("update:algorithm",m))},null,8,["items","label","model-value","readonly"]),t.createVNode(C,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!d.value,"error-message":d.value,help:t.unref(o)("upstreams.form.fields.slots.help"),label:t.unref(o)("upstreams.form.fields.slots.label"),max:t.unref(ut),min:t.unref(pt),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=m=>l("update:slots",m))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(f,null,{body:t.withCtx(()=>[t.createElementVNode("h5",cc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",dc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_on.help")),1),t.createVNode(k,{appearance:"select",class:"hash-on-select",items:h.value,label:t.unref(o)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[2]||(p[2]=m=>l("update:hash-on",m))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(o)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[3]||(p[3]=m=>l("update:hash-on-header",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(C,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(o)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[4]||(p[4]=m=>l("update:hash-on-cookie",m))},null,8,["label","model-value","readonly"]),t.createVNode(C,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(o)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[5]||(p[5]=m=>l("update:hash-on-cookie-path",m))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(C,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(o)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[6]||(p[6]=m=>l("update:hash-on-query-argument",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(C,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(o)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[7]||(p[7]=m=>l("update:hash-on-uri-capture",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(f,null,{body:t.withCtx(()=>[t.createElementVNode("h5",hc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",pc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(k,{appearance:"select",class:"hash-fallback-select",disabled:i.value,items:h.value,label:t.unref(o)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[8]||(p[8]=m=>l("update:hash-fallback",m))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(o)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[9]||(p[9]=m=>l("update:hash-fallback-header",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(C,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(o)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[10]||(p[10]=m=>l("update:hash-on-cookie",m))},null,8,["label","model-value","readonly"]),t.createVNode(C,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(o)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[11]||(p[11]=m=>l("update:hash-on-cookie-path",m))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(C,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(o)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[12]||(p[12]=m=>l("update:hash-fallback-query-argument",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(C,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(o)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[13]||(p[13]=m=>l("update:hash-fallback-uri-capture",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),cd="",fc=de(uc,[["__scopeId","data-v-678db4c1"]]),mc={class:"fields-group-title"},gc={class:"fields-group-text"},yc={class:"fields-group-title"},kc={class:"fields-group-text"},bc=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:l}){const{i18n:{t:a}}=ce.useI18n();return(r,o)=>{const s=t.resolveComponent("KExternalLink"),c=t.resolveComponent("KInputSwitch"),h=t.resolveComponent("KCard"),i=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Fe),{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(s,{"hide-icon":"",href:t.unref(Re).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(h,null,{body:t.withCtx(()=>[t.createElementVNode("h5",mc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",gc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(c,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:o[0]||(o[0]=d=>l("update:active-health-switch",d))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,null,{body:t.withCtx(()=>[t.createElementVNode("h5",yc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",kc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(c,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:o[1]||(o[1]=d=>l("update:passive-health-switch",d))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(i,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(Pi),min:t.unref(Ki),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":o[2]||(o[2]=d=>l("update:healthchecks-threshold",d))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),dd="",Cc=de(bc,[["__scopeId","data-v-7fda4841"]]),_c={key:2},wc={class:"fields-group-title"},Sc={class:"fields-group-text"},xc={class:"fields-group-title"},Nc={class:"fields-group-text"},Vc=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:l}){const a=e,{i18n:{t:r}}=ce.useI18n(),{objectsAreEqual:o}=Pe(),s=t.ref([{label:r("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),c=t.computed(()=>a.type==="https"||a.type==="grpcs"),h=t.computed(()=>a.type==="tcp"),{trackNewItems:i}=Oe({replaceId:!0}),{trackNewItems:d}=Oe({replaceId:!0});t.watch(()=>a.type,(C,f)=>{f==="tcp"&&C!==f&&l("update:tcp-failures","5"),(f==="https"||f==="grpcs")&&C!==f&&(l("update:https-sni",""),l("update:verify-ssl",!1)),f!=="tcp"&&C==="tcp"&&(l("update:http-path","/"),l("update:http-statuses",ft),l("update:unhealthy-http-statuses",gt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>a.headers,C=>{o(u.value,C)||(u.value=[...C])},{immediate:!0,deep:!0});const p=()=>{l("update:headers",u.value)},n=()=>{u.value.push({key:"",values:""}),p()},k=C=>{C===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(C,1),p()};return(C,f)=>{const m=t.resolveComponent("KExternalLink"),V=t.resolveComponent("KSelect"),_=t.resolveComponent("KInput"),O=t.resolveComponent("KCheckbox"),S=t.resolveComponent("KLabel"),x=t.resolveComponent("KIcon"),q=t.resolveComponent("KButton"),A=t.resolveComponent("KMultiselect"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(r)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(m,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var I;return[t.createVNode(V,{appearance:"select",class:"active-healthcheck-type-select",items:s.value,label:t.unref(r)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=w=>l("update:type",w))},null,8,["items","label","model-value","readonly"]),h.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(_,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(r)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":f[1]||(f[1]=w=>l("update:http-path",w))},null,8,["label","model-value","readonly"])),t.createVNode(_,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(r)("upstreams.form.fields.timeout.label"),max:t.unref(Ri),min:t.unref(Li),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":f[2]||(f[2]=w=>l("update:timeout",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(_,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(r)("upstreams.form.fields.concurrency.label"),max:t.unref(Ji),min:t.unref(zi),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":f[3]||(f[3]=w=>l("update:concurrency",w))},null,8,["label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(_,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(r)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":f[4]||(f[4]=w=>l("update:https-sni",w))},null,8,["label","model-value","readonly"]),t.createVNode(O,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(r)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":f[5]||(f[5]=w=>l("update:verify-ssl",w))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((I=e.config)==null?void 0:I.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",_c,[t.createVNode(S,{info:t.unref(r)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("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,T)=>(t.openBlock(),t.createElementBlock("div",{key:`${w.header}_${T}`,class:t.normalizeClass(["headers-row",{"margin-top-6":T>0}])},[t.createVNode(_,{modelValue:u.value[T].key,"onUpdate:modelValue":H=>u.value[T].key=H,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${T+1}`,readonly:e.readonly,type:"text",onBlur:p},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(_,{modelValue:u.value[T].values,"onUpdate:modelValue":H=>u.value[T].values=H,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${T+1}`,readonly:e.readonly,type:"text",onBlur:p},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(q,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:H=>k(T)},{icon:t.withCtx(()=>[t.createVNode(x,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&T===u.value.length-1?(t.openBlock(),t.createBlock(q,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:n},{icon:t.withCtx(()=>[t.createVNode(x,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(N,null,{body:t.withCtx(()=>[t.createElementVNode("h5",wc,t.toDisplayString(t.unref(r)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Sc,t.toDisplayString(t.unref(r)("upstreams.form.healthy.help")),1),t.createVNode(_,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(r)("upstreams.form.fields.interval.help"),label:t.unref(r)("upstreams.form.fields.interval.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":f[6]||(f[6]=w=>l("update:interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(_,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(r)("upstreams.form.fields.successes.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":f[7]||(f[7]=w=>l("update:successes",w))},null,8,["label","max","min","model-value","readonly"]),h.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(A,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%","onItem:added":f[8]||(f[8]=w=>t.unref(i)(w,!0)),"onItem:removed":f[9]||(f[9]=w=>t.unref(i)(w,!1)),"onUpdate:modelValue":f[10]||(f[10]=w=>l("update:http-statuses",w))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(N,null,{body:t.withCtx(()=>[t.createElementVNode("h5",xc,t.toDisplayString(t.unref(r)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Nc,t.toDisplayString(t.unref(r)("upstreams.form.unhealthy.help")),1),t.createVNode(_,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(r)("upstreams.form.fields.interval.help"),label:t.unref(r)("upstreams.form.fields.interval.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":f[11]||(f[11]=w=>l("update:unhealthy-interval",w))},null,8,["help","label","max","min","model-value","readonly"]),h.value?(t.openBlock(),t.createBlock(_,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(r)("upstreams.form.fields.tcp_failures.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":f[12]||(f[12]=w=>l("update:tcp-failures",w))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(_,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(r)("upstreams.form.fields.http_failures.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":f[13]||(f[13]=w=>l("update:http-failures",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(A,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%","onItem:added":f[14]||(f[14]=w=>t.unref(d)(w,!0)),"onItem:removed":f[15]||(f[15]=w=>t.unref(d)(w,!1)),"onUpdate:modelValue":f[16]||(f[16]=w=>l("update:unhealthy-http-statuses",w))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(_,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(r)("upstreams.form.fields.timeouts.label"),max:t.unref(Ra),min:t.unref(La),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":f[17]||(f[17]=w=>l("update:unhealthy-timeouts",w))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),hd="",Bc=de(Vc,[["__scopeId","data-v-0a7d6cda"]]),Ic={class:"fields-group-title"},Tc={class:"fields-group-text"},Hc={class:"fields-group-title"},Ec={class:"fields-group-text"},Ac=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:l}){const a=e,{i18n:{t:r}}=ce.useI18n(),o=t.ref([{label:r("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),s=t.computed(()=>a.type==="tcp"),{trackNewItems:c}=Oe({replaceId:!0}),{trackNewItems:h}=Oe({replaceId:!0});return t.watch(()=>a.type,(i,d)=>{d==="tcp"&&i!==d&&l("update:tcp-failures","5"),d!=="tcp"&&i==="tcp"&&(l("update:http-statuses",mt),l("update:unhealthy-http-statuses",yt))}),(i,d)=>{const u=t.resolveComponent("KExternalLink"),p=t.resolveComponent("KSelect"),n=t.resolveComponent("KInput"),k=t.resolveComponent("KMultiselect"),C=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(r)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(p,{appearance:"select",class:"passive-healthcheck-type-select",items:o.value,label:t.unref(r)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":d[0]||(d[0]=f=>l("update:type",f))},null,8,["items","label","model-value","readonly"]),t.createVNode(C,null,{body:t.withCtx(()=>[t.createElementVNode("h5",Ic,t.toDisplayString(t.unref(r)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",Tc,t.toDisplayString(t.unref(r)("upstreams.form.passive_healthy.help")),1),t.createVNode(n,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(r)("upstreams.form.fields.successes.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":d[1]||(d[1]=f=>l("update:successes",f))},null,8,["label","max","min","model-value","readonly"]),s.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(k,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%","onItem:added":d[2]||(d[2]=f=>t.unref(c)(f,!0)),"onItem:removed":d[3]||(d[3]=f=>t.unref(c)(f,!1)),"onUpdate:modelValue":d[4]||(d[4]=f=>l("update:http-statuses",f))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(C,null,{body:t.withCtx(()=>[t.createElementVNode("h5",Hc,t.toDisplayString(t.unref(r)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",Ec,t.toDisplayString(t.unref(r)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(n,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(r)("upstreams.form.fields.timeouts.label"),max:t.unref(Ra),min:t.unref(La),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":d[5]||(d[5]=f=>l("update:timeouts",f))},null,8,["label","max","min","model-value","readonly"]),s.value?(t.openBlock(),t.createBlock(n,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(r)("upstreams.form.fields.tcp_failures.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":d[6]||(d[6]=f=>l("update:tcp-failures",f))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(n,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(r)("upstreams.form.fields.http_failures.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":d[7]||(d[7]=f=>l("update:http-failures",f))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(k,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%","onItem:added":d[8]||(d[8]=f=>t.unref(h)(f,!0)),"onItem:removed":d[9]||(d[9]=f=>t.unref(h)(f,!1)),"onUpdate:modelValue":d[10]||(d[10]=f=>l("update:unhealthy-http-statuses",f))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),pd="",Fc=de(Ac,[["__scopeId","data-v-6d6854e3"]]),Oc={class:"kong-ui-entities-upstreams-form"},qc=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:l}){var K;const a=e,{inRange:r,stringToNumberArray:o,upstreamsResponseToFields:s,getDefaultUpstreamFields:c,objectsAreEqual:h,cloneDeep:i}=Pe(),{axiosInstance:d}=je({headers:(K=a.config)==null?void 0:K.requestHeaders}),{getMessageFromError:u}=ja(),p=ze.useRouter(),n=t.reactive({fields:c(),readonly:!1,errorMessage:""}),k=t.reactive(c()),C=t.computed(()=>!h(n.fields,k)),f=y=>{n.fields.activeHealthCheck.interval=y?"5":"0",n.fields.activeHealthCheck.successes=y?"5":"0",n.fields.activeHealthCheck.httpFailures=y?"5":"0",n.fields.activeHealthCheck.unhealthyInterval=y?"5":"0"},m=y=>{n.fields.passiveHealthCheck.timeouts=y?"5":"0",n.fields.passiveHealthCheck.successes=y?"80":"0"},V=t.computed(()=>n.fields.slots?r(n.fields.slots,pt,ut):!0),_=t.computed(()=>n.fields.hashOn==="header"?!!n.fields.hashOnHeader:!0),O=t.computed(()=>n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie"?!!n.fields.hashOnCookie:!0),S=t.computed(()=>n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie"?!!n.fields.hashOnCookiePath:!0),x=t.computed(()=>n.fields.hashOn==="query_arg"?!!n.fields.hashOnQueryArgument:!0),q=t.computed(()=>n.fields.hashOn==="uri_capture"?!!n.fields.hashOnUriCapture:!0),A=t.computed(()=>n.fields.hashFallback==="header"?!!n.fields.hashFallbackHeader:!0),N=t.computed(()=>n.fields.hashFallback==="query_arg"?!!n.fields.hashFallbackQueryArgument:!0),I=t.computed(()=>n.fields.hashFallback==="uri_capture"?!!n.fields.hashFallbackUriCapture:!0),w=t.computed(()=>!!n.fields.name&&V.value&&_.value&&O.value&&S.value&&x.value&&q.value&&A.value&&N.value&&I.value),T=t.computed(()=>a.upstreamId?oe.Edit:oe.Create),H=t.computed(()=>{var y,g;return(g=Ne.form[(y=a.config)==null?void 0:y.app])==null?void 0:g.edit}),$=y=>{Object.assign(n.fields,s(y)),Object.assign(k,i(n.fields))},v=()=>{var y;p.push(((y=a.config)==null?void 0:y.cancelRoute)||{name:"upstreams-list"})},F=y=>{l("loading",y)},D=y=>{l("error",y)},M=()=>{var g,b,z,j,P;const y={name:n.fields.name,slots:Number(n.fields.slots),algorithm:n.fields.algorithm,hash_on:n.fields.hashOn,hash_fallback:n.fields.hashFallback,healthchecks:{}};return n.fields.hostHeader&&(y.host_header=n.fields.hostHeader),n.fields.clientCertificate&&(y.client_certificate={id:n.fields.clientCertificate}),n.fields.healthchecksThreshold&&(y.healthchecks.threshold=Number(n.fields.healthchecksThreshold)),n.fields.tags&&(y.tags=(b=(g=n.fields.tags.split(","))==null?void 0:g.map(Z=>String(Z||"").trim()))==null?void 0:b.filter(Z=>Z!=="")),n.fields.hashOn==="header"&&(y.hash_on_header=n.fields.hashOnHeader),(n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie")&&(y.hash_on_cookie=n.fields.hashOnCookie,y.hash_on_cookie_path=n.fields.hashOnCookiePath),n.fields.hashOn==="query_arg"&&(y.hash_on_query_arg=n.fields.hashOnQueryArgument),n.fields.hashOn==="uri_capture"&&(y.hash_on_uri_capture=n.fields.hashOnUriCapture),n.fields.hashFallback==="header"&&(y.hash_fallback_header=n.fields.hashFallbackHeader),n.fields.hashFallback==="query_arg"&&(y.hash_fallback_query_arg=n.fields.hashFallbackQueryArgument),n.fields.hashFallback==="uri_capture"&&(y.hash_fallback_uri_capture=n.fields.hashFallbackUriCapture),n.fields.activeHealthSwitch?(y.healthchecks.active={type:n.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},n.fields.activeHealthCheck.timeout&&(y.healthchecks.active.timeout=Number(n.fields.activeHealthCheck.timeout)),n.fields.activeHealthCheck.concurrency&&(y.healthchecks.active.concurrency=Number(n.fields.activeHealthCheck.concurrency)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpPath&&(y.healthchecks.active.http_path=n.fields.activeHealthCheck.httpPath),((z=a.config)==null?void 0:z.app)==="kongManager"&&(n.fields.activeHealthCheck.headers.length===0?y.healthchecks.active.headers=[]:y.healthchecks.active.headers=n.fields.activeHealthCheck.headers.reduce((Z,R)=>{var ee,me;return R.key?{...Z,[R.key]:(me=(ee=R.values.split(","))==null?void 0:ee.map(Ve=>String(Ve||"").trim()))==null?void 0:me.filter(Ve=>Ve!=="")}:{...Z}},{})),(n.fields.activeHealthCheck.type==="https"||n.fields.activeHealthCheck.type==="grpcs")&&n.fields.activeHealthCheck.httpsSni&&(y.healthchecks.active.https_sni=n.fields.activeHealthCheck.httpsSni),(n.fields.activeHealthCheck.type==="https"||n.fields.activeHealthCheck.type==="grpcs")&&(y.healthchecks.active.https_verify_certificate=n.fields.activeHealthCheck.verifySsl),n.fields.activeHealthCheck.interval&&(y.healthchecks.active.healthy.interval=Number(n.fields.activeHealthCheck.interval)),n.fields.activeHealthCheck.successes&&(y.healthchecks.active.healthy.successes=Number(n.fields.activeHealthCheck.successes)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpStatuses&&(y.healthchecks.active.healthy.http_statuses=o(n.fields.activeHealthCheck.httpStatuses)),n.fields.activeHealthCheck.unhealthyInterval&&(y.healthchecks.active.unhealthy.interval=Number(n.fields.activeHealthCheck.unhealthyInterval)),n.fields.activeHealthCheck.unhealthyTimeouts&&(y.healthchecks.active.unhealthy.timeouts=Number(n.fields.activeHealthCheck.unhealthyTimeouts)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.active.unhealthy.http_statuses=o(n.fields.activeHealthCheck.unhealthyHttpStatuses)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpFailures&&(y.healthchecks.active.unhealthy.http_failures=Number(n.fields.activeHealthCheck.httpFailures)),n.fields.activeHealthCheck.type==="tcp"&&n.fields.activeHealthCheck.tcpFailures&&(y.healthchecks.active.unhealthy.tcp_failures=Number(n.fields.activeHealthCheck.tcpFailures))):((j=a.config)==null?void 0:j.app)==="kongManager"&&T.value===oe.Edit&&(y.healthchecks.active={type:n.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),n.fields.passiveHealthSwitch?(y.healthchecks.passive={type:n.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},n.fields.passiveHealthCheck.successes&&(y.healthchecks.passive.healthy.successes=Number(n.fields.passiveHealthCheck.successes)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.httpStatuses&&(y.healthchecks.passive.healthy.http_statuses=o(n.fields.passiveHealthCheck.httpStatuses)),n.fields.passiveHealthCheck.timeouts&&(y.healthchecks.passive.unhealthy.timeouts=Number(n.fields.passiveHealthCheck.timeouts)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.passive.unhealthy.http_statuses=o(n.fields.passiveHealthCheck.unhealthyHttpStatuses)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.httpFailures&&(y.healthchecks.passive.unhealthy.http_failures=Number(n.fields.passiveHealthCheck.httpFailures)),n.fields.passiveHealthCheck.type==="tcp"&&n.fields.passiveHealthCheck.tcpFailures&&(y.healthchecks.passive.unhealthy.tcp_failures=Number(n.fields.passiveHealthCheck.tcpFailures))):((P=a.config)==null?void 0:P.app)==="kongManager"&&T.value===oe.Edit&&(y.healthchecks.passive={type:n.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),y},B=y=>{var b,z,j,P,Z,R;let g=`${(b=a.config)==null?void 0:b.apiBaseUrl}${Ne.form[(z=a.config)==null?void 0:z.app][y]}`;return((j=a.config)==null?void 0:j.app)==="konnect"?g=g.replace(/{controlPlaneId}/gi,((P=a.config)==null?void 0:P.controlPlaneId)||""):((Z=a.config)==null?void 0:Z.app)==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(R=a.config)!=null&&R.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.upstreamId),g},U=async()=>{var y;try{n.readonly=!0,await d.post(B("validate"),M());let g;T.value===oe.Create?g=await d.post(B("create"),M()):T.value===oe.Edit&&(g=((y=a.config)==null?void 0:y.app)==="konnect"?await d.put(B("edit"),M()):await d.patch(B("edit"),M())),l("update",g==null?void 0:g.data)}catch(g){n.errorMessage=u(g),l("error",g)}finally{n.readonly=!1}};return(y,g)=>(t.openBlock(),t.createElementBlock("div",Oc,[t.createVNode(t.unref(va),{"can-submit":w.value&&C.value,config:e.config,"edit-id":e.upstreamId,"error-message":n.errorMessage,"fetch-url":H.value,"is-readonly":n.readonly,onCancel:v,"onFetch:error":D,"onFetch:success":$,onLoading:F,onSubmit:U},{default:t.withCtx(()=>[t.createVNode(ic,{"client-certificate":n.fields.clientCertificate,"onUpdate:clientCertificate":g[0]||(g[0]=b=>n.fields.clientCertificate=b),"host-header":n.fields.hostHeader,"onUpdate:hostHeader":g[1]||(g[1]=b=>n.fields.hostHeader=b),name:n.fields.name,"onUpdate:name":g[2]||(g[2]=b=>n.fields.name=b),tags:n.fields.tags,"onUpdate:tags":g[3]||(g[3]=b=>n.fields.tags=b),config:e.config,readonly:n.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(fc,{algorithm:n.fields.algorithm,"onUpdate:algorithm":g[4]||(g[4]=b=>n.fields.algorithm=b),"hash-fallback":n.fields.hashFallback,"onUpdate:hashFallback":g[5]||(g[5]=b=>n.fields.hashFallback=b),"hash-fallback-header":n.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":g[6]||(g[6]=b=>n.fields.hashFallbackHeader=b),"hash-fallback-query-argument":n.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":g[7]||(g[7]=b=>n.fields.hashFallbackQueryArgument=b),"hash-fallback-uri-capture":n.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":g[8]||(g[8]=b=>n.fields.hashFallbackUriCapture=b),"hash-on":n.fields.hashOn,"onUpdate:hashOn":g[9]||(g[9]=b=>n.fields.hashOn=b),"hash-on-cookie":n.fields.hashOnCookie,"onUpdate:hashOnCookie":g[10]||(g[10]=b=>n.fields.hashOnCookie=b),"hash-on-cookie-path":n.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":g[11]||(g[11]=b=>n.fields.hashOnCookiePath=b),"hash-on-header":n.fields.hashOnHeader,"onUpdate:hashOnHeader":g[12]||(g[12]=b=>n.fields.hashOnHeader=b),"hash-on-query-argument":n.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":g[13]||(g[13]=b=>n.fields.hashOnQueryArgument=b),"hash-on-uri-capture":n.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":g[14]||(g[14]=b=>n.fields.hashOnUriCapture=b),slots:n.fields.slots,"onUpdate:slots":g[15]||(g[15]=b=>n.fields.slots=b),readonly:n.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(Cc,{"active-health-switch":n.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[g[16]||(g[16]=b=>n.fields.activeHealthSwitch=b),f],"healthchecks-threshold":n.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":g[17]||(g[17]=b=>n.fields.healthchecksThreshold=b),"passive-health-switch":n.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[g[18]||(g[18]=b=>n.fields.passiveHealthSwitch=b),m],readonly:n.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),n.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Bc,{key:0,concurrency:n.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":g[19]||(g[19]=b=>n.fields.activeHealthCheck.concurrency=b),headers:n.fields.activeHealthCheck.headers,"onUpdate:headers":g[20]||(g[20]=b=>n.fields.activeHealthCheck.headers=b),"http-failures":n.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":g[21]||(g[21]=b=>n.fields.activeHealthCheck.httpFailures=b),"http-path":n.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":g[22]||(g[22]=b=>n.fields.activeHealthCheck.httpPath=b),"http-statuses":n.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[23]||(g[23]=b=>n.fields.activeHealthCheck.httpStatuses=b),"https-sni":n.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":g[24]||(g[24]=b=>n.fields.activeHealthCheck.httpsSni=b),interval:n.fields.activeHealthCheck.interval,"onUpdate:interval":g[25]||(g[25]=b=>n.fields.activeHealthCheck.interval=b),successes:n.fields.activeHealthCheck.successes,"onUpdate:successes":g[26]||(g[26]=b=>n.fields.activeHealthCheck.successes=b),"tcp-failures":n.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[27]||(g[27]=b=>n.fields.activeHealthCheck.tcpFailures=b),timeout:n.fields.activeHealthCheck.timeout,"onUpdate:timeout":g[28]||(g[28]=b=>n.fields.activeHealthCheck.timeout=b),type:n.fields.activeHealthCheck.type,"onUpdate:type":g[29]||(g[29]=b=>n.fields.activeHealthCheck.type=b),"unhealthy-http-statuses":n.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[30]||(g[30]=b=>n.fields.activeHealthCheck.unhealthyHttpStatuses=b),"unhealthy-interval":n.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":g[31]||(g[31]=b=>n.fields.activeHealthCheck.unhealthyInterval=b),"unhealthy-timeouts":n.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":g[32]||(g[32]=b=>n.fields.activeHealthCheck.unhealthyTimeouts=b),"verify-ssl":n.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":g[33]||(g[33]=b=>n.fields.activeHealthCheck.verifySsl=b),config:e.config,readonly:n.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),n.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(Fc,{key:1,"http-failures":n.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":g[34]||(g[34]=b=>n.fields.passiveHealthCheck.httpFailures=b),"http-statuses":n.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[35]||(g[35]=b=>n.fields.passiveHealthCheck.httpStatuses=b),successes:n.fields.passiveHealthCheck.successes,"onUpdate:successes":g[36]||(g[36]=b=>n.fields.passiveHealthCheck.successes=b),"tcp-failures":n.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[37]||(g[37]=b=>n.fields.passiveHealthCheck.tcpFailures=b),timeouts:n.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":g[38]||(g[38]=b=>n.fields.passiveHealthCheck.timeouts=b),type:n.fields.passiveHealthCheck.type,"onUpdate:type":g[39]||(g[39]=b=>n.fields.passiveHealthCheck.type=b),"unhealthy-http-statuses":n.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[40]||(g[40]=b=>n.fields.passiveHealthCheck.unhealthyHttpStatuses=b),readonly:n.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","is-readonly"])]))}}),ud="",vc=de(qc,[["__scopeId","data-v-810fb7b7"]]),Uc=t.createElementVNode("code",null,"10",-1),$c=t.createElementVNode("code",null,"65536",-1),Dc={"data-testid":"client_certificate-plain-text"},Mc=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","copy:success"],setup(e){const l=e,{i18n:{t:a},i18nT:r}=ce.useI18n(),{getPropValue:o}=Di(),s=t.computed(()=>Ne.form[l.config.app].edit),c=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(h,i)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(hi),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":c.value,"fetch-url":s.value,"hide-title":e.hideTitle,"onCopy:success":i[0]||(i[0]=d=>h.$emit("copy:success",d)),"onFetch:error":i[1]||(i[1]=d=>h.$emit("fetch:error",d)),"onFetch:success":i[2]||(i[2]=d=>h.$emit("fetch:success",d)),onLoading:i[3]||(i[3]=d=>h.$emit("loading",d))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{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:d})=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(d.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{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(r),{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(r),{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(r),{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(r),{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(r),{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(()=>[Uc]),max:t.withCtx(()=>[$c]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{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(r),{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(r),{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(r),{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(r),{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(d=>{var u;return[t.createElementVNode("div",null,[t.createElementVNode("div",Dc,[t.createElementVNode("span",null,t.toDisplayString((u=t.unref(o)("rowValue",d))==null?void 0:u.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});te.TargetForm=Wa,te.TargetsList=oc,te.UpstreamsConfigCard=Mc,te.UpstreamsForm=vc,te.UpstreamsList=Gi,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})});
32
+ `:""}var Is=Bs,Ts={dump:Is};function ht(e,l){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+l+" instead, which is now safe by default.")}}var Hs=G,Es=vt,As=Mt,Fs=Rt,Os=zt,qs=at,vs=ma.load,Us=ma.loadAll,$s=Ts.dump,Ds=ae,Ms={binary:Gt,float:Lt,map:Dt,null:jt,pairs:Xt,set:ea,timestamp:Qt,bool:Kt,int:Pt,merge:Yt,omap:Zt,seq:$t,str:Ut},js=ht("safeLoad","load"),Ks=ht("safeLoadAll","loadAll"),Ps=ht("safeDump","dump"),Ls={Type:Hs,Schema:Es,FAILSAFE_SCHEMA:As,JSON_SCHEMA:Fs,CORE_SCHEMA:Os,DEFAULT_SCHEMA:qs,load:vs,loadAll:Us,dump:$s,YAMLException:Ds,types:Ms,safeLoad:js,safeLoadAll:Ks,safeDump:Ps};const Rs={key:0,class:"config-card-display-form"},zs=["data-testid"],Js={key:0,class:"config-card-prop-section-title"},Ws={key:1,class:"config-card-display-json"},Qs={key:2,class:"config-card-display-yaml"},Ys=re(t.defineComponent({__name:"ConfigCardDisplay",props:{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:()=>null}},setup(e){const l=e,a=t.useSlots(),{i18n:{t:r}}=Y.useI18n(),o=h=>!!(h.tooltip||a[`${h.key}-label-tooltip`]),s=t.ref(""),c=t.ref("");return t.watch(()=>l.format,h=>{if(h!=="structured"){const i=JSON.parse(JSON.stringify(l.record));delete i.created_at,delete i.updated_at,h==="json"?s.value=JSON.stringify(i,null,2):h==="yaml"&&(c.value=Ls.dump(i))}},{immediate:!0}),(h,i)=>{const d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Rs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,u=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${u}-props`,class:t.normalizeClass(`config-card-details-${u}-props`),"data-testid":`config-card-details-${u}-props`},[u!=="basic"?(t.openBlock(),t.createElementBlock("div",Js,t.toDisplayString(u==="advanced"?t.unref(r)("baseConfigCard.sections.advanced"):t.unref(r)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[u],p=>(t.openBlock(),t.createBlock(Ge,{key:p.key,item:p},t.createSlots({label:t.withCtx(()=>[t.renderSlot(h.$slots,`${p.key}-label`,{row:p},void 0,!0)]),[p.key]:t.withCtx(({rowValue:n})=>[t.renderSlot(h.$slots,p.key,{row:p,rowValue:n},void 0,!0)]),_:2},[o(p)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(h.$slots,`${p.key}-label-tooltip`,{row:p},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,zs))),128))])):t.createCommentVNode("",!0),e.format==="json"?(t.openBlock(),t.createElementBlock("div",Ws,[t.createVNode(d,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),e.format==="yaml"?(t.openBlock(),t.createElementBlock("div",Qs,[t.createVNode(d,{id:"config-card-codeblock",code:c.value,language:"yaml",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-c914c7e4"]]),qa="24px",Gs=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Zs=e=>(t.pushScopeId("data-v-4c9d405a"),e=e(),t.popScopeId(),e),Xs=["aria-hidden"],ei={key:0,"data-testid":"kui-icon-svg-title"},ti=Zs(()=>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)),ai=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:qa,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qa}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,s)=>(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(r.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",ei,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ti],8,Xs))]),_:1},8,["aria-hidden","style"]))}}),li=Gs(ai,[["__scopeId","data-v-4c9d405a"]]),ri={"data-testid":"config-card-title"},oi={class:"config-card-actions"},ni=["href"],si={key:2,class:"config-card-details-section"},ii={key:3,class:"config-card-details-section"},ci=["data-testid"],di={key:0,class:"config-card-prop-section-title"},hi=re(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}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:l}){var a;const r=e,o=t.useSlots(),{i18n:{t:s}}=Y.useI18n(),{getMessageFromError:c}=Y.useErrors(),{convertKeyToTitle:h}=Y.useStringHelpers(),{axiosInstance:i}=Y.useAxios({headers:(a=r.config)==null?void 0:a.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=t.ref("structured"),p=N=>{u.value=N==null?void 0:N.value},n={id:{type:P.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:P.BadgeStatus,order:2,section:J.Basic},updated_at:{type:P.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:P.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:P.BadgeTag,order:-1,section:J.Basic}},k=t.ref(!1),C=t.ref(!1),f=t.ref(""),m=t.ref(),V=t.computed(()=>{var N,I,w;if(!m.value)return[];const T=[],H=Object.keys(m.value).length;for(const $ in m.value){const v=(I=(N=r.configSchema)==null?void 0:N[$])==null?void 0:I.order,F=(w=n[$])==null?void 0:w.order;let D=H;(F||F===0)&&(D=F===-1?H+1:F),v&&(D=v===-1?H+1:v),T.push([$,D])}return T.sort(function($,v){return $[1]-v[1]}),T.map($=>{var v,F;const D=$[0],M=(v=m.value)==null?void 0:v[D],B=((F=r.configSchema)==null?void 0:F[D])||{},U=n[D];return{key:D,value:M,hidden:B.hidden||!1,type:B.type??((U==null?void 0:U.type)||P.Text),label:B.label??((U==null?void 0:U.label)||h(D)),tooltip:B.tooltip??((U==null?void 0:U.tooltip)||void 0),section:B.section??((U==null?void 0:U.section)||J.Advanced)}}).filter($=>!$.hidden&&$.key!==r.pluginConfigKey)}),_=t.computed(()=>{var N,I;if(!m.value||!r.pluginConfigKey)return[];const w=m.value[r.pluginConfigKey]||{},T=Object.keys(w).length,H=[];for(const $ in w){const v=(I=(N=r.pluginConfigSchema)==null?void 0:N[$])==null?void 0:I.order,F=w[$];let D=F!=null&&F!==""?T-1:T;v&&(D=v===-1?T+1:v),H.push([$,D])}return H.sort(function($,v){return $[1]-v[1]}),H.map($=>{var v;const F=$[0],D=w[F],M=((v=r.pluginConfigSchema)==null?void 0:v[F])||{};return{key:F,value:D,hidden:M.hidden||!1,type:M.type??P.Text,label:M.label??h(F),tooltip:M.tooltip??void 0,section:J.Plugin}}).filter($=>!$.hidden)}),O=t.computed(()=>{var N,I,w,T;return{basic:(N=V.value)==null?void 0:N.filter(H=>H.section===J.Basic),advanced:(I=V.value)==null?void 0:I.filter(H=>H.section===J.Advanced),plugin:(T=_.value)==null?void 0:T.concat((w=V.value)==null?void 0:w.filter(H=>H.section===J.Plugin))}}),S=t.computed(()=>{const N=[];return O.value.basic.length&&N.push("basic"),O.value.advanced.length&&N.push("advanced"),O.value.plugin.length&&N.push("plugin"),N}),x=N=>!!(N.tooltip||o[`${N.key}-label-tooltip`]),q=t.computed(()=>{var N,I;let w=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((N=r.config)==null?void 0:N.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(I=r.config)!=null&&I.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.config.entityId),w}),A=N=>{m.value&&N(JSON.stringify(m.value))?l("copy:success",m.value):l("copy:error")};return t.watch(k,N=>{l("loading",N)},{immediate:!0}),t.onBeforeMount(async()=>{C.value=!1,k.value=!0;try{const{data:N}=await i.get(q.value);if(r.dataKey)if(typeof N[r.dataKey]<"u")m.value={...N[r.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:r.dataKey}));else m.value={...N};Object.keys(r.configSchema).filter(I=>r.configSchema[I].forceShow).forEach(I=>{m.value&&typeof m.value[I]>"u"&&(m.value[I]=null)}),l("fetch:success",N)}catch(N){const I=c(N);f.value=I.startsWith("code")?s("baseConfigCard.errors.load"):I,C.value=!0,l("fetch:error",N)}finally{k.value=!1}}),(N,I)=>{const w=t.resolveComponent("KLabel"),T=t.resolveComponent("KSelect"),H=t.resolveComponent("KButton"),$=t.resolveComponent("KClipboardProvider"),v=t.resolveComponent("KSkeleton"),F=t.resolveComponent("KEmptyState"),D=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(D,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",oi,[t.renderSlot(N.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(w,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(T,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:p})):t.createCommentVNode("",!0),r.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock(H,{key:2,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(li),{size:t.unref(ho)},null,8,["size"])],8,ni)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock($,{key:3},{default:t.withCtx(({copyToClipboard:M})=>[!k.value&&!C.value?(t.openBlock(),t.createBlock(H,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:B=>A(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),body:t.withCtx(()=>[k.value?(t.openBlock(),t.createBlock(v,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):C.value?(t.openBlock(),t.createBlock(F,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(f.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",si,[t.createVNode(Ys,{format:u.value,"prop-list-types":S.value,"property-collections":O.value,record:m.value},t.createSlots({_:2},[t.renderList(Object.keys(N.$slots),M=>({name:M,fn:t.withCtx(({row:B,rowValue:U})=>[t.renderSlot(N.$slots,M,{row:B,rowValue:U},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",ii,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(S.value,M=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${M}-props`,class:t.normalizeClass(`config-card-details-${M}-props`),"data-testid":`config-card-details-${M}-props`},[M!=="basic"?(t.openBlock(),t.createElementBlock("div",di,t.toDisplayString(M==="advanced"?t.unref(s)("baseConfigCard.sections.advanced"):t.unref(s)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.value[M],B=>(t.openBlock(),t.createBlock(Ge,{key:B.key,item:B},t.createSlots({label:t.withCtx(()=>[t.renderSlot(N.$slots,`${B.key}-label`,{row:B},void 0,!0)]),[B.key]:t.withCtx(({rowValue:U})=>[t.renderSlot(N.$slots,B.key,{row:B,rowValue:U},void 0,!0)]),_:2},[x(B)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(N.$slots,`${B.key}-label-tooltip`,{row:B},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,ci))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",ri,[t.renderSlot(N.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-b3999889"]]),pi=["onReset","onSubmit"],ui={class:"form-actions","data-testid":"form-actions"},va=re(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:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:l}){var a;const r=e,o=ze.useRouter(),{i18n:{t:s}}=Y.useI18n(),{getMessageFromError:c}=Y.useErrors(),{axiosInstance:h}=Y.useAxios({headers:(a=r.config)==null?void 0:a.requestHeaders}),i=t.ref(!1),d=t.ref(!1),u=t.ref(""),p=t.computed(()=>r.canSubmit===!1||r.isReadonly),n=t.computed(()=>{var m,V;if(!r.editId)return"";let _=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(V=r.config)!=null&&V.workspace?`/${r.config.workspace}`:"")),_=_.replace(/{id}/gi,r.editId),_}),k=()=>{r.config.cancelRoute?o.push(r.config.cancelRoute):C()},C=()=>{l("cancel")},f=()=>{p.value||l("submit")};return t.watch(()=>i.value,m=>{l("loading",m)},{immediate:!0}),t.onBeforeMount(async()=>{if(r.editId)try{d.value=!1,i.value=!0;const{data:m}=await h.get(n.value);l("fetch:success",m)}catch(m){const V=c(m);u.value=V.startsWith("code")?s("baseForm.errors.edit"):V,d.value=!0,l("fetch:error",m)}finally{i.value=!1}}),(m,V)=>{const _=t.resolveComponent("KSkeleton"),O=t.resolveComponent("KEmptyState"),S=t.resolveComponent("KAlert"),x=t.resolveComponent("KButton"),q=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(q,{class:"kong-ui-entity-base-form"},{body:t.withCtx(()=>[i.value?(t.openBlock(),t.createBlock(_,{key:0,type:"form"})):d.value?(t.openBlock(),t.createBlock(O,{key:1,"cta-text":t.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":k,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(C,["prevent"]),onSubmit:t.withModifiers(f,["prevent"])},[t.renderSlot(m.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(S,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",ui,[t.renderSlot(m.$slots,"form-actions",{},()=>[t.createVNode(x,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(x,{appearance:"primary","data-testid":"form-submit",disabled:p.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,pi))]),_:3})}}}),[["__scopeId","data-v-81612aef"]]),fi={key:0,"data-testid":"first-col"},mi=re(t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const l=e,a=t.computed(()=>{var f;return((f=l.rowEl)==null?void 0:f.querySelector(`[data-testid="${l.keyName}"]`))||null}),r=t.computed(()=>{var f;return((f=a.value)==null?void 0:f.querySelector('[data-testid="first-col"]'))||null}),o=t.computed(()=>{var f,m;const V=(f=l.rowEl)==null?void 0:f.querySelectorAll("td");return V?((m=V[0])==null?void 0:m.getAttribute("data-testid"))===l.keyName:!1});let s;const c=()=>{s&&(s.disconnect(),s=void 0)},h=()=>{var f,m,V;d.value=((f=r.value)==null?void 0:f.getBoundingClientRect().width)||0,u.value=((m=a.value)==null?void 0:m.clientWidth)||0,p.value=((V=i.value)==null?void 0:V.innerText)||""},i=t.ref({}),d=t.ref(0),u=t.ref(0),p=t.ref(""),n=t.computed(()=>[r.value,a.value]),k=t.watch(n,f=>{if(o.value&&(c(),"ResizeObserver"in window&&window)){s=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||h()})});for(const m of f)m&&s.observe(m)}},{immediate:!0,flush:"post",deep:!0}),C=t.computed(()=>o.value?d.value>u.value:!1);return t.onMounted(()=>{h()}),t.onUnmounted(()=>{k()}),(f,m)=>{const V=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:i,class:"content-wrapper"},[o.value?(t.openBlock(),t.createElementBlock("span",fi,[t.createVNode(V,{label:C.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(f.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-e42a20c9"]]),gi={class:"toolbar-container"},yi={key:0,class:"toolbar-button-container"},ki=["data-testid"],Ua=re(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},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:l}){const a=e,{i18n:{t:r}}=Y.useI18n(),o=t.computed(()=>{var S,x;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(S=a.errorMessage)==null?void 0:S.title,message:(x=a.errorMessage)==null?void 0:x.message}}),s=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),c=S=>S.hasData||!!a.query,h=t.computed(()=>{const S=[];return Object.keys(a.tableHeaders).forEach(x=>{const q=a.tableHeaders[x];S.push({label:q.label??x,key:x,sortable:q.sortable??!1})}),a.enableEntityActions&&S.push({key:"actions",hideLabel:!0}),S}),i=S=>({"data-rowid":S.id,"data-testid":S.name,...a.rowAttributes(S)}),d=t.ref({}),u=S=>{var x;return(x=d.value)==null?void 0:x.$el.querySelector(`[data-rowid="${S.id}"]`)},p=S=>{const x={"data-testid":S.headerKey,...a.cellAttributes(S)};return S.colIndex===0&&(x.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),x},n=()=>{l("empty-state-cta-clicked"),k()},k=()=>{l("clear-search-input")},C=t.computed(()=>a.disableRowClick?void 0:(S,x)=>{l("click:row",x)}),f=S=>{l("sort",S)},{setTablePreferences:m,getTablePreferences:V}=gr(),_=t.computed(()=>{const S=V(a.preferencesStorageKey);return{...a.initialFetcherParams,...S}}),O=S=>{a.preferencesStorageKey&&m(a.preferencesStorageKey,S)};return(S,x)=>{const q=t.resolveComponent("KIcon"),A=t.resolveComponent("KButton"),N=t.resolveComponent("KDropdown"),I=t.resolveComponent("KTable"),w=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(w,{class:"kong-ui-entity-base-table",title:e.title},{body:t.withCtx(()=>[t.createVNode(I,{ref_key:"tableRefs",ref:d,"cache-identifier":s.value,"cell-attrs":p,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":o.value.message,"error-state-title":o.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":o.value.hasError,headers:h.value,"hide-pagination-when-optional":"","initial-fetcher-params":_.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":i,"search-input":e.query,onKtableEmptyStateCtaClicked:n,"onRow:click":C.value,onSort:x[0]||(x[0]=T=>f(T)),"onUpdate:tablePreferences":O},t.createSlots({toolbar:t.withCtx(({state:T})=>[t.withDirectives(t.createElementVNode("div",gi,[t.renderSlot(S.$slots,"toolbar-filter",{},void 0,!0),S.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",yi,[t.renderSlot(S.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,c(T)]])]),actions:t.withCtx(({row:T,rowKey:H,rowValue:$})=>[t.createElementVNode("div",{class:"actions-container","data-testid":T.name},[t.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(S.$slots,"actions",{row:T,rowKey:H,rowValue:$},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(A,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(q,{color:t.unref(io),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,ki)]),_:2},[t.renderList(e.tableHeaders,(T,H)=>({name:H,fn:t.withCtx(({row:$,rowKey:v,rowValue:F})=>[t.createVNode(mi,{"key-name":String(H),"row-el":u($)},{default:t.withCtx(()=>[t.renderSlot(S.$slots,H,{row:$,rowKey:v,rowValue:F},()=>[t.createTextVNode(t.toDisplayString(F),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-499a771c"]]),bi={key:0,class:"kong-ui-entity-delete-error"},Ci={key:1,class:"description"},$a=re(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:l}){const a=e,{i18nT:r}=Y.useI18n(),o=t.computed(()=>a.needConfirm?a.entityName:""),s=()=>{l("cancel")},c=()=>{l("proceed")};return(h,i)=>{const d=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:s,onProceed:c},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",bi,[t.createVNode(d,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(r),{class:"message",keypath:a.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a.entityType),1)]),_:2},[a.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(a.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),a.description||h.$slots.description?(t.openBlock(),t.createElementBlock("div",Ci,[t.renderSlot(h.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(a.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),_i={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},wi={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Si=["fill"],xi={mask:"url(#mask0_180_20349)"},Ni=["fill"],Da=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${no})`}},setup(e){return(l,a)=>(t.openBlock(),t.createElementBlock("svg",_i,[t.createElementVNode("mask",wi,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Si)]),t.createElementVNode("g",xi,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ni)])]))}}),Vi={key:1,class:"kong-ui-entity-filter"},Bi={class:"menu-item-title"},Ii={class:"menu-item-indicator"},Ti={class:"menu-item-body"},Hi=["for"],Ei={class:"menu-item-buttons"},Ai={class:"filter-clear-button-container"},Fi=re(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:l}){const a=e,{i18n:{t:r}}=Y.useI18n(),o=t.ref(!1),s=t.ref({}),c=t.computed(()=>{const m=[];return new URLSearchParams(a.modelValue).forEach((V,_)=>{V!==""&&m.push(_)}),m}),h=t.computed(()=>{const m=a.config.fields;return Object.keys(m).filter(V=>m[V].searchable).map(V=>({label:m[V].label||V,value:V}))});t.watch(()=>a.modelValue,m=>{s.value={},new URLSearchParams(m).forEach((V,_)=>{s.value[_]=V})});const i=()=>{o.value=!o.value},d=m=>{l("update:modelValue",m)},u=m=>`filter-${m}`,p=m=>{var V,_;return(((_=(V=a.config.schema)==null?void 0:V[m])==null?void 0:_.values)??[]).map(O=>({value:O,label:O}))},n=m=>{var V,_;return((_=(V=a.config.schema)==null?void 0:V[m])==null?void 0:_.type)??"text"},k=m=>{s.value={...s.value,[m]:""},f()},C=()=>{s.value={},f(!0)},f=(m=!1)=>{const V=Object.keys(s.value).reduce((_,O)=>(s.value[O]&&(_[O]=`${s.value[O]}`),_),{});m&&(o.value=!1),l("update:modelValue",new URLSearchParams(V).toString())};return(m,V)=>{const _=t.resolveComponent("KInput"),O=t.resolveComponent("KButton"),S=t.resolveComponent("KSelect"),x=t.resolveComponent("KMenuItem"),q=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(_,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{before:t.withCtx(()=>[t.createVNode(Da)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Vi,[t.createVNode(O,{appearance:"tertiary","data-testid":"filter-button",onClick:i},{default:t.withCtx(()=>[t.createVNode(Da),t.createTextVNode(" "+t.toDisplayString(t.unref(r)("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:i},null,512),[[t.vShow,o.value]]),t.withDirectives(t.createVNode(q,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,(A,N)=>(t.openBlock(),t.createBlock(x,{key:A.value,"data-testid":A.value,expandable:"","last-menu-item":N===h.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",Bi,[t.createTextVNode(t.toDisplayString(A.label)+" ",1),t.withDirectives(t.createElementVNode("span",Ii,null,512),[[t.vShow,c.value.includes(A.value)]])])]),itemBody:t.withCtx(()=>{var I,w;return[t.createElementVNode("div",Ti,[t.createElementVNode("label",{class:"menu-item-label",for:u(A.value)},t.toDisplayString(t.unref(r)("filter.fieldLabel")),9,Hi),((w=(I=e.config.schema)==null?void 0:I[A.value])==null?void 0:w.type)==="select"?(t.openBlock(),t.createBlock(S,{key:0,id:u(A.value),modelValue:s.value[A.value],"onUpdate:modelValue":T=>s.value[A.value]=T,appearance:"select",items:p(A.value),placeholder:t.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(_,{key:1,id:u(A.value),modelValue:s.value[A.value],"onUpdate:modelValue":T=>s.value[A.value]=T,autocomplete:"off",placeholder:t.unref(r)("filter.inputPlaceholder"),type:n(A.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",Ei,[t.createVNode(O,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:V[0]||(V[0]=T=>f(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.applyButtonText")),1)]),_:1}),t.createVNode(O,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:T=>k(A.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",Ai,[t.createVNode(O,{appearance:"tertiary",size:"small",onClick:C},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,o.value]])]))}}}),[["__scopeId","data-v-15962ee2"]]),ie=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const l=e,a=t.ref(void 0),r=t.computed(()=>a.value===!0||a.value!==void 0&&l.forceShow===!0);return t.watch(()=>l.authFunction,async()=>{a.value=await l.authFunction()},{immediate:!0}),(o,s)=>r.value?t.renderSlot(o.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Oi={class:"form-section-wrapper"},qi={key:0,class:"form-section-title"},vi={key:1,class:"form-section-description"},Ui={key:2,class:"form-section-footer"},$i={class:"form-section-content"},Fe=re(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}},setup(e){const l=t.useSlots();return(a,r)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Oi,[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.createElementBlock("h4",qi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(l).description?(t.openBlock(),t.createElementBlock("div",vi,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(l).footer?(t.openBlock(),t.createElementBlock("div",Ui,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",$i,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:je,useDeleteUrlBuilder:Ma,useErrors:ja,useExternalLinkCreator:Gc,useFetchUrlBuilder:Zc,useFetcher:Ka,useDebouncedFilter:Pa,useStringHelpers:Xc,useHelpers:Di,useGatewayFeatureSupported:ed,useTruncationDetector:td}=Y,Mi={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 ji(){const e=Be.createI18n("en-us",Mi);return{i18n:e,i18nT:Be.i18nTComponent(e)}}function Oe(e){const{replaceId:l=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(o,s)=>{if(s){const c={...o};l&&(c.value=o.label),a.value.push(c)}else a.value=a.value.filter(c=>c.value!==o.value)}}}const Ke=[{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"}],pt=10,ut=65536,Ki=0,Pi=65535,_e=0,we=255,La=0,Ra=255,Li=0,Ri=65535,za=0,Ja=65535,zi=0,Ji=2**31,ft=["200","302"],mt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],gt=["429","404","500","501","502","503","504","505"],yt=["429","500","503"];function Pe(){const e=i=>/^\d+$/.test(i),l=(i,d,u)=>{if(e(i)){const p=Number(i);return p>=d&&p<=u}else return!1},a=i=>i.map(d=>Number(d)),r=i=>i.map(d=>d.toString()),o=()=>({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:ft,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:gt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:mt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:yt,tcpFailures:"5"}});return{isInteger:e,inRange:l,stringToNumberArray:a,numberToStringArray:r,upstreamsResponseToFields:i=>{var u,p,n,k,C,f,m,V,_,O,S,x,q,A,N,I,w,T,H,$,v,F,D,M,B,U,K,y,g,b,R,j,z,Z,L,ee,me,Ve,Qa,Ya,Ga,Za,Xa,el,tl,al,ll,rl,ol,nl,sl,il,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,_l,wl,Sl,xl,Nl,Vl,Bl,Il,Tl,Hl,El,Al,Fl,Ol,ql,vl,Ul,$l,Dl,Ml,jl,Kl,Pl,Ll,Rl,zl,Jl,Wl,Ql,Yl,Gl,Zl,Xl,er,tr,ar,lr,rr,or,nr,sr,ir,cr,dr,hr;const d=o();return d.name=i.name||"",d.algorithm=i.algorithm||"round-robin",d.hostHeader=i.host_header||"",d.clientCertificate=i.client_certificate?(u=i.client_certificate)==null?void 0:u.id:"",d.tags=((p=i.tags)==null?void 0:p.join(", "))||"",d.slots=i.slots!==null&&i.slots!==void 0?i.slots.toString():"10000",d.hashOn=i.hash_on||"none",d.hashFallback=i.hash_fallback||"none",d.hashOnHeader=i.hash_on_header||"",d.hashOnCookie=i.hash_on_cookie||"",d.hashOnCookiePath=i.hash_on_cookie_path||"/",d.hashOnQueryArgument=i.hash_on_query_arg||"",d.hashOnUriCapture=i.hash_on_uri_capture||"",d.hashFallbackHeader=i.hash_fallback_header||"",d.hashFallbackQueryArgument=i.hash_fallback_query_arg||"",d.hashFallbackUriCapture=i.hash_fallback_uri_capture||"",d.healthchecksThreshold=i.healthchecks.threshold!==null&&i.healthchecks.threshold!==void 0?i.healthchecks.threshold.toString():"",d.activeHealthSwitch=((k=(n=i.healthchecks.active)==null?void 0:n.healthy)==null?void 0:k.interval)!==0||((f=(C=i.healthchecks.active)==null?void 0:C.unhealthy)==null?void 0:f.interval)!==0,d.activeHealthCheck.type=((m=i.healthchecks.active)==null?void 0:m.type)||"http",d.activeHealthCheck.httpPath=((V=i.healthchecks.active)==null?void 0:V.http_path)||"/",d.activeHealthCheck.timeout=((_=i.healthchecks.active)==null?void 0:_.timeout)!==null&&((O=i.healthchecks.active)==null?void 0:O.timeout)!==void 0?(x=(S=i.healthchecks.active)==null?void 0:S.timeout)==null?void 0:x.toString():"",d.activeHealthCheck.concurrency=((q=i.healthchecks.active)==null?void 0:q.concurrency)!==null&&((A=i.healthchecks.active)==null?void 0:A.concurrency)!==void 0?(I=(N=i.healthchecks.active)==null?void 0:N.concurrency)==null?void 0:I.toString():"",d.activeHealthCheck.httpsSni=((w=i.healthchecks.active)==null?void 0:w.https_sni)||"",d.activeHealthCheck.verifySsl=((T=i.healthchecks.active)==null?void 0:T.https_verify_certificate)||!1,d.activeHealthCheck.headers=(H=i.healthchecks.active)!=null&&H.headers&&Object.entries(($=i.healthchecks.active)==null?void 0:$.headers).length>0?Object.entries((v=i.healthchecks.active)==null?void 0:v.headers).map(([jc,kt])=>({key:jc,values:kt==null?void 0:kt.join(", ")})):[{key:"",values:""}],d.activeHealthCheck.interval=((D=(F=i.healthchecks.active)==null?void 0:F.healthy)==null?void 0:D.interval)!==null&&((B=(M=i.healthchecks.active)==null?void 0:M.healthy)==null?void 0:B.interval)!==void 0?(y=(K=(U=i.healthchecks.active)==null?void 0:U.healthy)==null?void 0:K.interval)==null?void 0:y.toString():"0",d.activeHealthCheck.interval=((b=(g=i.healthchecks.active)==null?void 0:g.healthy)==null?void 0:b.interval)!==null&&((j=(R=i.healthchecks.active)==null?void 0:R.healthy)==null?void 0:j.interval)!==void 0?(L=(Z=(z=i.healthchecks.active)==null?void 0:z.healthy)==null?void 0:Z.interval)==null?void 0:L.toString():"0",d.activeHealthCheck.successes=((me=(ee=i.healthchecks.active)==null?void 0:ee.healthy)==null?void 0:me.successes)!==null&&((Qa=(Ve=i.healthchecks.active)==null?void 0:Ve.healthy)==null?void 0:Qa.successes)!==void 0?(Za=(Ga=(Ya=i.healthchecks.active)==null?void 0:Ya.healthy)==null?void 0:Ga.successes)==null?void 0:Za.toString():"0",d.activeHealthCheck.httpStatuses=(el=(Xa=i.healthchecks.active)==null?void 0:Xa.healthy)!=null&&el.http_statuses?r(((al=(tl=i.healthchecks.active)==null?void 0:tl.healthy)==null?void 0:al.http_statuses)||[]):ft,d.activeHealthCheck.unhealthyInterval=((rl=(ll=i.healthchecks.active)==null?void 0:ll.unhealthy)==null?void 0:rl.interval)!==null&&((nl=(ol=i.healthchecks.active)==null?void 0:ol.unhealthy)==null?void 0:nl.interval)!==void 0?(cl=(il=(sl=i.healthchecks.active)==null?void 0:sl.unhealthy)==null?void 0:il.interval)==null?void 0:cl.toString():"0",d.activeHealthCheck.httpFailures=((hl=(dl=i.healthchecks.active)==null?void 0:dl.unhealthy)==null?void 0:hl.http_failures)!==null&&((ul=(pl=i.healthchecks.active)==null?void 0:pl.unhealthy)==null?void 0:ul.http_failures)!==void 0?(gl=(ml=(fl=i.healthchecks.active)==null?void 0:fl.unhealthy)==null?void 0:ml.http_failures)==null?void 0:gl.toString():"0",d.activeHealthCheck.unhealthyTimeouts=((kl=(yl=i.healthchecks.active)==null?void 0:yl.unhealthy)==null?void 0:kl.timeouts)!==null&&((Cl=(bl=i.healthchecks.active)==null?void 0:bl.unhealthy)==null?void 0:Cl.timeouts)!==void 0?(Sl=(wl=(_l=i.healthchecks.active)==null?void 0:_l.unhealthy)==null?void 0:wl.timeouts)==null?void 0:Sl.toString():"0",d.activeHealthCheck.unhealthyHttpStatuses=(Nl=(xl=i.healthchecks.active)==null?void 0:xl.unhealthy)!=null&&Nl.http_statuses?r(((Bl=(Vl=i.healthchecks.active)==null?void 0:Vl.unhealthy)==null?void 0:Bl.http_statuses)||[]):gt,d.passiveHealthSwitch=((Tl=(Il=i.healthchecks.passive)==null?void 0:Il.healthy)==null?void 0:Tl.successes)!==0||((El=(Hl=i.healthchecks.passive)==null?void 0:Hl.unhealthy)==null?void 0:El.timeouts)!==0||((Fl=(Al=i.healthchecks.passive)==null?void 0:Al.unhealthy)==null?void 0:Fl.tcp_failures)!==0||((ql=(Ol=i.healthchecks.passive)==null?void 0:Ol.unhealthy)==null?void 0:ql.http_failures)!==0,d.passiveHealthCheck.type=((vl=i.healthchecks.passive)==null?void 0:vl.type)||"http",d.passiveHealthCheck.successes=(($l=(Ul=i.healthchecks.passive)==null?void 0:Ul.healthy)==null?void 0:$l.successes)!==null&&((Ml=(Dl=i.healthchecks.passive)==null?void 0:Dl.healthy)==null?void 0:Ml.successes)!==void 0?(Pl=(Kl=(jl=i.healthchecks.passive)==null?void 0:jl.healthy)==null?void 0:Kl.successes)==null?void 0:Pl.toString():"0",d.passiveHealthCheck.httpStatuses=(Rl=(Ll=i.healthchecks.passive)==null?void 0:Ll.healthy)!=null&&Rl.http_statuses?r(((Jl=(zl=i.healthchecks.passive)==null?void 0:zl.healthy)==null?void 0:Jl.http_statuses)||[]):mt,d.passiveHealthCheck.timeouts=((Ql=(Wl=i.healthchecks.passive)==null?void 0:Wl.unhealthy)==null?void 0:Ql.timeouts)!==null&&((Gl=(Yl=i.healthchecks.passive)==null?void 0:Yl.unhealthy)==null?void 0:Gl.timeouts)!==void 0?(er=(Xl=(Zl=i.healthchecks.passive)==null?void 0:Zl.unhealthy)==null?void 0:Xl.timeouts)==null?void 0:er.toString():"0",d.passiveHealthCheck.tcpFailures=((ar=(tr=i.healthchecks.passive)==null?void 0:tr.unhealthy)==null?void 0:ar.tcp_failures)!==null&&((rr=(lr=i.healthchecks.passive)==null?void 0:lr.unhealthy)==null?void 0:rr.tcp_failures)!==void 0?(sr=(nr=(or=i.healthchecks.passive)==null?void 0:or.unhealthy)==null?void 0:nr.tcp_failures)==null?void 0:sr.toString():"",d.passiveHealthCheck.unhealthyHttpStatuses=(cr=(ir=i.healthchecks.passive)==null?void 0:ir.unhealthy)!=null&&cr.http_statuses?r(((hr=(dr=i.healthchecks.passive)==null?void 0:dr.unhealthy)==null?void 0:hr.http_statuses)||[]):yt,d},getDefaultUpstreamFields:o,objectsAreEqual:(i,d)=>{try{return JSON.stringify(i)===JSON.stringify(d)}catch{return!1}},cloneDeep:i=>JSON.parse(JSON.stringify(i))}}const ce={useI18n:ji,useMultiselectCreation:Oe,useHelpers:Pe},Se="/api/runtime_groups/{controlPlaneId}",xe="/{workspace}",Ne={list:{konnect:`${Se}/upstreams`,kongManager:`${xe}/upstreams`},form:{konnect:{getServices:`${Se}/services`,getCertificates:`${Se}/certificates`,validate:`${Se}/v1/schemas/json/upstream/validate`,create:`${Se}/upstreams`,edit:`${Se}/upstreams/{id}`},kongManager:{getServices:`${xe}/services`,getCertificates:`${xe}/certificates`,validate:`${xe}/schemas/upstreams/validate`,create:`${xe}/upstreams`,edit:`${xe}/upstreams/{id}`}}},rd="",Wi={class:"kong-ui-entities-upstreams-list"},Qi={class:"upstream-name"},Yi=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:l}){var M;const a=e,{i18n:{t:r}}=ce.useI18n(),o=ze.useRouter(),{axiosInstance:s}=je({headers:(M=a.config)==null?void 0:M.requestHeaders}),c=t.ref(1),h=t.computed(()=>a.config.app!=="kongManager"||!!a.config.disableSorting),i={name:{label:r("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:r("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:r("upstreams.list.table_headers.tags"),sortable:!1}},d=i,u=t.computed(()=>{var U,K;let B=`${a.config.apiBaseUrl}${Ne.list[a.config.app]}`;return a.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((U=a.config)==null?void 0:U.controlPlaneId)||""):a.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(K=a.config)!=null&&K.workspace?`/${a.config.workspace}`:"")),B}),p=t.ref(""),n=t.computed(()=>{const B=a.config.app==="konnect"||a.config.isExactMatch;if(B)return{isExactMatch:B,placeholder:r("upstreams.search.placeholder")};const{name:U,slots:K}=i;return{isExactMatch:B,fields:{name:U,slots:K},schema:a.config.filterSchema}}),{fetcher:k,fetcherState:C}=Ka(a.config,u.value),f=()=>{p.value=""},m=()=>{c.value++},V=t.ref(null),_=(B,U)=>{const K=B.id;if(!U(K)){l("copy:error",{entity:B,field:"id",message:r("upstreams.errors.copy")});return}l("copy:success",{entity:B,field:"id",message:r("upstreams.copy.success",{val:K})})},O=(B,U)=>{const K=JSON.stringify(B);if(!U(K)){l("copy:error",{entity:B,message:r("upstreams.errors.copy")});return}l("copy:success",{entity:B,message:r("upstreams.copy.success_brief")})},S=async B=>{var K;await((K=a.canRetrieve)==null?void 0:K.call(a,B))&&o.push(a.config.getViewRoute(B.id))},x=B=>({label:r("upstreams.actions.view"),to:a.config.getViewRoute(B)}),q=B=>({label:r("upstreams.actions.edit"),to:a.config.getEditRoute(B)}),A=t.ref(void 0),N=t.ref(!1),I=t.ref(!1),w=t.ref(""),T=Ma(a.config,u.value),H=B=>{A.value=B,N.value=!0},$=()=>{N.value=!1},v=async()=>{var B,U,K;if((B=A.value)!=null&&B.id){I.value=!0;try{await s.delete(T(A.value.id)),I.value=!1,N.value=!1,c.value++,l("delete:success",A.value)}catch(y){w.value=((K=(U=y.response)==null?void 0:U.data)==null?void 0:K.message)||y.message||r("upstreams.errors.delete"),l("error",y)}finally{I.value=!1}}},F=t.ref(!0);t.watch(C,B=>{var U,K,y,g;if(Array.isArray((U=B==null?void 0:B.response)==null?void 0:U.data)&&(F.value=B.response.data.length>0),B.status===he.Error){V.value={title:r("upstreams.errors.general")},(g=(y=(K=B.error)==null?void 0:K.response)==null?void 0:y.data)!=null&&g.message&&(V.value.message=B.error.response.data.message),l("error",B.error);return}V.value=null});const D=t.ref({ctaPath:a.config.createRoute,ctaText:void 0,message:r("upstreams.list.empty_state.description"),title:r("upstreams.title")});return t.onBeforeMount(async()=>{await a.canCreate()&&(D.value.title=r("upstreams.list.empty_state.title"),D.value.ctaText=r("upstreams.actions.create"))}),(B,U)=>{const K=t.resolveComponent("KButton"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KTruncate"),b=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Wi,[t.createVNode(t.unref(Ua),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":h.value,"empty-state-options":D.value,"enable-entity-actions":"","error-message":V.value,fetcher:t.unref(k),"fetcher-cache-key":c.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:p.value,"table-headers":t.unref(d),"use-action-outside":e.useActionOutside,onClearSearchInput:f,"onClick:row":U[1]||(U[1]=j=>S(j)),onSort:m},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Fi),{modelValue:p.value,"onUpdate:modelValue":U[0]||(U[0]=j=>p.value=j),config:n.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(ie),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,F.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:t.withCtx(({rowValue:j})=>[t.createElementVNode("span",Qi,t.toDisplayString(j),1)]),tags:t.withCtx(({rowValue:j})=>[t.createVNode(g,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j,z=>(t.openBlock(),t.createBlock(y,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:j})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:Z=>_(j,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:Z=>O(j,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ie),{"auth-function":()=>e.canRetrieve(j)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:x(j.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canEdit(j)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-edit",item:q(j.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canDelete(j)},{default:t.withCtx(()=>[t.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>H(j)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("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($a),{"action-pending":I.value,description:t.unref(r)("upstreams.delete.description"),"entity-name":A.value&&(A.value.name||A.value.id),"entity-type":t.unref(Je).Upstream,error:w.value,title:t.unref(r)("upstreams.delete.title"),visible:N.value,onCancel:$,onProceed:v},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),od="",de=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Gi=de(Yi,[["__scopeId","data-v-1082fd6a"]]),Le={list:{konnect:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",kongManager:"/{workspace}/upstreams/{upstreamId}/targets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",edit:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/target/validate"},kongManager:{create:"/{workspace}/upstreams/{upstreamId}/targets",edit:"/{workspace}/upstreams/{upstreamId}/targets/{id}",validate:"/{workspace}/schemas/targets/validate"}}},Zi={class:"kong-ui-entities-target-form"},Xi={class:"target-form-container"},ec={key:0,class:"target-form-info"},tc=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:l}){var S;const a=e;t.useCssVars(x=>({"36f73404":O.value}));const{i18n:{t:r}}=ce.useI18n(),{getMessageFromError:o}=ja(),{axiosInstance:s}=je({headers:(S=a.config)==null?void 0:S.requestHeaders}),c=t.computed(()=>{var x;return Le.form[a.config.app].edit.replace(/{upstreamId}/gi,((x=a.config)==null?void 0:x.upstreamId)||"")}),h=t.computed(()=>a.targetId?oe.Edit:oe.Create),i=t.computed(()=>h.value===oe.Edit?r("targets.form.edit.title"):r("targets.form.create.title")),d=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),p={target:"",weight:100,tags:""},n=t.computed(()=>{const x=parseInt(d.fields.weight.toString(),10);return x<0||x>65535}),k=t.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(u)&&!!d.fields.target&&!!d.fields.weight&&!n.value),C=x=>{var q;d.fields.target=(x==null?void 0:x.target)||"",d.fields.weight=(x==null?void 0:x.weight)??"",d.fields.tags=((q=x==null?void 0:x.tags)==null?void 0:q.join(", "))||"",Object.assign(u,d.fields)},f=()=>{d.errorMessage="",l("cancel")},m=t.computed(()=>{var q,A;let x=`${a.config.apiBaseUrl}${Le.form[a.config.app].validate}`;return a.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((q=a.config)==null?void 0:q.controlPlaneId)||""):a.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(A=a.config)!=null&&A.workspace?`/${a.config.workspace}`:"")),x=x.replace(/{id}/gi,a.targetId),x}),V=t.computed(()=>{var q,A,N,I;let x=`${a.config.apiBaseUrl}${Le.form[a.config.app][h.value]}`;return a.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((q=a.config)==null?void 0:q.controlPlaneId)||"").replace(/{upstreamId}/gi,((A=a.config)==null?void 0:A.upstreamId)||""):a.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(N=a.config)!=null&&N.workspace?`/${a.config.workspace}`:"").replace(/{upstreamId}/gi,((I=a.config)==null?void 0:I.upstreamId)||"")),x=x.replace(/{id}/gi,a.targetId),x}),_=async()=>{var x,q,A,N,I;try{d.isReadonly=!0,d.errorMessage="";const w={target:d.fields.target,weight:parseInt(d.fields.weight),tags:(A=(q=(x=d.fields.tags)==null?void 0:x.split(","))==null?void 0:q.map(H=>String(H||"").trim()))==null?void 0:A.filter(H=>H!==""),upstream:{id:a.config.upstreamId}};let T;if(await s.post(m.value,w),h.value==="create"?T=await s.post(V.value,w):h.value==="edit"&&(T=((N=a.config)==null?void 0:N.app)==="konnect"?await s.put(V.value,w):await s.patch(V.value,w)),T){const{data:H}=T;d.fields.target=(H==null?void 0:H.name)||"",d.fields.weight=(H==null?void 0:H.weight)??100,d.fields.tags=((I=H==null?void 0:H.tags)==null?void 0:I.join(", "))||"",l("update",H),Object.assign(d.fields,p)}}catch(w){d.errorMessage=o(w),l("error",w)}finally{d.isReadonly=!1}},O=t.computed(()=>d.isReadonly?"inline-flex":"none");return t.watch(()=>a.targetId,()=>{Object.assign(d.fields,p)}),(x,q)=>{const A=t.resolveComponent("KInput"),N=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(N,{"action-button-text":t.unref(r)("targets.form.buttons.save"),"action-pending":!k.value||d.isReadonly,"cancel-button-text":t.unref(r)("targets.form.buttons.cancel"),"is-visible":e.isVisible,title:i.value,onCanceled:f,onProceed:_},{"body-content":t.withCtx(()=>[t.createElementVNode("div",Zi,[t.createVNode(t.unref(va),{config:e.config,"edit-id":e.targetId,"error-message":d.errorMessage,"fetch-url":c.value,"is-readonly":d.isReadonly,onCancel:f,"onFetch:error":q[3]||(q[3]=I=>x.$emit("error",I)),"onFetch:success":C,onLoading:q[4]||(q[4]=I=>x.$emit("loading",I))},{default:t.withCtx(()=>[t.createElementVNode("div",Xi,[x.$slots.info?(t.openBlock(),t.createElementBlock("div",ec,[t.renderSlot(x.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(A,{modelValue:d.fields.target,"onUpdate:modelValue":q[0]||(q[0]=I=>d.fields.target=I),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(r)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(r)("targets.form.fields.target.tooltip")},placeholder:t.unref(r)("targets.form.fields.target.placeholder"),readonly:d.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(A,{modelValue:d.fields.weight,"onUpdate:modelValue":q[1]||(q[1]=I=>d.fields.weight=I),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:n.value,"error-message":t.unref(r)("targets.errors.weight"),label:t.unref(r)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(r)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:d.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(A,{modelValue:d.fields.tags,"onUpdate:modelValue":q[2]||(q[2]=I=>d.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(r)("targets.form.fields.tags.help"),label:t.unref(r)("targets.form.fields.tags.label"),placeholder:t.unref(r)("targets.form.fields.tags.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","is-readonly"])])]),_:3},8,["action-button-text","action-pending","cancel-button-text","is-visible","title"])}}}),nd="",Wa=de(tc,[["__scopeId","data-v-d291c3d9"]]),ac={class:"kong-ui-entities-targets-list"},lc={class:"target-address"},rc=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:l}){var K;const a=e,{i18n:{t:r}}=ce.useI18n(),{axiosInstance:o}=je({headers:(K=a.config)==null?void 0:K.requestHeaders}),s=t.ref(1),c=t.computed(()=>a.config.app!=="kongManager"||!!a.config.disableSorting),i={target:{label:r("targets.list.table_headers.target_address"),sortable:!0},weight:{label:r("targets.list.table_headers.weight"),sortable:!0},tags:{label:r("targets.list.table_headers.tags"),sortable:!1}},d=t.computed(()=>{var g,b,R,j;let y=`${a.config.apiBaseUrl}${Le.list[a.config.app]}`;return a.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((g=a.config)==null?void 0:g.controlPlaneId)||"").replace(/{upstreamId}/gi,((b=a.config)==null?void 0:b.upstreamId)||""):a.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(R=a.config)!=null&&R.workspace?`/${a.config.workspace}`:"").replace(/{upstreamId}/gi,((j=a.config)==null?void 0:j.upstreamId)||"")),y}),{fetcher:u,fetcherState:p}=Ka(a.config,d.value),n=()=>{s.value++},k=t.ref(null),C=()=>{D.value=!0},f=(y,g)=>{const b=y.id;if(!g(b)){l("copy:error",{entity:y,field:"id",message:r("targets.errors.copy")});return}l("copy:success",{entity:y,field:"id",message:r("targets.copy.success",{val:b})})},m=(y,g)=>{const b=JSON.stringify(y);if(!g(b)){l("copy:error",{entity:y,message:r("targets.errors.copy")});return}l("copy:success",{entity:y,message:r("targets.copy.success_brief")})},V=y=>{F.value=y,D.value=!0},_=y=>a.config.app==="konnect"?!1:a.config.canMarkHealthy(y),O=y=>a.config.app==="konnect"?!1:a.config.canMarkUnhealthy(y),S=t.ref(void 0),x=t.ref(!1),q=t.ref(!1),A=t.ref(""),N=Ma(a.config,d.value),I=y=>{S.value=y,x.value=!0},w=()=>{x.value=!1},T=async()=>{var y,g,b;if((y=S.value)!=null&&y.id){q.value=!0;try{await o.delete(N(S.value.id)),q.value=!1,x.value=!1,s.value++,l("delete:success",S.value)}catch(R){A.value=((b=(g=R.response)==null?void 0:g.data)==null?void 0:b.message)||R.message||r("targets.errors.delete"),l("error",R)}finally{q.value=!1}}},H=t.ref(!0);t.watch(p,y=>{var g,b,R,j;if(Array.isArray((g=y==null?void 0:y.response)==null?void 0:g.data)&&(H.value=y.response.data.length>0),y.status===he.Error){k.value={title:r("targets.errors.general")},(j=(R=(b=y.error)==null?void 0:b.response)==null?void 0:R.data)!=null&&j.message&&(k.value.message=y.error.response.data.message),l("error",y.error);return}k.value=null});const $=t.ref({ctaText:void 0,message:r("targets.list.empty_state.description"),title:r("targets.title"),...a.config.createRoute&&{ctaPath:a.config.createRoute}});t.onBeforeMount(async()=>{await a.canCreate()&&($.value.title=r("targets.list.empty_state.title"),$.value.ctaText=r("targets.actions.create"))});const v=t.computed(()=>({app:a.config.app,apiBaseUrl:a.config.apiBaseUrl,upstreamId:a.config.upstreamId,...a.config.app==="konnect"&&{controlPlaneId:a.config.controlPlaneId},...a.config.app==="kongManager"&&{workspace:a.config.workspace,requestHeaders:a.config.requestHeaders}})),F=t.ref(""),D=t.ref(!1),M=y=>{F.value?l("update:target",y):l("create:target",y),B()},B=()=>{U(),s.value++},U=()=>{D.value=!1,F.value=""};return(y,g)=>{const b=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),j=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),Z=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",ac,[t.createVNode(t.unref(Ua),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":$.value,"enable-entity-actions":"","error-message":k.value,fetcher:t.unref(u),"fetcher-cache-key":s.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(i),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:g[1]||(g[1]=()=>a.config.createRoute?void 0:C()),onSort:n},{"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(ie),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(b,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:a.config.createRoute?a.config.createRoute:void 0,onClick:g[0]||(g[0]=()=>a.config.createRoute?void 0:C())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,H.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:L})=>[t.createElementVNode("span",lc,t.toDisplayString(L),1)]),tags:t.withCtx(({rowValue:L})=>[t.createVNode(j,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(L,ee=>(t.openBlock(),t.createBlock(R,{key:ee,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ee),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:L})=>[t.createVNode(Z,null,{default:t.withCtx(({copyToClipboard:ee})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:me=>f(L,ee)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(Z,null,{default:t.withCtx(({copyToClipboard:ee})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:me=>m(L,ee)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ie),{"auth-function":()=>e.canEdit(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:ee=>V(L.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>_(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:ee=>l("health-actions:healthy",L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>O(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:ee=>l("health-actions:unhealthy",L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canDelete(L)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ee=>I(L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("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($a),{"action-pending":q.value,description:t.unref(r)("targets.delete.description"),"entity-type":t.unref(Je).Target,error:A.value,"need-confirm":!1,title:t.unref(r)("targets.delete.title"),visible:x.value,onCancel:w,onProceed:T},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Wa,{config:v.value,"is-visible":D.value,"target-id":F.value,onCancel:U,onUpdate:M},t.createSlots({_:2},[y.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),sd="",oc=de(rc,[["__scopeId","data-v-268875d2"]]),nc={key:1},sc=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:l}){var w,T,H,$;const a=e,{i18nT:r,i18n:{t:o}}=ce.useI18n(),{debouncedQueryChange:s,loading:c,loadItems:h,results:i,allRecords:d}=Pa(a.config,(T=Ne.form[(w=a.config)==null?void 0:w.app])==null?void 0:T.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:p,loadItems:n,results:k}=Pa(a.config,($=Ne.form[(H=a.config)==null?void 0:H.app])==null?void 0:$.getCertificates),C=t.ref(""),f=t.computed(()=>{var v;return!!a.name&&!((v=d.value)!=null&&v.some(F=>F.host===a.name))}),m=t.computed(()=>{var F,D,M;const v=f.value&&a.name.includes((F=C.value)==null?void 0:F.toLowerCase());return(M=i.value)==null?void 0:M.map(B=>({label:B.host,value:B.id})).concat(v?[{label:a.name,value:((D=O.value)==null?void 0:D.value)||a.name}]:[])}),V=t.computed(()=>{var v;return(v=k.value)==null?void 0:v.map(F=>({label:F.id,value:F.id}))}),_=t.ref(""),O=t.ref({value:"",label:""}),S=t.computed(()=>{var v,F;return((v=m.value.find(D=>D.value===_.value))==null?void 0:v.label)||((F=O.value)==null?void 0:F.label)}),x=v=>{C.value=v,s(v)},q=v=>{O.value=v},A=()=>{O.value={value:"",label:""}},N=v=>{_.value=v,l("update:name",S.value)},I=t.ref(!1);return t.onBeforeMount(async()=>{var v,F;try{I.value=!0,await h(),a.name&&(_.value=((F=(v=m.value.find(D=>D.label===a.name))==null?void 0:v.value)==null?void 0:F.toString())||a.name),await n()}finally{I.value=!1}}),(v,F)=>{const D=t.resolveComponent("KSkeleton"),M=t.resolveComponent("KSelect"),B=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(o)("upstreams.form.general_info.help"),title:t.unref(o)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[I.value?(t.openBlock(),t.createBlock(D,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",nc,[t.createVNode(M,{appearance:"select",autosuggest:"",class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"",items:m.value,label:t.unref(o)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(c),"model-value":_.value,placeholder:t.unref(o)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%","onItem:added":q,"onItem:removed":A,onQueryChange:x,"onUpdate:modelValue":N},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(o)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":F[0]||(F[0]=U=>l("update:host-header",U))},null,8,["label","model-value","readonly"]),t.createVNode(M,{appearance:"select",autosuggest:"",class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"",items:V.value,label:t.unref(o)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(o)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(p),"model-value":e.clientCertificate,placeholder:t.unref(o)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":F[1]||(F[1]=U=>l("update:client-certificate",U))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(B,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(o)("upstreams.form.fields.tags.help"),label:t.unref(o)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(o)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(o)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":F[2]||(F[2]=U=>l("update:tags",U))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),id="",ic=de(sc,[["__scopeId","data-v-02065a3d"]]),Re={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},cc={class:"fields-group-title"},dc={class:"fields-group-text"},hc={class:"fields-group-title"},pc={class:"fields-group-text"},uc=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:l}){const a=e,{i18nT:r,i18n:{t:o}}=ce.useI18n(),{inRange:s}=Pe(),c=t.ref([{label:o("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:o("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:o("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:o("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),h=t.ref([{label:o("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:o("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:o("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:o("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:o("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:o("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:o("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:o("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>a.hashOn,(u,p)=>{p==="header"&&u!==p&&l("update:hash-on-header",""),p==="cookie"&&u!==p&&(l("update:hash-on-cookie",""),l("update:hash-on-cookie-path","/")),p==="query_arg"&&u!==p&&l("update:hash-on-query-argument",""),p==="uri_capture"&&u!==p&&l("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(l("update:hash-fallback","none"),l("update:hash-fallback-header",""),l("update:hash-fallback-query-argument",""),l("update:hash-fallback-uri-capture",""))}),t.watch(()=>a.hashFallback,(u,p)=>{p==="header"&&u!==p&&l("update:hash-fallback-header",""),p==="cookie"&&u!==p&&(l("update:hash-on-cookie",""),l("update:hash-on-cookie-path","/")),p==="query_arg"&&u!==p&&l("update:hash-fallback-query-argument",""),p==="uri_capture"&&u!==p&&l("update:hash-fallback-uri-capture","")});const i=t.computed(()=>a.hashOn==="cookie"||a.hashOn==="none"),d=t.computed(()=>a.slots?s(a.slots,pt,ut)?"":o("upstreams.form.errors.in_range"):"");return(u,p)=>{const n=t.resolveComponent("KExternalLink"),k=t.resolveComponent("KSelect"),C=t.resolveComponent("KInput"),f=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(o)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(n,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(k,{appearance:"select",class:"algorithm-select",items:c.value,label:t.unref(o)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=m=>l("update:algorithm",m))},null,8,["items","label","model-value","readonly"]),t.createVNode(C,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!d.value,"error-message":d.value,help:t.unref(o)("upstreams.form.fields.slots.help"),label:t.unref(o)("upstreams.form.fields.slots.label"),max:t.unref(ut),min:t.unref(pt),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=m=>l("update:slots",m))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(f,null,{body:t.withCtx(()=>[t.createElementVNode("h5",cc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",dc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_on.help")),1),t.createVNode(k,{appearance:"select",class:"hash-on-select",items:h.value,label:t.unref(o)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[2]||(p[2]=m=>l("update:hash-on",m))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(o)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[3]||(p[3]=m=>l("update:hash-on-header",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(C,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(o)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[4]||(p[4]=m=>l("update:hash-on-cookie",m))},null,8,["label","model-value","readonly"]),t.createVNode(C,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(o)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[5]||(p[5]=m=>l("update:hash-on-cookie-path",m))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(C,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(o)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[6]||(p[6]=m=>l("update:hash-on-query-argument",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(C,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(o)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[7]||(p[7]=m=>l("update:hash-on-uri-capture",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(f,null,{body:t.withCtx(()=>[t.createElementVNode("h5",hc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",pc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(k,{appearance:"select",class:"hash-fallback-select",disabled:i.value,items:h.value,label:t.unref(o)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[8]||(p[8]=m=>l("update:hash-fallback",m))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(o)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[9]||(p[9]=m=>l("update:hash-fallback-header",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(C,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(o)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[10]||(p[10]=m=>l("update:hash-on-cookie",m))},null,8,["label","model-value","readonly"]),t.createVNode(C,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(o)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[11]||(p[11]=m=>l("update:hash-on-cookie-path",m))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(C,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(o)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[12]||(p[12]=m=>l("update:hash-fallback-query-argument",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(C,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(o)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[13]||(p[13]=m=>l("update:hash-fallback-uri-capture",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),cd="",fc=de(uc,[["__scopeId","data-v-678db4c1"]]),mc={class:"fields-group-title"},gc={class:"fields-group-text"},yc={class:"fields-group-title"},kc={class:"fields-group-text"},bc=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:l}){const{i18n:{t:a}}=ce.useI18n();return(r,o)=>{const s=t.resolveComponent("KExternalLink"),c=t.resolveComponent("KInputSwitch"),h=t.resolveComponent("KCard"),i=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Fe),{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(s,{"hide-icon":"",href:t.unref(Re).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(h,null,{body:t.withCtx(()=>[t.createElementVNode("h5",mc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",gc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(c,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:o[0]||(o[0]=d=>l("update:active-health-switch",d))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,null,{body:t.withCtx(()=>[t.createElementVNode("h5",yc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",kc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(c,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:o[1]||(o[1]=d=>l("update:passive-health-switch",d))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(i,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(Pi),min:t.unref(Ki),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":o[2]||(o[2]=d=>l("update:healthchecks-threshold",d))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),dd="",Cc=de(bc,[["__scopeId","data-v-7fda4841"]]),_c={key:2},wc={class:"fields-group-title"},Sc={class:"fields-group-text"},xc={class:"fields-group-title"},Nc={class:"fields-group-text"},Vc=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:l}){const a=e,{i18n:{t:r}}=ce.useI18n(),{objectsAreEqual:o}=Pe(),s=t.ref([{label:r("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),c=t.computed(()=>a.type==="https"||a.type==="grpcs"),h=t.computed(()=>a.type==="tcp"),{trackNewItems:i}=Oe({replaceId:!0}),{trackNewItems:d}=Oe({replaceId:!0});t.watch(()=>a.type,(C,f)=>{f==="tcp"&&C!==f&&l("update:tcp-failures","5"),(f==="https"||f==="grpcs")&&C!==f&&(l("update:https-sni",""),l("update:verify-ssl",!1)),f!=="tcp"&&C==="tcp"&&(l("update:http-path","/"),l("update:http-statuses",ft),l("update:unhealthy-http-statuses",gt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>a.headers,C=>{o(u.value,C)||(u.value=[...C])},{immediate:!0,deep:!0});const p=()=>{l("update:headers",u.value)},n=()=>{u.value.push({key:"",values:""}),p()},k=C=>{C===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(C,1),p()};return(C,f)=>{const m=t.resolveComponent("KExternalLink"),V=t.resolveComponent("KSelect"),_=t.resolveComponent("KInput"),O=t.resolveComponent("KCheckbox"),S=t.resolveComponent("KLabel"),x=t.resolveComponent("KIcon"),q=t.resolveComponent("KButton"),A=t.resolveComponent("KMultiselect"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(r)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(m,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var I;return[t.createVNode(V,{appearance:"select",class:"active-healthcheck-type-select",items:s.value,label:t.unref(r)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=w=>l("update:type",w))},null,8,["items","label","model-value","readonly"]),h.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(_,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(r)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":f[1]||(f[1]=w=>l("update:http-path",w))},null,8,["label","model-value","readonly"])),t.createVNode(_,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(r)("upstreams.form.fields.timeout.label"),max:t.unref(Ri),min:t.unref(Li),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":f[2]||(f[2]=w=>l("update:timeout",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(_,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(r)("upstreams.form.fields.concurrency.label"),max:t.unref(Ji),min:t.unref(zi),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":f[3]||(f[3]=w=>l("update:concurrency",w))},null,8,["label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(_,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(r)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":f[4]||(f[4]=w=>l("update:https-sni",w))},null,8,["label","model-value","readonly"]),t.createVNode(O,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(r)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":f[5]||(f[5]=w=>l("update:verify-ssl",w))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((I=e.config)==null?void 0:I.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",_c,[t.createVNode(S,{info:t.unref(r)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("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,T)=>(t.openBlock(),t.createElementBlock("div",{key:`${w.header}_${T}`,class:t.normalizeClass(["headers-row",{"margin-top-6":T>0}])},[t.createVNode(_,{modelValue:u.value[T].key,"onUpdate:modelValue":H=>u.value[T].key=H,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${T+1}`,readonly:e.readonly,type:"text",onBlur:p},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(_,{modelValue:u.value[T].values,"onUpdate:modelValue":H=>u.value[T].values=H,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${T+1}`,readonly:e.readonly,type:"text",onBlur:p},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(q,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:H=>k(T)},{icon:t.withCtx(()=>[t.createVNode(x,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&T===u.value.length-1?(t.openBlock(),t.createBlock(q,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:n},{icon:t.withCtx(()=>[t.createVNode(x,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(N,null,{body:t.withCtx(()=>[t.createElementVNode("h5",wc,t.toDisplayString(t.unref(r)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Sc,t.toDisplayString(t.unref(r)("upstreams.form.healthy.help")),1),t.createVNode(_,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(r)("upstreams.form.fields.interval.help"),label:t.unref(r)("upstreams.form.fields.interval.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":f[6]||(f[6]=w=>l("update:interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(_,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(r)("upstreams.form.fields.successes.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":f[7]||(f[7]=w=>l("update:successes",w))},null,8,["label","max","min","model-value","readonly"]),h.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(A,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%","onItem:added":f[8]||(f[8]=w=>t.unref(i)(w,!0)),"onItem:removed":f[9]||(f[9]=w=>t.unref(i)(w,!1)),"onUpdate:modelValue":f[10]||(f[10]=w=>l("update:http-statuses",w))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(N,null,{body:t.withCtx(()=>[t.createElementVNode("h5",xc,t.toDisplayString(t.unref(r)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Nc,t.toDisplayString(t.unref(r)("upstreams.form.unhealthy.help")),1),t.createVNode(_,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(r)("upstreams.form.fields.interval.help"),label:t.unref(r)("upstreams.form.fields.interval.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":f[11]||(f[11]=w=>l("update:unhealthy-interval",w))},null,8,["help","label","max","min","model-value","readonly"]),h.value?(t.openBlock(),t.createBlock(_,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(r)("upstreams.form.fields.tcp_failures.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":f[12]||(f[12]=w=>l("update:tcp-failures",w))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(_,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(r)("upstreams.form.fields.http_failures.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":f[13]||(f[13]=w=>l("update:http-failures",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(A,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%","onItem:added":f[14]||(f[14]=w=>t.unref(d)(w,!0)),"onItem:removed":f[15]||(f[15]=w=>t.unref(d)(w,!1)),"onUpdate:modelValue":f[16]||(f[16]=w=>l("update:unhealthy-http-statuses",w))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(_,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(r)("upstreams.form.fields.timeouts.label"),max:t.unref(Ra),min:t.unref(La),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":f[17]||(f[17]=w=>l("update:unhealthy-timeouts",w))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),hd="",Bc=de(Vc,[["__scopeId","data-v-0a7d6cda"]]),Ic={class:"fields-group-title"},Tc={class:"fields-group-text"},Hc={class:"fields-group-title"},Ec={class:"fields-group-text"},Ac=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:l}){const a=e,{i18n:{t:r}}=ce.useI18n(),o=t.ref([{label:r("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),s=t.computed(()=>a.type==="tcp"),{trackNewItems:c}=Oe({replaceId:!0}),{trackNewItems:h}=Oe({replaceId:!0});return t.watch(()=>a.type,(i,d)=>{d==="tcp"&&i!==d&&l("update:tcp-failures","5"),d!=="tcp"&&i==="tcp"&&(l("update:http-statuses",mt),l("update:unhealthy-http-statuses",yt))}),(i,d)=>{const u=t.resolveComponent("KExternalLink"),p=t.resolveComponent("KSelect"),n=t.resolveComponent("KInput"),k=t.resolveComponent("KMultiselect"),C=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(r)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(p,{appearance:"select",class:"passive-healthcheck-type-select",items:o.value,label:t.unref(r)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":d[0]||(d[0]=f=>l("update:type",f))},null,8,["items","label","model-value","readonly"]),t.createVNode(C,null,{body:t.withCtx(()=>[t.createElementVNode("h5",Ic,t.toDisplayString(t.unref(r)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",Tc,t.toDisplayString(t.unref(r)("upstreams.form.passive_healthy.help")),1),t.createVNode(n,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(r)("upstreams.form.fields.successes.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":d[1]||(d[1]=f=>l("update:successes",f))},null,8,["label","max","min","model-value","readonly"]),s.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(k,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%","onItem:added":d[2]||(d[2]=f=>t.unref(c)(f,!0)),"onItem:removed":d[3]||(d[3]=f=>t.unref(c)(f,!1)),"onUpdate:modelValue":d[4]||(d[4]=f=>l("update:http-statuses",f))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(C,null,{body:t.withCtx(()=>[t.createElementVNode("h5",Hc,t.toDisplayString(t.unref(r)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",Ec,t.toDisplayString(t.unref(r)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(n,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(r)("upstreams.form.fields.timeouts.label"),max:t.unref(Ra),min:t.unref(La),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":d[5]||(d[5]=f=>l("update:timeouts",f))},null,8,["label","max","min","model-value","readonly"]),s.value?(t.openBlock(),t.createBlock(n,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(r)("upstreams.form.fields.tcp_failures.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":d[6]||(d[6]=f=>l("update:tcp-failures",f))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(n,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(r)("upstreams.form.fields.http_failures.label"),max:t.unref(we),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":d[7]||(d[7]=f=>l("update:http-failures",f))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(k,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%","onItem:added":d[8]||(d[8]=f=>t.unref(h)(f,!0)),"onItem:removed":d[9]||(d[9]=f=>t.unref(h)(f,!1)),"onUpdate:modelValue":d[10]||(d[10]=f=>l("update:unhealthy-http-statuses",f))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),pd="",Fc=de(Ac,[["__scopeId","data-v-6d6854e3"]]),Oc={class:"kong-ui-entities-upstreams-form"},qc=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:l}){var K;const a=e,{inRange:r,stringToNumberArray:o,upstreamsResponseToFields:s,getDefaultUpstreamFields:c,objectsAreEqual:h,cloneDeep:i}=Pe(),{axiosInstance:d}=je({headers:(K=a.config)==null?void 0:K.requestHeaders}),{getMessageFromError:u}=ja(),p=ze.useRouter(),n=t.reactive({fields:c(),readonly:!1,errorMessage:""}),k=t.reactive(c()),C=t.computed(()=>!h(n.fields,k)),f=y=>{n.fields.activeHealthCheck.interval=y?"5":"0",n.fields.activeHealthCheck.successes=y?"5":"0",n.fields.activeHealthCheck.httpFailures=y?"5":"0",n.fields.activeHealthCheck.unhealthyInterval=y?"5":"0"},m=y=>{n.fields.passiveHealthCheck.timeouts=y?"5":"0",n.fields.passiveHealthCheck.successes=y?"80":"0"},V=t.computed(()=>n.fields.slots?r(n.fields.slots,pt,ut):!0),_=t.computed(()=>n.fields.hashOn==="header"?!!n.fields.hashOnHeader:!0),O=t.computed(()=>n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie"?!!n.fields.hashOnCookie:!0),S=t.computed(()=>n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie"?!!n.fields.hashOnCookiePath:!0),x=t.computed(()=>n.fields.hashOn==="query_arg"?!!n.fields.hashOnQueryArgument:!0),q=t.computed(()=>n.fields.hashOn==="uri_capture"?!!n.fields.hashOnUriCapture:!0),A=t.computed(()=>n.fields.hashFallback==="header"?!!n.fields.hashFallbackHeader:!0),N=t.computed(()=>n.fields.hashFallback==="query_arg"?!!n.fields.hashFallbackQueryArgument:!0),I=t.computed(()=>n.fields.hashFallback==="uri_capture"?!!n.fields.hashFallbackUriCapture:!0),w=t.computed(()=>!!n.fields.name&&V.value&&_.value&&O.value&&S.value&&x.value&&q.value&&A.value&&N.value&&I.value),T=t.computed(()=>a.upstreamId?oe.Edit:oe.Create),H=t.computed(()=>{var y,g;return(g=Ne.form[(y=a.config)==null?void 0:y.app])==null?void 0:g.edit}),$=y=>{Object.assign(n.fields,s(y)),Object.assign(k,i(n.fields))},v=()=>{var y;p.push(((y=a.config)==null?void 0:y.cancelRoute)||{name:"upstreams-list"})},F=y=>{l("loading",y)},D=y=>{l("error",y)},M=()=>{var g,b,R,j,z;const y={name:n.fields.name,slots:Number(n.fields.slots),algorithm:n.fields.algorithm,hash_on:n.fields.hashOn,hash_fallback:n.fields.hashFallback,healthchecks:{}};return n.fields.hostHeader&&(y.host_header=n.fields.hostHeader),n.fields.clientCertificate&&(y.client_certificate={id:n.fields.clientCertificate}),n.fields.healthchecksThreshold&&(y.healthchecks.threshold=Number(n.fields.healthchecksThreshold)),n.fields.tags&&(y.tags=(b=(g=n.fields.tags.split(","))==null?void 0:g.map(Z=>String(Z||"").trim()))==null?void 0:b.filter(Z=>Z!=="")),n.fields.hashOn==="header"&&(y.hash_on_header=n.fields.hashOnHeader),(n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie")&&(y.hash_on_cookie=n.fields.hashOnCookie,y.hash_on_cookie_path=n.fields.hashOnCookiePath),n.fields.hashOn==="query_arg"&&(y.hash_on_query_arg=n.fields.hashOnQueryArgument),n.fields.hashOn==="uri_capture"&&(y.hash_on_uri_capture=n.fields.hashOnUriCapture),n.fields.hashFallback==="header"&&(y.hash_fallback_header=n.fields.hashFallbackHeader),n.fields.hashFallback==="query_arg"&&(y.hash_fallback_query_arg=n.fields.hashFallbackQueryArgument),n.fields.hashFallback==="uri_capture"&&(y.hash_fallback_uri_capture=n.fields.hashFallbackUriCapture),n.fields.activeHealthSwitch?(y.healthchecks.active={type:n.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},n.fields.activeHealthCheck.timeout&&(y.healthchecks.active.timeout=Number(n.fields.activeHealthCheck.timeout)),n.fields.activeHealthCheck.concurrency&&(y.healthchecks.active.concurrency=Number(n.fields.activeHealthCheck.concurrency)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpPath&&(y.healthchecks.active.http_path=n.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(n.fields.activeHealthCheck.headers.length===0?y.healthchecks.active.headers=[]:y.healthchecks.active.headers=n.fields.activeHealthCheck.headers.reduce((Z,L)=>{var ee,me;return L.key?{...Z,[L.key]:(me=(ee=L.values.split(","))==null?void 0:ee.map(Ve=>String(Ve||"").trim()))==null?void 0:me.filter(Ve=>Ve!=="")}:{...Z}},{})),(n.fields.activeHealthCheck.type==="https"||n.fields.activeHealthCheck.type==="grpcs")&&n.fields.activeHealthCheck.httpsSni&&(y.healthchecks.active.https_sni=n.fields.activeHealthCheck.httpsSni),(n.fields.activeHealthCheck.type==="https"||n.fields.activeHealthCheck.type==="grpcs")&&(y.healthchecks.active.https_verify_certificate=n.fields.activeHealthCheck.verifySsl),n.fields.activeHealthCheck.interval&&(y.healthchecks.active.healthy.interval=Number(n.fields.activeHealthCheck.interval)),n.fields.activeHealthCheck.successes&&(y.healthchecks.active.healthy.successes=Number(n.fields.activeHealthCheck.successes)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpStatuses&&(y.healthchecks.active.healthy.http_statuses=o(n.fields.activeHealthCheck.httpStatuses)),n.fields.activeHealthCheck.unhealthyInterval&&(y.healthchecks.active.unhealthy.interval=Number(n.fields.activeHealthCheck.unhealthyInterval)),n.fields.activeHealthCheck.unhealthyTimeouts&&(y.healthchecks.active.unhealthy.timeouts=Number(n.fields.activeHealthCheck.unhealthyTimeouts)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.active.unhealthy.http_statuses=o(n.fields.activeHealthCheck.unhealthyHttpStatuses)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpFailures&&(y.healthchecks.active.unhealthy.http_failures=Number(n.fields.activeHealthCheck.httpFailures)),n.fields.activeHealthCheck.type==="tcp"&&n.fields.activeHealthCheck.tcpFailures&&(y.healthchecks.active.unhealthy.tcp_failures=Number(n.fields.activeHealthCheck.tcpFailures))):((j=a.config)==null?void 0:j.app)==="kongManager"&&T.value===oe.Edit&&(y.healthchecks.active={type:n.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),n.fields.passiveHealthSwitch?(y.healthchecks.passive={type:n.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},n.fields.passiveHealthCheck.successes&&(y.healthchecks.passive.healthy.successes=Number(n.fields.passiveHealthCheck.successes)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.httpStatuses&&(y.healthchecks.passive.healthy.http_statuses=o(n.fields.passiveHealthCheck.httpStatuses)),n.fields.passiveHealthCheck.timeouts&&(y.healthchecks.passive.unhealthy.timeouts=Number(n.fields.passiveHealthCheck.timeouts)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.passive.unhealthy.http_statuses=o(n.fields.passiveHealthCheck.unhealthyHttpStatuses)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.httpFailures&&(y.healthchecks.passive.unhealthy.http_failures=Number(n.fields.passiveHealthCheck.httpFailures)),n.fields.passiveHealthCheck.type==="tcp"&&n.fields.passiveHealthCheck.tcpFailures&&(y.healthchecks.passive.unhealthy.tcp_failures=Number(n.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&T.value===oe.Edit&&(y.healthchecks.passive={type:n.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),y},B=y=>{var b,R,j,z,Z,L;let g=`${(b=a.config)==null?void 0:b.apiBaseUrl}${Ne.form[(R=a.config)==null?void 0:R.app][y]}`;return((j=a.config)==null?void 0:j.app)==="konnect"?g=g.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((Z=a.config)==null?void 0:Z.app)==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(L=a.config)!=null&&L.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.upstreamId),g},U=async()=>{var y;try{n.readonly=!0,await d.post(B("validate"),M());let g;T.value===oe.Create?g=await d.post(B("create"),M()):T.value===oe.Edit&&(g=((y=a.config)==null?void 0:y.app)==="konnect"?await d.put(B("edit"),M()):await d.patch(B("edit"),M())),l("update",g==null?void 0:g.data)}catch(g){n.errorMessage=u(g),l("error",g)}finally{n.readonly=!1}};return(y,g)=>(t.openBlock(),t.createElementBlock("div",Oc,[t.createVNode(t.unref(va),{"can-submit":w.value&&C.value,config:e.config,"edit-id":e.upstreamId,"error-message":n.errorMessage,"fetch-url":H.value,"is-readonly":n.readonly,onCancel:v,"onFetch:error":D,"onFetch:success":$,onLoading:F,onSubmit:U},{default:t.withCtx(()=>[t.createVNode(ic,{"client-certificate":n.fields.clientCertificate,"onUpdate:clientCertificate":g[0]||(g[0]=b=>n.fields.clientCertificate=b),"host-header":n.fields.hostHeader,"onUpdate:hostHeader":g[1]||(g[1]=b=>n.fields.hostHeader=b),name:n.fields.name,"onUpdate:name":g[2]||(g[2]=b=>n.fields.name=b),tags:n.fields.tags,"onUpdate:tags":g[3]||(g[3]=b=>n.fields.tags=b),config:e.config,readonly:n.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(fc,{algorithm:n.fields.algorithm,"onUpdate:algorithm":g[4]||(g[4]=b=>n.fields.algorithm=b),"hash-fallback":n.fields.hashFallback,"onUpdate:hashFallback":g[5]||(g[5]=b=>n.fields.hashFallback=b),"hash-fallback-header":n.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":g[6]||(g[6]=b=>n.fields.hashFallbackHeader=b),"hash-fallback-query-argument":n.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":g[7]||(g[7]=b=>n.fields.hashFallbackQueryArgument=b),"hash-fallback-uri-capture":n.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":g[8]||(g[8]=b=>n.fields.hashFallbackUriCapture=b),"hash-on":n.fields.hashOn,"onUpdate:hashOn":g[9]||(g[9]=b=>n.fields.hashOn=b),"hash-on-cookie":n.fields.hashOnCookie,"onUpdate:hashOnCookie":g[10]||(g[10]=b=>n.fields.hashOnCookie=b),"hash-on-cookie-path":n.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":g[11]||(g[11]=b=>n.fields.hashOnCookiePath=b),"hash-on-header":n.fields.hashOnHeader,"onUpdate:hashOnHeader":g[12]||(g[12]=b=>n.fields.hashOnHeader=b),"hash-on-query-argument":n.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":g[13]||(g[13]=b=>n.fields.hashOnQueryArgument=b),"hash-on-uri-capture":n.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":g[14]||(g[14]=b=>n.fields.hashOnUriCapture=b),slots:n.fields.slots,"onUpdate:slots":g[15]||(g[15]=b=>n.fields.slots=b),readonly:n.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(Cc,{"active-health-switch":n.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[g[16]||(g[16]=b=>n.fields.activeHealthSwitch=b),f],"healthchecks-threshold":n.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":g[17]||(g[17]=b=>n.fields.healthchecksThreshold=b),"passive-health-switch":n.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[g[18]||(g[18]=b=>n.fields.passiveHealthSwitch=b),m],readonly:n.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),n.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Bc,{key:0,concurrency:n.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":g[19]||(g[19]=b=>n.fields.activeHealthCheck.concurrency=b),headers:n.fields.activeHealthCheck.headers,"onUpdate:headers":g[20]||(g[20]=b=>n.fields.activeHealthCheck.headers=b),"http-failures":n.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":g[21]||(g[21]=b=>n.fields.activeHealthCheck.httpFailures=b),"http-path":n.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":g[22]||(g[22]=b=>n.fields.activeHealthCheck.httpPath=b),"http-statuses":n.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[23]||(g[23]=b=>n.fields.activeHealthCheck.httpStatuses=b),"https-sni":n.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":g[24]||(g[24]=b=>n.fields.activeHealthCheck.httpsSni=b),interval:n.fields.activeHealthCheck.interval,"onUpdate:interval":g[25]||(g[25]=b=>n.fields.activeHealthCheck.interval=b),successes:n.fields.activeHealthCheck.successes,"onUpdate:successes":g[26]||(g[26]=b=>n.fields.activeHealthCheck.successes=b),"tcp-failures":n.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[27]||(g[27]=b=>n.fields.activeHealthCheck.tcpFailures=b),timeout:n.fields.activeHealthCheck.timeout,"onUpdate:timeout":g[28]||(g[28]=b=>n.fields.activeHealthCheck.timeout=b),type:n.fields.activeHealthCheck.type,"onUpdate:type":g[29]||(g[29]=b=>n.fields.activeHealthCheck.type=b),"unhealthy-http-statuses":n.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[30]||(g[30]=b=>n.fields.activeHealthCheck.unhealthyHttpStatuses=b),"unhealthy-interval":n.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":g[31]||(g[31]=b=>n.fields.activeHealthCheck.unhealthyInterval=b),"unhealthy-timeouts":n.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":g[32]||(g[32]=b=>n.fields.activeHealthCheck.unhealthyTimeouts=b),"verify-ssl":n.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":g[33]||(g[33]=b=>n.fields.activeHealthCheck.verifySsl=b),config:e.config,readonly:n.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),n.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(Fc,{key:1,"http-failures":n.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":g[34]||(g[34]=b=>n.fields.passiveHealthCheck.httpFailures=b),"http-statuses":n.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[35]||(g[35]=b=>n.fields.passiveHealthCheck.httpStatuses=b),successes:n.fields.passiveHealthCheck.successes,"onUpdate:successes":g[36]||(g[36]=b=>n.fields.passiveHealthCheck.successes=b),"tcp-failures":n.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[37]||(g[37]=b=>n.fields.passiveHealthCheck.tcpFailures=b),timeouts:n.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":g[38]||(g[38]=b=>n.fields.passiveHealthCheck.timeouts=b),type:n.fields.passiveHealthCheck.type,"onUpdate:type":g[39]||(g[39]=b=>n.fields.passiveHealthCheck.type=b),"unhealthy-http-statuses":n.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[40]||(g[40]=b=>n.fields.passiveHealthCheck.unhealthyHttpStatuses=b),readonly:n.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","is-readonly"])]))}}),ud="",vc=de(qc,[["__scopeId","data-v-810fb7b7"]]),Uc=t.createElementVNode("code",null,"10",-1),$c=t.createElementVNode("code",null,"65536",-1),Dc={"data-testid":"client_certificate-plain-text"},Mc=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","copy:success"],setup(e){const l=e,{i18n:{t:a},i18nT:r}=ce.useI18n(),{getPropValue:o}=Di(),s=t.computed(()=>Ne.form[l.config.app].edit),c=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:P.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(h,i)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(hi),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":c.value,"fetch-url":s.value,"hide-title":e.hideTitle,"onCopy:success":i[0]||(i[0]=d=>h.$emit("copy:success",d)),"onFetch:error":i[1]||(i[1]=d=>h.$emit("fetch:error",d)),"onFetch:success":i[2]||(i[2]=d=>h.$emit("fetch:success",d)),onLoading:i[3]||(i[3]=d=>h.$emit("loading",d))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{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:d})=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(d.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{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(r),{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(r),{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(r),{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(r),{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(r),{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(()=>[Uc]),max:t.withCtx(()=>[$c]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{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(r),{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(r),{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(r),{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(r),{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(d=>{var u;return[t.createElementVNode("div",null,[t.createElementVNode("div",Dc,[t.createElementVNode("span",null,t.toDisplayString((u=t.unref(o)("rowValue",d))==null?void 0:u.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});te.TargetForm=Wa,te.TargetsList=oc,te.UpstreamsConfigCard=Mc,te.UpstreamsForm=vc,te.UpstreamsList=Gi,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})});