@kong-ui-public/entities-upstreams-targets 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,32 @@
1
- (function(ae,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):(ae=typeof globalThis<"u"?globalThis:ae||self,t(ae["kong-ui-entities-upstreams-targets"]={},ae.Vue,ae.axios,ae["kong-ui-public-i18n"],ae.Kongponents,ae.VueRouter))})(this,function(ae,t,wt,Oe,ul,Qe){"use strict";var Ye=(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))(Ye||{}),oe=(e=>(e.Edit="edit",e.Create="create",e))(oe||{}),pe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(pe||{}),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 fl(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):wt.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),wt.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function ml(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const Ze="khcp-user-table-preferences",gl={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function yl(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(Ze));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(Ze,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||gl},deleteAllTablePreferences:()=>{localStorage.removeItem(Ze)}}}function Ge(e={}){const{getAxiosInstance:r}=fl();return{axiosInstance:r(e)}}const kl={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},bl={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Cl={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},wl={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Sl={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"}},_l={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},xl={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Nl={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Vl={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"}},Il={global:kl,deleteModal:bl,baseForm:Cl,baseTable:wl,baseConfigCard:Sl,filter:_l,debouncedFilter:xl,errors:Nl,toggleModal:Vl};function Xe(){const e=Oe.createI18n("en-us",Il);return{i18n:e,i18nT:Oe.i18nTComponent(e)}}function St(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const i of n){const o=a.filter(c=>c===i).length,d=l.filter(c=>c===i).length;if(o!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const i in a)if(Array.isArray(a[i])&&Array.isArray(l[i])){if(r(a[i],l[i]))continue;return!1}else{if(a[i]===l[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let i=l[a]===void 0||l[a]===null?"":l[a],o=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(i=l[a][0]),Array.isArray(n[a])&&(o=n[a][0]),i.localeCompare(o)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function Bl(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:n}=Ge({headers:e.requestHeaders}),{i18n:{t:i}}=Xe(),{debounce:o}=ml(),d=o(async _=>{await F(_)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),f=t.ref([]),s=t.ref(void 0),V=t.unref(r);let C=`${e.apiBaseUrl}${V}`;e.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:g}=St(),B=async()=>{try{c.value=!0;const{data:_}=await n.get(`${C}?size=${a}`);_!=null&&_.next||(s.value=l.fetchedItemsKey in _?_[l.fetchedItemsKey]:[]),f.value=l.fetchedItemsKey in _?_[l.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},T=t.ref(""),F=async _=>{var w,m,N;if(T.value!==_)if(T.value=_||"",s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){let I=C+"";_&&(I+=`/${_}`);const{data:x}=await n.get(`${I}?size=${a}`);l.fetchedItemsKey in x?u.value=x[l.fetchedItemsKey]:x!=null&&x.id?u.value=[x]:u.value=[]}else if(_){const I=[];g(_)&&l.searchKeys.includes("id")?I.push((async()=>{const{data:S}=await n.get(`${C}/${_}`);return[S[l.fetchedItemsKey]??S]})()):I.push(...l.searchKeys.filter(S=>S!=="id").map(async S=>{const{data:A}=await n.get(`${C}?${S}=${_}`);return A[l.fetchedItemsKey]}));const x=await Promise.all(I),E=new Set;u.value=[],(w=x==null?void 0:x.forEach)==null||w.call(x,S=>{var A;(A=S==null?void 0:S.forEach)==null||A.call(S,q=>{E.has(q.id)||(E.add(q.id),u.value.push(q))})})}else u.value=f.value}catch(I){((m=I==null?void 0:I.response)==null?void 0:m.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],h.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",_?(u.value=(N=s.value)==null?void 0:N.filter(I=>{var x;let E=!1;for(const S of l.searchKeys){const A=typeof I[S]=="string"?(x=I[S])==null?void 0:x.toLowerCase():I[S];A!=null&&A.includes(_.toLowerCase())&&(E=!0)}return E}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid"))):u.value=s.value,c.value=!1};return{loading:c,error:h,validationError:p,results:u,allRecords:s,loadItems:B,debouncedQueryChange:d}}function Al(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Tl(){const{i18n:{t:e}}=Xe();return{getMessageFromError:r=>{var a,l,n,i;if(!r)return e("errors.unexpected");if(((a=r==null?void 0:r.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((l=r==null?void 0:r.response)!=null&&l.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let d=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(d=o.messages.join(", ")),o.field?`${o.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||e("errors.unexpected")}}}function El(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,i=e.some(o=>o.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!i&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function _t(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),i=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return o=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:f}=o;try{let s=new URL(i.value.href);return n.value&&f?(s.search="",s=a.value.isExactMatch?new URL(`${s.href}/${f}/`):new URL(`${s.href}?filter[name][contains]=${f}`)):(n.value||new URLSearchParams(f).forEach((V,C)=>{s.searchParams.append(C,V)}),p&&s.searchParams.append("sort_by",p),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),h&&d!==1&&s.searchParams.append("offset",String(h)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function Hl(e,r,a="data"){const l=t.unref(r),{axiosInstance:n}=Ge({headers:e.requestHeaders}),i=_t(e,l),o=t.ref({status:pe.Idle});return{fetcher:async d=>{try{o.value={status:pe.Loading};let c=i(d);c.includes("filter[name]")&&(c=`${c}&page[size]=${d.pageSize}&page[number]=${d.page}`);const{data:h}=await n.get(c),p=a&&a.replace(/[^\w-_]/gi,"");let u;h[p]&&Array.isArray(h[p])?u=h[p]:Array.isArray(h)?u=h:u=Object.keys(h).length?[h]:[];const f={data:u,total:u.length,...h.offset?{pagination:{offset:h.offset}}:null};return o.value={status:pe.Idle,response:f},f}catch(c){const h={data:[],total:0};return d.query&&c.response.status===404?(o.value={status:pe.NoResults,response:h,error:c},h):(o.value={status:pe.Error,response:h,error:c},h)}},fetcherState:o}}function vl(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const xt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Nt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(xt);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},Vt=e=>e==="*"||e==="x"||e==="X",It=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Fl=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],ql=(e,r)=>{if(Vt(e)||Vt(r))return 0;const[a,l]=Fl(It(e),It(r));return a>l?1:a<l?-1:0},Bt=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=ql(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},Ol=(e,r)=>{const a=Nt(e),l=Nt(r),n=a.pop(),i=l.pop(),o=Bt(a,l);return o!==0?o:n&&i?Bt(n.split("."),i.split(".")):n||i?n?-1:1:0},At=(e,r,a)=>{Ul(a);const l=Ol(e,r);return Tt[a].includes(l)},Tt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Et=Object.keys(Tt),Ul=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Et.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Et.join("|")}`)},$l=e=>typeof e=="string"&&/^[v\d]/.test(e)&&xt.test(e);function Dl(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!$l(n))return console.error("Invalid version"),!1;const i=a[l];if(!i)return!1;const[o,d]=i;return!(o&&At(n,o,"<")||d&&At(n,d,">"))}function Ml(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}const Z={useAxios:Ge,useDebouncedFilter:Bl,useDeleteUrlBuilder:Al,useErrors:Tl,useExternalLinkCreator:El,useFetcher:Hl,useFetchUrlBuilder:_t,useHelpers:St,useStringHelpers:vl,useI18n:Xe,useGatewayFeatureSupported:Dl,useTruncationDetector:Ml},jl={key:0,class:"config-card-fieldset-title"},Kl=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Z.useI18n(),{convertKeyToTitle:l}=Z.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),i=t.computed(()=>r.item.value??r.item),o=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=i.value)!=null&&c.name?l(i.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,h)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",jl,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(o.value),(p,u)=>(t.openBlock(),t.createBlock(vt,{key:`${n.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:o.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ne=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Ht=ne(Kl,[["__scopeId","data-v-68ca83ec"]]),Pl=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=i=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Ll=ne(Pl,[["__scopeId","data-v-c96811e5"]]),Rl=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),zl="#0044f4",Jl="#e0e4ea",Wl="#3a3f51",Ql="#afb7c5",Yl="1px",Zl="20px",Gl={class:"config-card-details-row"},Xl=["data-testid"],en=["data-testid"],tn=["data-testid"],an=["data-testid"],rn={key:1},ln=["data-testid"],nn=["data-testid"],on=["data-testid"],sn=["data-testid"],cn={name:"ConfigCardItem",components:{JsonCardItem:Ht,StatusBadge:Rl,InternalLinkItem:Ll}},dn=t.defineComponent({...cn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(V=>({"07753575":p.value?"none":`solid ${t.unref(Yl)} ${t.unref(Jl)}`,"32d44ea8":h.value&&d.value?"block":"flex","5036b738":h.value&&d.value?"100%":a.slim?"50%":"25%","5038fd13":h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:o}}=Z.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),h=t.computed(()=>a.item.type===P.Json||a.item.type===P.JsonArray),p=t.computed(()=>a.item.type===P.JsonArray),u=t.computed(()=>{switch(a.item.type){case P.ID:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case P.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case P.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case P.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case P.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:o(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:V=>{l("navigation-click",V)}}};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}}}),f=t.ref(),{isTruncated:s}=Z.useTruncationDetector(f);return(V,C)=>{const g=t.resolveComponent("KLabel"),B=t.resolveComponent("KBadge"),T=t.resolveComponent("KCopy"),F=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Gl,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(V.$slots,"label",{item:e.item},()=>[t.createVNode(g,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(V.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,en)]),key:"0"}:void 0]),1024)],!0)],8,Xl),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(V.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",rn,[(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,(_,w)=>(t.openBlock(),t.createBlock(B,{key:`${e.item.key}-badge-tag-${w}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${w}`,tooltip:_,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(_),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,ln)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(_,w)=>(t.openBlock(),t.createBlock(T,t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${w}`,"data-testid":`${e.item.key}-copy-uuid-${w}`,text:_}),null,16,["data-testid","text"]))),128))],8,nn)):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,(_,w)=>(t.openBlock(),t.createBlock(B,{key:`${e.item.key}-badge-method-${w}`,appearance:Object.values(t.unref(ul.BadgeMethodAppearances)).includes(_.toLowerCase())?_.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${w}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(_),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,on)):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,(_,w)=>(t.openBlock(),t.createBlock(Ht,{key:`json-array-item-${w}`,index:w,"is-array-item":"",item:_},null,8,["index","item"]))),128))],8,sn)):(t.openBlock(),t.createBlock(F,{key:4,text:t.unref(s)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:f,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,an))],!0)],8,tn)])}}}),vt=ne(dn,[["__scopeId","data-v-d056663c"]]),hn={class:"json-config"},pn={key:0,class:"json-endpoint"},Ft=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"954d3eca":`${l.value}ch`}));const r=e,a=t.computed(()=>r.jsonRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const i=(n=r.fetcherUrl)==null?void 0:n.split("/");return i.length<2?0:41+(r.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(n,i)=>{const o=t.resolveComponent("KBadge"),d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",hn,[r.fetcherUrl?(t.openBlock(),t.createElementBlock("div",pn,[t.createVNode(o,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(d,{id:"json-endpoint-codeblock",code:r.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(d,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(a.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function qt(e){return typeof e>"u"||e===null}function un(e){return typeof e=="object"&&e!==null}function fn(e){return Array.isArray(e)?e:qt(e)?[]:[e]}function mn(e,r){var a,l,n,i;if(r)for(i=Object.keys(r),a=0,l=i.length;a<l;a+=1)n=i[a],e[n]=r[n];return e}function gn(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function yn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var kn=qt,bn=un,Cn=fn,wn=gn,Sn=yn,_n=mn,Q={isNothing:kn,isObject:bn,toArray:Cn,repeat:wn,isNegativeZero:Sn,extend:_n};function Ot(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
1
+ (function(ae,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):(ae=typeof globalThis<"u"?globalThis:ae||self,t(ae["kong-ui-entities-upstreams-targets"]={},ae.Vue,ae.axios,ae["kong-ui-public-i18n"],ae.Kongponents,ae.VueRouter))})(this,function(ae,t,wt,ve,ul,Qe){"use strict";var Ye=(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))(Ye||{}),oe=(e=>(e.Edit="edit",e.Create="create",e))(oe||{}),pe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(pe||{}),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 fl(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):wt.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),wt.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function ml(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const Ze="khcp-user-table-preferences",gl={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function yl(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(Ze));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(Ze,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||gl},deleteAllTablePreferences:()=>{localStorage.removeItem(Ze)}}}function Ge(e={}){const{getAxiosInstance:r}=fl();return{axiosInstance:r(e)}}const kl={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},bl={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Cl={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},wl={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},_l={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"}},Sl={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},xl={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Nl={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Vl={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"}},Il={global:kl,deleteModal:bl,baseForm:Cl,baseTable:wl,baseConfigCard:_l,filter:Sl,debouncedFilter:xl,errors:Nl,toggleModal:Vl};function Xe(){const e=ve.createI18n("en-us",Il);return{i18n:e,i18nT:ve.i18nTComponent(e)}}function _t(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const i of n){const o=a.filter(c=>c===i).length,d=l.filter(c=>c===i).length;if(o!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const i in a)if(Array.isArray(a[i])&&Array.isArray(l[i])){if(r(a[i],l[i]))continue;return!1}else{if(a[i]===l[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let i=l[a]===void 0||l[a]===null?"":l[a],o=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(i=l[a][0]),Array.isArray(n[a])&&(o=n[a][0]),i.localeCompare(o)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function Bl(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:n}=Ge({headers:e.requestHeaders}),{i18n:{t:i}}=Xe(),{debounce:o}=ml(),d=o(async S=>{await F(S)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),f=t.ref([]),s=t.ref(void 0),N=t.unref(r);let C=`${e.apiBaseUrl}${N}`;e.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:g}=_t(),B=async()=>{try{c.value=!0;const{data:S}=await n.get(`${C}?size=${a}`);S!=null&&S.next||(s.value=l.fetchedItemsKey in S?S[l.fetchedItemsKey]:[]),f.value=l.fetchedItemsKey in S?S[l.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},A=t.ref(""),F=async S=>{var w,m,V;if(A.value!==S)if(A.value=S||"",s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){let I=C+"";S&&(I+=`/${S}`);const{data:x}=await n.get(`${I}?size=${a}`);l.fetchedItemsKey in x?u.value=x[l.fetchedItemsKey]:x!=null&&x.id?u.value=[x]:u.value=[]}else if(S){const I=[];g(S)&&l.searchKeys.includes("id")?I.push((async()=>{const{data:_}=await n.get(`${C}/${S}`);return[_[l.fetchedItemsKey]??_]})()):I.push(...l.searchKeys.filter(_=>_!=="id").map(async _=>{const{data:T}=await n.get(`${C}?${_}=${S}`);return T[l.fetchedItemsKey]}));const x=await Promise.all(I),E=new Set;u.value=[],(w=x==null?void 0:x.forEach)==null||w.call(x,_=>{var T;(T=_==null?void 0:_.forEach)==null||T.call(_,O=>{E.has(O.id)||(E.add(O.id),u.value.push(O))})})}else u.value=f.value}catch(I){((m=I==null?void 0:I.response)==null?void 0:m.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],h.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",S?(u.value=(V=s.value)==null?void 0:V.filter(I=>{var x;let E=!1;for(const _ of l.searchKeys){const T=typeof I[_]=="string"?(x=I[_])==null?void 0:x.toLowerCase():I[_];T!=null&&T.includes(S.toLowerCase())&&(E=!0)}return E}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid"))):u.value=s.value,c.value=!1};return{loading:c,error:h,validationError:p,results:u,allRecords:s,loadItems:B,debouncedQueryChange:d}}function Tl(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Al(){const{i18n:{t:e}}=Xe();return{getMessageFromError:r=>{var a,l,n,i;if(!r)return e("errors.unexpected");if(((a=r==null?void 0:r.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((l=r==null?void 0:r.response)!=null&&l.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let d=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(d=o.messages.join(", ")),o.field?`${o.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||e("errors.unexpected")}}}function El(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,i=e.some(o=>o.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!i&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function St(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),i=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return o=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:f}=o;try{let s=new URL(i.value.href);return n.value&&f?(s.search="",s=a.value.isExactMatch?new URL(`${s.href}/${f}/`):new URL(`${s.href}?filter[name][contains]=${f}`)):(n.value||new URLSearchParams(f).forEach((N,C)=>{s.searchParams.append(C,N)}),p&&s.searchParams.append("sort_by",p),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),h&&d!==1&&s.searchParams.append("offset",String(h)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function Hl(e,r,a="data"){var l;const n=t.unref(r),{axiosInstance:i}=Ge({...e.axiosRequestConfig,headers:{...(l=e.axiosRequestConfig)==null?void 0:l.headers,...e.requestHeaders}}),o=St(e,n),d=t.ref({status:pe.Idle});return{fetcher:async c=>{var h;try{d.value={status:pe.Loading};let p=o(c);p.includes("filter[name]")&&(p=`${p}&page[size]=${c.pageSize}&page[number]=${c.page}`);const u=await i.get(p);if(u.status>=400)throw u;const f=u.data,s=a&&a.replace(/[^\w-_]/gi,"");let N;f[s]&&Array.isArray(f[s])?N=f[s]:Array.isArray(f)?N=f:N=Object.keys(f).length?[f]:[];const C={data:N,total:N.length,...f.offset?{pagination:{offset:f.offset}}:null};return d.value={status:pe.Idle,response:C},C}catch(p){const u={data:[],total:0};return c.query&&(((h=p.response)==null?void 0:h.status)===404||p.status===404)?(d.value={status:pe.NoResults,response:u,error:p.response?p:{response:p}},u):(d.value={status:pe.Error,response:u,error:p.response?p:{response:p}},u)}},fetcherState:d}}function ql(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const xt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Nt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(xt);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},Vt=e=>e==="*"||e==="x"||e==="X",It=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Fl=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Ol=(e,r)=>{if(Vt(e)||Vt(r))return 0;const[a,l]=Fl(It(e),It(r));return a>l?1:a<l?-1:0},Bt=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Ol(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},vl=(e,r)=>{const a=Nt(e),l=Nt(r),n=a.pop(),i=l.pop(),o=Bt(a,l);return o!==0?o:n&&i?Bt(n.split("."),i.split(".")):n||i?n?-1:1:0},Tt=(e,r,a)=>{Ul(a);const l=vl(e,r);return At[a].includes(l)},At={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Et=Object.keys(At),Ul=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Et.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Et.join("|")}`)},$l=e=>typeof e=="string"&&/^[v\d]/.test(e)&&xt.test(e);function Dl(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!$l(n))return console.error("Invalid version"),!1;const i=a[l];if(!i)return!1;const[o,d]=i;return!(o&&Tt(n,o,"<")||d&&Tt(n,d,">"))}function Ml(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}const Z={useAxios:Ge,useDebouncedFilter:Bl,useDeleteUrlBuilder:Tl,useErrors:Al,useExternalLinkCreator:El,useFetcher:Hl,useFetchUrlBuilder:St,useHelpers:_t,useStringHelpers:ql,useI18n:Xe,useGatewayFeatureSupported:Dl,useTruncationDetector:Ml},jl={key:0,class:"config-card-fieldset-title"},Kl=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Z.useI18n(),{convertKeyToTitle:l}=Z.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),i=t.computed(()=>r.item.value??r.item),o=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=i.value)!=null&&c.name?l(i.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,h)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",jl,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(o.value),(p,u)=>(t.openBlock(),t.createBlock(qt,{key:`${n.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:o.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ne=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Ht=ne(Kl,[["__scopeId","data-v-68ca83ec"]]),Pl=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=i=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Ll=ne(Pl,[["__scopeId","data-v-c96811e5"]]),Rl=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),zl="#0044f4",Jl="#e0e4ea",Wl="#3a3f51",Ql="#afb7c5",Yl="1px",Zl="20px",Gl={class:"config-card-details-row"},Xl=["data-testid"],en=["data-testid"],tn=["data-testid"],an=["data-testid"],rn={key:1},ln=["data-testid"],nn=["data-testid"],on=["data-testid"],sn=["data-testid"],cn={name:"ConfigCardItem",components:{JsonCardItem:Ht,StatusBadge:Rl,InternalLinkItem:Ll}},dn=t.defineComponent({...cn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(N=>({"07753575":p.value?"none":`solid ${t.unref(Yl)} ${t.unref(Jl)}`,"32d44ea8":h.value&&d.value?"block":"flex","5036b738":h.value&&d.value?"100%":a.slim?"50%":"25%","5038fd13":h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:o}}=Z.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),h=t.computed(()=>a.item.type===P.Json||a.item.type===P.JsonArray),p=t.computed(()=>a.item.type===P.JsonArray),u=t.computed(()=>{switch(a.item.type){case P.ID:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case P.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case P.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case P.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case P.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:o(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:N=>{l("navigation-click",N)}}};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}}}),f=t.ref(),{isTruncated:s}=Z.useTruncationDetector(f);return(N,C)=>{const g=t.resolveComponent("KLabel"),B=t.resolveComponent("KBadge"),A=t.resolveComponent("KCopy"),F=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Gl,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(N.$slots,"label",{item:e.item},()=>[t.createVNode(g,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(N.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,en)]),key:"0"}:void 0]),1024)],!0)],8,Xl),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(N.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",rn,[(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,(S,w)=>(t.openBlock(),t.createBlock(B,{key:`${e.item.key}-badge-tag-${w}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${w}`,tooltip:S,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,ln)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(S,w)=>(t.openBlock(),t.createBlock(A,t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${w}`,"data-testid":`${e.item.key}-copy-uuid-${w}`,text:S}),null,16,["data-testid","text"]))),128))],8,nn)):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,(S,w)=>(t.openBlock(),t.createBlock(B,{key:`${e.item.key}-badge-method-${w}`,appearance:Object.values(t.unref(ul.BadgeMethodAppearances)).includes(S.toLowerCase())?S.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${w}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(S),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,on)):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,(S,w)=>(t.openBlock(),t.createBlock(Ht,{key:`json-array-item-${w}`,index:w,"is-array-item":"",item:S},null,8,["index","item"]))),128))],8,sn)):(t.openBlock(),t.createBlock(F,{key:4,text:t.unref(s)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:f,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,an))],!0)],8,tn)])}}}),qt=ne(dn,[["__scopeId","data-v-d056663c"]]),hn={class:"json-config"},pn={key:0,class:"json-endpoint"},Ft=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"954d3eca":`${l.value}ch`}));const r=e,a=t.computed(()=>r.jsonRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const i=(n=r.fetcherUrl)==null?void 0:n.split("/");return i.length<2?0:41+(r.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(n,i)=>{const o=t.resolveComponent("KBadge"),d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",hn,[r.fetcherUrl?(t.openBlock(),t.createElementBlock("div",pn,[t.createVNode(o,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(d,{id:"json-endpoint-codeblock",code:r.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(d,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(a.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ot(e){return typeof e>"u"||e===null}function un(e){return typeof e=="object"&&e!==null}function fn(e){return Array.isArray(e)?e:Ot(e)?[]:[e]}function mn(e,r){var a,l,n,i;if(r)for(i=Object.keys(r),a=0,l=i.length;a<l;a+=1)n=i[a],e[n]=r[n];return e}function gn(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function yn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var kn=Ot,bn=un,Cn=fn,wn=gn,_n=yn,Sn=mn,Q={isNothing:kn,isObject:bn,toArray:Cn,repeat:wn,isNegativeZero:_n,extend:Sn};function vt(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
2
2
 
3
- `+e.mark.snippet),l+" "+a):l}function Ae(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=Ot(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ae.prototype=Object.create(Error.prototype),Ae.prototype.constructor=Ae,Ae.prototype.toString=function(e){return this.name+": "+Ot(this,e)};var re=Ae;function et(e,r,a,l,n){var i="",o="",d=Math.floor(n/2)-1;return l-r>d&&(i=" ... ",r=l-d+i.length),a-l>d&&(o=" ...",a=l+d-o.length),{str:i+e.slice(r,a).replace(/\t/g,"→")+o,pos:l-r+i.length}}function tt(e,r){return Q.repeat(" ",r-e.length)+e}function xn(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var a=/\r?\n|\r|\0/g,l=[0],n=[],i,o=-1;i=a.exec(e.buffer);)n.push(i.index),l.push(i.index+i[0].length),e.position<=i.index&&o<0&&(o=l.length-2);o<0&&(o=l.length-1);var d="",c,h,p=Math.min(e.line+r.linesAfter,n.length).toString().length,u=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(o-c<0);c++)h=et(e.buffer,l[o-c],n[o-c],e.position-(l[o]-l[o-c]),u),d=Q.repeat(" ",r.indent)+tt((e.line-c+1).toString(),p)+" | "+h.str+`
3
+ `+e.mark.snippet),l+" "+a):l}function Te(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=vt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Te.prototype=Object.create(Error.prototype),Te.prototype.constructor=Te,Te.prototype.toString=function(e){return this.name+": "+vt(this,e)};var re=Te;function et(e,r,a,l,n){var i="",o="",d=Math.floor(n/2)-1;return l-r>d&&(i=" ... ",r=l-d+i.length),a-l>d&&(o=" ...",a=l+d-o.length),{str:i+e.slice(r,a).replace(/\t/g,"→")+o,pos:l-r+i.length}}function tt(e,r){return Q.repeat(" ",r-e.length)+e}function xn(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var a=/\r?\n|\r|\0/g,l=[0],n=[],i,o=-1;i=a.exec(e.buffer);)n.push(i.index),l.push(i.index+i[0].length),e.position<=i.index&&o<0&&(o=l.length-2);o<0&&(o=l.length-1);var d="",c,h,p=Math.min(e.line+r.linesAfter,n.length).toString().length,u=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(o-c<0);c++)h=et(e.buffer,l[o-c],n[o-c],e.position-(l[o]-l[o-c]),u),d=Q.repeat(" ",r.indent)+tt((e.line-c+1).toString(),p)+" | "+h.str+`
4
4
  `+d;for(h=et(e.buffer,l[o],n[o],e.position,u),d+=Q.repeat(" ",r.indent)+tt((e.line+1).toString(),p)+" | "+h.str+`
5
5
  `,d+=Q.repeat("-",r.indent+p+3+h.pos)+`^
6
6
  `,c=1;c<=r.linesAfter&&!(o+c>=n.length);c++)h=et(e.buffer,l[o+c],n[o+c],e.position-(l[o]-l[o+c]),u),d+=Q.repeat(" ",r.indent)+tt((e.line+c+1).toString(),p)+" | "+h.str+`
7
- `;return d.replace(/\n$/,"")}var Nn=xn,Vn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],In=["scalar","sequence","mapping"];function Bn(e){var r={};return e!==null&&Object.keys(e).forEach(function(a){e[a].forEach(function(l){r[String(l)]=a})}),r}function An(e,r){if(r=r||{},Object.keys(r).forEach(function(a){if(Vn.indexOf(a)===-1)throw new re('Unknown option "'+a+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(a){return a},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Bn(r.styleAliases||null),In.indexOf(this.kind)===-1)throw new re('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var G=An;function Ut(e,r){var a=[];return e[r].forEach(function(l){var n=a.length;a.forEach(function(i,o){i.tag===l.tag&&i.kind===l.kind&&i.multi===l.multi&&(n=o)}),a[n]=l}),a}function Tn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,a;function l(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(r=0,a=arguments.length;r<a;r+=1)arguments[r].forEach(l);return e}function at(e){return this.extend(e)}at.prototype.extend=function(e){var r=[],a=[];if(e instanceof G)a.push(e);else if(Array.isArray(e))a=a.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(a=a.concat(e.explicit));else throw new re("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(n){if(!(n instanceof G))throw new re("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new re("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new re("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),a.forEach(function(n){if(!(n instanceof G))throw new re("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(at.prototype);return l.implicit=(this.implicit||[]).concat(r),l.explicit=(this.explicit||[]).concat(a),l.compiledImplicit=Ut(l,"implicit"),l.compiledExplicit=Ut(l,"explicit"),l.compiledTypeMap=Tn(l.compiledImplicit,l.compiledExplicit),l};var $t=at,Dt=new G("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Mt=new G("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),jt=new G("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Kt=new $t({explicit:[Dt,Mt,jt]});function En(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Hn(){return null}function vn(e){return e===null}var Pt=new G("tag:yaml.org,2002:null",{kind:"scalar",resolve:En,construct:Hn,predicate:vn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Fn(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function qn(e){return e==="true"||e==="True"||e==="TRUE"}function On(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Lt=new G("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Fn,construct:qn,predicate:On,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Un(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function $n(e){return 48<=e&&e<=55}function Dn(e){return 48<=e&&e<=57}function Mn(e){if(e===null)return!1;var r=e.length,a=0,l=!1,n;if(!r)return!1;if(n=e[a],(n==="-"||n==="+")&&(n=e[++a]),n==="0"){if(a+1===r)return!0;if(n=e[++a],n==="b"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(n!=="0"&&n!=="1")return!1;l=!0}return l&&n!=="_"}if(n==="x"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Un(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}if(n==="o"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!$n(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}}if(n==="_")return!1;for(;a<r;a++)if(n=e[a],n!=="_"){if(!Dn(e.charCodeAt(a)))return!1;l=!0}return!(!l||n==="_")}function jn(e){var r=e,a=1,l;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),l=r[0],(l==="-"||l==="+")&&(l==="-"&&(a=-1),r=r.slice(1),l=r[0]),r==="0")return 0;if(l==="0"){if(r[1]==="b")return a*parseInt(r.slice(2),2);if(r[1]==="x")return a*parseInt(r.slice(2),16);if(r[1]==="o")return a*parseInt(r.slice(2),8)}return a*parseInt(r,10)}function Kn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Q.isNegativeZero(e)}var Rt=new G("tag:yaml.org,2002:int",{kind:"scalar",resolve:Mn,construct:jn,predicate:Kn,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Pn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ln(e){return!(e===null||!Pn.test(e)||e[e.length-1]==="_")}function Rn(e){var r,a;return r=e.replace(/_/g,"").toLowerCase(),a=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:a*parseFloat(r,10)}var zn=/^[-+]?[0-9]+e/;function Jn(e,r){var a;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Q.isNegativeZero(e))return"-0.0";return a=e.toString(10),zn.test(a)?a.replace("e",".e"):a}function Wn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Q.isNegativeZero(e))}var zt=new G("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ln,construct:Rn,predicate:Wn,represent:Jn,defaultStyle:"lowercase"}),Jt=Kt.extend({implicit:[Pt,Lt,Rt,zt]}),Wt=Jt,Qt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Yt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Qn(e){return e===null?!1:Qt.exec(e)!==null||Yt.exec(e)!==null}function Yn(e){var r,a,l,n,i,o,d,c=0,h=null,p,u,f;if(r=Qt.exec(e),r===null&&(r=Yt.exec(e)),r===null)throw new Error("Date resolve error");if(a=+r[1],l=+r[2]-1,n=+r[3],!r[4])return new Date(Date.UTC(a,l,n));if(i=+r[4],o=+r[5],d=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(p=+r[10],u=+(r[11]||0),h=(p*60+u)*6e4,r[9]==="-"&&(h=-h)),f=new Date(Date.UTC(a,l,n,i,o,d,c)),h&&f.setTime(f.getTime()-h),f}function Zn(e){return e.toISOString()}var Zt=new G("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Qn,construct:Yn,instanceOf:Date,represent:Zn});function Gn(e){return e==="<<"||e===null}var Gt=new G("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Gn}),rt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
7
+ `;return d.replace(/\n$/,"")}var Nn=xn,Vn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],In=["scalar","sequence","mapping"];function Bn(e){var r={};return e!==null&&Object.keys(e).forEach(function(a){e[a].forEach(function(l){r[String(l)]=a})}),r}function Tn(e,r){if(r=r||{},Object.keys(r).forEach(function(a){if(Vn.indexOf(a)===-1)throw new re('Unknown option "'+a+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(a){return a},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Bn(r.styleAliases||null),In.indexOf(this.kind)===-1)throw new re('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var G=Tn;function Ut(e,r){var a=[];return e[r].forEach(function(l){var n=a.length;a.forEach(function(i,o){i.tag===l.tag&&i.kind===l.kind&&i.multi===l.multi&&(n=o)}),a[n]=l}),a}function An(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,a;function l(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(r=0,a=arguments.length;r<a;r+=1)arguments[r].forEach(l);return e}function at(e){return this.extend(e)}at.prototype.extend=function(e){var r=[],a=[];if(e instanceof G)a.push(e);else if(Array.isArray(e))a=a.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(a=a.concat(e.explicit));else throw new re("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(n){if(!(n instanceof G))throw new re("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new re("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new re("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),a.forEach(function(n){if(!(n instanceof G))throw new re("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(at.prototype);return l.implicit=(this.implicit||[]).concat(r),l.explicit=(this.explicit||[]).concat(a),l.compiledImplicit=Ut(l,"implicit"),l.compiledExplicit=Ut(l,"explicit"),l.compiledTypeMap=An(l.compiledImplicit,l.compiledExplicit),l};var $t=at,Dt=new G("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Mt=new G("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),jt=new G("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Kt=new $t({explicit:[Dt,Mt,jt]});function En(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Hn(){return null}function qn(e){return e===null}var Pt=new G("tag:yaml.org,2002:null",{kind:"scalar",resolve:En,construct:Hn,predicate:qn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Fn(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function On(e){return e==="true"||e==="True"||e==="TRUE"}function vn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Lt=new G("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Fn,construct:On,predicate:vn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Un(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function $n(e){return 48<=e&&e<=55}function Dn(e){return 48<=e&&e<=57}function Mn(e){if(e===null)return!1;var r=e.length,a=0,l=!1,n;if(!r)return!1;if(n=e[a],(n==="-"||n==="+")&&(n=e[++a]),n==="0"){if(a+1===r)return!0;if(n=e[++a],n==="b"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(n!=="0"&&n!=="1")return!1;l=!0}return l&&n!=="_"}if(n==="x"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Un(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}if(n==="o"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!$n(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}}if(n==="_")return!1;for(;a<r;a++)if(n=e[a],n!=="_"){if(!Dn(e.charCodeAt(a)))return!1;l=!0}return!(!l||n==="_")}function jn(e){var r=e,a=1,l;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),l=r[0],(l==="-"||l==="+")&&(l==="-"&&(a=-1),r=r.slice(1),l=r[0]),r==="0")return 0;if(l==="0"){if(r[1]==="b")return a*parseInt(r.slice(2),2);if(r[1]==="x")return a*parseInt(r.slice(2),16);if(r[1]==="o")return a*parseInt(r.slice(2),8)}return a*parseInt(r,10)}function Kn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Q.isNegativeZero(e)}var Rt=new G("tag:yaml.org,2002:int",{kind:"scalar",resolve:Mn,construct:jn,predicate:Kn,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Pn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ln(e){return!(e===null||!Pn.test(e)||e[e.length-1]==="_")}function Rn(e){var r,a;return r=e.replace(/_/g,"").toLowerCase(),a=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:a*parseFloat(r,10)}var zn=/^[-+]?[0-9]+e/;function Jn(e,r){var a;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Q.isNegativeZero(e))return"-0.0";return a=e.toString(10),zn.test(a)?a.replace("e",".e"):a}function Wn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Q.isNegativeZero(e))}var zt=new G("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ln,construct:Rn,predicate:Wn,represent:Jn,defaultStyle:"lowercase"}),Jt=Kt.extend({implicit:[Pt,Lt,Rt,zt]}),Wt=Jt,Qt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Yt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Qn(e){return e===null?!1:Qt.exec(e)!==null||Yt.exec(e)!==null}function Yn(e){var r,a,l,n,i,o,d,c=0,h=null,p,u,f;if(r=Qt.exec(e),r===null&&(r=Yt.exec(e)),r===null)throw new Error("Date resolve error");if(a=+r[1],l=+r[2]-1,n=+r[3],!r[4])return new Date(Date.UTC(a,l,n));if(i=+r[4],o=+r[5],d=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(p=+r[10],u=+(r[11]||0),h=(p*60+u)*6e4,r[9]==="-"&&(h=-h)),f=new Date(Date.UTC(a,l,n,i,o,d,c)),h&&f.setTime(f.getTime()-h),f}function Zn(e){return e.toISOString()}var Zt=new G("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Qn,construct:Yn,instanceOf:Date,represent:Zn});function Gn(e){return e==="<<"||e===null}var Gt=new G("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Gn}),rt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
8
  \r`;function Xn(e){if(e===null)return!1;var r,a,l=0,n=e.length,i=rt;for(a=0;a<n;a++)if(r=i.indexOf(e.charAt(a)),!(r>64)){if(r<0)return!1;l+=6}return l%8===0}function eo(e){var r,a,l=e.replace(/[\r\n=]/g,""),n=l.length,i=rt,o=0,d=[];for(r=0;r<n;r++)r%4===0&&r&&(d.push(o>>16&255),d.push(o>>8&255),d.push(o&255)),o=o<<6|i.indexOf(l.charAt(r));return a=n%4*6,a===0?(d.push(o>>16&255),d.push(o>>8&255),d.push(o&255)):a===18?(d.push(o>>10&255),d.push(o>>2&255)):a===12&&d.push(o>>4&255),new Uint8Array(d)}function to(e){var r="",a=0,l,n,i=e.length,o=rt;for(l=0;l<i;l++)l%3===0&&l&&(r+=o[a>>18&63],r+=o[a>>12&63],r+=o[a>>6&63],r+=o[a&63]),a=(a<<8)+e[l];return n=i%3,n===0?(r+=o[a>>18&63],r+=o[a>>12&63],r+=o[a>>6&63],r+=o[a&63]):n===2?(r+=o[a>>10&63],r+=o[a>>4&63],r+=o[a<<2&63],r+=o[64]):n===1&&(r+=o[a>>2&63],r+=o[a<<4&63],r+=o[64],r+=o[64]),r}function ao(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Xt=new G("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Xn,construct:eo,predicate:ao,represent:to}),ro=Object.prototype.hasOwnProperty,lo=Object.prototype.toString;function no(e){if(e===null)return!0;var r=[],a,l,n,i,o,d=e;for(a=0,l=d.length;a<l;a+=1){if(n=d[a],o=!1,lo.call(n)!=="[object Object]")return!1;for(i in n)if(ro.call(n,i))if(!o)o=!0;else return!1;if(!o)return!1;if(r.indexOf(i)===-1)r.push(i);else return!1}return!0}function oo(e){return e!==null?e:[]}var ea=new G("tag:yaml.org,2002:omap",{kind:"sequence",resolve:no,construct:oo}),io=Object.prototype.toString;function so(e){if(e===null)return!0;var r,a,l,n,i,o=e;for(i=new Array(o.length),r=0,a=o.length;r<a;r+=1){if(l=o[r],io.call(l)!=="[object Object]"||(n=Object.keys(l),n.length!==1))return!1;i[r]=[n[0],l[n[0]]]}return!0}function co(e){if(e===null)return[];var r,a,l,n,i,o=e;for(i=new Array(o.length),r=0,a=o.length;r<a;r+=1)l=o[r],n=Object.keys(l),i[r]=[n[0],l[n[0]]];return i}var ta=new G("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:so,construct:co}),ho=Object.prototype.hasOwnProperty;function po(e){if(e===null)return!0;var r,a=e;for(r in a)if(ho.call(a,r)&&a[r]!==null)return!1;return!0}function uo(e){return e!==null?e:{}}var aa=new G("tag:yaml.org,2002:set",{kind:"mapping",resolve:po,construct:uo}),lt=Wt.extend({implicit:[Zt,Gt],explicit:[Xt,ea,ta,aa]}),ue=Object.prototype.hasOwnProperty,Ue=1,ra=2,la=3,$e=4,nt=1,fo=2,na=3,mo=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,go=/[\x85\u2028\u2029]/,yo=/[,\[\]\{\}]/,oa=/^(?:!|!!|![a-z\-]+!)$/i,ia=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function sa(e){return Object.prototype.toString.call(e)}function ie(e){return e===10||e===13}function ge(e){return e===9||e===32}function le(e){return e===9||e===32||e===10||e===13}function ke(e){return e===44||e===91||e===93||e===123||e===125}function ko(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function bo(e){return e===120?2:e===117?4:e===85?8:0}function Co(e){return 48<=e&&e<=57?e-48:-1}function ca(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function wo(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var da=new Array(256),ha=new Array(256),be=0;be<256;be++)da[be]=ca(be)?1:0,ha[be]=ca(be);function So(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||lt,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function pa(e,r){var a={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return a.snippet=Nn(a),new re(r,a)}function H(e,r){throw pa(e,r)}function De(e,r){e.onWarning&&e.onWarning.call(null,pa(e,r))}var ua={YAML:function(e,r,a){var l,n,i;e.version!==null&&H(e,"duplication of %YAML directive"),a.length!==1&&H(e,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(a[0]),l===null&&H(e,"ill-formed argument of the YAML directive"),n=parseInt(l[1],10),i=parseInt(l[2],10),n!==1&&H(e,"unacceptable YAML version of the document"),e.version=a[0],e.checkLineBreaks=i<2,i!==1&&i!==2&&De(e,"unsupported YAML version of the document")},TAG:function(e,r,a){var l,n;a.length!==2&&H(e,"TAG directive accepts exactly two arguments"),l=a[0],n=a[1],oa.test(l)||H(e,"ill-formed tag handle (first argument) of the TAG directive"),ue.call(e.tagMap,l)&&H(e,'there is a previously declared suffix for "'+l+'" tag handle'),ia.test(n)||H(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{H(e,"tag prefix is malformed: "+n)}e.tagMap[l]=n}};function fe(e,r,a,l){var n,i,o,d;if(r<a){if(d=e.input.slice(r,a),l)for(n=0,i=d.length;n<i;n+=1)o=d.charCodeAt(n),o===9||32<=o&&o<=1114111||H(e,"expected valid JSON character");else mo.test(d)&&H(e,"the stream contains non-printable characters");e.result+=d}}function fa(e,r,a,l){var n,i,o,d;for(Q.isObject(a)||H(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(a),o=0,d=n.length;o<d;o+=1)i=n[o],ue.call(r,i)||(r[i]=a[i],l[i]=!0)}function Ce(e,r,a,l,n,i,o,d,c){var h,p;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),h=0,p=n.length;h<p;h+=1)Array.isArray(n[h])&&H(e,"nested arrays are not supported inside keys"),typeof n=="object"&&sa(n[h])==="[object Object]"&&(n[h]="[object Object]");if(typeof n=="object"&&sa(n)==="[object Object]"&&(n="[object Object]"),n=String(n),r===null&&(r={}),l==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(h=0,p=i.length;h<p;h+=1)fa(e,r,i[h],a);else fa(e,r,i,a);else!e.json&&!ue.call(a,n)&&ue.call(r,n)&&(e.line=o||e.line,e.lineStart=d||e.lineStart,e.position=c||e.position,H(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(r,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):r[n]=i,delete a[n];return r}function ot(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):H(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function W(e,r,a){for(var l=0,n=e.input.charCodeAt(e.position);n!==0;){for(;ge(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(r&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(ie(n))for(ot(e),n=e.input.charCodeAt(e.position),l++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return a!==-1&&l!==0&&e.lineIndent<a&&De(e,"deficient indentation"),l}function Me(e){var r=e.position,a;return a=e.input.charCodeAt(r),!!((a===45||a===46)&&a===e.input.charCodeAt(r+1)&&a===e.input.charCodeAt(r+2)&&(r+=3,a=e.input.charCodeAt(r),a===0||le(a)))}function it(e,r){r===1?e.result+=" ":r>1&&(e.result+=Q.repeat(`
10
- `,r-1))}function _o(e,r,a){var l,n,i,o,d,c,h,p,u=e.kind,f=e.result,s;if(s=e.input.charCodeAt(e.position),le(s)||ke(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(n=e.input.charCodeAt(e.position+1),le(n)||a&&ke(n)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,d=!1;s!==0;){if(s===58){if(n=e.input.charCodeAt(e.position+1),le(n)||a&&ke(n))break}else if(s===35){if(l=e.input.charCodeAt(e.position-1),le(l))break}else{if(e.position===e.lineStart&&Me(e)||a&&ke(s))break;if(ie(s))if(c=e.line,h=e.lineStart,p=e.lineIndent,W(e,!1,-1),e.lineIndent>=r){d=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=h,e.lineIndent=p;break}}d&&(fe(e,i,o,!1),it(e,e.line-c),i=o=e.position,d=!1),ge(s)||(o=e.position+1),s=e.input.charCodeAt(++e.position)}return fe(e,i,o,!1),e.result?!0:(e.kind=u,e.result=f,!1)}function xo(e,r){var a,l,n;if(a=e.input.charCodeAt(e.position),a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,l=n=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(fe(e,l,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)l=e.position,e.position++,n=e.position;else return!0;else ie(a)?(fe(e,l,n,!0),it(e,W(e,!1,r)),l=n=e.position):e.position===e.lineStart&&Me(e)?H(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);H(e,"unexpected end of the stream within a single quoted scalar")}function No(e,r){var a,l,n,i,o,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,a=l=e.position;(d=e.input.charCodeAt(e.position))!==0;){if(d===34)return fe(e,a,e.position,!0),e.position++,!0;if(d===92){if(fe(e,a,e.position,!0),d=e.input.charCodeAt(++e.position),ie(d))W(e,!1,r);else if(d<256&&da[d])e.result+=ha[d],e.position++;else if((o=bo(d))>0){for(n=o,i=0;n>0;n--)d=e.input.charCodeAt(++e.position),(o=ko(d))>=0?i=(i<<4)+o:H(e,"expected hexadecimal character");e.result+=wo(i),e.position++}else H(e,"unknown escape sequence");a=l=e.position}else ie(d)?(fe(e,a,l,!0),it(e,W(e,!1,r)),a=l=e.position):e.position===e.lineStart&&Me(e)?H(e,"unexpected end of the document within a double quoted scalar"):(e.position++,l=e.position)}H(e,"unexpected end of the stream within a double quoted scalar")}function Vo(e,r){var a=!0,l,n,i,o=e.tag,d,c=e.anchor,h,p,u,f,s,V=Object.create(null),C,g,B,T;if(T=e.input.charCodeAt(e.position),T===91)p=93,s=!1,d=[];else if(T===123)p=125,s=!0,d={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),T=e.input.charCodeAt(++e.position);T!==0;){if(W(e,!0,r),T=e.input.charCodeAt(e.position),T===p)return e.position++,e.tag=o,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=d,!0;a?T===44&&H(e,"expected the node content, but found ','"):H(e,"missed comma between flow collection entries"),g=C=B=null,u=f=!1,T===63&&(h=e.input.charCodeAt(e.position+1),le(h)&&(u=f=!0,e.position++,W(e,!0,r))),l=e.line,n=e.lineStart,i=e.position,we(e,r,Ue,!1,!0),g=e.tag,C=e.result,W(e,!0,r),T=e.input.charCodeAt(e.position),(f||e.line===l)&&T===58&&(u=!0,T=e.input.charCodeAt(++e.position),W(e,!0,r),we(e,r,Ue,!1,!0),B=e.result),s?Ce(e,d,V,g,C,B,l,n,i):u?d.push(Ce(e,null,V,g,C,B,l,n,i)):d.push(C),W(e,!0,r),T=e.input.charCodeAt(e.position),T===44?(a=!0,T=e.input.charCodeAt(++e.position)):a=!1}H(e,"unexpected end of the stream within a flow collection")}function Io(e,r){var a,l,n=nt,i=!1,o=!1,d=r,c=0,h=!1,p,u;if(u=e.input.charCodeAt(e.position),u===124)l=!1;else if(u===62)l=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)nt===n?n=u===43?na:fo:H(e,"repeat of a chomping mode identifier");else if((p=Co(u))>=0)p===0?H(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?H(e,"repeat of an indentation width identifier"):(d=r+p-1,o=!0);else break;if(ge(u)){do u=e.input.charCodeAt(++e.position);while(ge(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ie(u)&&u!==0)}for(;u!==0;){for(ot(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<d)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>d&&(d=e.lineIndent),ie(u)){c++;continue}if(e.lineIndent<d){n===na?e.result+=Q.repeat(`
9
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function wo(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var da=new Array(256),ha=new Array(256),be=0;be<256;be++)da[be]=ca(be)?1:0,ha[be]=ca(be);function _o(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||lt,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function pa(e,r){var a={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return a.snippet=Nn(a),new re(r,a)}function H(e,r){throw pa(e,r)}function De(e,r){e.onWarning&&e.onWarning.call(null,pa(e,r))}var ua={YAML:function(e,r,a){var l,n,i;e.version!==null&&H(e,"duplication of %YAML directive"),a.length!==1&&H(e,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(a[0]),l===null&&H(e,"ill-formed argument of the YAML directive"),n=parseInt(l[1],10),i=parseInt(l[2],10),n!==1&&H(e,"unacceptable YAML version of the document"),e.version=a[0],e.checkLineBreaks=i<2,i!==1&&i!==2&&De(e,"unsupported YAML version of the document")},TAG:function(e,r,a){var l,n;a.length!==2&&H(e,"TAG directive accepts exactly two arguments"),l=a[0],n=a[1],oa.test(l)||H(e,"ill-formed tag handle (first argument) of the TAG directive"),ue.call(e.tagMap,l)&&H(e,'there is a previously declared suffix for "'+l+'" tag handle'),ia.test(n)||H(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{H(e,"tag prefix is malformed: "+n)}e.tagMap[l]=n}};function fe(e,r,a,l){var n,i,o,d;if(r<a){if(d=e.input.slice(r,a),l)for(n=0,i=d.length;n<i;n+=1)o=d.charCodeAt(n),o===9||32<=o&&o<=1114111||H(e,"expected valid JSON character");else mo.test(d)&&H(e,"the stream contains non-printable characters");e.result+=d}}function fa(e,r,a,l){var n,i,o,d;for(Q.isObject(a)||H(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(a),o=0,d=n.length;o<d;o+=1)i=n[o],ue.call(r,i)||(r[i]=a[i],l[i]=!0)}function Ce(e,r,a,l,n,i,o,d,c){var h,p;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),h=0,p=n.length;h<p;h+=1)Array.isArray(n[h])&&H(e,"nested arrays are not supported inside keys"),typeof n=="object"&&sa(n[h])==="[object Object]"&&(n[h]="[object Object]");if(typeof n=="object"&&sa(n)==="[object Object]"&&(n="[object Object]"),n=String(n),r===null&&(r={}),l==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(h=0,p=i.length;h<p;h+=1)fa(e,r,i[h],a);else fa(e,r,i,a);else!e.json&&!ue.call(a,n)&&ue.call(r,n)&&(e.line=o||e.line,e.lineStart=d||e.lineStart,e.position=c||e.position,H(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(r,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):r[n]=i,delete a[n];return r}function ot(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):H(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function W(e,r,a){for(var l=0,n=e.input.charCodeAt(e.position);n!==0;){for(;ge(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(r&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(ie(n))for(ot(e),n=e.input.charCodeAt(e.position),l++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return a!==-1&&l!==0&&e.lineIndent<a&&De(e,"deficient indentation"),l}function Me(e){var r=e.position,a;return a=e.input.charCodeAt(r),!!((a===45||a===46)&&a===e.input.charCodeAt(r+1)&&a===e.input.charCodeAt(r+2)&&(r+=3,a=e.input.charCodeAt(r),a===0||le(a)))}function it(e,r){r===1?e.result+=" ":r>1&&(e.result+=Q.repeat(`
10
+ `,r-1))}function So(e,r,a){var l,n,i,o,d,c,h,p,u=e.kind,f=e.result,s;if(s=e.input.charCodeAt(e.position),le(s)||ke(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(n=e.input.charCodeAt(e.position+1),le(n)||a&&ke(n)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,d=!1;s!==0;){if(s===58){if(n=e.input.charCodeAt(e.position+1),le(n)||a&&ke(n))break}else if(s===35){if(l=e.input.charCodeAt(e.position-1),le(l))break}else{if(e.position===e.lineStart&&Me(e)||a&&ke(s))break;if(ie(s))if(c=e.line,h=e.lineStart,p=e.lineIndent,W(e,!1,-1),e.lineIndent>=r){d=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=h,e.lineIndent=p;break}}d&&(fe(e,i,o,!1),it(e,e.line-c),i=o=e.position,d=!1),ge(s)||(o=e.position+1),s=e.input.charCodeAt(++e.position)}return fe(e,i,o,!1),e.result?!0:(e.kind=u,e.result=f,!1)}function xo(e,r){var a,l,n;if(a=e.input.charCodeAt(e.position),a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,l=n=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(fe(e,l,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)l=e.position,e.position++,n=e.position;else return!0;else ie(a)?(fe(e,l,n,!0),it(e,W(e,!1,r)),l=n=e.position):e.position===e.lineStart&&Me(e)?H(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);H(e,"unexpected end of the stream within a single quoted scalar")}function No(e,r){var a,l,n,i,o,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,a=l=e.position;(d=e.input.charCodeAt(e.position))!==0;){if(d===34)return fe(e,a,e.position,!0),e.position++,!0;if(d===92){if(fe(e,a,e.position,!0),d=e.input.charCodeAt(++e.position),ie(d))W(e,!1,r);else if(d<256&&da[d])e.result+=ha[d],e.position++;else if((o=bo(d))>0){for(n=o,i=0;n>0;n--)d=e.input.charCodeAt(++e.position),(o=ko(d))>=0?i=(i<<4)+o:H(e,"expected hexadecimal character");e.result+=wo(i),e.position++}else H(e,"unknown escape sequence");a=l=e.position}else ie(d)?(fe(e,a,l,!0),it(e,W(e,!1,r)),a=l=e.position):e.position===e.lineStart&&Me(e)?H(e,"unexpected end of the document within a double quoted scalar"):(e.position++,l=e.position)}H(e,"unexpected end of the stream within a double quoted scalar")}function Vo(e,r){var a=!0,l,n,i,o=e.tag,d,c=e.anchor,h,p,u,f,s,N=Object.create(null),C,g,B,A;if(A=e.input.charCodeAt(e.position),A===91)p=93,s=!1,d=[];else if(A===123)p=125,s=!0,d={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),A=e.input.charCodeAt(++e.position);A!==0;){if(W(e,!0,r),A=e.input.charCodeAt(e.position),A===p)return e.position++,e.tag=o,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=d,!0;a?A===44&&H(e,"expected the node content, but found ','"):H(e,"missed comma between flow collection entries"),g=C=B=null,u=f=!1,A===63&&(h=e.input.charCodeAt(e.position+1),le(h)&&(u=f=!0,e.position++,W(e,!0,r))),l=e.line,n=e.lineStart,i=e.position,we(e,r,Ue,!1,!0),g=e.tag,C=e.result,W(e,!0,r),A=e.input.charCodeAt(e.position),(f||e.line===l)&&A===58&&(u=!0,A=e.input.charCodeAt(++e.position),W(e,!0,r),we(e,r,Ue,!1,!0),B=e.result),s?Ce(e,d,N,g,C,B,l,n,i):u?d.push(Ce(e,null,N,g,C,B,l,n,i)):d.push(C),W(e,!0,r),A=e.input.charCodeAt(e.position),A===44?(a=!0,A=e.input.charCodeAt(++e.position)):a=!1}H(e,"unexpected end of the stream within a flow collection")}function Io(e,r){var a,l,n=nt,i=!1,o=!1,d=r,c=0,h=!1,p,u;if(u=e.input.charCodeAt(e.position),u===124)l=!1;else if(u===62)l=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)nt===n?n=u===43?na:fo:H(e,"repeat of a chomping mode identifier");else if((p=Co(u))>=0)p===0?H(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?H(e,"repeat of an indentation width identifier"):(d=r+p-1,o=!0);else break;if(ge(u)){do u=e.input.charCodeAt(++e.position);while(ge(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ie(u)&&u!==0)}for(;u!==0;){for(ot(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<d)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>d&&(d=e.lineIndent),ie(u)){c++;continue}if(e.lineIndent<d){n===na?e.result+=Q.repeat(`
11
11
  `,i?1+c:c):n===nt&&i&&(e.result+=`
12
12
  `);break}for(l?ge(u)?(h=!0,e.result+=Q.repeat(`
13
13
  `,i?1+c:c)):h?(h=!1,e.result+=Q.repeat(`
14
14
  `,c+1)):c===0?i&&(e.result+=" "):e.result+=Q.repeat(`
15
15
  `,c):e.result+=Q.repeat(`
16
- `,i?1+c:c),i=!0,o=!0,c=0,a=e.position;!ie(u)&&u!==0;)u=e.input.charCodeAt(++e.position);fe(e,a,e.position,!1)}return!0}function ma(e,r){var a,l=e.tag,n=e.anchor,i=[],o,d=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,H(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!le(o))));){if(d=!0,e.position++,W(e,!0,-1)&&e.lineIndent<=r){i.push(null),c=e.input.charCodeAt(e.position);continue}if(a=e.line,we(e,r,la,!1,!0),i.push(e.result),W(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>r)&&c!==0)H(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return d?(e.tag=l,e.anchor=n,e.kind="sequence",e.result=i,!0):!1}function Bo(e,r,a){var l,n,i,o,d,c,h=e.tag,p=e.anchor,u={},f=Object.create(null),s=null,V=null,C=null,g=!1,B=!1,T;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),T=e.input.charCodeAt(e.position);T!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,H(e,"tab characters must not be used in indentation")),l=e.input.charCodeAt(e.position+1),i=e.line,(T===63||T===58)&&le(l))T===63?(g&&(Ce(e,u,f,s,V,null,o,d,c),s=V=C=null),B=!0,g=!0,n=!0):g?(g=!1,n=!0):H(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,T=l;else{if(o=e.line,d=e.lineStart,c=e.position,!we(e,a,ra,!1,!0))break;if(e.line===i){for(T=e.input.charCodeAt(e.position);ge(T);)T=e.input.charCodeAt(++e.position);if(T===58)T=e.input.charCodeAt(++e.position),le(T)||H(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(Ce(e,u,f,s,V,null,o,d,c),s=V=C=null),B=!0,g=!1,n=!1,s=e.tag,V=e.result;else if(B)H(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=p,!0}else if(B)H(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=h,e.anchor=p,!0}if((e.line===i||e.lineIndent>r)&&(g&&(o=e.line,d=e.lineStart,c=e.position),we(e,r,$e,!0,n)&&(g?V=e.result:C=e.result),g||(Ce(e,u,f,s,V,C,o,d,c),s=V=C=null),W(e,!0,-1),T=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>r)&&T!==0)H(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return g&&Ce(e,u,f,s,V,null,o,d,c),B&&(e.tag=h,e.anchor=p,e.kind="mapping",e.result=u),B}function Ao(e){var r,a=!1,l=!1,n,i,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&H(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(a=!0,o=e.input.charCodeAt(++e.position)):o===33?(l=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",r=e.position,a){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(i=e.input.slice(r,e.position),o=e.input.charCodeAt(++e.position)):H(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!le(o);)o===33&&(l?H(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(r-1,e.position+1),oa.test(n)||H(e,"named tag handle cannot contain such characters"),l=!0,r=e.position+1)),o=e.input.charCodeAt(++e.position);i=e.input.slice(r,e.position),yo.test(i)&&H(e,"tag suffix cannot contain flow indicator characters")}i&&!ia.test(i)&&H(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{H(e,"tag name is malformed: "+i)}return a?e.tag=i:ue.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:n==="!"?e.tag="!"+i:n==="!!"?e.tag="tag:yaml.org,2002:"+i:H(e,'undeclared tag handle "'+n+'"'),!0}function To(e){var r,a;if(a=e.input.charCodeAt(e.position),a!==38)return!1;for(e.anchor!==null&&H(e,"duplication of an anchor property"),a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!le(a)&&!ke(a);)a=e.input.charCodeAt(++e.position);return e.position===r&&H(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function Eo(e){var r,a,l;if(l=e.input.charCodeAt(e.position),l!==42)return!1;for(l=e.input.charCodeAt(++e.position),r=e.position;l!==0&&!le(l)&&!ke(l);)l=e.input.charCodeAt(++e.position);return e.position===r&&H(e,"name of an alias node must contain at least one character"),a=e.input.slice(r,e.position),ue.call(e.anchorMap,a)||H(e,'unidentified alias "'+a+'"'),e.result=e.anchorMap[a],W(e,!0,-1),!0}function we(e,r,a,l,n){var i,o,d,c=1,h=!1,p=!1,u,f,s,V,C,g;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=o=d=$e===a||la===a,l&&W(e,!0,-1)&&(h=!0,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)),c===1)for(;Ao(e)||To(e);)W(e,!0,-1)?(h=!0,d=i,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)):d=!1;if(d&&(d=h||n),(c===1||$e===a)&&(Ue===a||ra===a?C=r:C=r+1,g=e.position-e.lineStart,c===1?d&&(ma(e,g)||Bo(e,g,C))||Vo(e,C)?p=!0:(o&&Io(e,C)||xo(e,C)||No(e,C)?p=!0:Eo(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&H(e,"alias node should not have any properties")):_o(e,C,Ue===a)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=d&&ma(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&H(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u<f;u+=1)if(V=e.implicitTypes[u],V.resolve(e.result)){e.result=V.construct(e.result),e.tag=V.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ue.call(e.typeMap[e.kind||"fallback"],e.tag))V=e.typeMap[e.kind||"fallback"][e.tag];else for(V=null,s=e.typeMap.multi[e.kind||"fallback"],u=0,f=s.length;u<f;u+=1)if(e.tag.slice(0,s[u].tag.length)===s[u].tag){V=s[u];break}V||H(e,"unknown tag !<"+e.tag+">"),e.result!==null&&V.kind!==e.kind&&H(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+V.kind+'", not "'+e.kind+'"'),V.resolve(e.result,e.tag)?(e.result=V.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):H(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function Ho(e){var r=e.position,a,l,n,i=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(W(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(i=!0,o=e.input.charCodeAt(++e.position),a=e.position;o!==0&&!le(o);)o=e.input.charCodeAt(++e.position);for(l=e.input.slice(a,e.position),n=[],l.length<1&&H(e,"directive name must not be less than one character in length");o!==0;){for(;ge(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!ie(o));break}if(ie(o))break;for(a=e.position;o!==0&&!le(o);)o=e.input.charCodeAt(++e.position);n.push(e.input.slice(a,e.position))}o!==0&&ot(e),ue.call(ua,l)?ua[l](e,l,n):De(e,'unknown document directive "'+l+'"')}if(W(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,W(e,!0,-1)):i&&H(e,"directives end mark is expected"),we(e,e.lineIndent-1,$e,!1,!0),W(e,!0,-1),e.checkLineBreaks&&go.test(e.input.slice(r,e.position))&&De(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Me(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,W(e,!0,-1));return}if(e.position<e.length-1)H(e,"end of the stream or a document separator is expected");else return}function ga(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var a=new So(e,r),l=e.indexOf("\0");for(l!==-1&&(a.position=l,H(a,"null byte is not allowed in input")),a.input+="\0";a.input.charCodeAt(a.position)===32;)a.lineIndent+=1,a.position+=1;for(;a.position<a.length-1;)Ho(a);return a.documents}function vo(e,r,a){r!==null&&typeof r=="object"&&typeof a>"u"&&(a=r,r=null);var l=ga(e,a);if(typeof r!="function")return l;for(var n=0,i=l.length;n<i;n+=1)r(l[n])}function Fo(e,r){var a=ga(e,r);if(a.length!==0){if(a.length===1)return a[0];throw new re("expected a single document in the stream, but found more")}}var qo=vo,Oo=Fo,ya={loadAll:qo,load:Oo},ka=Object.prototype.toString,ba=Object.prototype.hasOwnProperty,st=65279,Uo=9,Te=10,$o=13,Do=32,Mo=33,jo=34,ct=35,Ko=37,Po=38,Lo=39,Ro=42,Ca=44,zo=45,je=58,Jo=61,Wo=62,Qo=63,Yo=64,wa=91,Sa=93,Zo=96,_a=123,Go=124,xa=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var Xo=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ei=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ti(e,r){var a,l,n,i,o,d,c;if(r===null)return{};for(a={},l=Object.keys(r),n=0,i=l.length;n<i;n+=1)o=l[n],d=String(r[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&ba.call(c.styleAliases,d)&&(d=c.styleAliases[d]),a[o]=d;return a}function ai(e){var r,a,l;if(r=e.toString(16).toUpperCase(),e<=255)a="x",l=2;else if(e<=65535)a="u",l=4;else if(e<=4294967295)a="U",l=8;else throw new re("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+Q.repeat("0",l-r.length)+r}var ri=1,Ee=2;function li(e){this.schema=e.schema||lt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Q.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ti(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ee:ri,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Na(e,r){for(var a=Q.repeat(" ",r),l=0,n=-1,i="",o,d=e.length;l<d;)n=e.indexOf(`
16
+ `,i?1+c:c),i=!0,o=!0,c=0,a=e.position;!ie(u)&&u!==0;)u=e.input.charCodeAt(++e.position);fe(e,a,e.position,!1)}return!0}function ma(e,r){var a,l=e.tag,n=e.anchor,i=[],o,d=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,H(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!le(o))));){if(d=!0,e.position++,W(e,!0,-1)&&e.lineIndent<=r){i.push(null),c=e.input.charCodeAt(e.position);continue}if(a=e.line,we(e,r,la,!1,!0),i.push(e.result),W(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>r)&&c!==0)H(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return d?(e.tag=l,e.anchor=n,e.kind="sequence",e.result=i,!0):!1}function Bo(e,r,a){var l,n,i,o,d,c,h=e.tag,p=e.anchor,u={},f=Object.create(null),s=null,N=null,C=null,g=!1,B=!1,A;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),A=e.input.charCodeAt(e.position);A!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,H(e,"tab characters must not be used in indentation")),l=e.input.charCodeAt(e.position+1),i=e.line,(A===63||A===58)&&le(l))A===63?(g&&(Ce(e,u,f,s,N,null,o,d,c),s=N=C=null),B=!0,g=!0,n=!0):g?(g=!1,n=!0):H(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,A=l;else{if(o=e.line,d=e.lineStart,c=e.position,!we(e,a,ra,!1,!0))break;if(e.line===i){for(A=e.input.charCodeAt(e.position);ge(A);)A=e.input.charCodeAt(++e.position);if(A===58)A=e.input.charCodeAt(++e.position),le(A)||H(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(Ce(e,u,f,s,N,null,o,d,c),s=N=C=null),B=!0,g=!1,n=!1,s=e.tag,N=e.result;else if(B)H(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=p,!0}else if(B)H(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=h,e.anchor=p,!0}if((e.line===i||e.lineIndent>r)&&(g&&(o=e.line,d=e.lineStart,c=e.position),we(e,r,$e,!0,n)&&(g?N=e.result:C=e.result),g||(Ce(e,u,f,s,N,C,o,d,c),s=N=C=null),W(e,!0,-1),A=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>r)&&A!==0)H(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return g&&Ce(e,u,f,s,N,null,o,d,c),B&&(e.tag=h,e.anchor=p,e.kind="mapping",e.result=u),B}function To(e){var r,a=!1,l=!1,n,i,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&H(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(a=!0,o=e.input.charCodeAt(++e.position)):o===33?(l=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",r=e.position,a){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(i=e.input.slice(r,e.position),o=e.input.charCodeAt(++e.position)):H(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!le(o);)o===33&&(l?H(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(r-1,e.position+1),oa.test(n)||H(e,"named tag handle cannot contain such characters"),l=!0,r=e.position+1)),o=e.input.charCodeAt(++e.position);i=e.input.slice(r,e.position),yo.test(i)&&H(e,"tag suffix cannot contain flow indicator characters")}i&&!ia.test(i)&&H(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{H(e,"tag name is malformed: "+i)}return a?e.tag=i:ue.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:n==="!"?e.tag="!"+i:n==="!!"?e.tag="tag:yaml.org,2002:"+i:H(e,'undeclared tag handle "'+n+'"'),!0}function Ao(e){var r,a;if(a=e.input.charCodeAt(e.position),a!==38)return!1;for(e.anchor!==null&&H(e,"duplication of an anchor property"),a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!le(a)&&!ke(a);)a=e.input.charCodeAt(++e.position);return e.position===r&&H(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function Eo(e){var r,a,l;if(l=e.input.charCodeAt(e.position),l!==42)return!1;for(l=e.input.charCodeAt(++e.position),r=e.position;l!==0&&!le(l)&&!ke(l);)l=e.input.charCodeAt(++e.position);return e.position===r&&H(e,"name of an alias node must contain at least one character"),a=e.input.slice(r,e.position),ue.call(e.anchorMap,a)||H(e,'unidentified alias "'+a+'"'),e.result=e.anchorMap[a],W(e,!0,-1),!0}function we(e,r,a,l,n){var i,o,d,c=1,h=!1,p=!1,u,f,s,N,C,g;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=o=d=$e===a||la===a,l&&W(e,!0,-1)&&(h=!0,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)),c===1)for(;To(e)||Ao(e);)W(e,!0,-1)?(h=!0,d=i,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)):d=!1;if(d&&(d=h||n),(c===1||$e===a)&&(Ue===a||ra===a?C=r:C=r+1,g=e.position-e.lineStart,c===1?d&&(ma(e,g)||Bo(e,g,C))||Vo(e,C)?p=!0:(o&&Io(e,C)||xo(e,C)||No(e,C)?p=!0:Eo(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&H(e,"alias node should not have any properties")):So(e,C,Ue===a)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=d&&ma(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&H(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u<f;u+=1)if(N=e.implicitTypes[u],N.resolve(e.result)){e.result=N.construct(e.result),e.tag=N.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ue.call(e.typeMap[e.kind||"fallback"],e.tag))N=e.typeMap[e.kind||"fallback"][e.tag];else for(N=null,s=e.typeMap.multi[e.kind||"fallback"],u=0,f=s.length;u<f;u+=1)if(e.tag.slice(0,s[u].tag.length)===s[u].tag){N=s[u];break}N||H(e,"unknown tag !<"+e.tag+">"),e.result!==null&&N.kind!==e.kind&&H(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+N.kind+'", not "'+e.kind+'"'),N.resolve(e.result,e.tag)?(e.result=N.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):H(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function Ho(e){var r=e.position,a,l,n,i=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(W(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(i=!0,o=e.input.charCodeAt(++e.position),a=e.position;o!==0&&!le(o);)o=e.input.charCodeAt(++e.position);for(l=e.input.slice(a,e.position),n=[],l.length<1&&H(e,"directive name must not be less than one character in length");o!==0;){for(;ge(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!ie(o));break}if(ie(o))break;for(a=e.position;o!==0&&!le(o);)o=e.input.charCodeAt(++e.position);n.push(e.input.slice(a,e.position))}o!==0&&ot(e),ue.call(ua,l)?ua[l](e,l,n):De(e,'unknown document directive "'+l+'"')}if(W(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,W(e,!0,-1)):i&&H(e,"directives end mark is expected"),we(e,e.lineIndent-1,$e,!1,!0),W(e,!0,-1),e.checkLineBreaks&&go.test(e.input.slice(r,e.position))&&De(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Me(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,W(e,!0,-1));return}if(e.position<e.length-1)H(e,"end of the stream or a document separator is expected");else return}function ga(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var a=new _o(e,r),l=e.indexOf("\0");for(l!==-1&&(a.position=l,H(a,"null byte is not allowed in input")),a.input+="\0";a.input.charCodeAt(a.position)===32;)a.lineIndent+=1,a.position+=1;for(;a.position<a.length-1;)Ho(a);return a.documents}function qo(e,r,a){r!==null&&typeof r=="object"&&typeof a>"u"&&(a=r,r=null);var l=ga(e,a);if(typeof r!="function")return l;for(var n=0,i=l.length;n<i;n+=1)r(l[n])}function Fo(e,r){var a=ga(e,r);if(a.length!==0){if(a.length===1)return a[0];throw new re("expected a single document in the stream, but found more")}}var Oo=qo,vo=Fo,ya={loadAll:Oo,load:vo},ka=Object.prototype.toString,ba=Object.prototype.hasOwnProperty,st=65279,Uo=9,Ae=10,$o=13,Do=32,Mo=33,jo=34,ct=35,Ko=37,Po=38,Lo=39,Ro=42,Ca=44,zo=45,je=58,Jo=61,Wo=62,Qo=63,Yo=64,wa=91,_a=93,Zo=96,Sa=123,Go=124,xa=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var Xo=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ei=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ti(e,r){var a,l,n,i,o,d,c;if(r===null)return{};for(a={},l=Object.keys(r),n=0,i=l.length;n<i;n+=1)o=l[n],d=String(r[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&ba.call(c.styleAliases,d)&&(d=c.styleAliases[d]),a[o]=d;return a}function ai(e){var r,a,l;if(r=e.toString(16).toUpperCase(),e<=255)a="x",l=2;else if(e<=65535)a="u",l=4;else if(e<=4294967295)a="U",l=8;else throw new re("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+Q.repeat("0",l-r.length)+r}var ri=1,Ee=2;function li(e){this.schema=e.schema||lt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Q.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ti(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ee:ri,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Na(e,r){for(var a=Q.repeat(" ",r),l=0,n=-1,i="",o,d=e.length;l<d;)n=e.indexOf(`
18
18
  `,l),n===-1?(o=e.slice(l),l=d):(o=e.slice(l,n+1),l=n+1),o.length&&o!==`
19
19
  `&&(i+=a),i+=o;return i}function dt(e,r){return`
20
- `+Q.repeat(" ",e.indent*r)}function ni(e,r){var a,l,n;for(a=0,l=e.implicitTypes.length;a<l;a+=1)if(n=e.implicitTypes[a],n.resolve(r))return!0;return!1}function Ke(e){return e===Do||e===Uo}function He(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==st||65536<=e&&e<=1114111}function Va(e){return He(e)&&e!==st&&e!==$o&&e!==Te}function Ia(e,r,a){var l=Va(e),n=l&&!Ke(e);return(a?l:l&&e!==Ca&&e!==wa&&e!==Sa&&e!==_a&&e!==xa)&&e!==ct&&!(r===je&&!n)||Va(r)&&!Ke(r)&&e===ct||r===je&&n}function oi(e){return He(e)&&e!==st&&!Ke(e)&&e!==zo&&e!==Qo&&e!==je&&e!==Ca&&e!==wa&&e!==Sa&&e!==_a&&e!==xa&&e!==ct&&e!==Po&&e!==Ro&&e!==Mo&&e!==Go&&e!==Jo&&e!==Wo&&e!==Lo&&e!==jo&&e!==Ko&&e!==Yo&&e!==Zo}function ii(e){return!Ke(e)&&e!==je}function ve(e,r){var a=e.charCodeAt(r),l;return a>=55296&&a<=56319&&r+1<e.length&&(l=e.charCodeAt(r+1),l>=56320&&l<=57343)?(a-55296)*1024+l-56320+65536:a}function Ba(e){var r=/^\n* /;return r.test(e)}var Aa=1,ht=2,Ta=3,Ea=4,Se=5;function si(e,r,a,l,n,i,o,d){var c,h=0,p=null,u=!1,f=!1,s=l!==-1,V=-1,C=oi(ve(e,0))&&ii(ve(e,e.length-1));if(r||o)for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=ve(e,c),!He(h))return Se;C=C&&Ia(h,p,d),p=h}else{for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=ve(e,c),h===Te)u=!0,s&&(f=f||c-V-1>l&&e[V+1]!==" ",V=c);else if(!He(h))return Se;C=C&&Ia(h,p,d),p=h}f=f||s&&c-V-1>l&&e[V+1]!==" "}return!u&&!f?C&&!o&&!n(e)?Aa:i===Ee?Se:ht:a>9&&Ba(e)?Se:o?i===Ee?Se:ht:f?Ea:Ta}function ci(e,r,a,l,n){e.dump=function(){if(r.length===0)return e.quotingType===Ee?'""':"''";if(!e.noCompatMode&&(Xo.indexOf(r)!==-1||ei.test(r)))return e.quotingType===Ee?'"'+r+'"':"'"+r+"'";var i=e.indent*Math.max(1,a),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),d=l||e.flowLevel>-1&&a>=e.flowLevel;function c(h){return ni(e,h)}switch(si(r,d,e.indent,o,c,e.quotingType,e.forceQuotes&&!l,n)){case Aa:return r;case ht:return"'"+r.replace(/'/g,"''")+"'";case Ta:return"|"+Ha(r,e.indent)+va(Na(r,i));case Ea:return">"+Ha(r,e.indent)+va(Na(di(r,o),i));case Se:return'"'+hi(r)+'"';default:throw new re("impossible error: invalid scalar style")}}()}function Ha(e,r){var a=Ba(e)?String(r):"",l=e[e.length-1]===`
20
+ `+Q.repeat(" ",e.indent*r)}function ni(e,r){var a,l,n;for(a=0,l=e.implicitTypes.length;a<l;a+=1)if(n=e.implicitTypes[a],n.resolve(r))return!0;return!1}function Ke(e){return e===Do||e===Uo}function He(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==st||65536<=e&&e<=1114111}function Va(e){return He(e)&&e!==st&&e!==$o&&e!==Ae}function Ia(e,r,a){var l=Va(e),n=l&&!Ke(e);return(a?l:l&&e!==Ca&&e!==wa&&e!==_a&&e!==Sa&&e!==xa)&&e!==ct&&!(r===je&&!n)||Va(r)&&!Ke(r)&&e===ct||r===je&&n}function oi(e){return He(e)&&e!==st&&!Ke(e)&&e!==zo&&e!==Qo&&e!==je&&e!==Ca&&e!==wa&&e!==_a&&e!==Sa&&e!==xa&&e!==ct&&e!==Po&&e!==Ro&&e!==Mo&&e!==Go&&e!==Jo&&e!==Wo&&e!==Lo&&e!==jo&&e!==Ko&&e!==Yo&&e!==Zo}function ii(e){return!Ke(e)&&e!==je}function qe(e,r){var a=e.charCodeAt(r),l;return a>=55296&&a<=56319&&r+1<e.length&&(l=e.charCodeAt(r+1),l>=56320&&l<=57343)?(a-55296)*1024+l-56320+65536:a}function Ba(e){var r=/^\n* /;return r.test(e)}var Ta=1,ht=2,Aa=3,Ea=4,_e=5;function si(e,r,a,l,n,i,o,d){var c,h=0,p=null,u=!1,f=!1,s=l!==-1,N=-1,C=oi(qe(e,0))&&ii(qe(e,e.length-1));if(r||o)for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=qe(e,c),!He(h))return _e;C=C&&Ia(h,p,d),p=h}else{for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=qe(e,c),h===Ae)u=!0,s&&(f=f||c-N-1>l&&e[N+1]!==" ",N=c);else if(!He(h))return _e;C=C&&Ia(h,p,d),p=h}f=f||s&&c-N-1>l&&e[N+1]!==" "}return!u&&!f?C&&!o&&!n(e)?Ta:i===Ee?_e:ht:a>9&&Ba(e)?_e:o?i===Ee?_e:ht:f?Ea:Aa}function ci(e,r,a,l,n){e.dump=function(){if(r.length===0)return e.quotingType===Ee?'""':"''";if(!e.noCompatMode&&(Xo.indexOf(r)!==-1||ei.test(r)))return e.quotingType===Ee?'"'+r+'"':"'"+r+"'";var i=e.indent*Math.max(1,a),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),d=l||e.flowLevel>-1&&a>=e.flowLevel;function c(h){return ni(e,h)}switch(si(r,d,e.indent,o,c,e.quotingType,e.forceQuotes&&!l,n)){case Ta:return r;case ht:return"'"+r.replace(/'/g,"''")+"'";case Aa:return"|"+Ha(r,e.indent)+qa(Na(r,i));case Ea:return">"+Ha(r,e.indent)+qa(Na(di(r,o),i));case _e:return'"'+hi(r)+'"';default:throw new re("impossible error: invalid scalar style")}}()}function Ha(e,r){var a=Ba(e)?String(r):"",l=e[e.length-1]===`
21
21
  `,n=l&&(e[e.length-2]===`
22
22
  `||e===`
23
23
  `),i=n?"+":l?"":"-";return a+i+`
24
- `}function va(e){return e[e.length-1]===`
24
+ `}function qa(e){return e[e.length-1]===`
25
25
  `?e.slice(0,-1):e}function di(e,r){for(var a=/(\n+)([^\n]*)/g,l=function(){var h=e.indexOf(`
26
26
  `);return h=h!==-1?h:e.length,a.lastIndex=h,Fa(e.slice(0,h),r)}(),n=e[0]===`
27
27
  `||e[0]===" ",i,o;o=a.exec(e);){var d=o[1],c=o[2];i=c[0]===" ",l+=d+(!n&&!i&&c!==""?`
28
28
  `:"")+Fa(c,r),n=i}return l}function Fa(e,r){if(e===""||e[0]===" ")return e;for(var a=/ [^ ]/g,l,n=0,i,o=0,d=0,c="";l=a.exec(e);)d=l.index,d-n>r&&(i=o>n?o:d,c+=`
29
29
  `+e.slice(n,i),n=i+1),o=d;return c+=`
30
30
  `,e.length-n>r&&o>n?c+=e.slice(n,o)+`
31
- `+e.slice(o+1):c+=e.slice(n),c.slice(1)}function hi(e){for(var r="",a=0,l,n=0;n<e.length;a>=65536?n+=2:n++)a=ve(e,n),l=ee[a],!l&&He(a)?(r+=e[n],a>=65536&&(r+=e[n+1])):r+=l||ai(a);return r}function pi(e,r,a){var l="",n=e.tag,i,o,d;for(i=0,o=a.length;i<o;i+=1)d=a[i],e.replacer&&(d=e.replacer.call(a,String(i),d)),(se(e,r,d,!1,!1)||typeof d>"u"&&se(e,r,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=n,e.dump="["+l+"]"}function qa(e,r,a,l){var n="",i=e.tag,o,d,c;for(o=0,d=a.length;o<d;o+=1)c=a[o],e.replacer&&(c=e.replacer.call(a,String(o),c)),(se(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&se(e,r+1,null,!0,!0,!1,!0))&&((!l||n!=="")&&(n+=dt(e,r)),e.dump&&Te===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function ui(e,r,a){var l="",n=e.tag,i=Object.keys(a),o,d,c,h,p;for(o=0,d=i.length;o<d;o+=1)p="",l!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[o],h=a[c],e.replacer&&(h=e.replacer.call(a,c,h)),se(e,r,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),se(e,r,h,!1,!1)&&(p+=e.dump,l+=p));e.tag=n,e.dump="{"+l+"}"}function fi(e,r,a,l){var n="",i=e.tag,o=Object.keys(a),d,c,h,p,u,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new re("sortKeys must be a boolean or a function");for(d=0,c=o.length;d<c;d+=1)f="",(!l||n!=="")&&(f+=dt(e,r)),h=o[d],p=a[h],e.replacer&&(p=e.replacer.call(a,h,p)),se(e,r+1,h,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Te===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=dt(e,r)),se(e,r+1,p,!0,u)&&(e.dump&&Te===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,n+=f));e.tag=i,e.dump=n||"{}"}function Oa(e,r,a){var l,n,i,o,d,c;for(n=a?e.explicitTypes:e.implicitTypes,i=0,o=n.length;i<o;i+=1)if(d=n[i],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof r=="object"&&r instanceof d.instanceOf)&&(!d.predicate||d.predicate(r))){if(a?d.multi&&d.representName?e.tag=d.representName(r):e.tag=d.tag:e.tag="?",d.represent){if(c=e.styleMap[d.tag]||d.defaultStyle,ka.call(d.represent)==="[object Function]")l=d.represent(r,c);else if(ba.call(d.represent,c))l=d.represent[c](r,c);else throw new re("!<"+d.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function se(e,r,a,l,n,i,o){e.tag=null,e.dump=a,Oa(e,a,!1)||Oa(e,a,!0);var d=ka.call(e.dump),c=l,h;l&&(l=e.flowLevel<0||e.flowLevel>r);var p=d==="[object Object]"||d==="[object Array]",u,f;if(p&&(u=e.duplicates.indexOf(a),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&r>0)&&(n=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")l&&Object.keys(e.dump).length!==0?(fi(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(ui(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?qa(e,r-1,e.dump,n):qa(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(pi(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&ci(e,e.dump,r,i,c);else{if(d==="[object Undefined]"||e.skipInvalid)return!1;throw new re("unacceptable kind of an object to dump "+d)}e.tag!==null&&e.tag!=="?"&&(h=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",e.dump=h+" "+e.dump)}return!0}function mi(e,r){var a=[],l=[],n,i;for(pt(e,a,l),n=0,i=l.length;n<i;n+=1)r.duplicates.push(a[l[n]]);r.usedDuplicates=new Array(i)}function pt(e,r,a){var l,n,i;if(e!==null&&typeof e=="object")if(n=r.indexOf(e),n!==-1)a.indexOf(n)===-1&&a.push(n);else if(r.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)pt(e[n],r,a);else for(l=Object.keys(e),n=0,i=l.length;n<i;n+=1)pt(e[l[n]],r,a)}function gi(e,r){r=r||{};var a=new li(r);a.noRefs||mi(e,a);var l=e;return a.replacer&&(l=a.replacer.call({"":l},"",l)),se(a,0,l,!0,!0)?a.dump+`
32
- `:""}var yi=gi,ki={dump:yi};function ut(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var bi=G,Ci=$t,wi=Kt,Si=Jt,_i=Wt,xi=lt,Ni=ya.load,Vi=ya.loadAll,Ii=ki.dump,Bi=re,Ai={binary:Xt,float:zt,map:jt,null:Pt,pairs:ta,set:aa,timestamp:Zt,bool:Lt,int:Rt,merge:Gt,omap:ea,seq:Mt,str:Dt},Ti=ut("safeLoad","load"),Ei=ut("safeLoadAll","loadAll"),Hi=ut("safeDump","dump"),vi={Type:bi,Schema:Ci,FAILSAFE_SCHEMA:wi,JSON_SCHEMA:Si,CORE_SCHEMA:_i,DEFAULT_SCHEMA:xi,load:Ni,loadAll:Vi,dump:Ii,YAMLException:Bi,types:Ai,safeLoad:Ti,safeLoadAll:Ei,safeDump:Hi};const Fi={class:"yaml-config"},Ua=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>{const l=Object.fromEntries(Object.entries(r.yamlRecord).filter(([,n])=>n&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(l).length===0&&l.constructor===Object?"":vi.dump(l).trim()});return(l,n)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Fi,[r.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),qi={key:0,class:"config-card-display-form"},Oi=["data-testid"],Ui={key:0,class:"config-card-prop-section-title"},$i=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const r=e,a=t.useSlots(),{i18n:{t:l}}=Z.useI18n(),n=o=>!!(o.tooltip||a[`${o.key}-label-tooltip`]),i=t.computed(()=>{if(!r.record)return r.record;const o=JSON.parse(JSON.stringify(r.record));return delete o.created_at,delete o.updated_at,o});return(o,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",qi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,c=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${c}-props`,class:t.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(t.openBlock(),t.createElementBlock("div",Ui,t.toDisplayString(c==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],h=>(t.openBlock(),t.createBlock(vt,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(o.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[n(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Oi))),128))])):t.createCommentVNode("",!0),e.format==="json"&&r.record?(t.openBlock(),t.createBlock(Ft,{key:1,config:r.config,"fetcher-url":r.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&r.record?(t.openBlock(),t.createBlock(Ua,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),Di=ne($i,[["__scopeId","data-v-147a2f70"]]),me="24px",Pe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Mi=e=>(t.pushScopeId("data-v-2295e0fb"),e=e(),t.popScopeId(),e),ji=["aria-hidden"],Ki={key:0,"data-testid":"kui-icon-svg-title"},Pi=Mi(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Li=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:me,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return me}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Ki,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Pi],8,ji))]),_:1},8,["aria-hidden","style"]))}}),Ri=Pe(Li,[["__scopeId","data-v-2295e0fb"]]),zi=e=>(t.pushScopeId("data-v-40a7f387"),e=e(),t.popScopeId(),e),Ji=["aria-hidden"],Wi={key:0,"data-testid":"kui-icon-svg-title"},Qi=zi(()=>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)),Yi=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:me,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return me}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Wi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Qi],8,Ji))]),_:1},8,["aria-hidden","style"]))}}),Zi=Pe(Yi,[["__scopeId","data-v-40a7f387"]]),Gi=e=>(t.pushScopeId("data-v-98c34919"),e=e(),t.popScopeId(),e),Xi=["aria-hidden"],es={key:0,"data-testid":"kui-icon-svg-title"},ts=Gi(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),as=t.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:me,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return me}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",es,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ts],8,Xi))]),_:1},8,["aria-hidden","style"]))}}),rs=Pe(as,[["__scopeId","data-v-98c34919"]]),ls=e=>(t.pushScopeId("data-v-19f4cbbe"),e=e(),t.popScopeId(),e),ns=["aria-hidden"],os={key:0,"data-testid":"kui-icon-svg-title"},is=ls(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),ss=t.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:me,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return me}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",os,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),is],8,ns))]),_:1},8,["aria-hidden","style"]))}}),cs=Pe(ss,[["__scopeId","data-v-19f4cbbe"]]),ds={"data-testid":"config-card-title"},hs={class:"config-card-actions"},ps=["href"],us={class:"config-card-details-section"},fs=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"],setup(e,{emit:r}){var a;const l=r,n=e,{i18n:{t:i}}=Z.useI18n(),{getMessageFromError:o}=Z.useErrors(),{convertKeyToTitle:d}=Z.useStringHelpers(),{axiosInstance:c}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),h=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=m=>{p.value=m==null?void 0:m.value},f={id:{type:P.ID,label:i("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:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:P.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:P.BadgeTag,order:-1,section:J.Basic}},s=t.ref(!1),V=t.ref(!1),C=t.ref(""),g=t.ref({}),B=t.computed(()=>{var m,N,I;if(!g.value)return[];const x=[],E=Object.keys(g.value).length;for(const S in g.value){const A=(N=(m=n.configSchema)==null?void 0:m[S])==null?void 0:N.order,q=(I=f[S])==null?void 0:I.order;let $=E;(q||q===0)&&($=q===-1?E+1:q),A&&($=A===-1?E+1:A),x.push([S,$])}return x.sort(function(S,A){return S[1]-A[1]}),x.map(S=>{var A,q;const $=S[0],U=(A=g.value)==null?void 0:A[$],O=((q=n.configSchema)==null?void 0:q[$])||{},j=f[$];return{key:$,value:U,hidden:O.hidden||!1,type:O.type??((j==null?void 0:j.type)||P.Text),label:O.label??((j==null?void 0:j.label)||d($)),tooltip:O.tooltip??((j==null?void 0:j.tooltip)||void 0),section:O.section??((j==null?void 0:j.section)||J.Advanced)}}).filter(S=>!S.hidden&&S.key!==n.pluginConfigKey)}),T=t.computed(()=>{var m,N;if(!g.value||!n.pluginConfigKey)return[];const I=g.value[n.pluginConfigKey]||{},x=Object.keys(I).length,E=[];for(const S in I){const A=(N=(m=n.pluginConfigSchema)==null?void 0:m[S])==null?void 0:N.order,q=I[S];let $=q!=null&&q!==""?x-1:x;A&&($=A===-1?x+1:A),E.push([S,$])}return E.sort(function(S,A){return S[1]-A[1]}),E.map(S=>{var A;const q=S[0],$=I[q],U=((A=n.pluginConfigSchema)==null?void 0:A[q])||{};return{key:q,value:$,hidden:U.hidden||!1,type:U.type??P.Text,label:U.label??d(q),tooltip:U.tooltip??void 0,section:J.Plugin}}).filter(S=>!S.hidden)}),F=t.computed(()=>{var m,N,I,x;return{basic:(m=B.value)==null?void 0:m.filter(E=>E.section===J.Basic),advanced:(N=B.value)==null?void 0:N.filter(E=>E.section===J.Advanced),plugin:(x=T.value)==null?void 0:x.concat((I=B.value)==null?void 0:I.filter(E=>E.section===J.Plugin))}}),_=t.computed(()=>{const m=[];return F.value.basic.length&&m.push("basic"),F.value.advanced.length&&m.push("advanced"),F.value.plugin.length&&m.push("plugin"),m}),w=t.computed(()=>{var m,N;let I=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((m=n.config)==null?void 0:m.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.config.entityId),I});return t.watch(s,m=>{l("loading",m)},{immediate:!0}),t.onBeforeMount(async()=>{V.value=!1,s.value=!0;try{const{data:m}=await c.get(w.value);if(n.dataKey)if(typeof m[n.dataKey]<"u")g.value={...m[n.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:n.dataKey}));else g.value={...m};Object.keys(n.configSchema).filter(N=>n.configSchema[N].forceShow).forEach(N=>{g.value&&typeof g.value[N]>"u"&&(g.value[N]=null)}),l("fetch:success",m)}catch(m){const N=o(m);C.value=N.startsWith("code")?i("baseConfigCard.errors.load"):N,V.value=!0,l("fetch:error",m)}finally{s.value=!1}}),(m,N)=>{const I=t.resolveComponent("KLabel"),x=t.resolveComponent("KSelect"),E=t.resolveComponent("KButton"),S=t.resolveComponent("KSkeleton"),A=t.resolveComponent("KEmptyState"),q=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(q,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",hs,[t.renderSlot(m.$slots,"actions",{},void 0,!0),t.createVNode(I,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(x,{"data-testid":"select-config-format",items:h,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(E,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(Zi),{size:t.unref(Zl)},null,8,["size"])],8,ps)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[s.value?(t.openBlock(),t.createBlock(S,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):V.value?(t.openBlock(),t.createBlock(A,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(C.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",us,[t.createVNode(Di,{config:e.config,"fetcher-url":w.value,format:p.value,"prop-list-types":_.value,"property-collections":F.value,record:g.value},t.createSlots({_:2},[t.renderList(Object.keys(m.$slots),$=>({name:$,fn:t.withCtx(({row:U,rowValue:O})=>[t.renderSlot(m.$slots,$,{row:U,rowValue:O},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",ds,[t.renderSlot(m.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),ms=ne(fs,[["__scopeId","data-v-491f1797"]]),gs={class:"form-actions","data-testid":"form-actions"},ys=t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,i=Qe.useRouter(),{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),f=t.computed(()=>n.canSubmit===!1||n.isReadonly),s=t.ref(!1),V=t.computed(()=>{var _,w;let m=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((_=n.config)==null?void 0:_.controlPlaneId)||""):n.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(w=n.config)!=null&&w.workspace?`/${n.config.workspace}`:"")),n.editId?(m=m.replace(/{id}/gi,n.editId),m):(m=m.replace(/\/{id}/gi,""),m)}),C=()=>{s.value=!s.value},g=()=>{n.config.cancelRoute?i.push(n.config.cancelRoute):B()},B=()=>{l("cancel")},T=()=>{f.value||l("submit")},F=t.ref([{title:o("baseForm.configuration.yaml"),hash:"#yaml"},{title:o("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,_=>{l("loading",_)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{p.value=!1,h.value=!0;const{data:_}=await c.get(V.value);l("fetch:success",_)}catch(_){const w=d(_);u.value=w.startsWith("code")?o("baseForm.errors.edit"):w,p.value=!0,l("fetch:error",_)}finally{h.value=!1}}),(_,w)=>{const m=t.resolveComponent("KSkeleton"),N=t.resolveComponent("KEmptyState"),I=t.resolveComponent("KAlert"),x=t.resolveComponent("KButton"),E=t.resolveComponent("KTabs"),S=t.resolveComponent("KSlideout"),A=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(A,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(m,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(N,{key:1,"action-button-text":t.unref(o)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:g},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(B,["prevent"]),onSubmit:t.withModifiers(T,["prevent"])},[t.renderSlot(_.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(I,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",gs,[t.renderSlot(_.$slots,"form-actions",{},()=>[t.createVNode(x,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:w[0]||(w[0]=q=>C())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.viewConfiguration")),1)]),_:1}),t.createVNode(x,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(x,{appearance:"primary","data-testid":"form-submit",disabled:f.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),t.createVNode(S,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(o)("baseForm.configuration.title"),visible:s.value,onClose:w[1]||(w[1]=q=>C())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("baseForm.configuration.message")),1),t.createVNode(E,{"data-testid":"form-view-configuration-slideout-tabs",tabs:F.value},{json:t.withCtx(()=>[t.createVNode(Ft,{config:e.config,"fetcher-url":V.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(Ua,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),$a=ne(ys,[["__scopeId","data-v-1d932d98"]]),ks={key:0,"data-testid":"first-col"},bs=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const r=e,a=t.computed(()=>{var C;return((C=r.rowEl)==null?void 0:C.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var C;return((C=a.value)==null?void 0:C.querySelector('[data-testid="first-col"]'))||null}),n=t.computed(()=>{var C,g;const B=(C=r.rowEl)==null?void 0:C.querySelectorAll("td");return B?((g=B[0])==null?void 0:g.getAttribute("data-testid"))===r.keyName:!1});let i;const o=()=>{i&&(i.disconnect(),i=void 0)},d=()=>{var C,g,B;h.value=((C=l.value)==null?void 0:C.getBoundingClientRect().width)||0,p.value=((g=a.value)==null?void 0:g.clientWidth)||0,u.value=((B=c.value)==null?void 0:B.innerText)||""},c=t.ref({}),h=t.ref(0),p=t.ref(0),u=t.ref(""),f=t.computed(()=>[l.value,a.value]),s=t.watch(f,C=>{if(n.value&&(o(),"ResizeObserver"in window&&window)){i=new ResizeObserver(g=>{window.requestAnimationFrame(()=>{!Array.isArray(g)||!g.length||d()})});for(const g of C)g&&i.observe(g)}},{immediate:!0,flush:"post",deep:!0}),V=t.computed(()=>n.value?h.value>p.value:!1);return t.onMounted(()=>{d()}),t.onUnmounted(()=>{s()}),(C,g)=>{const B=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[n.value?(t.openBlock(),t.createElementBlock("span",ks,[t.createVNode(B,{"max-width":"300",placement:"bottomStart",text:V.value?u.value:""},{default:t.withCtx(()=>[t.renderSlot(C.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):t.renderSlot(C.$slots,"default",{key:1},void 0,!0)],512)}}}),Cs=ne(bs,[["__scopeId","data-v-c4379fd4"]]),ws={class:"toolbar-container"},Ss={key:0,class:"toolbar-button-container"},_s=["data-testid"],xs=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:r}){const a=e,l=r,{i18n:{t:n}}=Z.useI18n(),i=t.computed(()=>{var w,m;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(w=a.errorMessage)==null?void 0:w.title,message:(m=a.errorMessage)==null?void 0:m.message}}),o=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=w=>w.hasData||!!a.query,c=t.computed(()=>{const w=[];return Object.keys(a.tableHeaders).forEach(m=>{const N=a.tableHeaders[m];w.push({label:N.label??m,key:m,sortable:N.sortable??!1})}),a.enableEntityActions&&w.push({key:"actions",hideLabel:!0}),w}),h=w=>({"data-rowid":w.id,"data-testid":w.name,...a.rowAttributes(w)}),p=t.ref({}),u=w=>{var m;return(m=p.value)==null?void 0:m.$el.querySelector(`[data-rowid="${w.id}"]`)},f=w=>{const m={"data-testid":w.headerKey,...a.cellAttributes(w)};return w.colIndex===0&&(m.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),m},s=()=>{l("empty-state-cta-clicked"),V()},V=()=>{l("clear-search-input")},C=t.computed(()=>a.disableRowClick?void 0:(w,m)=>{l("click:row",m)}),g=w=>{l("sort",w)},{setTablePreferences:B,getTablePreferences:T}=yl(),F=t.computed(()=>{const w=T(a.preferencesStorageKey);return{...a.initialFetcherParams,...w}}),_=w=>{a.preferencesStorageKey&&B(a.preferencesStorageKey,w)};return(w,m)=>{const N=t.resolveComponent("KIcon"),I=t.resolveComponent("KButton"),x=t.resolveComponent("KDropdown"),E=t.resolveComponent("KTable"),S=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(S,{class:"kong-ui-entity-base-table",title:e.title},{default:t.withCtx(()=>[t.createVNode(E,{ref_key:"tableRefs",ref:p,"cache-identifier":o.value,"cell-attrs":f,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":i.value.message,"error-state-title":i.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":i.value.hasError,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":F.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":h,"search-input":e.query,onKtableEmptyStateCtaClicked:s,"onRow:click":C.value,onSort:m[0]||(m[0]=A=>g(A)),"onUpdate:tablePreferences":_},t.createSlots({toolbar:t.withCtx(({state:A})=>[t.withDirectives(t.createElementVNode("div",ws,[t.renderSlot(w.$slots,"toolbar-filter",{},void 0,!0),w.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Ss,[t.renderSlot(w.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(A)]])]),actions:t.withCtx(({row:A,rowKey:q,rowValue:$})=>[t.createElementVNode("div",{class:"actions-container","data-testid":A.name},[t.createVNode(x,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(w.$slots,"actions",{row:A,rowKey:q,rowValue:$},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(I,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(N,{color:t.unref(Wl),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,_s)]),_:2},[t.renderList(e.tableHeaders,(A,q)=>({name:q,fn:t.withCtx(({row:$,rowKey:U,rowValue:O})=>[t.createVNode(Cs,{"key-name":String(q),"row-el":u($)},{default:t.withCtx(()=>[t.renderSlot(w.$slots,q,{row:$,rowKey:U,rowValue:O},()=>[t.createTextVNode(t.toDisplayString(O),1)],!0)]),_:2},1032,["key-name","row-el"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(Ri))]),key:"0"}]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","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"])}}}),Da=ne(xs,[["__scopeId","data-v-273124cf"]]),Ns={key:0,class:"kong-ui-entity-delete-error"},Vs={key:1,class:"description"},Is=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:r}){const{i18nT:a}=Z.useI18n(),l=e,n=r,i=t.computed(()=>l.needConfirm?l.entityName:""),o=()=>{n("cancel")},d=()=>{n("proceed")};return(c,h)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":i.value,title:e.title,visible:e.visible,onCancel:o,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Ns,[t.createVNode(p,{appearance:"danger"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Vs,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Ma=ne(Is,[["__scopeId","data-v-4361d622"]]),Bs={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},As={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Ts=["fill"],Es={mask:"url(#mask0_180_20349)"},Hs=["fill"],ja=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${zl})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Bs,[t.createElementVNode("mask",As,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Ts)]),t.createElementVNode("g",Es,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Hs)])]))}}),vs={key:1,class:"kong-ui-entity-filter"},Fs={class:"kong-ui-entity-filter-menu"},qs=["data-testid"],Os=["onClick","onKeydown"],Us={class:"menu-item-indicator"},$s={class:"menu-item-body"},Ds=["for"],Ms={class:"menu-item-buttons"},js={class:"filter-clear-button-container"},Ks=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:r}){const{i18n:{t:a}}=Z.useI18n(),l=e,n=r,i=t.ref(!1),o=t.ref({}),d=t.ref(new Set),c=t.computed(()=>{const _=[];return new URLSearchParams(l.modelValue).forEach((w,m)=>{w!==""&&_.push(m)}),_}),h=t.computed(()=>{const _=l.config.fields;return Object.keys(_).filter(w=>_[w].searchable).map(w=>({label:_[w].label||w,value:w,expanded:!1}))});t.watch(()=>l.modelValue,_=>{o.value={},new URLSearchParams(_).forEach((w,m)=>{o.value[m]=w})});const p=()=>{i.value=!i.value},u=_=>{d.value.has(_)?d.value.delete(_):d.value.add(_)},f=_=>{n("update:modelValue",_)},s=()=>{f("")},V=_=>`filter-${_}`,C=_=>{var w,m;return(((m=(w=l.config.schema)==null?void 0:w[_])==null?void 0:m.values)??[]).map(N=>({value:N,label:N}))},g=_=>{var w,m;return((m=(w=l.config.schema)==null?void 0:w[_])==null?void 0:m.type)??"text"},B=_=>{o.value={...o.value,[_]:""},F()},T=()=>{o.value={},F(!0)},F=(_=!1)=>{const w=Object.keys(o.value).reduce((m,N)=>(o.value[N]&&(m[N]=`${o.value[N]}`),m),{});_&&(i.value=!1),n("update:modelValue",new URLSearchParams(w).toString())};return(_,w)=>{const m=t.resolveComponent("KInput"),N=t.resolveComponent("KButton"),I=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(m,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":f},{before:t.withCtx(()=>[t.createVNode(ja)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(cs),{class:"kong-ui-entity-filter-clear",onClick:s},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",vs,[t.createVNode(N,{appearance:"tertiary","data-testid":"filter-button",onClick:p},{default:t.withCtx(()=>[t.createVNode(ja),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:p},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createElementVNode("div",Fs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,x=>{var E,S;return t.openBlock(),t.createElementBlock("div",{key:x.value,class:"kong-ui-entity-filter-menu-item","data-testid":x.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:d.value.has(x.value)}]),role:"button",tabindex:"0",onClick:A=>u(x.value),onKeydown:t.withKeys(A=>u(x.value),["enter"])},[t.createTextVNode(t.toDisplayString(x.label)+" ",1),t.withDirectives(t.createElementVNode("span",Us,null,512),[[t.vShow,c.value.includes(x.value)]]),t.createVNode(t.unref(rs),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:d.value.has(x.value)}]),color:t.unref(Ql)},null,8,["class","color"])],42,Os),t.withDirectives(t.createElementVNode("div",$s,[t.createElementVNode("label",{class:"menu-item-label",for:V(x.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,Ds),((S=(E=e.config.schema)==null?void 0:E[x.value])==null?void 0:S.type)==="select"?(t.openBlock(),t.createBlock(I,{key:0,id:V(x.value),modelValue:o.value[x.value],"onUpdate:modelValue":A=>o.value[x.value]=A,items:C(x.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(m,{key:1,id:V(x.value),modelValue:o.value[x.value],"onUpdate:modelValue":A=>o.value[x.value]=A,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:g(x.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,d.value.has(x.value)]]),t.withDirectives(t.createElementVNode("div",Ms,[t.createVNode(N,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:w[0]||(w[0]=A=>F(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(N,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:A=>B(x.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,d.value.has(x.value)]])],8,qs)}),128)),t.createElementVNode("div",js,[t.createVNode(N,{appearance:"tertiary",size:"small",onClick:T},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,i.value]])]))}}}),Ps=ne(Ks,[["__scopeId","data-v-8cfadde3"]]),ce=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,i)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Ls={class:"form-section-wrapper"},Rs={key:0,class:"form-section-title"},zs={key:1,class:"form-section-description"},Js={key:2,class:"form-section-footer"},Ws={class:"form-section-content"},Qs=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 r=t.useSlots();return(a,l)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Ls,[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",Rs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",zs,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",Js,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",Ws,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),Fe=ne(Qs,[["__scopeId","data-v-3565daa7"]]),{useAxios:Le,useDeleteUrlBuilder:Ka,useErrors:Pa,useExternalLinkCreator:Rc,useFetchUrlBuilder:zc,useFetcher:La,useDebouncedFilter:Ra,useStringHelpers:Jc,useHelpers:Ys,useGatewayFeatureSupported:Wc,useTruncationDetector:Qc}=Z,Zs={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 Gs(){const e=Oe.createI18n("en-us",Zs);return{i18n:e,i18nT:Oe.i18nTComponent(e)}}function qe(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,i)=>{if(i){const o={...n};r&&(o.value=n.label),a.value.push(o)}else a.value=a.value.filter(o=>o.value!==n.value)}}}const Re=[{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"}],ft=10,mt=65536,Xs=0,ec=65535,_e=0,xe=255,za=0,Ja=255,tc=0,ac=65535,Wa=0,Qa=65535,rc=0,lc=2**31,gt=["200","302"],yt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],kt=["429","404","500","501","502","503","504","505"],bt=["429","500","503"];function ze(){const e=c=>/^\d+$/.test(c),r=(c,h,p)=>{if(e(c)){const u=Number(c);return u>=h&&u<=p}else return!1},a=c=>c.map(h=>Number(h)),l=c=>c.map(h=>h.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:gt,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:kt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:yt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:bt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,f,s,V,C,g,B,T,F,_,w,m,N,I,x,E,S,A,q,$,U,O,j,Y,v,D,K,k,y,b,R,M,z,X,L,te,ye,Be,Za,Ga,Xa,er,tr,ar,rr,lr,nr,or,ir,sr,cr,dr,hr,pr,ur,fr,mr,gr,yr,kr,br,Cr,wr,Sr,_r,xr,Nr,Vr,Ir,Br,Ar,Tr,Er,Hr,vr,Fr,qr,Or,Ur,$r,Dr,Mr,jr,Kr,Pr,Lr,Rr,zr,Jr,Wr,Qr,Yr,Zr,Gr,Xr,el,tl,al,rl,ll,nl,ol,il,sl,cl,dl,hl,pl;const h=n();return h.name=c.name||"",h.algorithm=c.algorithm||"round-robin",h.hostHeader=c.host_header||"",h.clientCertificate=c.client_certificate?(p=c.client_certificate)==null?void 0:p.id:"",h.tags=((u=c.tags)==null?void 0:u.join(", "))||"",h.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",h.hashOn=c.hash_on||"none",h.hashFallback=c.hash_fallback||"none",h.hashOnHeader=c.hash_on_header||"",h.hashOnCookie=c.hash_on_cookie||"",h.hashOnCookiePath=c.hash_on_cookie_path||"/",h.hashOnQueryArgument=c.hash_on_query_arg||"",h.hashOnUriCapture=c.hash_on_uri_capture||"",h.hashFallbackHeader=c.hash_fallback_header||"",h.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",h.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",h.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",h.activeHealthSwitch=((s=(f=c.healthchecks.active)==null?void 0:f.healthy)==null?void 0:s.interval)!==0||((C=(V=c.healthchecks.active)==null?void 0:V.unhealthy)==null?void 0:C.interval)!==0,h.activeHealthCheck.type=((g=c.healthchecks.active)==null?void 0:g.type)||"http",h.activeHealthCheck.httpPath=((B=c.healthchecks.active)==null?void 0:B.http_path)||"/",h.activeHealthCheck.timeout=((T=c.healthchecks.active)==null?void 0:T.timeout)!==null&&((F=c.healthchecks.active)==null?void 0:F.timeout)!==void 0?(w=(_=c.healthchecks.active)==null?void 0:_.timeout)==null?void 0:w.toString():"",h.activeHealthCheck.concurrency=((m=c.healthchecks.active)==null?void 0:m.concurrency)!==null&&((N=c.healthchecks.active)==null?void 0:N.concurrency)!==void 0?(x=(I=c.healthchecks.active)==null?void 0:I.concurrency)==null?void 0:x.toString():"",h.activeHealthCheck.httpsSni=((E=c.healthchecks.active)==null?void 0:E.https_sni)||"",h.activeHealthCheck.verifySsl=((S=c.healthchecks.active)==null?void 0:S.https_verify_certificate)||!1,h.activeHealthCheck.headers=(A=c.healthchecks.active)!=null&&A.headers&&Object.entries((q=c.healthchecks.active)==null?void 0:q.headers).length>0?Object.entries(($=c.healthchecks.active)==null?void 0:$.headers).map(([Lc,Ct])=>({key:Lc,values:Ct==null?void 0:Ct.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((O=(U=c.healthchecks.active)==null?void 0:U.healthy)==null?void 0:O.interval)!==null&&((Y=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:Y.interval)!==void 0?(K=(D=(v=c.healthchecks.active)==null?void 0:v.healthy)==null?void 0:D.interval)==null?void 0:K.toString():"0",h.activeHealthCheck.interval=((y=(k=c.healthchecks.active)==null?void 0:k.healthy)==null?void 0:y.interval)!==null&&((R=(b=c.healthchecks.active)==null?void 0:b.healthy)==null?void 0:R.interval)!==void 0?(X=(z=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:z.interval)==null?void 0:X.toString():"0",h.activeHealthCheck.successes=((te=(L=c.healthchecks.active)==null?void 0:L.healthy)==null?void 0:te.successes)!==null&&((Be=(ye=c.healthchecks.active)==null?void 0:ye.healthy)==null?void 0:Be.successes)!==void 0?(Xa=(Ga=(Za=c.healthchecks.active)==null?void 0:Za.healthy)==null?void 0:Ga.successes)==null?void 0:Xa.toString():"0",h.activeHealthCheck.httpStatuses=(tr=(er=c.healthchecks.active)==null?void 0:er.healthy)!=null&&tr.http_statuses?l(((rr=(ar=c.healthchecks.active)==null?void 0:ar.healthy)==null?void 0:rr.http_statuses)||[]):gt,h.activeHealthCheck.unhealthyInterval=((nr=(lr=c.healthchecks.active)==null?void 0:lr.unhealthy)==null?void 0:nr.interval)!==null&&((ir=(or=c.healthchecks.active)==null?void 0:or.unhealthy)==null?void 0:ir.interval)!==void 0?(dr=(cr=(sr=c.healthchecks.active)==null?void 0:sr.unhealthy)==null?void 0:cr.interval)==null?void 0:dr.toString():"0",h.activeHealthCheck.httpFailures=((pr=(hr=c.healthchecks.active)==null?void 0:hr.unhealthy)==null?void 0:pr.http_failures)!==null&&((fr=(ur=c.healthchecks.active)==null?void 0:ur.unhealthy)==null?void 0:fr.http_failures)!==void 0?(yr=(gr=(mr=c.healthchecks.active)==null?void 0:mr.unhealthy)==null?void 0:gr.http_failures)==null?void 0:yr.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((br=(kr=c.healthchecks.active)==null?void 0:kr.unhealthy)==null?void 0:br.timeouts)!==null&&((wr=(Cr=c.healthchecks.active)==null?void 0:Cr.unhealthy)==null?void 0:wr.timeouts)!==void 0?(xr=(_r=(Sr=c.healthchecks.active)==null?void 0:Sr.unhealthy)==null?void 0:_r.timeouts)==null?void 0:xr.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(Vr=(Nr=c.healthchecks.active)==null?void 0:Nr.unhealthy)!=null&&Vr.http_statuses?l(((Br=(Ir=c.healthchecks.active)==null?void 0:Ir.unhealthy)==null?void 0:Br.http_statuses)||[]):kt,h.passiveHealthSwitch=((Tr=(Ar=c.healthchecks.passive)==null?void 0:Ar.healthy)==null?void 0:Tr.successes)!==0||((Hr=(Er=c.healthchecks.passive)==null?void 0:Er.unhealthy)==null?void 0:Hr.timeouts)!==0||((Fr=(vr=c.healthchecks.passive)==null?void 0:vr.unhealthy)==null?void 0:Fr.tcp_failures)!==0||((Or=(qr=c.healthchecks.passive)==null?void 0:qr.unhealthy)==null?void 0:Or.http_failures)!==0,h.passiveHealthCheck.type=((Ur=c.healthchecks.passive)==null?void 0:Ur.type)||"http",h.passiveHealthCheck.successes=((Dr=($r=c.healthchecks.passive)==null?void 0:$r.healthy)==null?void 0:Dr.successes)!==null&&((jr=(Mr=c.healthchecks.passive)==null?void 0:Mr.healthy)==null?void 0:jr.successes)!==void 0?(Lr=(Pr=(Kr=c.healthchecks.passive)==null?void 0:Kr.healthy)==null?void 0:Pr.successes)==null?void 0:Lr.toString():"0",h.passiveHealthCheck.httpStatuses=(zr=(Rr=c.healthchecks.passive)==null?void 0:Rr.healthy)!=null&&zr.http_statuses?l(((Wr=(Jr=c.healthchecks.passive)==null?void 0:Jr.healthy)==null?void 0:Wr.http_statuses)||[]):yt,h.passiveHealthCheck.timeouts=((Yr=(Qr=c.healthchecks.passive)==null?void 0:Qr.unhealthy)==null?void 0:Yr.timeouts)!==null&&((Gr=(Zr=c.healthchecks.passive)==null?void 0:Zr.unhealthy)==null?void 0:Gr.timeouts)!==void 0?(tl=(el=(Xr=c.healthchecks.passive)==null?void 0:Xr.unhealthy)==null?void 0:el.timeouts)==null?void 0:tl.toString():"0",h.passiveHealthCheck.tcpFailures=((rl=(al=c.healthchecks.passive)==null?void 0:al.unhealthy)==null?void 0:rl.tcp_failures)!==null&&((nl=(ll=c.healthchecks.passive)==null?void 0:ll.unhealthy)==null?void 0:nl.tcp_failures)!==void 0?(sl=(il=(ol=c.healthchecks.passive)==null?void 0:ol.unhealthy)==null?void 0:il.tcp_failures)==null?void 0:sl.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(dl=(cl=c.healthchecks.passive)==null?void 0:cl.unhealthy)!=null&&dl.http_statuses?l(((pl=(hl=c.healthchecks.passive)==null?void 0:hl.unhealthy)==null?void 0:pl.http_statuses)||[]):bt,h},getDefaultUpstreamFields:n,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const de={useI18n:Gs,useMultiselectCreation:qe,useHelpers:ze},Ne="/api/runtime_groups/{controlPlaneId}",Ve="/{workspace}",Ie={list:{konnect:`${Ne}/upstreams`,kongManager:`${Ve}/upstreams`},form:{konnect:{getServices:`${Ne}/services`,getCertificates:`${Ne}/certificates`,validate:`${Ne}/v1/schemas/json/upstream/validate`,create:`${Ne}/upstreams`,edit:`${Ne}/upstreams/{id}`},kongManager:{getServices:`${Ve}/services`,getCertificates:`${Ve}/certificates`,validate:`${Ve}/schemas/upstreams/validate`,create:`${Ve}/upstreams`,edit:`${Ve}/upstreams/{id}`}}},nc={class:"kong-ui-entities-upstreams-list"},oc={class:"upstream-name"},ic=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:r}){var Y;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),i=Qe.useRouter(),{axiosInstance:o}=Le({headers:(Y=l.config)==null?void 0:Y.requestHeaders}),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var D,K;let v=`${l.config.apiBaseUrl}${Ie.list[l.config.app]}`;return l.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((D=l.config)==null?void 0:D.controlPlaneId)||""):l.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(K=l.config)!=null&&K.workspace?`/${l.config.workspace}`:"")),v}),f=t.ref(""),s=t.computed(()=>{const v=l.config.app==="konnect"||l.config.isExactMatch;if(v)return{isExactMatch:v,placeholder:n("upstreams.search.placeholder")};const{name:D,slots:K}=h;return{isExactMatch:v,fields:{name:D,slots:K},schema:l.config.filterSchema}}),{fetcher:V,fetcherState:C}=La(l.config,u.value),g=()=>{f.value=""},B=()=>{d.value++},T=t.ref(null),F=(v,D)=>{const K=v.id;if(!D(K)){a("copy:error",{entity:v,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:v,field:"id",message:n("upstreams.copy.success",{val:K})})},_=(v,D)=>{const K=JSON.stringify(v);if(!D(K)){a("copy:error",{entity:v,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:v,message:n("upstreams.copy.success_brief")})},w=async v=>{var K;await((K=l.canRetrieve)==null?void 0:K.call(l,v))&&i.push(l.config.getViewRoute(v.id))},m=v=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(v)}),N=v=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(v)}),I=t.ref(void 0),x=t.ref(!1),E=t.ref(!1),S=t.ref(""),A=Ka(l.config,u.value),q=v=>{I.value=v,x.value=!0},$=()=>{x.value=!1},U=async()=>{var v,D,K;if((v=I.value)!=null&&v.id){E.value=!0;try{await o.delete(A(I.value.id)),E.value=!1,x.value=!1,d.value++,a("delete:success",I.value)}catch(k){S.value=((K=(D=k.response)==null?void 0:D.data)==null?void 0:K.message)||k.message||n("upstreams.errors.delete"),a("error",k)}finally{E.value=!1}}},O=t.ref(!0);t.watch(C,v=>{var D,K,k,y;if(Array.isArray((D=v==null?void 0:v.response)==null?void 0:D.data)&&(O.value=v.response.data.length>0),v.status===pe.Error){T.value={title:n("upstreams.errors.general")},(y=(k=(K=v.error)==null?void 0:K.response)==null?void 0:k.data)!=null&&y.message&&(T.value.message=v.error.response.data.message),a("error",v.error);return}T.value=null});const j=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(j.value.title=n("upstreams.list.empty_state.title"),j.value.ctaText=n("upstreams.actions.create"))}),(v,D)=>{const K=t.resolveComponent("KButton"),k=t.resolveComponent("KBadge"),y=t.resolveComponent("KTruncate"),b=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",nc,[t.createVNode(t.unref(Da),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":T.value,fetcher:t.unref(V),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:f.value,"table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onClearSearchInput:g,"onClick:row":D[1]||(D[1]=M=>w(M)),onSort:B},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Ps),{modelValue:f.value,"onUpdate:modelValue":D[0]||(D[0]=M=>f.value=M),config:s.value},null,8,["modelValue","config"])]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:t.withCtx(()=>[t.createVNode(t.unref(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,O.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),name:t.withCtx(({rowValue:M})=>[t.createElementVNode("span",oc,t.toDisplayString(M),1)]),tags:t.withCtx(({rowValue:M})=>[t.createVNode(y,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M,z=>(t.openBlock(),t.createBlock(k,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:M})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:X=>F(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:X=>_(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canRetrieve(M)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:m(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(M)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-edit",item:N(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(M)},{default:t.withCtx(()=>[t.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>q(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(Ma),{"action-pending":E.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":I.value&&(I.value.name||I.value.id),"entity-type":t.unref(Ye).Upstream,error:S.value,title:t.unref(n)("upstreams.delete.title"),visible:x.value,onCancel:$,onProceed:U},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),he=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},sc=he(ic,[["__scopeId","data-v-8833eb77"]]),Je={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"}}},cc={class:"kong-ui-entities-target-form"},dc={class:"target-form-container"},hc={key:0,class:"target-form-info"},Ya=he(t.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var w;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{getMessageFromError:i}=Pa(),{axiosInstance:o}=Le({headers:(w=l.config)==null?void 0:w.requestHeaders}),d=t.computed(()=>{var m;return Je.form[l.config.app].edit.replace(/{upstreamId}/gi,((m=l.config)==null?void 0:m.upstreamId)||"")}),c=t.computed(()=>l.targetId?oe.Edit:oe.Create),h=t.computed(()=>c.value===oe.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),p=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),f={target:"",weight:100,tags:""},s=t.computed(()=>{const m=parseInt(p.fields.weight.toString(),10);return m<0||m>65535}),V=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),C=m=>{var N;p.fields.target=(m==null?void 0:m.target)||"",p.fields.weight=(m==null?void 0:m.weight)??"",p.fields.tags=((N=m==null?void 0:m.tags)==null?void 0:N.join(", "))||"",Object.assign(u,p.fields)},g=()=>{p.errorMessage="",a("cancel")},B=t.computed(()=>{var N,I;let m=`${l.config.apiBaseUrl}${Je.form[l.config.app].validate}`;return l.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((N=l.config)==null?void 0:N.controlPlaneId)||""):l.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(I=l.config)!=null&&I.workspace?`/${l.config.workspace}`:"")),m=m.replace(/{id}/gi,l.targetId),m}),T=t.computed(()=>{var N,I,x,E;let m=`${l.config.apiBaseUrl}${Je.form[l.config.app][c.value]}`;return l.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((N=l.config)==null?void 0:N.controlPlaneId)||"").replace(/{upstreamId}/gi,((I=l.config)==null?void 0:I.upstreamId)||""):l.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(x=l.config)!=null&&x.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((E=l.config)==null?void 0:E.upstreamId)||"")),m=m.replace(/{id}/gi,l.targetId),m}),F=t.computed(()=>{var m,N,I;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(I=(N=(m=p.fields.tags)==null?void 0:m.split(","))==null?void 0:N.map(x=>String(x||"").trim()))==null?void 0:I.filter(x=>x!==""),upstream:{id:l.config.upstreamId}}}),_=async()=>{var m,N;try{p.isReadonly=!0,p.errorMessage="";let I;if(await o.post(B.value,F.value),c.value==="create"?I=await o.post(T.value,F.value):c.value==="edit"&&(I=((m=l.config)==null?void 0:m.app)==="konnect"?await o.put(T.value,F.value):await o.patch(T.value,F.value)),I){const{data:x}=I;p.fields.target=(x==null?void 0:x.name)||"",p.fields.weight=(x==null?void 0:x.weight)??100,p.fields.tags=((N=x==null?void 0:x.tags)==null?void 0:N.join(", "))||"",a("update",x),Object.assign(p.fields,f)}}catch(I){p.errorMessage=i(I),a("error",I)}finally{p.isReadonly=!1}};return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,f)}),(m,N)=>{const I=t.resolveComponent("KInput"),x=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(x,{"action-button-disabled":!V.value||p.isReadonly,"action-button-text":t.unref(n)("targets.form.buttons.save"),"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),title:h.value,visible:e.isVisible,onCancel:g,onProceed:_},{default:t.withCtx(()=>[t.createElementVNode("div",cc,[t.createVNode(t.unref($a),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":F.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":N[3]||(N[3]=E=>m.$emit("error",E)),"onFetch:success":C,onLoading:N[4]||(N[4]=E=>m.$emit("loading",E))},{default:t.withCtx(()=>[t.createElementVNode("div",dc,[m.$slots.info?(t.openBlock(),t.createElementBlock("div",hc,[t.renderSlot(m.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(I,{modelValue:p.fields.target,"onUpdate:modelValue":N[0]||(N[0]=E=>p.fields.target=E),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(I,{modelValue:p.fields.weight,"onUpdate:modelValue":N[1]||(N[1]=E=>p.fields.weight=E),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:p.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(I,{modelValue:p.fields.tags,"onUpdate:modelValue":N[2]||(N[2]=E=>p.fields.tags=E),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-1d864e54"]]),pc={class:"kong-ui-entities-targets-list"},uc={class:"target-address"},fc=he(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var K;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{axiosInstance:i}=Le({headers:(K=l.config)==null?void 0:K.requestHeaders}),o=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:n("targets.list.table_headers.target_address"),sortable:!0},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var y,b,R,M;let k=`${l.config.apiBaseUrl}${Je.list[l.config.app]}`;return l.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((y=l.config)==null?void 0:y.controlPlaneId)||"").replace(/{upstreamId}/gi,((b=l.config)==null?void 0:b.upstreamId)||""):l.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(R=l.config)!=null&&R.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((M=l.config)==null?void 0:M.upstreamId)||"")),k}),{fetcher:u,fetcherState:f}=La(l.config,p.value),s=()=>{o.value++},V=t.ref(null),C=()=>{j.value=!0},g=(k,y)=>{const b=k.id;if(!y(b)){a("copy:error",{entity:k,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:k,field:"id",message:n("targets.copy.success",{val:b})})},B=(k,y)=>{const b=JSON.stringify(k);if(!y(b)){a("copy:error",{entity:k,message:n("targets.errors.copy")});return}a("copy:success",{entity:k,message:n("targets.copy.success_brief")})},T=k=>{O.value=k,j.value=!0},F=k=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(k),_=k=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(k),w=t.ref(void 0),m=t.ref(!1),N=t.ref(!1),I=t.ref(""),x=Ka(l.config,p.value),E=k=>{w.value=k,m.value=!0},S=()=>{m.value=!1},A=async()=>{var k,y,b;if((k=w.value)!=null&&k.id){N.value=!0;try{await i.delete(x(w.value.id)),N.value=!1,m.value=!1,o.value++,a("delete:success",w.value)}catch(R){I.value=((b=(y=R.response)==null?void 0:y.data)==null?void 0:b.message)||R.message||n("targets.errors.delete"),a("error",R)}finally{N.value=!1}}},q=t.ref(!0);t.watch(f,k=>{var y,b,R,M;if(Array.isArray((y=k==null?void 0:k.response)==null?void 0:y.data)&&(q.value=k.response.data.length>0),k.status===pe.Error){V.value={title:n("targets.errors.general")},(M=(R=(b=k.error)==null?void 0:b.response)==null?void 0:R.data)!=null&&M.message&&(V.value.message=k.error.response.data.message),a("error",k.error);return}V.value=null});const $=t.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&($.value.title=n("targets.list.empty_state.title"),$.value.ctaText=n("targets.actions.create"))});const U=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace,requestHeaders:l.config.requestHeaders}})),O=t.ref(""),j=t.ref(!1),Y=k=>{O.value?a("update:target",k):a("create:target",k),v()},v=()=>{D(),o.value++},D=()=>{j.value=!1,O.value=""};return(k,y)=>{const b=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),M=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),X=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",pc,[t.createVNode(t.unref(Da),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":$.value,"enable-entity-actions":"","error-message":V.value,fetcher:t.unref(u),"fetcher-cache-key":o.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:y[1]||(y[1]=()=>l.config.createRoute?void 0:C()),onSort:s},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:t.withCtx(()=>[t.createVNode(t.unref(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(b,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:l.config.createRoute?l.config.createRoute:void 0,onClick:y[0]||(y[0]=()=>l.config.createRoute?void 0:C())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,q.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),target:t.withCtx(({rowValue:L})=>[t.createElementVNode("span",uc,t.toDisplayString(L),1)]),tags:t.withCtx(({rowValue:L})=>[t.createVNode(M,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(L,te=>(t.openBlock(),t.createBlock(R,{key:te,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(te),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:L})=>[t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:ye=>g(L,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:ye=>B(L,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:te=>T(L.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>F(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:te=>a("health-actions:healthy",L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>_(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:te=>a("health-actions:unhealthy",L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(L)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:te=>E(L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(Ma),{"action-pending":N.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(Ye).Target,error:I.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:m.value,onCancel:S,onProceed:A},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Ya,{config:U.value,"is-visible":j.value,"target-id":O.value,onCancel:D,onUpdate:Y},t.createSlots({_:2},[k.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(k.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-d258bcd3"]]),mc={key:1},gc=he(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var S,A,q,$;const{i18nT:a,i18n:{t:l}}=de.useI18n(),n=e,i=r,{debouncedQueryChange:o,loading:d,loadItems:c,results:h,allRecords:p}=Ra(n.config,(A=Ie.form[(S=n.config)==null?void 0:S.app])==null?void 0:A.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:s,results:V}=Ra(n.config,($=Ie.form[(q=n.config)==null?void 0:q.app])==null?void 0:$.getCertificates),C=t.ref(""),g=t.computed(()=>{var U;return!!n.name&&!((U=p.value)!=null&&U.some(O=>O.host===n.name))}),B=t.computed(()=>{var O,j,Y;const U=g.value&&n.name.includes((O=C.value)==null?void 0:O.toLowerCase());return(Y=h.value)==null?void 0:Y.map(v=>({label:v.host,value:v.id})).concat(U?[{label:n.name,value:((j=_.value)==null?void 0:j.value)||n.name}]:[])}),T=t.computed(()=>{var U;return(U=V.value)==null?void 0:U.map(O=>({label:O.id,value:O.id}))}),F=t.ref(""),_=t.ref({value:"",label:""}),w=t.computed(()=>{var U,O;return((U=B.value.find(j=>j.value===F.value))==null?void 0:U.label)||((O=_.value)==null?void 0:O.label)}),m=U=>{C.value=U,o(U)},N=U=>{_.value=U},I=()=>{_.value={value:"",label:""}},x=U=>{F.value=U,i("update:name",w.value)},E=t.ref(!1);return t.onBeforeMount(async()=>{var U,O;try{E.value=!0,await c(),n.name&&(F.value=((O=(U=B.value.find(j=>j.label===n.name))==null?void 0:U.value)==null?void 0:O.toString())||n.name),await s()}finally{E.value=!1}}),(U,O)=>{const j=t.resolveComponent("KSkeleton"),Y=t.resolveComponent("KSelect"),v=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[E.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",mc,[t.createVNode(Y,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:B.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":F.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:N,onItemRemoved:I,onQueryChange:m,"onUpdate:modelValue":x},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(v,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":O[0]||(O[0]=D=>i("update:host-header",D))},null,8,["label","model-value","readonly"]),t.createVNode(Y,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:T.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(f),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":O[1]||(O[1]=D=>i("update:client-certificate",D))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(v,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":O[2]||(O[2]=D=>i("update:tags",D))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),We={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},yc={class:"fields-group-title"},kc={class:"fields-group-text"},bc={class:"fields-group-title"},Cc={class:"fields-group-text"},wc=he(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=de.useI18n(),{inRange:n}=ze(),i=e,o=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>i.hashOn,(u,f)=>{f==="header"&&u!==f&&o("update:hash-on-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(o("update:hash-fallback","none"),o("update:hash-fallback-header",""),o("update:hash-fallback-query-argument",""),o("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,f)=>{f==="header"&&u!==f&&o("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?n(i.slots,ft,mt)?"":l("upstreams.form.errors.in_range"):"");return(u,f)=>{const s=t.resolveComponent("KExternalLink"),V=t.resolveComponent("KSelect"),C=t.resolveComponent("KInput"),g=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(We).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(V,{class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=B=>o("update:algorithm",B))},null,8,["items","label","model-value","readonly"]),t.createVNode(C,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(mt),min:t.unref(ft),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":f[1]||(f[1]=B=>o("update:slots",B))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",yc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",kc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(V,{class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[2]||(f[2]=B=>o("update:hash-on",B))},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(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[3]||(f[3]=B=>o("update:hash-on-header",B))},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(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[4]||(f[4]=B=>o("update:hash-on-cookie",B))},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(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[5]||(f[5]=B=>o("update:hash-on-cookie-path",B))},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(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[6]||(f[6]=B=>o("update:hash-on-query-argument",B))},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(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[7]||(f[7]=B=>o("update:hash-on-uri-capture",B))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",bc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",Cc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(V,{class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[8]||(f[8]=B=>o("update:hash-fallback",B))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[9]||(f[9]=B=>o("update:hash-fallback-header",B))},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(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[10]||(f[10]=B=>o("update:hash-on-cookie",B))},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(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[11]||(f[11]=B=>o("update:hash-on-cookie-path",B))},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(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[12]||(f[12]=B=>o("update:hash-fallback-query-argument",B))},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(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[13]||(f[13]=B=>o("update:hash-fallback-uri-capture",B))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),Sc={class:"fields-group-title"},_c={class:"fields-group-text"},xc={class:"fields-group-title"},Nc={class:"fields-group-text"},Vc=he(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=r;return(n,i)=>{const o=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(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(o,{"hide-icon":"",href:t.unref(We).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Sc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",_c,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:i[0]||(i[0]=p=>l("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",xc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",Nc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:i[1]||(i[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(ec),min:t.unref(Xs),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),Ic={key:2},Bc={class:"fields-group-title"},Ac={class:"fields-group-text"},Tc={class:"fields-group-title"},Ec={class:"fields-group-text"},Hc=he(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),{objectsAreEqual:l}=ze(),n=e,i=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:h}=qe({replaceId:!0}),{trackNewItems:p}=qe({replaceId:!0});t.watch(()=>n.type,(C,g)=>{g==="tcp"&&C!==g&&i("update:tcp-failures","5"),(g==="https"||g==="grpcs")&&C!==g&&(i("update:https-sni",""),i("update:verify-ssl",!1)),g!=="tcp"&&C==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",gt),i("update:unhealthy-http-statuses",kt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,C=>{l(u.value,C)||(u.value=[...C])},{immediate:!0,deep:!0});const f=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),f()},V=C=>{C===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(C,1),f()};return(C,g)=>{const B=t.resolveComponent("KExternalLink"),T=t.resolveComponent("KSelect"),F=t.resolveComponent("KInput"),_=t.resolveComponent("KCheckbox"),w=t.resolveComponent("KLabel"),m=t.resolveComponent("KIcon"),N=t.resolveComponent("KButton"),I=t.resolveComponent("KMultiselect"),x=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(B,{"hide-icon":"",href:t.unref(We).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var E;return[t.createVNode(T,{class:"active-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":g[0]||(g[0]=S=>i("update:type",S))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(F,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":g[1]||(g[1]=S=>i("update:http-path",S))},null,8,["label","model-value","readonly"])),t.createVNode(F,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(ac),min:t.unref(tc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":g[2]||(g[2]=S=>i("update:timeout",S))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(F,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(lc),min:t.unref(rc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":g[3]||(g[3]=S=>i("update:concurrency",S))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(F,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":g[4]||(g[4]=S=>i("update:https-sni",S))},null,8,["label","model-value","readonly"]),t.createVNode(_,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":g[5]||(g[5]=S=>i("update:verify-ssl",S))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((E=e.config)==null?void 0:E.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",Ic,[t.createVNode(w,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(S,A)=>(t.openBlock(),t.createElementBlock("div",{key:`${S.header}_${A}`,class:t.normalizeClass(["headers-row",{"margin-top-6":A>0}])},[t.createVNode(F,{modelValue:u.value[A].key,"onUpdate:modelValue":q=>u.value[A].key=q,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${A+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(F,{modelValue:u.value[A].values,"onUpdate:modelValue":q=>u.value[A].values=q,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${A+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(N,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:q=>V(A)},{icon:t.withCtx(()=>[t.createVNode(m,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&A===u.value.length-1?(t.openBlock(),t.createBlock(N,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:s},{icon:t.withCtx(()=>[t.createVNode(m,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Bc,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Ac,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(F,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Qa),min:t.unref(Wa),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[6]||(g[6]=S=>i("update:interval",S))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(F,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(xe),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":g[7]||(g[7]=S=>i("update:successes",S))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Re),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[8]||(g[8]=S=>t.unref(h)(S,!0)),onItemRemoved:g[9]||(g[9]=S=>t.unref(h)(S,!1)),"onUpdate:modelValue":g[10]||(g[10]=S=>i("update:http-statuses",S))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Tc,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Ec,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(F,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Qa),min:t.unref(Wa),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[11]||(g[11]=S=>i("update:unhealthy-interval",S))},null,8,["help","label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createBlock(F,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(xe),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[12]||(g[12]=S=>i("update:tcp-failures",S))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(F,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(xe),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[13]||(g[13]=S=>i("update:http-failures",S))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Re),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[14]||(g[14]=S=>t.unref(p)(S,!0)),onItemRemoved:g[15]||(g[15]=S=>t.unref(p)(S,!1)),"onUpdate:modelValue":g[16]||(g[16]=S=>i("update:unhealthy-http-statuses",S))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(F,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":g[17]||(g[17]=S=>i("update:unhealthy-timeouts",S))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-9e6394cf"]]),vc={class:"fields-group-title"},Fc={class:"fields-group-text"},qc={class:"fields-group-title"},Oc={class:"fields-group-text"},Uc=he(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=e,n=r,i=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),o=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=qe({replaceId:!0}),{trackNewItems:c}=qe({replaceId:!0});return t.watch(()=>l.type,(h,p)=>{p==="tcp"&&h!==p&&n("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(n("update:http-statuses",yt),n("update:unhealthy-http-statuses",bt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),V=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(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(We).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(f,{class:"passive-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=g=>n("update:type",g))},null,8,["items","label","model-value","readonly"]),t.createVNode(C,null,{default:t.withCtx(()=>[t.createElementVNode("h5",vc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",Fc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(xe),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=g=>n("update:successes",g))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(V,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Re),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=g=>t.unref(d)(g,!0)),onItemRemoved:p[3]||(p[3]=g=>t.unref(d)(g,!1)),"onUpdate:modelValue":p[4]||(p[4]=g=>n("update:http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(C,null,{default:t.withCtx(()=>[t.createElementVNode("h5",qc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",Oc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=g=>n("update:timeouts",g))},null,8,["label","max","min","model-value","readonly"]),o.value?(t.openBlock(),t.createBlock(s,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(xe),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=g=>n("update:tcp-failures",g))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(s,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(xe),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=g=>n("update:http-failures",g))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(V,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Re),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=g=>t.unref(c)(g,!0)),onItemRemoved:p[9]||(p[9]=g=>t.unref(c)(g,!1)),"onUpdate:modelValue":p[10]||(p[10]=g=>n("update:unhealthy-http-statuses",g))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-cca8adae"]]),$c={class:"kong-ui-entities-upstreams-form"},Dc=he(t.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:r}){var K;const a=e,l=r,{inRange:n,stringToNumberArray:i,upstreamsResponseToFields:o,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=ze(),{axiosInstance:p}=Le({headers:(K=a.config)==null?void 0:K.requestHeaders}),{getMessageFromError:u}=Pa(),f=Qe.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),V=t.reactive(d()),C=t.computed(()=>!c(s.fields,V)),g=k=>{s.fields.activeHealthCheck.interval=k?"5":"0",s.fields.activeHealthCheck.successes=k?"5":"0",s.fields.activeHealthCheck.httpFailures=k?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=k?"5":"0"},B=k=>{s.fields.passiveHealthCheck.timeouts=k?"5":"0",s.fields.passiveHealthCheck.successes=k?"80":"0"},T=t.computed(()=>s.fields.slots?n(s.fields.slots,ft,mt):!0),F=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),_=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),w=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),m=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),N=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),I=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),x=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),E=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),S=t.computed(()=>!!s.fields.name&&T.value&&F.value&&_.value&&w.value&&m.value&&N.value&&I.value&&x.value&&E.value),A=t.computed(()=>a.upstreamId?oe.Edit:oe.Create),q=t.computed(()=>{var k,y;return(y=Ie.form[(k=a.config)==null?void 0:k.app])==null?void 0:y.edit}),$=k=>{Object.assign(s.fields,o(k)),Object.assign(V,h(s.fields))},U=()=>{var k;f.push(((k=a.config)==null?void 0:k.cancelRoute)||{name:"upstreams-list"})},O=k=>{l("loading",k)},j=k=>{l("error",k)},Y=t.computed(()=>{var y,b,R,M,z;const k={name:s.fields.name,slots:Number(s.fields.slots),algorithm:s.fields.algorithm,hash_on:s.fields.hashOn,hash_fallback:s.fields.hashFallback,healthchecks:{}};return s.fields.hostHeader&&(k.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(k.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(k.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(k.tags=(b=(y=s.fields.tags.split(","))==null?void 0:y.map(X=>String(X||"").trim()))==null?void 0:b.filter(X=>X!=="")),s.fields.hashOn==="header"&&(k.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(k.hash_on_cookie=s.fields.hashOnCookie,k.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(k.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(k.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(k.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(k.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(k.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(k.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(k.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(k.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(k.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?k.healthchecks.active.headers=[]:k.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((X,L)=>{var te,ye;return L.key?{...X,[L.key]:(ye=(te=L.values.split(","))==null?void 0:te.map(Be=>String(Be||"").trim()))==null?void 0:ye.filter(Be=>Be!=="")}:{...X}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(k.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(k.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(k.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(k.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(k.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(k.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(k.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(k.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.type==="tcp"&&s.fields.activeHealthCheck.tcpFailures&&(k.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((M=a.config)==null?void 0:M.app)==="kongManager"&&A.value===oe.Edit&&(k.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),s.fields.passiveHealthSwitch?(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(k.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(k.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(k.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(k.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.type==="tcp"&&s.fields.passiveHealthCheck.tcpFailures&&(k.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&A.value===oe.Edit&&(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),k}),v=k=>{var b,R,M,z,X,L;let y=`${(b=a.config)==null?void 0:b.apiBaseUrl}${Ie.form[(R=a.config)==null?void 0:R.app][k]}`;return((M=a.config)==null?void 0:M.app)==="konnect"?y=y.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((X=a.config)==null?void 0:X.app)==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(L=a.config)!=null&&L.workspace?`/${a.config.workspace}`:"")),y=y.replace(/{id}/gi,a.upstreamId),y},D=async()=>{var k;try{s.readonly=!0,await p.post(v("validate"),Y.value);let y;A.value===oe.Create?y=await p.post(v("create"),Y.value):A.value===oe.Edit&&(y=((k=a.config)==null?void 0:k.app)==="konnect"?await p.put(v("edit"),Y.value):await p.patch(v("edit"),Y.value)),l("update",y==null?void 0:y.data)}catch(y){s.errorMessage=u(y),l("error",y)}finally{s.readonly=!1}};return(k,y)=>(t.openBlock(),t.createElementBlock("div",$c,[t.createVNode(t.unref($a),{"can-submit":S.value&&C.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":q.value,"form-fields":Y.value,"is-readonly":s.readonly,onCancel:U,"onFetch:error":j,"onFetch:success":$,onLoading:O,onSubmit:D},{default:t.withCtx(()=>[t.createVNode(gc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":y[0]||(y[0]=b=>s.fields.clientCertificate=b),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":y[1]||(y[1]=b=>s.fields.hostHeader=b),name:s.fields.name,"onUpdate:name":y[2]||(y[2]=b=>s.fields.name=b),tags:s.fields.tags,"onUpdate:tags":y[3]||(y[3]=b=>s.fields.tags=b),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(wc,{algorithm:s.fields.algorithm,"onUpdate:algorithm":y[4]||(y[4]=b=>s.fields.algorithm=b),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":y[5]||(y[5]=b=>s.fields.hashFallback=b),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":y[6]||(y[6]=b=>s.fields.hashFallbackHeader=b),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":y[7]||(y[7]=b=>s.fields.hashFallbackQueryArgument=b),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":y[8]||(y[8]=b=>s.fields.hashFallbackUriCapture=b),"hash-on":s.fields.hashOn,"onUpdate:hashOn":y[9]||(y[9]=b=>s.fields.hashOn=b),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":y[10]||(y[10]=b=>s.fields.hashOnCookie=b),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":y[11]||(y[11]=b=>s.fields.hashOnCookiePath=b),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":y[12]||(y[12]=b=>s.fields.hashOnHeader=b),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":y[13]||(y[13]=b=>s.fields.hashOnQueryArgument=b),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":y[14]||(y[14]=b=>s.fields.hashOnUriCapture=b),slots:s.fields.slots,"onUpdate:slots":y[15]||(y[15]=b=>s.fields.slots=b),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(Vc,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[y[16]||(y[16]=b=>s.fields.activeHealthSwitch=b),g],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":y[17]||(y[17]=b=>s.fields.healthchecksThreshold=b),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[y[18]||(y[18]=b=>s.fields.passiveHealthSwitch=b),B],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Hc,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":y[19]||(y[19]=b=>s.fields.activeHealthCheck.concurrency=b),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":y[20]||(y[20]=b=>s.fields.activeHealthCheck.headers=b),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":y[21]||(y[21]=b=>s.fields.activeHealthCheck.httpFailures=b),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":y[22]||(y[22]=b=>s.fields.activeHealthCheck.httpPath=b),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[23]||(y[23]=b=>s.fields.activeHealthCheck.httpStatuses=b),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":y[24]||(y[24]=b=>s.fields.activeHealthCheck.httpsSni=b),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":y[25]||(y[25]=b=>s.fields.activeHealthCheck.interval=b),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":y[26]||(y[26]=b=>s.fields.activeHealthCheck.successes=b),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[27]||(y[27]=b=>s.fields.activeHealthCheck.tcpFailures=b),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":y[28]||(y[28]=b=>s.fields.activeHealthCheck.timeout=b),type:s.fields.activeHealthCheck.type,"onUpdate:type":y[29]||(y[29]=b=>s.fields.activeHealthCheck.type=b),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[30]||(y[30]=b=>s.fields.activeHealthCheck.unhealthyHttpStatuses=b),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":y[31]||(y[31]=b=>s.fields.activeHealthCheck.unhealthyInterval=b),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":y[32]||(y[32]=b=>s.fields.activeHealthCheck.unhealthyTimeouts=b),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":y[33]||(y[33]=b=>s.fields.activeHealthCheck.verifySsl=b),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(Uc,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":y[34]||(y[34]=b=>s.fields.passiveHealthCheck.httpFailures=b),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[35]||(y[35]=b=>s.fields.passiveHealthCheck.httpStatuses=b),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":y[36]||(y[36]=b=>s.fields.passiveHealthCheck.successes=b),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[37]||(y[37]=b=>s.fields.passiveHealthCheck.tcpFailures=b),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":y[38]||(y[38]=b=>s.fields.passiveHealthCheck.timeouts=b),type:s.fields.passiveHealthCheck.type,"onUpdate:type":y[39]||(y[39]=b=>s.fields.passiveHealthCheck.type=b),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[40]||(y[40]=b=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=b),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-05687a98"]]),Mc=t.createElementVNode("code",null,"10",-1),jc=t.createElementVNode("code",null,"65536",-1),Kc={"data-testid":"client_certificate-plain-text"},Pc=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=de.useI18n(),{getPropValue:n}=Ys(),i=t.computed(()=>Ie.form[r.config.app].edit),o=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:J.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:J.Basic},hash_on:{order:7,section:J.Basic},hash_on_header:{order:8,section:J.Basic},hash_on_uri_capture:{order:9,section:J.Basic},hash_on_query_arg:{order:10,section:J.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:J.Basic},hash_on_cookie_path:{order:12,section:J.Basic},healthchecks:{order:13,section:J.Basic,type: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(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(ms),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":o.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onFetch:error":c[0]||(c[0]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[1]||(c[1]=h=>d.$emit("fetch:success",h)),onLoading:c[2]||(c[2]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(h.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[Mc]),max:t.withCtx(()=>[jc]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",Kc,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(n)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});ae.TargetForm=Ya,ae.TargetsList=fc,ae.UpstreamsConfigCard=Pc,ae.UpstreamsForm=Dc,ae.UpstreamsList=sc,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
31
+ `+e.slice(o+1):c+=e.slice(n),c.slice(1)}function hi(e){for(var r="",a=0,l,n=0;n<e.length;a>=65536?n+=2:n++)a=qe(e,n),l=ee[a],!l&&He(a)?(r+=e[n],a>=65536&&(r+=e[n+1])):r+=l||ai(a);return r}function pi(e,r,a){var l="",n=e.tag,i,o,d;for(i=0,o=a.length;i<o;i+=1)d=a[i],e.replacer&&(d=e.replacer.call(a,String(i),d)),(se(e,r,d,!1,!1)||typeof d>"u"&&se(e,r,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=n,e.dump="["+l+"]"}function Oa(e,r,a,l){var n="",i=e.tag,o,d,c;for(o=0,d=a.length;o<d;o+=1)c=a[o],e.replacer&&(c=e.replacer.call(a,String(o),c)),(se(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&se(e,r+1,null,!0,!0,!1,!0))&&((!l||n!=="")&&(n+=dt(e,r)),e.dump&&Ae===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function ui(e,r,a){var l="",n=e.tag,i=Object.keys(a),o,d,c,h,p;for(o=0,d=i.length;o<d;o+=1)p="",l!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[o],h=a[c],e.replacer&&(h=e.replacer.call(a,c,h)),se(e,r,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),se(e,r,h,!1,!1)&&(p+=e.dump,l+=p));e.tag=n,e.dump="{"+l+"}"}function fi(e,r,a,l){var n="",i=e.tag,o=Object.keys(a),d,c,h,p,u,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new re("sortKeys must be a boolean or a function");for(d=0,c=o.length;d<c;d+=1)f="",(!l||n!=="")&&(f+=dt(e,r)),h=o[d],p=a[h],e.replacer&&(p=e.replacer.call(a,h,p)),se(e,r+1,h,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Ae===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=dt(e,r)),se(e,r+1,p,!0,u)&&(e.dump&&Ae===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,n+=f));e.tag=i,e.dump=n||"{}"}function va(e,r,a){var l,n,i,o,d,c;for(n=a?e.explicitTypes:e.implicitTypes,i=0,o=n.length;i<o;i+=1)if(d=n[i],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof r=="object"&&r instanceof d.instanceOf)&&(!d.predicate||d.predicate(r))){if(a?d.multi&&d.representName?e.tag=d.representName(r):e.tag=d.tag:e.tag="?",d.represent){if(c=e.styleMap[d.tag]||d.defaultStyle,ka.call(d.represent)==="[object Function]")l=d.represent(r,c);else if(ba.call(d.represent,c))l=d.represent[c](r,c);else throw new re("!<"+d.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function se(e,r,a,l,n,i,o){e.tag=null,e.dump=a,va(e,a,!1)||va(e,a,!0);var d=ka.call(e.dump),c=l,h;l&&(l=e.flowLevel<0||e.flowLevel>r);var p=d==="[object Object]"||d==="[object Array]",u,f;if(p&&(u=e.duplicates.indexOf(a),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&r>0)&&(n=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")l&&Object.keys(e.dump).length!==0?(fi(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(ui(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?Oa(e,r-1,e.dump,n):Oa(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(pi(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&ci(e,e.dump,r,i,c);else{if(d==="[object Undefined]"||e.skipInvalid)return!1;throw new re("unacceptable kind of an object to dump "+d)}e.tag!==null&&e.tag!=="?"&&(h=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",e.dump=h+" "+e.dump)}return!0}function mi(e,r){var a=[],l=[],n,i;for(pt(e,a,l),n=0,i=l.length;n<i;n+=1)r.duplicates.push(a[l[n]]);r.usedDuplicates=new Array(i)}function pt(e,r,a){var l,n,i;if(e!==null&&typeof e=="object")if(n=r.indexOf(e),n!==-1)a.indexOf(n)===-1&&a.push(n);else if(r.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)pt(e[n],r,a);else for(l=Object.keys(e),n=0,i=l.length;n<i;n+=1)pt(e[l[n]],r,a)}function gi(e,r){r=r||{};var a=new li(r);a.noRefs||mi(e,a);var l=e;return a.replacer&&(l=a.replacer.call({"":l},"",l)),se(a,0,l,!0,!0)?a.dump+`
32
+ `:""}var yi=gi,ki={dump:yi};function ut(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var bi=G,Ci=$t,wi=Kt,_i=Jt,Si=Wt,xi=lt,Ni=ya.load,Vi=ya.loadAll,Ii=ki.dump,Bi=re,Ti={binary:Xt,float:zt,map:jt,null:Pt,pairs:ta,set:aa,timestamp:Zt,bool:Lt,int:Rt,merge:Gt,omap:ea,seq:Mt,str:Dt},Ai=ut("safeLoad","load"),Ei=ut("safeLoadAll","loadAll"),Hi=ut("safeDump","dump"),qi={Type:bi,Schema:Ci,FAILSAFE_SCHEMA:wi,JSON_SCHEMA:_i,CORE_SCHEMA:Si,DEFAULT_SCHEMA:xi,load:Ni,loadAll:Vi,dump:Ii,YAMLException:Bi,types:Ti,safeLoad:Ai,safeLoadAll:Ei,safeDump:Hi};const Fi={class:"yaml-config"},Ua=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>{const l=Object.fromEntries(Object.entries(r.yamlRecord).filter(([,n])=>n&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(l).length===0&&l.constructor===Object?"":qi.dump(l).trim()});return(l,n)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Fi,[r.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Oi={key:0,class:"config-card-display-form"},vi=["data-testid"],Ui={key:0,class:"config-card-prop-section-title"},$i=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const r=e,a=t.useSlots(),{i18n:{t:l}}=Z.useI18n(),n=o=>!!(o.tooltip||a[`${o.key}-label-tooltip`]),i=t.computed(()=>{if(!r.record)return r.record;const o=JSON.parse(JSON.stringify(r.record));return delete o.created_at,delete o.updated_at,o});return(o,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Oi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,c=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${c}-props`,class:t.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(t.openBlock(),t.createElementBlock("div",Ui,t.toDisplayString(c==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],h=>(t.openBlock(),t.createBlock(qt,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(o.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[n(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,vi))),128))])):t.createCommentVNode("",!0),e.format==="json"&&r.record?(t.openBlock(),t.createBlock(Ft,{key:1,config:r.config,"fetcher-url":r.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&r.record?(t.openBlock(),t.createBlock(Ua,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),Di=ne($i,[["__scopeId","data-v-147a2f70"]]),me="24px",Pe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Mi=e=>(t.pushScopeId("data-v-2295e0fb"),e=e(),t.popScopeId(),e),ji=["aria-hidden"],Ki={key:0,"data-testid":"kui-icon-svg-title"},Pi=Mi(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Li=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:me,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return me}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Ki,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Pi],8,ji))]),_:1},8,["aria-hidden","style"]))}}),Ri=Pe(Li,[["__scopeId","data-v-2295e0fb"]]),zi=e=>(t.pushScopeId("data-v-40a7f387"),e=e(),t.popScopeId(),e),Ji=["aria-hidden"],Wi={key:0,"data-testid":"kui-icon-svg-title"},Qi=zi(()=>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)),Yi=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:me,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return me}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Wi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Qi],8,Ji))]),_:1},8,["aria-hidden","style"]))}}),Zi=Pe(Yi,[["__scopeId","data-v-40a7f387"]]),Gi=e=>(t.pushScopeId("data-v-98c34919"),e=e(),t.popScopeId(),e),Xi=["aria-hidden"],es={key:0,"data-testid":"kui-icon-svg-title"},ts=Gi(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),as=t.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:me,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return me}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",es,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ts],8,Xi))]),_:1},8,["aria-hidden","style"]))}}),rs=Pe(as,[["__scopeId","data-v-98c34919"]]),ls=e=>(t.pushScopeId("data-v-19f4cbbe"),e=e(),t.popScopeId(),e),ns=["aria-hidden"],os={key:0,"data-testid":"kui-icon-svg-title"},is=ls(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),ss=t.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:me,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return me}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",os,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),is],8,ns))]),_:1},8,["aria-hidden","style"]))}}),cs=Pe(ss,[["__scopeId","data-v-19f4cbbe"]]),ds={"data-testid":"config-card-title"},hs={class:"config-card-actions"},ps=["href"],us={class:"config-card-details-section"},fs=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"],setup(e,{emit:r}){var a;const l=r,n=e,{i18n:{t:i}}=Z.useI18n(),{getMessageFromError:o}=Z.useErrors(),{convertKeyToTitle:d}=Z.useStringHelpers(),{axiosInstance:c}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),h=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=m=>{p.value=m==null?void 0:m.value},f={id:{type:P.ID,label:i("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:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:P.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:P.BadgeTag,order:-1,section:J.Basic}},s=t.ref(!1),N=t.ref(!1),C=t.ref(""),g=t.ref({}),B=t.computed(()=>{var m,V,I;if(!g.value)return[];const x=[],E=Object.keys(g.value).length;for(const _ in g.value){const T=(V=(m=n.configSchema)==null?void 0:m[_])==null?void 0:V.order,O=(I=f[_])==null?void 0:I.order;let $=E;(O||O===0)&&($=O===-1?E+1:O),T&&($=T===-1?E+1:T),x.push([_,$])}return x.sort(function(_,T){return _[1]-T[1]}),x.map(_=>{var T,O;const $=_[0],U=(T=g.value)==null?void 0:T[$],v=((O=n.configSchema)==null?void 0:O[$])||{},j=f[$];return{key:$,value:U,hidden:v.hidden||!1,type:v.type??((j==null?void 0:j.type)||P.Text),label:v.label??((j==null?void 0:j.label)||d($)),tooltip:v.tooltip??((j==null?void 0:j.tooltip)||void 0),section:v.section??((j==null?void 0:j.section)||J.Advanced)}}).filter(_=>!_.hidden&&_.key!==n.pluginConfigKey)}),A=t.computed(()=>{var m,V;if(!g.value||!n.pluginConfigKey)return[];const I=g.value[n.pluginConfigKey]||{},x=Object.keys(I).length,E=[];for(const _ in I){const T=(V=(m=n.pluginConfigSchema)==null?void 0:m[_])==null?void 0:V.order,O=I[_];let $=O!=null&&O!==""?x-1:x;T&&($=T===-1?x+1:T),E.push([_,$])}return E.sort(function(_,T){return _[1]-T[1]}),E.map(_=>{var T;const O=_[0],$=I[O],U=((T=n.pluginConfigSchema)==null?void 0:T[O])||{};return{key:O,value:$,hidden:U.hidden||!1,type:U.type??P.Text,label:U.label??d(O),tooltip:U.tooltip??void 0,section:J.Plugin}}).filter(_=>!_.hidden)}),F=t.computed(()=>{var m,V,I,x;return{basic:(m=B.value)==null?void 0:m.filter(E=>E.section===J.Basic),advanced:(V=B.value)==null?void 0:V.filter(E=>E.section===J.Advanced),plugin:(x=A.value)==null?void 0:x.concat((I=B.value)==null?void 0:I.filter(E=>E.section===J.Plugin))}}),S=t.computed(()=>{const m=[];return F.value.basic.length&&m.push("basic"),F.value.advanced.length&&m.push("advanced"),F.value.plugin.length&&m.push("plugin"),m}),w=t.computed(()=>{var m,V;let I=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((m=n.config)==null?void 0:m.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(V=n.config)!=null&&V.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.config.entityId),I});return t.watch(s,m=>{l("loading",m)},{immediate:!0}),t.onBeforeMount(async()=>{N.value=!1,s.value=!0;try{const{data:m}=await c.get(w.value);if(n.dataKey)if(typeof m[n.dataKey]<"u")g.value={...m[n.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:n.dataKey}));else g.value={...m};Object.keys(n.configSchema).filter(V=>n.configSchema[V].forceShow).forEach(V=>{g.value&&typeof g.value[V]>"u"&&(g.value[V]=null)}),l("fetch:success",m)}catch(m){const V=o(m);C.value=V.startsWith("code")?i("baseConfigCard.errors.load"):V,N.value=!0,l("fetch:error",m)}finally{s.value=!1}}),(m,V)=>{const I=t.resolveComponent("KLabel"),x=t.resolveComponent("KSelect"),E=t.resolveComponent("KButton"),_=t.resolveComponent("KSkeleton"),T=t.resolveComponent("KEmptyState"),O=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(O,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",hs,[t.renderSlot(m.$slots,"actions",{},void 0,!0),t.createVNode(I,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(x,{"data-testid":"select-config-format",items:h,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(E,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(Zi),{size:t.unref(Zl)},null,8,["size"])],8,ps)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[s.value?(t.openBlock(),t.createBlock(_,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):N.value?(t.openBlock(),t.createBlock(T,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(C.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",us,[t.createVNode(Di,{config:e.config,"fetcher-url":w.value,format:p.value,"prop-list-types":S.value,"property-collections":F.value,record:g.value},t.createSlots({_:2},[t.renderList(Object.keys(m.$slots),$=>({name:$,fn:t.withCtx(({row:U,rowValue:v})=>[t.renderSlot(m.$slots,$,{row:U,rowValue:v},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",ds,[t.renderSlot(m.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),ms=ne(fs,[["__scopeId","data-v-491f1797"]]),gs={class:"form-actions","data-testid":"form-actions"},ys=t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,i=Qe.useRouter(),{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),f=t.computed(()=>n.canSubmit===!1||n.isReadonly),s=t.ref(!1),N=t.computed(()=>{var S,w;let m=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((S=n.config)==null?void 0:S.controlPlaneId)||""):n.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(w=n.config)!=null&&w.workspace?`/${n.config.workspace}`:"")),n.editId?(m=m.replace(/{id}/gi,n.editId),m):(m=m.replace(/\/{id}/gi,""),m)}),C=()=>{s.value=!s.value},g=()=>{n.config.cancelRoute?i.push(n.config.cancelRoute):B()},B=()=>{l("cancel")},A=()=>{f.value||l("submit")},F=t.ref([{title:o("baseForm.configuration.yaml"),hash:"#yaml"},{title:o("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,S=>{l("loading",S)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{p.value=!1,h.value=!0;const{data:S}=await c.get(N.value);l("fetch:success",S)}catch(S){const w=d(S);u.value=w.startsWith("code")?o("baseForm.errors.edit"):w,p.value=!0,l("fetch:error",S)}finally{h.value=!1}}),(S,w)=>{const m=t.resolveComponent("KSkeleton"),V=t.resolveComponent("KEmptyState"),I=t.resolveComponent("KAlert"),x=t.resolveComponent("KButton"),E=t.resolveComponent("KTabs"),_=t.resolveComponent("KSlideout"),T=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(T,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(m,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(V,{key:1,"action-button-text":t.unref(o)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:g},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(B,["prevent"]),onSubmit:t.withModifiers(A,["prevent"])},[t.renderSlot(S.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(I,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",gs,[t.renderSlot(S.$slots,"form-actions",{},()=>[t.createVNode(x,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:w[0]||(w[0]=O=>C())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.viewConfiguration")),1)]),_:1}),t.createVNode(x,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(x,{appearance:"primary","data-testid":"form-submit",disabled:f.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),t.createVNode(_,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(o)("baseForm.configuration.title"),visible:s.value,onClose:w[1]||(w[1]=O=>C())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("baseForm.configuration.message")),1),t.createVNode(E,{"data-testid":"form-view-configuration-slideout-tabs",tabs:F.value},{json:t.withCtx(()=>[t.createVNode(Ft,{config:e.config,"fetcher-url":N.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(Ua,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),$a=ne(ys,[["__scopeId","data-v-1d932d98"]]),ks={key:0,"data-testid":"first-col"},bs=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const r=e,a=t.computed(()=>{var C;return((C=r.rowEl)==null?void 0:C.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var C;return((C=a.value)==null?void 0:C.querySelector('[data-testid="first-col"]'))||null}),n=t.computed(()=>{var C,g;const B=(C=r.rowEl)==null?void 0:C.querySelectorAll("td");return B?((g=B[0])==null?void 0:g.getAttribute("data-testid"))===r.keyName:!1});let i;const o=()=>{i&&(i.disconnect(),i=void 0)},d=()=>{var C,g,B;h.value=((C=l.value)==null?void 0:C.getBoundingClientRect().width)||0,p.value=((g=a.value)==null?void 0:g.clientWidth)||0,u.value=((B=c.value)==null?void 0:B.innerText)||""},c=t.ref({}),h=t.ref(0),p=t.ref(0),u=t.ref(""),f=t.computed(()=>[l.value,a.value]),s=t.watch(f,C=>{if(n.value&&(o(),"ResizeObserver"in window&&window)){i=new ResizeObserver(g=>{window.requestAnimationFrame(()=>{!Array.isArray(g)||!g.length||d()})});for(const g of C)g&&i.observe(g)}},{immediate:!0,flush:"post",deep:!0}),N=t.computed(()=>n.value?h.value>p.value:!1);return t.onMounted(()=>{d()}),t.onUnmounted(()=>{s()}),(C,g)=>{const B=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[n.value?(t.openBlock(),t.createElementBlock("span",ks,[t.createVNode(B,{"max-width":"300",placement:"bottomStart",text:N.value?u.value:""},{default:t.withCtx(()=>[t.renderSlot(C.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):t.renderSlot(C.$slots,"default",{key:1},void 0,!0)],512)}}}),Cs=ne(bs,[["__scopeId","data-v-c4379fd4"]]),ws={class:"toolbar-container"},_s={key:0,class:"toolbar-button-container"},Ss=["data-testid"],xs=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:r}){const a=e,l=r,{i18n:{t:n}}=Z.useI18n(),i=t.computed(()=>{var w,m;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(w=a.errorMessage)==null?void 0:w.title,message:(m=a.errorMessage)==null?void 0:m.message}}),o=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=w=>w.hasData||!!a.query,c=t.computed(()=>{const w=[];return Object.keys(a.tableHeaders).forEach(m=>{const V=a.tableHeaders[m];w.push({label:V.label??m,key:m,sortable:V.sortable??!1})}),a.enableEntityActions&&w.push({key:"actions",hideLabel:!0}),w}),h=w=>({"data-rowid":w.id,"data-testid":w.name,...a.rowAttributes(w)}),p=t.ref({}),u=w=>{var m;return(m=p.value)==null?void 0:m.$el.querySelector(`[data-rowid="${w.id}"]`)},f=w=>{const m={"data-testid":w.headerKey,...a.cellAttributes(w)};return w.colIndex===0&&(m.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),m},s=()=>{l("empty-state-cta-clicked"),N()},N=()=>{l("clear-search-input")},C=t.computed(()=>a.disableRowClick?void 0:(w,m)=>{l("click:row",m)}),g=w=>{l("sort",w)},{setTablePreferences:B,getTablePreferences:A}=yl(),F=t.computed(()=>{const w=A(a.preferencesStorageKey);return{...a.initialFetcherParams,...w}}),S=w=>{a.preferencesStorageKey&&B(a.preferencesStorageKey,w)};return(w,m)=>{const V=t.resolveComponent("KIcon"),I=t.resolveComponent("KButton"),x=t.resolveComponent("KDropdown"),E=t.resolveComponent("KTable"),_=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(_,{class:"kong-ui-entity-base-table",title:e.title},{default:t.withCtx(()=>[t.createVNode(E,{ref_key:"tableRefs",ref:p,"cache-identifier":o.value,"cell-attrs":f,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":i.value.message,"error-state-title":i.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":i.value.hasError,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":F.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":h,"search-input":e.query,onKtableEmptyStateCtaClicked:s,"onRow:click":C.value,onSort:m[0]||(m[0]=T=>g(T)),"onUpdate:tablePreferences":S},t.createSlots({toolbar:t.withCtx(({state:T})=>[t.withDirectives(t.createElementVNode("div",ws,[t.renderSlot(w.$slots,"toolbar-filter",{},void 0,!0),w.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",_s,[t.renderSlot(w.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(T)]])]),actions:t.withCtx(({row:T,rowKey:O,rowValue:$})=>[t.createElementVNode("div",{class:"actions-container","data-testid":T.name},[t.createVNode(x,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(w.$slots,"actions",{row:T,rowKey:O,rowValue:$},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(I,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(V,{color:t.unref(Wl),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,Ss)]),_:2},[t.renderList(e.tableHeaders,(T,O)=>({name:O,fn:t.withCtx(({row:$,rowKey:U,rowValue:v})=>[t.createVNode(Cs,{"key-name":String(O),"row-el":u($)},{default:t.withCtx(()=>[t.renderSlot(w.$slots,O,{row:$,rowKey:U,rowValue:v},()=>[t.createTextVNode(t.toDisplayString(v),1)],!0)]),_:2},1032,["key-name","row-el"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(Ri))]),key:"0"}]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","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"])}}}),Da=ne(xs,[["__scopeId","data-v-273124cf"]]),Ns={key:0,class:"kong-ui-entity-delete-error"},Vs={key:1,class:"description"},Is=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:r}){const{i18nT:a}=Z.useI18n(),l=e,n=r,i=t.computed(()=>l.needConfirm?l.entityName:""),o=()=>{n("cancel")},d=()=>{n("proceed")};return(c,h)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":i.value,title:e.title,visible:e.visible,onCancel:o,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Ns,[t.createVNode(p,{appearance:"danger"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Vs,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Ma=ne(Is,[["__scopeId","data-v-4361d622"]]),Bs={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ts={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},As=["fill"],Es={mask:"url(#mask0_180_20349)"},Hs=["fill"],ja=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${zl})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Bs,[t.createElementVNode("mask",Ts,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,As)]),t.createElementVNode("g",Es,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Hs)])]))}}),qs={key:1,class:"kong-ui-entity-filter"},Fs={class:"kong-ui-entity-filter-menu"},Os=["data-testid"],vs=["onClick","onKeydown"],Us={class:"menu-item-indicator"},$s={class:"menu-item-body"},Ds=["for"],Ms={class:"menu-item-buttons"},js={class:"filter-clear-button-container"},Ks=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:r}){const{i18n:{t:a}}=Z.useI18n(),l=e,n=r,i=t.ref(!1),o=t.ref({}),d=t.ref(new Set),c=t.computed(()=>{const S=[];return new URLSearchParams(l.modelValue).forEach((w,m)=>{w!==""&&S.push(m)}),S}),h=t.computed(()=>{const S=l.config.fields;return Object.keys(S).filter(w=>S[w].searchable).map(w=>({label:S[w].label||w,value:w,expanded:!1}))});t.watch(()=>l.modelValue,S=>{o.value={},new URLSearchParams(S).forEach((w,m)=>{o.value[m]=w})});const p=()=>{i.value=!i.value},u=S=>{d.value.has(S)?d.value.delete(S):d.value.add(S)},f=S=>{n("update:modelValue",S)},s=()=>{f("")},N=S=>`filter-${S}`,C=S=>{var w,m;return(((m=(w=l.config.schema)==null?void 0:w[S])==null?void 0:m.values)??[]).map(V=>({value:V,label:V}))},g=S=>{var w,m;return((m=(w=l.config.schema)==null?void 0:w[S])==null?void 0:m.type)??"text"},B=S=>{o.value={...o.value,[S]:""},F()},A=()=>{o.value={},F(!0)},F=(S=!1)=>{const w=Object.keys(o.value).reduce((m,V)=>(o.value[V]&&(m[V]=`${o.value[V]}`),m),{});S&&(i.value=!1),n("update:modelValue",new URLSearchParams(w).toString())};return(S,w)=>{const m=t.resolveComponent("KInput"),V=t.resolveComponent("KButton"),I=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(m,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":f},{before:t.withCtx(()=>[t.createVNode(ja)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(cs),{class:"kong-ui-entity-filter-clear",onClick:s},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",qs,[t.createVNode(V,{appearance:"tertiary","data-testid":"filter-button",onClick:p},{default:t.withCtx(()=>[t.createVNode(ja),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:p},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createElementVNode("div",Fs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,x=>{var E,_;return t.openBlock(),t.createElementBlock("div",{key:x.value,class:"kong-ui-entity-filter-menu-item","data-testid":x.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:d.value.has(x.value)}]),role:"button",tabindex:"0",onClick:T=>u(x.value),onKeydown:t.withKeys(T=>u(x.value),["enter"])},[t.createTextVNode(t.toDisplayString(x.label)+" ",1),t.withDirectives(t.createElementVNode("span",Us,null,512),[[t.vShow,c.value.includes(x.value)]]),t.createVNode(t.unref(rs),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:d.value.has(x.value)}]),color:t.unref(Ql)},null,8,["class","color"])],42,vs),t.withDirectives(t.createElementVNode("div",$s,[t.createElementVNode("label",{class:"menu-item-label",for:N(x.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,Ds),((_=(E=e.config.schema)==null?void 0:E[x.value])==null?void 0:_.type)==="select"?(t.openBlock(),t.createBlock(I,{key:0,id:N(x.value),modelValue:o.value[x.value],"onUpdate:modelValue":T=>o.value[x.value]=T,items:C(x.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(m,{key:1,id:N(x.value),modelValue:o.value[x.value],"onUpdate:modelValue":T=>o.value[x.value]=T,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:g(x.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,d.value.has(x.value)]]),t.withDirectives(t.createElementVNode("div",Ms,[t.createVNode(V,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:w[0]||(w[0]=T=>F(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(V,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:T=>B(x.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,d.value.has(x.value)]])],8,Os)}),128)),t.createElementVNode("div",js,[t.createVNode(V,{appearance:"tertiary",size:"small",onClick:A},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,i.value]])]))}}}),Ps=ne(Ks,[["__scopeId","data-v-8cfadde3"]]),ce=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,i)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Ls={class:"form-section-wrapper"},Rs={key:0,class:"form-section-title"},zs={key:1,class:"form-section-description"},Js={key:2,class:"form-section-footer"},Ws={class:"form-section-content"},Qs=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 r=t.useSlots();return(a,l)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Ls,[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",Rs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",zs,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",Js,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",Ws,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),Fe=ne(Qs,[["__scopeId","data-v-3565daa7"]]),{useAxios:Le,useDeleteUrlBuilder:Ka,useErrors:Pa,useExternalLinkCreator:Rc,useFetchUrlBuilder:zc,useFetcher:La,useDebouncedFilter:Ra,useStringHelpers:Jc,useHelpers:Ys,useGatewayFeatureSupported:Wc,useTruncationDetector:Qc}=Z,Zs={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 Gs(){const e=ve.createI18n("en-us",Zs);return{i18n:e,i18nT:ve.i18nTComponent(e)}}function Oe(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,i)=>{if(i){const o={...n};r&&(o.value=n.label),a.value.push(o)}else a.value=a.value.filter(o=>o.value!==n.value)}}}const Re=[{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"}],ft=10,mt=65536,Xs=0,ec=65535,Se=0,xe=255,za=0,Ja=255,tc=0,ac=65535,Wa=0,Qa=65535,rc=0,lc=2**31,gt=["200","302"],yt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],kt=["429","404","500","501","502","503","504","505"],bt=["429","500","503"];function ze(){const e=c=>/^\d+$/.test(c),r=(c,h,p)=>{if(e(c)){const u=Number(c);return u>=h&&u<=p}else return!1},a=c=>c.map(h=>Number(h)),l=c=>c.map(h=>h.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:gt,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:kt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:yt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:bt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,f,s,N,C,g,B,A,F,S,w,m,V,I,x,E,_,T,O,$,U,v,j,Y,q,D,K,k,y,b,R,M,z,X,L,te,ye,Be,Za,Ga,Xa,er,tr,ar,rr,lr,nr,or,ir,sr,cr,dr,hr,pr,ur,fr,mr,gr,yr,kr,br,Cr,wr,_r,Sr,xr,Nr,Vr,Ir,Br,Tr,Ar,Er,Hr,qr,Fr,Or,vr,Ur,$r,Dr,Mr,jr,Kr,Pr,Lr,Rr,zr,Jr,Wr,Qr,Yr,Zr,Gr,Xr,el,tl,al,rl,ll,nl,ol,il,sl,cl,dl,hl,pl;const h=n();return h.name=c.name||"",h.algorithm=c.algorithm||"round-robin",h.hostHeader=c.host_header||"",h.clientCertificate=c.client_certificate?(p=c.client_certificate)==null?void 0:p.id:"",h.tags=((u=c.tags)==null?void 0:u.join(", "))||"",h.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",h.hashOn=c.hash_on||"none",h.hashFallback=c.hash_fallback||"none",h.hashOnHeader=c.hash_on_header||"",h.hashOnCookie=c.hash_on_cookie||"",h.hashOnCookiePath=c.hash_on_cookie_path||"/",h.hashOnQueryArgument=c.hash_on_query_arg||"",h.hashOnUriCapture=c.hash_on_uri_capture||"",h.hashFallbackHeader=c.hash_fallback_header||"",h.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",h.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",h.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",h.activeHealthSwitch=((s=(f=c.healthchecks.active)==null?void 0:f.healthy)==null?void 0:s.interval)!==0||((C=(N=c.healthchecks.active)==null?void 0:N.unhealthy)==null?void 0:C.interval)!==0,h.activeHealthCheck.type=((g=c.healthchecks.active)==null?void 0:g.type)||"http",h.activeHealthCheck.httpPath=((B=c.healthchecks.active)==null?void 0:B.http_path)||"/",h.activeHealthCheck.timeout=((A=c.healthchecks.active)==null?void 0:A.timeout)!==null&&((F=c.healthchecks.active)==null?void 0:F.timeout)!==void 0?(w=(S=c.healthchecks.active)==null?void 0:S.timeout)==null?void 0:w.toString():"",h.activeHealthCheck.concurrency=((m=c.healthchecks.active)==null?void 0:m.concurrency)!==null&&((V=c.healthchecks.active)==null?void 0:V.concurrency)!==void 0?(x=(I=c.healthchecks.active)==null?void 0:I.concurrency)==null?void 0:x.toString():"",h.activeHealthCheck.httpsSni=((E=c.healthchecks.active)==null?void 0:E.https_sni)||"",h.activeHealthCheck.verifySsl=((_=c.healthchecks.active)==null?void 0:_.https_verify_certificate)||!1,h.activeHealthCheck.headers=(T=c.healthchecks.active)!=null&&T.headers&&Object.entries((O=c.healthchecks.active)==null?void 0:O.headers).length>0?Object.entries(($=c.healthchecks.active)==null?void 0:$.headers).map(([Lc,Ct])=>({key:Lc,values:Ct==null?void 0:Ct.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((v=(U=c.healthchecks.active)==null?void 0:U.healthy)==null?void 0:v.interval)!==null&&((Y=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:Y.interval)!==void 0?(K=(D=(q=c.healthchecks.active)==null?void 0:q.healthy)==null?void 0:D.interval)==null?void 0:K.toString():"0",h.activeHealthCheck.interval=((y=(k=c.healthchecks.active)==null?void 0:k.healthy)==null?void 0:y.interval)!==null&&((R=(b=c.healthchecks.active)==null?void 0:b.healthy)==null?void 0:R.interval)!==void 0?(X=(z=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:z.interval)==null?void 0:X.toString():"0",h.activeHealthCheck.successes=((te=(L=c.healthchecks.active)==null?void 0:L.healthy)==null?void 0:te.successes)!==null&&((Be=(ye=c.healthchecks.active)==null?void 0:ye.healthy)==null?void 0:Be.successes)!==void 0?(Xa=(Ga=(Za=c.healthchecks.active)==null?void 0:Za.healthy)==null?void 0:Ga.successes)==null?void 0:Xa.toString():"0",h.activeHealthCheck.httpStatuses=(tr=(er=c.healthchecks.active)==null?void 0:er.healthy)!=null&&tr.http_statuses?l(((rr=(ar=c.healthchecks.active)==null?void 0:ar.healthy)==null?void 0:rr.http_statuses)||[]):gt,h.activeHealthCheck.unhealthyInterval=((nr=(lr=c.healthchecks.active)==null?void 0:lr.unhealthy)==null?void 0:nr.interval)!==null&&((ir=(or=c.healthchecks.active)==null?void 0:or.unhealthy)==null?void 0:ir.interval)!==void 0?(dr=(cr=(sr=c.healthchecks.active)==null?void 0:sr.unhealthy)==null?void 0:cr.interval)==null?void 0:dr.toString():"0",h.activeHealthCheck.httpFailures=((pr=(hr=c.healthchecks.active)==null?void 0:hr.unhealthy)==null?void 0:pr.http_failures)!==null&&((fr=(ur=c.healthchecks.active)==null?void 0:ur.unhealthy)==null?void 0:fr.http_failures)!==void 0?(yr=(gr=(mr=c.healthchecks.active)==null?void 0:mr.unhealthy)==null?void 0:gr.http_failures)==null?void 0:yr.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((br=(kr=c.healthchecks.active)==null?void 0:kr.unhealthy)==null?void 0:br.timeouts)!==null&&((wr=(Cr=c.healthchecks.active)==null?void 0:Cr.unhealthy)==null?void 0:wr.timeouts)!==void 0?(xr=(Sr=(_r=c.healthchecks.active)==null?void 0:_r.unhealthy)==null?void 0:Sr.timeouts)==null?void 0:xr.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(Vr=(Nr=c.healthchecks.active)==null?void 0:Nr.unhealthy)!=null&&Vr.http_statuses?l(((Br=(Ir=c.healthchecks.active)==null?void 0:Ir.unhealthy)==null?void 0:Br.http_statuses)||[]):kt,h.passiveHealthSwitch=((Ar=(Tr=c.healthchecks.passive)==null?void 0:Tr.healthy)==null?void 0:Ar.successes)!==0||((Hr=(Er=c.healthchecks.passive)==null?void 0:Er.unhealthy)==null?void 0:Hr.timeouts)!==0||((Fr=(qr=c.healthchecks.passive)==null?void 0:qr.unhealthy)==null?void 0:Fr.tcp_failures)!==0||((vr=(Or=c.healthchecks.passive)==null?void 0:Or.unhealthy)==null?void 0:vr.http_failures)!==0,h.passiveHealthCheck.type=((Ur=c.healthchecks.passive)==null?void 0:Ur.type)||"http",h.passiveHealthCheck.successes=((Dr=($r=c.healthchecks.passive)==null?void 0:$r.healthy)==null?void 0:Dr.successes)!==null&&((jr=(Mr=c.healthchecks.passive)==null?void 0:Mr.healthy)==null?void 0:jr.successes)!==void 0?(Lr=(Pr=(Kr=c.healthchecks.passive)==null?void 0:Kr.healthy)==null?void 0:Pr.successes)==null?void 0:Lr.toString():"0",h.passiveHealthCheck.httpStatuses=(zr=(Rr=c.healthchecks.passive)==null?void 0:Rr.healthy)!=null&&zr.http_statuses?l(((Wr=(Jr=c.healthchecks.passive)==null?void 0:Jr.healthy)==null?void 0:Wr.http_statuses)||[]):yt,h.passiveHealthCheck.timeouts=((Yr=(Qr=c.healthchecks.passive)==null?void 0:Qr.unhealthy)==null?void 0:Yr.timeouts)!==null&&((Gr=(Zr=c.healthchecks.passive)==null?void 0:Zr.unhealthy)==null?void 0:Gr.timeouts)!==void 0?(tl=(el=(Xr=c.healthchecks.passive)==null?void 0:Xr.unhealthy)==null?void 0:el.timeouts)==null?void 0:tl.toString():"0",h.passiveHealthCheck.tcpFailures=((rl=(al=c.healthchecks.passive)==null?void 0:al.unhealthy)==null?void 0:rl.tcp_failures)!==null&&((nl=(ll=c.healthchecks.passive)==null?void 0:ll.unhealthy)==null?void 0:nl.tcp_failures)!==void 0?(sl=(il=(ol=c.healthchecks.passive)==null?void 0:ol.unhealthy)==null?void 0:il.tcp_failures)==null?void 0:sl.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(dl=(cl=c.healthchecks.passive)==null?void 0:cl.unhealthy)!=null&&dl.http_statuses?l(((pl=(hl=c.healthchecks.passive)==null?void 0:hl.unhealthy)==null?void 0:pl.http_statuses)||[]):bt,h},getDefaultUpstreamFields:n,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const de={useI18n:Gs,useMultiselectCreation:Oe,useHelpers:ze},Ne="/api/runtime_groups/{controlPlaneId}",Ve="/{workspace}",Ie={list:{konnect:`${Ne}/upstreams`,kongManager:`${Ve}/upstreams`},form:{konnect:{getServices:`${Ne}/services`,getCertificates:`${Ne}/certificates`,validate:`${Ne}/v1/schemas/json/upstream/validate`,create:`${Ne}/upstreams`,edit:`${Ne}/upstreams/{id}`},kongManager:{getServices:`${Ve}/services`,getCertificates:`${Ve}/certificates`,validate:`${Ve}/schemas/upstreams/validate`,create:`${Ve}/upstreams`,edit:`${Ve}/upstreams/{id}`}}},nc={class:"kong-ui-entities-upstreams-list"},oc={class:"upstream-name"},ic=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:r}){var Y;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),i=Qe.useRouter(),{axiosInstance:o}=Le({headers:(Y=l.config)==null?void 0:Y.requestHeaders}),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var D,K;let q=`${l.config.apiBaseUrl}${Ie.list[l.config.app]}`;return l.config.app==="konnect"?q=q.replace(/{controlPlaneId}/gi,((D=l.config)==null?void 0:D.controlPlaneId)||""):l.config.app==="kongManager"&&(q=q.replace(/\/{workspace}/gi,(K=l.config)!=null&&K.workspace?`/${l.config.workspace}`:"")),q}),f=t.ref(""),s=t.computed(()=>{const q=l.config.app==="konnect"||l.config.isExactMatch;if(q)return{isExactMatch:q,placeholder:n("upstreams.search.placeholder")};const{name:D,slots:K}=h;return{isExactMatch:q,fields:{name:D,slots:K},schema:l.config.filterSchema}}),{fetcher:N,fetcherState:C}=La(l.config,u.value),g=()=>{f.value=""},B=()=>{d.value++},A=t.ref(null),F=(q,D)=>{const K=q.id;if(!D(K)){a("copy:error",{entity:q,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:q,field:"id",message:n("upstreams.copy.success",{val:K})})},S=(q,D)=>{const K=JSON.stringify(q);if(!D(K)){a("copy:error",{entity:q,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:q,message:n("upstreams.copy.success_brief")})},w=async q=>{var K;await((K=l.canRetrieve)==null?void 0:K.call(l,q))&&i.push(l.config.getViewRoute(q.id))},m=q=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(q)}),V=q=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(q)}),I=t.ref(void 0),x=t.ref(!1),E=t.ref(!1),_=t.ref(""),T=Ka(l.config,u.value),O=q=>{I.value=q,x.value=!0},$=()=>{x.value=!1},U=async()=>{var q,D,K;if((q=I.value)!=null&&q.id){E.value=!0;try{await o.delete(T(I.value.id)),E.value=!1,x.value=!1,d.value++,a("delete:success",I.value)}catch(k){_.value=((K=(D=k.response)==null?void 0:D.data)==null?void 0:K.message)||k.message||n("upstreams.errors.delete"),a("error",k)}finally{E.value=!1}}},v=t.ref(!0);t.watch(C,q=>{var D,K,k,y;if(Array.isArray((D=q==null?void 0:q.response)==null?void 0:D.data)&&(v.value=q.response.data.length>0),q.status===pe.Error){A.value={title:n("upstreams.errors.general")},(y=(k=(K=q.error)==null?void 0:K.response)==null?void 0:k.data)!=null&&y.message&&(A.value.message=q.error.response.data.message),a("error",q.error);return}A.value=null});const j=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(j.value.title=n("upstreams.list.empty_state.title"),j.value.ctaText=n("upstreams.actions.create"))}),(q,D)=>{const K=t.resolveComponent("KButton"),k=t.resolveComponent("KBadge"),y=t.resolveComponent("KTruncate"),b=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",nc,[t.createVNode(t.unref(Da),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":A.value,fetcher:t.unref(N),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:f.value,"table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onClearSearchInput:g,"onClick:row":D[1]||(D[1]=M=>w(M)),onSort:B},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Ps),{modelValue:f.value,"onUpdate:modelValue":D[0]||(D[0]=M=>f.value=M),config:s.value},null,8,["modelValue","config"])]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:t.withCtx(()=>[t.createVNode(t.unref(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,v.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),name:t.withCtx(({rowValue:M})=>[t.createElementVNode("span",oc,t.toDisplayString(M),1)]),tags:t.withCtx(({rowValue:M})=>[t.createVNode(y,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M,z=>(t.openBlock(),t.createBlock(k,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:M})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:X=>F(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:X=>S(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canRetrieve(M)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:m(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(M)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-edit",item:V(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(M)},{default:t.withCtx(()=>[t.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>O(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(Ma),{"action-pending":E.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":I.value&&(I.value.name||I.value.id),"entity-type":t.unref(Ye).Upstream,error:_.value,title:t.unref(n)("upstreams.delete.title"),visible:x.value,onCancel:$,onProceed:U},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),he=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},sc=he(ic,[["__scopeId","data-v-8833eb77"]]),Je={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"}}},cc={class:"kong-ui-entities-target-form"},dc={class:"target-form-container"},hc={key:0,class:"target-form-info"},Ya=he(t.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var w;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{getMessageFromError:i}=Pa(),{axiosInstance:o}=Le({headers:(w=l.config)==null?void 0:w.requestHeaders}),d=t.computed(()=>{var m;return Je.form[l.config.app].edit.replace(/{upstreamId}/gi,((m=l.config)==null?void 0:m.upstreamId)||"")}),c=t.computed(()=>l.targetId?oe.Edit:oe.Create),h=t.computed(()=>c.value===oe.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),p=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),f={target:"",weight:100,tags:""},s=t.computed(()=>{const m=parseInt(p.fields.weight.toString(),10);return m<0||m>65535}),N=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),C=m=>{var V;p.fields.target=(m==null?void 0:m.target)||"",p.fields.weight=(m==null?void 0:m.weight)??"",p.fields.tags=((V=m==null?void 0:m.tags)==null?void 0:V.join(", "))||"",Object.assign(u,p.fields)},g=()=>{p.errorMessage="",a("cancel")},B=t.computed(()=>{var V,I;let m=`${l.config.apiBaseUrl}${Je.form[l.config.app].validate}`;return l.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((V=l.config)==null?void 0:V.controlPlaneId)||""):l.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(I=l.config)!=null&&I.workspace?`/${l.config.workspace}`:"")),m=m.replace(/{id}/gi,l.targetId),m}),A=t.computed(()=>{var V,I,x,E;let m=`${l.config.apiBaseUrl}${Je.form[l.config.app][c.value]}`;return l.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((V=l.config)==null?void 0:V.controlPlaneId)||"").replace(/{upstreamId}/gi,((I=l.config)==null?void 0:I.upstreamId)||""):l.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(x=l.config)!=null&&x.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((E=l.config)==null?void 0:E.upstreamId)||"")),m=m.replace(/{id}/gi,l.targetId),m}),F=t.computed(()=>{var m,V,I;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(I=(V=(m=p.fields.tags)==null?void 0:m.split(","))==null?void 0:V.map(x=>String(x||"").trim()))==null?void 0:I.filter(x=>x!==""),upstream:{id:l.config.upstreamId}}}),S=async()=>{var m,V;try{p.isReadonly=!0,p.errorMessage="";let I;if(await o.post(B.value,F.value),c.value==="create"?I=await o.post(A.value,F.value):c.value==="edit"&&(I=((m=l.config)==null?void 0:m.app)==="konnect"?await o.put(A.value,F.value):await o.patch(A.value,F.value)),I){const{data:x}=I;p.fields.target=(x==null?void 0:x.name)||"",p.fields.weight=(x==null?void 0:x.weight)??100,p.fields.tags=((V=x==null?void 0:x.tags)==null?void 0:V.join(", "))||"",a("update",x),Object.assign(p.fields,f)}}catch(I){p.errorMessage=i(I),a("error",I)}finally{p.isReadonly=!1}};return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,f)}),(m,V)=>{const I=t.resolveComponent("KInput"),x=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(x,{"action-button-disabled":!N.value||p.isReadonly,"action-button-text":t.unref(n)("targets.form.buttons.save"),"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),title:h.value,visible:e.isVisible,onCancel:g,onProceed:S},{default:t.withCtx(()=>[t.createElementVNode("div",cc,[t.createVNode(t.unref($a),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":F.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":V[3]||(V[3]=E=>m.$emit("error",E)),"onFetch:success":C,onLoading:V[4]||(V[4]=E=>m.$emit("loading",E))},{default:t.withCtx(()=>[t.createElementVNode("div",dc,[m.$slots.info?(t.openBlock(),t.createElementBlock("div",hc,[t.renderSlot(m.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(I,{modelValue:p.fields.target,"onUpdate:modelValue":V[0]||(V[0]=E=>p.fields.target=E),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(I,{modelValue:p.fields.weight,"onUpdate:modelValue":V[1]||(V[1]=E=>p.fields.weight=E),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:p.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(I,{modelValue:p.fields.tags,"onUpdate:modelValue":V[2]||(V[2]=E=>p.fields.tags=E),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-1d864e54"]]),pc={class:"kong-ui-entities-targets-list"},uc={class:"target-address"},fc=he(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var K;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{axiosInstance:i}=Le({headers:(K=l.config)==null?void 0:K.requestHeaders}),o=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:n("targets.list.table_headers.target_address"),sortable:!0},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var y,b,R,M;let k=`${l.config.apiBaseUrl}${Je.list[l.config.app]}`;return l.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((y=l.config)==null?void 0:y.controlPlaneId)||"").replace(/{upstreamId}/gi,((b=l.config)==null?void 0:b.upstreamId)||""):l.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(R=l.config)!=null&&R.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((M=l.config)==null?void 0:M.upstreamId)||"")),k}),{fetcher:u,fetcherState:f}=La(l.config,p.value),s=()=>{o.value++},N=t.ref(null),C=()=>{j.value=!0},g=(k,y)=>{const b=k.id;if(!y(b)){a("copy:error",{entity:k,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:k,field:"id",message:n("targets.copy.success",{val:b})})},B=(k,y)=>{const b=JSON.stringify(k);if(!y(b)){a("copy:error",{entity:k,message:n("targets.errors.copy")});return}a("copy:success",{entity:k,message:n("targets.copy.success_brief")})},A=k=>{v.value=k,j.value=!0},F=k=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(k),S=k=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(k),w=t.ref(void 0),m=t.ref(!1),V=t.ref(!1),I=t.ref(""),x=Ka(l.config,p.value),E=k=>{w.value=k,m.value=!0},_=()=>{m.value=!1},T=async()=>{var k,y,b;if((k=w.value)!=null&&k.id){V.value=!0;try{await i.delete(x(w.value.id)),V.value=!1,m.value=!1,o.value++,a("delete:success",w.value)}catch(R){I.value=((b=(y=R.response)==null?void 0:y.data)==null?void 0:b.message)||R.message||n("targets.errors.delete"),a("error",R)}finally{V.value=!1}}},O=t.ref(!0);t.watch(f,k=>{var y,b,R,M;if(Array.isArray((y=k==null?void 0:k.response)==null?void 0:y.data)&&(O.value=k.response.data.length>0),k.status===pe.Error){N.value={title:n("targets.errors.general")},(M=(R=(b=k.error)==null?void 0:b.response)==null?void 0:R.data)!=null&&M.message&&(N.value.message=k.error.response.data.message),a("error",k.error);return}N.value=null});const $=t.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&($.value.title=n("targets.list.empty_state.title"),$.value.ctaText=n("targets.actions.create"))});const U=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace,requestHeaders:l.config.requestHeaders}})),v=t.ref(""),j=t.ref(!1),Y=k=>{v.value?a("update:target",k):a("create:target",k),q()},q=()=>{D(),o.value++},D=()=>{j.value=!1,v.value=""};return(k,y)=>{const b=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),M=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),X=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",pc,[t.createVNode(t.unref(Da),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":$.value,"enable-entity-actions":"","error-message":N.value,fetcher:t.unref(u),"fetcher-cache-key":o.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:y[1]||(y[1]=()=>l.config.createRoute?void 0:C()),onSort:s},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:t.withCtx(()=>[t.createVNode(t.unref(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(b,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:l.config.createRoute?l.config.createRoute:void 0,onClick:y[0]||(y[0]=()=>l.config.createRoute?void 0:C())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,O.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),target:t.withCtx(({rowValue:L})=>[t.createElementVNode("span",uc,t.toDisplayString(L),1)]),tags:t.withCtx(({rowValue:L})=>[t.createVNode(M,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(L,te=>(t.openBlock(),t.createBlock(R,{key:te,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(te),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:L})=>[t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:ye=>g(L,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:ye=>B(L,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:te=>A(L.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>F(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:te=>a("health-actions:healthy",L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>S(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:te=>a("health-actions:unhealthy",L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(L)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:te=>E(L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(Ma),{"action-pending":V.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(Ye).Target,error:I.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:m.value,onCancel:_,onProceed:T},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Ya,{config:U.value,"is-visible":j.value,"target-id":v.value,onCancel:D,onUpdate:Y},t.createSlots({_:2},[k.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(k.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-d258bcd3"]]),mc={key:1},gc=he(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var _,T,O,$;const{i18nT:a,i18n:{t:l}}=de.useI18n(),n=e,i=r,{debouncedQueryChange:o,loading:d,loadItems:c,results:h,allRecords:p}=Ra(n.config,(T=Ie.form[(_=n.config)==null?void 0:_.app])==null?void 0:T.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:s,results:N}=Ra(n.config,($=Ie.form[(O=n.config)==null?void 0:O.app])==null?void 0:$.getCertificates),C=t.ref(""),g=t.computed(()=>{var U;return!!n.name&&!((U=p.value)!=null&&U.some(v=>v.host===n.name))}),B=t.computed(()=>{var v,j,Y;const U=g.value&&n.name.includes((v=C.value)==null?void 0:v.toLowerCase());return(Y=h.value)==null?void 0:Y.map(q=>({label:q.host,value:q.id})).concat(U?[{label:n.name,value:((j=S.value)==null?void 0:j.value)||n.name}]:[])}),A=t.computed(()=>{var U;return(U=N.value)==null?void 0:U.map(v=>({label:v.id,value:v.id}))}),F=t.ref(""),S=t.ref({value:"",label:""}),w=t.computed(()=>{var U,v;return((U=B.value.find(j=>j.value===F.value))==null?void 0:U.label)||((v=S.value)==null?void 0:v.label)}),m=U=>{C.value=U,o(U)},V=U=>{S.value=U},I=()=>{S.value={value:"",label:""}},x=U=>{F.value=U,i("update:name",w.value)},E=t.ref(!1);return t.onBeforeMount(async()=>{var U,v;try{E.value=!0,await c(),n.name&&(F.value=((v=(U=B.value.find(j=>j.label===n.name))==null?void 0:U.value)==null?void 0:v.toString())||n.name),await s()}finally{E.value=!1}}),(U,v)=>{const j=t.resolveComponent("KSkeleton"),Y=t.resolveComponent("KSelect"),q=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[E.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",mc,[t.createVNode(Y,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:B.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":F.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:V,onItemRemoved:I,onQueryChange:m,"onUpdate:modelValue":x},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(q,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":v[0]||(v[0]=D=>i("update:host-header",D))},null,8,["label","model-value","readonly"]),t.createVNode(Y,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:A.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(f),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":v[1]||(v[1]=D=>i("update:client-certificate",D))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(q,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":v[2]||(v[2]=D=>i("update:tags",D))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),We={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},yc={class:"fields-group-title"},kc={class:"fields-group-text"},bc={class:"fields-group-title"},Cc={class:"fields-group-text"},wc=he(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=de.useI18n(),{inRange:n}=ze(),i=e,o=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>i.hashOn,(u,f)=>{f==="header"&&u!==f&&o("update:hash-on-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(o("update:hash-fallback","none"),o("update:hash-fallback-header",""),o("update:hash-fallback-query-argument",""),o("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,f)=>{f==="header"&&u!==f&&o("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?n(i.slots,ft,mt)?"":l("upstreams.form.errors.in_range"):"");return(u,f)=>{const s=t.resolveComponent("KExternalLink"),N=t.resolveComponent("KSelect"),C=t.resolveComponent("KInput"),g=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(We).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(N,{class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=B=>o("update:algorithm",B))},null,8,["items","label","model-value","readonly"]),t.createVNode(C,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(mt),min:t.unref(ft),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":f[1]||(f[1]=B=>o("update:slots",B))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",yc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",kc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(N,{class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[2]||(f[2]=B=>o("update:hash-on",B))},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(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[3]||(f[3]=B=>o("update:hash-on-header",B))},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(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[4]||(f[4]=B=>o("update:hash-on-cookie",B))},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(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[5]||(f[5]=B=>o("update:hash-on-cookie-path",B))},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(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[6]||(f[6]=B=>o("update:hash-on-query-argument",B))},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(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[7]||(f[7]=B=>o("update:hash-on-uri-capture",B))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",bc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",Cc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(N,{class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[8]||(f[8]=B=>o("update:hash-fallback",B))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[9]||(f[9]=B=>o("update:hash-fallback-header",B))},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(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[10]||(f[10]=B=>o("update:hash-on-cookie",B))},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(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[11]||(f[11]=B=>o("update:hash-on-cookie-path",B))},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(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[12]||(f[12]=B=>o("update:hash-fallback-query-argument",B))},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(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[13]||(f[13]=B=>o("update:hash-fallback-uri-capture",B))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),_c={class:"fields-group-title"},Sc={class:"fields-group-text"},xc={class:"fields-group-title"},Nc={class:"fields-group-text"},Vc=he(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=r;return(n,i)=>{const o=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(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(o,{"hide-icon":"",href:t.unref(We).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",_c,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",Sc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:i[0]||(i[0]=p=>l("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",xc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",Nc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:i[1]||(i[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(ec),min:t.unref(Xs),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),Ic={key:2},Bc={class:"fields-group-title"},Tc={class:"fields-group-text"},Ac={class:"fields-group-title"},Ec={class:"fields-group-text"},Hc=he(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),{objectsAreEqual:l}=ze(),n=e,i=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:h}=Oe({replaceId:!0}),{trackNewItems:p}=Oe({replaceId:!0});t.watch(()=>n.type,(C,g)=>{g==="tcp"&&C!==g&&i("update:tcp-failures","5"),(g==="https"||g==="grpcs")&&C!==g&&(i("update:https-sni",""),i("update:verify-ssl",!1)),g!=="tcp"&&C==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",gt),i("update:unhealthy-http-statuses",kt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,C=>{l(u.value,C)||(u.value=[...C])},{immediate:!0,deep:!0});const f=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),f()},N=C=>{C===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(C,1),f()};return(C,g)=>{const B=t.resolveComponent("KExternalLink"),A=t.resolveComponent("KSelect"),F=t.resolveComponent("KInput"),S=t.resolveComponent("KCheckbox"),w=t.resolveComponent("KLabel"),m=t.resolveComponent("KIcon"),V=t.resolveComponent("KButton"),I=t.resolveComponent("KMultiselect"),x=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(B,{"hide-icon":"",href:t.unref(We).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var E;return[t.createVNode(A,{class:"active-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":g[0]||(g[0]=_=>i("update:type",_))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(F,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":g[1]||(g[1]=_=>i("update:http-path",_))},null,8,["label","model-value","readonly"])),t.createVNode(F,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(ac),min:t.unref(tc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":g[2]||(g[2]=_=>i("update:timeout",_))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(F,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(lc),min:t.unref(rc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":g[3]||(g[3]=_=>i("update:concurrency",_))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(F,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":g[4]||(g[4]=_=>i("update:https-sni",_))},null,8,["label","model-value","readonly"]),t.createVNode(S,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":g[5]||(g[5]=_=>i("update:verify-ssl",_))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((E=e.config)==null?void 0:E.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",Ic,[t.createVNode(w,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(_,T)=>(t.openBlock(),t.createElementBlock("div",{key:`${_.header}_${T}`,class:t.normalizeClass(["headers-row",{"margin-top-6":T>0}])},[t.createVNode(F,{modelValue:u.value[T].key,"onUpdate:modelValue":O=>u.value[T].key=O,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${T+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(F,{modelValue:u.value[T].values,"onUpdate:modelValue":O=>u.value[T].values=O,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${T+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(V,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:O=>N(T)},{icon:t.withCtx(()=>[t.createVNode(m,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&T===u.value.length-1?(t.openBlock(),t.createBlock(V,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:s},{icon:t.withCtx(()=>[t.createVNode(m,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Bc,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Tc,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(F,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Qa),min:t.unref(Wa),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[6]||(g[6]=_=>i("update:interval",_))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(F,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(xe),min:t.unref(Se),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":g[7]||(g[7]=_=>i("update:successes",_))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Re),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[8]||(g[8]=_=>t.unref(h)(_,!0)),onItemRemoved:g[9]||(g[9]=_=>t.unref(h)(_,!1)),"onUpdate:modelValue":g[10]||(g[10]=_=>i("update:http-statuses",_))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Ac,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Ec,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(F,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Qa),min:t.unref(Wa),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[11]||(g[11]=_=>i("update:unhealthy-interval",_))},null,8,["help","label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createBlock(F,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(xe),min:t.unref(Se),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[12]||(g[12]=_=>i("update:tcp-failures",_))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(F,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(xe),min:t.unref(Se),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[13]||(g[13]=_=>i("update:http-failures",_))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Re),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[14]||(g[14]=_=>t.unref(p)(_,!0)),onItemRemoved:g[15]||(g[15]=_=>t.unref(p)(_,!1)),"onUpdate:modelValue":g[16]||(g[16]=_=>i("update:unhealthy-http-statuses",_))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(F,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":g[17]||(g[17]=_=>i("update:unhealthy-timeouts",_))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-9e6394cf"]]),qc={class:"fields-group-title"},Fc={class:"fields-group-text"},Oc={class:"fields-group-title"},vc={class:"fields-group-text"},Uc=he(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=e,n=r,i=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),o=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=Oe({replaceId:!0}),{trackNewItems:c}=Oe({replaceId:!0});return t.watch(()=>l.type,(h,p)=>{p==="tcp"&&h!==p&&n("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(n("update:http-statuses",yt),n("update:unhealthy-http-statuses",bt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),N=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(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(We).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(f,{class:"passive-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=g=>n("update:type",g))},null,8,["items","label","model-value","readonly"]),t.createVNode(C,null,{default:t.withCtx(()=>[t.createElementVNode("h5",qc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",Fc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(xe),min:t.unref(Se),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=g=>n("update:successes",g))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(N,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Re),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=g=>t.unref(d)(g,!0)),onItemRemoved:p[3]||(p[3]=g=>t.unref(d)(g,!1)),"onUpdate:modelValue":p[4]||(p[4]=g=>n("update:http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(C,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Oc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",vc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=g=>n("update:timeouts",g))},null,8,["label","max","min","model-value","readonly"]),o.value?(t.openBlock(),t.createBlock(s,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(xe),min:t.unref(Se),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=g=>n("update:tcp-failures",g))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(s,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(xe),min:t.unref(Se),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=g=>n("update:http-failures",g))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(N,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Re),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=g=>t.unref(c)(g,!0)),onItemRemoved:p[9]||(p[9]=g=>t.unref(c)(g,!1)),"onUpdate:modelValue":p[10]||(p[10]=g=>n("update:unhealthy-http-statuses",g))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-cca8adae"]]),$c={class:"kong-ui-entities-upstreams-form"},Dc=he(t.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:r}){var K;const a=e,l=r,{inRange:n,stringToNumberArray:i,upstreamsResponseToFields:o,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=ze(),{axiosInstance:p}=Le({headers:(K=a.config)==null?void 0:K.requestHeaders}),{getMessageFromError:u}=Pa(),f=Qe.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),N=t.reactive(d()),C=t.computed(()=>!c(s.fields,N)),g=k=>{s.fields.activeHealthCheck.interval=k?"5":"0",s.fields.activeHealthCheck.successes=k?"5":"0",s.fields.activeHealthCheck.httpFailures=k?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=k?"5":"0"},B=k=>{s.fields.passiveHealthCheck.timeouts=k?"5":"0",s.fields.passiveHealthCheck.successes=k?"80":"0"},A=t.computed(()=>s.fields.slots?n(s.fields.slots,ft,mt):!0),F=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),S=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),w=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),m=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),V=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),I=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),x=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),E=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),_=t.computed(()=>!!s.fields.name&&A.value&&F.value&&S.value&&w.value&&m.value&&V.value&&I.value&&x.value&&E.value),T=t.computed(()=>a.upstreamId?oe.Edit:oe.Create),O=t.computed(()=>{var k,y;return(y=Ie.form[(k=a.config)==null?void 0:k.app])==null?void 0:y.edit}),$=k=>{Object.assign(s.fields,o(k)),Object.assign(N,h(s.fields))},U=()=>{var k;f.push(((k=a.config)==null?void 0:k.cancelRoute)||{name:"upstreams-list"})},v=k=>{l("loading",k)},j=k=>{l("error",k)},Y=t.computed(()=>{var y,b,R,M,z;const k={name:s.fields.name,slots:Number(s.fields.slots),algorithm:s.fields.algorithm,hash_on:s.fields.hashOn,hash_fallback:s.fields.hashFallback,healthchecks:{}};return s.fields.hostHeader&&(k.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(k.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(k.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(k.tags=(b=(y=s.fields.tags.split(","))==null?void 0:y.map(X=>String(X||"").trim()))==null?void 0:b.filter(X=>X!=="")),s.fields.hashOn==="header"&&(k.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(k.hash_on_cookie=s.fields.hashOnCookie,k.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(k.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(k.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(k.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(k.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(k.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(k.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(k.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(k.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(k.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?k.healthchecks.active.headers=[]:k.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((X,L)=>{var te,ye;return L.key?{...X,[L.key]:(ye=(te=L.values.split(","))==null?void 0:te.map(Be=>String(Be||"").trim()))==null?void 0:ye.filter(Be=>Be!=="")}:{...X}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(k.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(k.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(k.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(k.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(k.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(k.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(k.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(k.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.type==="tcp"&&s.fields.activeHealthCheck.tcpFailures&&(k.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((M=a.config)==null?void 0:M.app)==="kongManager"&&T.value===oe.Edit&&(k.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),s.fields.passiveHealthSwitch?(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(k.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(k.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(k.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(k.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.type==="tcp"&&s.fields.passiveHealthCheck.tcpFailures&&(k.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&T.value===oe.Edit&&(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),k}),q=k=>{var b,R,M,z,X,L;let y=`${(b=a.config)==null?void 0:b.apiBaseUrl}${Ie.form[(R=a.config)==null?void 0:R.app][k]}`;return((M=a.config)==null?void 0:M.app)==="konnect"?y=y.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((X=a.config)==null?void 0:X.app)==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(L=a.config)!=null&&L.workspace?`/${a.config.workspace}`:"")),y=y.replace(/{id}/gi,a.upstreamId),y},D=async()=>{var k;try{s.readonly=!0,await p.post(q("validate"),Y.value);let y;T.value===oe.Create?y=await p.post(q("create"),Y.value):T.value===oe.Edit&&(y=((k=a.config)==null?void 0:k.app)==="konnect"?await p.put(q("edit"),Y.value):await p.patch(q("edit"),Y.value)),l("update",y==null?void 0:y.data)}catch(y){s.errorMessage=u(y),l("error",y)}finally{s.readonly=!1}};return(k,y)=>(t.openBlock(),t.createElementBlock("div",$c,[t.createVNode(t.unref($a),{"can-submit":_.value&&C.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":O.value,"form-fields":Y.value,"is-readonly":s.readonly,onCancel:U,"onFetch:error":j,"onFetch:success":$,onLoading:v,onSubmit:D},{default:t.withCtx(()=>[t.createVNode(gc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":y[0]||(y[0]=b=>s.fields.clientCertificate=b),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":y[1]||(y[1]=b=>s.fields.hostHeader=b),name:s.fields.name,"onUpdate:name":y[2]||(y[2]=b=>s.fields.name=b),tags:s.fields.tags,"onUpdate:tags":y[3]||(y[3]=b=>s.fields.tags=b),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(wc,{algorithm:s.fields.algorithm,"onUpdate:algorithm":y[4]||(y[4]=b=>s.fields.algorithm=b),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":y[5]||(y[5]=b=>s.fields.hashFallback=b),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":y[6]||(y[6]=b=>s.fields.hashFallbackHeader=b),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":y[7]||(y[7]=b=>s.fields.hashFallbackQueryArgument=b),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":y[8]||(y[8]=b=>s.fields.hashFallbackUriCapture=b),"hash-on":s.fields.hashOn,"onUpdate:hashOn":y[9]||(y[9]=b=>s.fields.hashOn=b),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":y[10]||(y[10]=b=>s.fields.hashOnCookie=b),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":y[11]||(y[11]=b=>s.fields.hashOnCookiePath=b),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":y[12]||(y[12]=b=>s.fields.hashOnHeader=b),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":y[13]||(y[13]=b=>s.fields.hashOnQueryArgument=b),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":y[14]||(y[14]=b=>s.fields.hashOnUriCapture=b),slots:s.fields.slots,"onUpdate:slots":y[15]||(y[15]=b=>s.fields.slots=b),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(Vc,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[y[16]||(y[16]=b=>s.fields.activeHealthSwitch=b),g],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":y[17]||(y[17]=b=>s.fields.healthchecksThreshold=b),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[y[18]||(y[18]=b=>s.fields.passiveHealthSwitch=b),B],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Hc,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":y[19]||(y[19]=b=>s.fields.activeHealthCheck.concurrency=b),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":y[20]||(y[20]=b=>s.fields.activeHealthCheck.headers=b),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":y[21]||(y[21]=b=>s.fields.activeHealthCheck.httpFailures=b),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":y[22]||(y[22]=b=>s.fields.activeHealthCheck.httpPath=b),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[23]||(y[23]=b=>s.fields.activeHealthCheck.httpStatuses=b),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":y[24]||(y[24]=b=>s.fields.activeHealthCheck.httpsSni=b),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":y[25]||(y[25]=b=>s.fields.activeHealthCheck.interval=b),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":y[26]||(y[26]=b=>s.fields.activeHealthCheck.successes=b),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[27]||(y[27]=b=>s.fields.activeHealthCheck.tcpFailures=b),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":y[28]||(y[28]=b=>s.fields.activeHealthCheck.timeout=b),type:s.fields.activeHealthCheck.type,"onUpdate:type":y[29]||(y[29]=b=>s.fields.activeHealthCheck.type=b),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[30]||(y[30]=b=>s.fields.activeHealthCheck.unhealthyHttpStatuses=b),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":y[31]||(y[31]=b=>s.fields.activeHealthCheck.unhealthyInterval=b),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":y[32]||(y[32]=b=>s.fields.activeHealthCheck.unhealthyTimeouts=b),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":y[33]||(y[33]=b=>s.fields.activeHealthCheck.verifySsl=b),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(Uc,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":y[34]||(y[34]=b=>s.fields.passiveHealthCheck.httpFailures=b),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[35]||(y[35]=b=>s.fields.passiveHealthCheck.httpStatuses=b),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":y[36]||(y[36]=b=>s.fields.passiveHealthCheck.successes=b),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[37]||(y[37]=b=>s.fields.passiveHealthCheck.tcpFailures=b),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":y[38]||(y[38]=b=>s.fields.passiveHealthCheck.timeouts=b),type:s.fields.passiveHealthCheck.type,"onUpdate:type":y[39]||(y[39]=b=>s.fields.passiveHealthCheck.type=b),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[40]||(y[40]=b=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=b),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-05687a98"]]),Mc=t.createElementVNode("code",null,"10",-1),jc=t.createElementVNode("code",null,"65536",-1),Kc={"data-testid":"client_certificate-plain-text"},Pc=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=de.useI18n(),{getPropValue:n}=Ys(),i=t.computed(()=>Ie.form[r.config.app].edit),o=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:J.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:J.Basic},hash_on:{order:7,section:J.Basic},hash_on_header:{order:8,section:J.Basic},hash_on_uri_capture:{order:9,section:J.Basic},hash_on_query_arg:{order:10,section:J.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:J.Basic},hash_on_cookie_path:{order:12,section:J.Basic},healthchecks:{order:13,section:J.Basic,type: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(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(ms),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":o.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onFetch:error":c[0]||(c[0]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[1]||(c[1]=h=>d.$emit("fetch:success",h)),onLoading:c[2]||(c[2]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(h.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[Mc]),max:t.withCtx(()=>[jc]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",Kc,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(n)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});ae.TargetForm=Ya,ae.TargetsList=fc,ae.UpstreamsConfigCard=Pc,ae.UpstreamsForm=Dc,ae.UpstreamsList=sc,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});