@kong-ui-public/entities-upstreams-targets 2.3.28 → 2.3.29
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.
- package/dist/entities-upstreams-targets.es.js +1371 -1262
- package/dist/entities-upstreams-targets.umd.js +26 -26
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -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,Ct,Ie,mr,Je){"use strict";var We=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(We||{}),ne=(e=>(e.Edit="edit",e.Create="create",e))(ne||{}),pe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(pe||{}),L=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),W=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(W||{});function gr(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):Ct.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),Ct.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 yr(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const Qe="khcp-user-table-preferences",kr={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function br(){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(Qe));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const o=r();o.set(a,l),localStorage.setItem(Qe,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||kr},deleteAllTablePreferences:()=>{localStorage.removeItem(Qe)}}}function Ye(e={}){const{getAxiosInstance:r}=gr();return{axiosInstance:r(e)}}const Cr={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},wr={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},_r={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."}},Sr={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},xr={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"}},Nr={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Vr={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Br={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ir={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"}},Tr={global:Cr,deleteModal:wr,baseForm:_r,baseTable:Sr,baseConfigCard:xr,filter:Nr,debouncedFilter:Vr,errors:Br,toggleModal:Ir};function Ze(){const e=Ie.createI18n("en-us",Tr);return{i18n:e,i18nT:Ie.i18nTComponent(e)}}function wt(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const o=new Set([...a,...l]);for(const i of o){const n=a.filter(c=>c===i).length,d=l.filter(c=>c===i).length;if(n!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,o)=>{if(o){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,o)=>{let i=l[a]===void 0||l[a]===null?"":l[a],n=o[a]===void 0||o[a]===null?"":o[a];return Array.isArray(l[a])&&(i=l[a][0]),Array.isArray(o[a])&&(n=o[a][0]),i.localeCompare(n)},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 Ar(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:o}=Ye({headers:e.requestHeaders}),{i18n:{t:i}}=Ze(),{debounce:n}=yr(),d=n(async V=>{await A(V)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),f=t.ref([]),s=t.ref(void 0),x=t.unref(r);let b=`${e.apiBaseUrl}${x}`;e.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=wt(),k=async()=>{try{c.value=!0;const{data:V}=await o.get(`${b}?size=${a}`);V!=null&&V.next||(s.value=l.fetchedItemsKey in V?V[l.fetchedItemsKey]:[]),f.value=l.fetchedItemsKey in V?V[l.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},N=t.ref(""),A=async V=>{var T,_,F;if(N.value!==V)if(N.value=V||"",s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){let B=b+"";V&&(B+=`/${V}`);const{data:w}=await o.get(`${B}?size=${a}`);l.fetchedItemsKey in w?u.value=w[l.fetchedItemsKey]:w!=null&&w.id?u.value=[w]:u.value=[]}else if(V){const B=[];m(V)&&l.searchKeys.includes("id")?B.push((async()=>{const{data:S}=await o.get(`${b}/${V}`);return[S[l.fetchedItemsKey]??S]})()):B.push(...l.searchKeys.filter(S=>S!=="id").map(async S=>{const{data:H}=await o.get(`${b}?${S}=${V}`);return H[l.fetchedItemsKey]}));const w=await Promise.all(B),E=new Set;u.value=[],(T=w==null?void 0:w.forEach)==null||T.call(w,S=>{var H;(H=S==null?void 0:S.forEach)==null||H.call(S,v=>{E.has(v.id)||(E.add(v.id),u.value.push(v))})})}else u.value=f.value}catch(B){((_=B==null?void 0:B.response)==null?void 0:_.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="",V?(u.value=(F=s.value)==null?void 0:F.filter(B=>{var w;let E=!1;for(const S of l.searchKeys){const H=typeof B[S]=="string"?(w=B[S])==null?void 0:w.toLowerCase():B[S];H!=null&&H.includes(V.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:k,debouncedQueryChange:d}}function Er(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="",o=>`${l.value.href}/${o}`}function Hr(){const{i18n:{t:e}}=Ze();return{getMessageFromError:r=>{var a,l,o,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((o=r.response.data.details)!=null&&o.length)return r.response.data.details.map(n=>{let d=e("errors.unexpected");return n.messages&&typeof n.messages=="object"&&n.messages.length&&(d=n.messages.join(", ")),n.field?`${n.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:n}=r.response.data;return Array.isArray(n)?(i=n[0])!=null&&i.constraints?Object.values(n[0].constraints)[0]:n[0]:n}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(n=>`${n} ${r.response.data[n]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Fr(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),o=`${a}${l}`,i=e.some(n=>n.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!i&&new URL(o))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)),o=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 n=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:f}=n;try{let s=new URL(i.value.href);return o.value&&f?(s.search="",s=a.value.app==="konnect"?new URL(`${s.href}?filter[name][contains]=${f}`):new URL(`${s.href}/${f}/`)):(o.value||new URLSearchParams(f).forEach((x,b)=>{s.searchParams.append(b,x)}),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 Or(e,r,a="data"){const l=t.unref(r),{axiosInstance:o}=Ye({headers:e.requestHeaders}),i=_t(e,l),n=t.ref({status:pe.Idle});return{fetcher:async d=>{try{n.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 o.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 n.value={status:pe.Idle,response:f},f}catch(c){const h={data:[],total:0};return d.query&&c.response.status===404?(n.value={status:pe.NoResults,response:h,error:c},h):(n.value={status:pe.Error,response:h,error:c},h)}},fetcherState:n}}function qr(){const e=(a,l="_")=>a?a.split(l).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const St=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,xt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(St);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},Nt=e=>e==="*"||e==="x"||e==="X",Vt=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Ur=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],$r=(e,r)=>{if(Nt(e)||Nt(r))return 0;const[a,l]=Ur(Vt(e),Vt(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=$r(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},vr=(e,r)=>{const a=xt(e),l=xt(r),o=a.pop(),i=l.pop(),n=Bt(a,l);return n!==0?n:o&&i?Bt(o.split("."),i.split(".")):o||i?o?-1:1:0},It=(e,r,a)=>{Dr(a);const l=vr(e,r);return Tt[a].includes(l)},Tt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},At=Object.keys(Tt),Dr=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(At.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${At.join("|")}`)},jr=e=>typeof e=="string"&&/^[v\d]/.test(e)&&St.test(e);function Mr(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:o}=r;if(!jr(o))return console.error("Invalid version"),!1;const i=a[l];if(!i)return!1;const[n,d]=i;return!(n&&It(o,n,"<")||d&&It(o,d,">"))}function Kr(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,o=>{o&&!l.value&&(r.value=o.offsetWidth,a.value=o.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}const Z={useAxios:Ye,useDebouncedFilter:Ar,useDeleteUrlBuilder:Er,useErrors:Hr,useExternalLinkCreator:Fr,useFetcher:Or,useFetchUrlBuilder:_t,useHelpers:wt,useStringHelpers:qr,useI18n:Ze,useGatewayFeatureSupported:Mr,useTruncationDetector:Kr},Pr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Lr="Copy to clipboard",Rr={message:Pr,iconTitle:Lr},zr="kong-ui-copy-uuid-notify",Et="24px",Jr=(e,r)=>{const a=e.__vccOpts||e;for(const[l,o]of r)a[l]=o;return a},Wr=e=>(t.pushScopeId("data-v-13f41aa3"),e=e(),t.popScopeId(),e),Qr=["aria-hidden"],Yr={key:0,"data-testid":"kui-icon-svg-title"},Zr=Wr(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Gr=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Et,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 o=String(r.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return Et}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(o,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Yr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Zr],8,Qr))]),_:1},8,["aria-hidden","style"]))}}),Xr=Jr(Gr,[["__scopeId","data-v-13f41aa3"]]),eo="16px",to={class:"kong-ui-copy-uuid"},ao=["onClick"],Ht=15,lo=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:r}){const{t:a}=Ie.createI18n("en-us",Rr),l=e,o=r,i=l.notify||t.inject(zr,()=>{}),n=t.computed(()=>l.idTooltip?{label:l.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:l.uuid}),d=t.computed(()=>!!(l.tooltip&&l.successTooltip)),c=t.ref(l.tooltip),h=t.computed(()=>l.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),p=t.computed(()=>{var s;return l.format==="redacted"?"*****":l.format==="deleted"?`*${(s=l.uuid)==null?void 0:s.substring(0,5)}`:l.uuid}),u=s=>{c.value=s,setTimeout(()=>{c.value=l.tooltip},1800)},f=s=>{var x,b;if(!s(l.uuid)){typeof i=="function"&&i({type:"error",message:a("message.fail")}),d.value?u(a("message.fail")):o("error",l.uuid);return}const m=((x=l.uuid)==null?void 0:x.length)>Ht,k=l.format==="hidden"||l.format==="redacted"?a("message.success.prefix"):`"${((b=l.uuid)==null?void 0:b.substring(0,Ht))+(m?"...":"")}"`;typeof i=="function"&&i({type:"success",message:`${k}${a("message.success.content")}`}),d.value?u(l.successTooltip):o("success",l.uuid)};return(s,x)=>{const b=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",to,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},n.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(p.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(h.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(b,null,{default:t.withCtx(({copyToClipboard:m})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(k=>f(m),["stop"])},[t.createVNode(t.unref(Xr),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(eo),title:t.unref(a)("iconTitle")},null,8,["color","decorative","size","title"])],8,ao)]),_:1})]),_:1},16))])}}}),ro=(e,r)=>{const a=e.__vccOpts||e;for(const[l,o]of r)a[l]=o;return a},Ft=ro(lo,[["__scopeId","data-v-0c07874b"]]),oo={key:0,class:"config-card-fieldset-title"},no=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(),o=t.computed(()=>r.item.key??"json-array-item"),i=t.computed(()=>r.item.value??r.item),n=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",oo,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(n.value),(p,u)=>(t.openBlock(),t.createBlock(Ge,{key:`${o.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:n.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),oe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,o]of r)a[l]=o;return a},Ot=oe(no,[["__scopeId","data-v-68ca83ec"]]),io=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 o=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(o,{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})])}}}),so=oe(io,[["__scopeId","data-v-c96811e5"]]),co=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const o=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(o,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),ho="#0044f4",po="#e0e4ea",uo="#3a3f51",fo="1px",mo="20px",go={class:"config-card-details-row"},yo=["data-testid"],ko=["data-testid"],bo=["data-testid"],Co=["data-testid"],wo={key:1},_o=["data-testid"],So=["data-testid"],xo=["data-testid"],No=["data-testid"],Vo={name:"ConfigCardItem",components:{CopyUuid:Ft,JsonCardItem:Ot,StatusBadge:co,InternalLinkItem:so}},Bo=t.defineComponent({...Vo,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(x=>({"5ae2770e":p.value?"none":`solid ${t.unref(fo)} ${t.unref(po)}`,"4db3977e":h.value&&d.value?"block":"flex","1a7c5e02":h.value&&d.value?"100%":a.slim?"50%":"25%","1a77d24c":h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,o=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:n}}=Z.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||o["label-tooltip"])),h=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),p=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:n(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:x=>{l("navigation-click",x)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),f=t.ref(),{isTruncated:s}=Z.useTruncationDetector(f);return(x,b)=>{const m=t.resolveComponent("KLabel"),k=t.resolveComponent("KBadge"),N=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",go,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(x.$slots,"label",{item:e.item},()=>[t.createVNode(m,{"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(x.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,ko)]),key:"0"}:void 0]),1024)],!0)],8,yo),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(x.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",wo,[(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,(A,V)=>(t.openBlock(),t.createBlock(k,{key:`${e.item.key}-badge-tag-${V}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${V}`,tooltip:A,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(A),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,_o)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(A,V)=>(t.openBlock(),t.createBlock(t.unref(Ft),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${V}`,"data-testid":`${e.item.key}-copy-uuid-${V}`,uuid:A}),null,16,["data-testid","uuid"]))),128))],8,So)):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,(A,V)=>(t.openBlock(),t.createBlock(k,{key:`${e.item.key}-badge-method-${V}`,appearance:Object.values(t.unref(mr.BadgeMethodAppearances)).includes(A.toLowerCase())?A.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${V}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(A),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,xo)):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,(A,V)=>(t.openBlock(),t.createBlock(Ot,{key:`json-array-item-${V}`,index:V,"is-array-item":"",item:A},null,8,["index","item"]))),128))],8,No)):(t.openBlock(),t.createBlock(N,{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,Co))],!0)],8,bo)])}}}),Ge=oe(Bo,[["__scopeId","data-v-f65fc52c"]]),Io={class:"json-config"},To={key:0,class:"json-endpoint"},qt=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(o=>({"2d178975":`${l.value}ch`}));const r=e,a=t.computed(()=>r.jsonRecord),l=t.computed(()=>{var o;if(!r.fetcherUrl)return 0;const i=(o=r.fetcherUrl)==null?void 0:o.split("/");return i.length<2?0:41+(r.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(o,i)=>{var n;const d=t.resolveComponent("KBadge"),c=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Io,[r.fetcherUrl&&(n=r.config)!=null&&n.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",To,[t.createVNode(d,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(c,{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(c,{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 Ut(e){return typeof e>"u"||e===null}function Ao(e){return typeof e=="object"&&e!==null}function Eo(e){return Array.isArray(e)?e:Ut(e)?[]:[e]}function Ho(e,r){var a,l,o,i;if(r)for(i=Object.keys(r),a=0,l=i.length;a<l;a+=1)o=i[a],e[o]=r[o];return e}function Fo(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function Oo(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var qo=Ut,Uo=Ao,$o=Eo,vo=Fo,Do=Oo,jo=Ho,Y={isNothing:qo,isObject:Uo,toArray:$o,repeat:vo,isNegativeZero:Do,extend:jo};function $t(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,Ie,gl,We){"use strict";var Qe=(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))(Qe||{}),ne=(e=>(e.Edit="edit",e.Create="create",e))(ne||{}),pe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(pe||{}),L=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),W=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(W||{});function yl(){return{getAxiosInstance:(e={})=>{try{const l=t.inject("get-axios-instance",void 0);return typeof l=="function"?l(e):wt.create({withCredentials:!0,timeout:3e4,...e})}catch(l){return console.warn("getAxiosInstance:",l.message||l),wt.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var l;return((l=e==null?void 0:e.response)==null?void 0:l.headers["x-datadog-trace-id"])||""}}}function kl(){return{debounce:(e,l)=>{let a;return(...r)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...r)},l)}}}}const Ye="khcp-user-table-preferences",bl={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Cl(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},l=()=>{const a=e(localStorage.getItem(Ye));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,r)=>{try{const o=l();o.set(a,r),localStorage.setItem(Ye,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:a=>{const r=l();return(r==null?void 0:r.get(a))||void 0||bl},deleteAllTablePreferences:()=>{localStorage.removeItem(Ye)}}}function Ze(e={}){const{getAxiosInstance:l}=yl();return{axiosInstance:l(e)}}const wl={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},_l={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Sl={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."}},xl={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Nl={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"}},Vl={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Bl={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Il={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Tl={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"}},Al={global:wl,deleteModal:_l,baseForm:Sl,baseTable:xl,baseConfigCard:Nl,filter:Vl,debouncedFilter:Bl,errors:Il,toggleModal:Tl};function Ge(){const e=Ie.createI18n("en-us",Al);return{i18n:e,i18nT:Ie.i18nTComponent(e)}}function _t(){const e=(a,r)=>(r==null?void 0:r[a])??void 0,l=(a,r)=>{if(a.length!==r.length)return!1;const o=new Set([...a,...r]);for(const i of o){const n=a.filter(c=>c===i).length,d=r.filter(c=>c===i).length;if(n!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,r,o)=>{if(o){if(Object.keys(a).length===Object.keys(r).length)for(const i in a)if(Array.isArray(a[i])&&Array.isArray(r[i])){if(l(a[i],r[i]))continue;return!1}else{if(a[i]===r[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(r)}catch{return!1}},sortAlpha:a=>(r,o)=>{let i=r[a]===void 0||r[a]===null?"":r[a],n=o[a]===void 0||o[a]===null?"":o[a];return Array.isArray(r[a])&&(i=r[a][0]),Array.isArray(o[a])&&(n=o[a][0]),i.localeCompare(n)},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 El(e,l,a,r={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:o}=Ze({headers:e.requestHeaders}),{i18n:{t:i}}=Ge(),{debounce:n}=kl(),d=n(async N=>{await T(N)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),f=t.ref([]),s=t.ref(void 0),x=t.unref(l);let b=`${e.apiBaseUrl}${x}`;e.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=_t(),w=async()=>{try{c.value=!0;const{data:N}=await o.get(`${b}?size=${a}`);N!=null&&N.next||(s.value=r.fetchedItemsKey in N?N[r.fetchedItemsKey]:[]),f.value=r.fetchedItemsKey in N?N[r.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},V=t.ref(""),T=async N=>{var B,_,F;if(V.value!==N)if(V.value=N||"",s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){let E=b+"";N&&(E+=`/${N}`);const{data:k}=await o.get(`${E}?size=${a}`);r.fetchedItemsKey in k?u.value=k[r.fetchedItemsKey]:k!=null&&k.id?u.value=[k]:u.value=[]}else if(N){const E=[];m(N)&&r.searchKeys.includes("id")?E.push((async()=>{const{data:S}=await o.get(`${b}/${N}`);return[S[r.fetchedItemsKey]??S]})()):E.push(...r.searchKeys.filter(S=>S!=="id").map(async S=>{const{data:H}=await o.get(`${b}?${S}=${N}`);return H[r.fetchedItemsKey]}));const k=await Promise.all(E),A=new Set;u.value=[],(B=k==null?void 0:k.forEach)==null||B.call(k,S=>{var H;(H=S==null?void 0:S.forEach)==null||H.call(S,$=>{A.has($.id)||(A.add($.id),u.value.push($))})})}else u.value=f.value}catch(E){((_=E==null?void 0:E.response)==null?void 0:_.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="",N?(u.value=(F=s.value)==null?void 0:F.filter(E=>{var k;let A=!1;for(const S of r.searchKeys){const H=typeof E[S]=="string"?(k=E[S])==null?void 0:k.toLowerCase():E[S];H!=null&&H.includes(N.toLowerCase())&&(A=!0)}return A}),(!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:w,debouncedQueryChange:d}}function Hl(e,l){const a=t.unref(l),r=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return r.value.search="",o=>`${r.value.href}/${o}`}function Fl(){const{i18n:{t:e}}=Ge();return{getMessageFromError:l=>{var a,r,o,i;if(!l)return e("errors.unexpected");if(((a=l==null?void 0:l.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((r=l==null?void 0:l.response)!=null&&r.data){if(l.response.data.detail)return l.response.data.detail;if((o=l.response.data.details)!=null&&o.length)return l.response.data.details.map(n=>{let d=e("errors.unexpected");return n.messages&&typeof n.messages=="object"&&n.messages.length&&(d=n.messages.join(", ")),n.field?`${n.field} - ${d}`:d}).join("; ");if(l.response.data.message){const{message:n}=l.response.data;return Array.isArray(n)?(i=n[0])!=null&&i.constraints?Object.values(n[0].constraints)[0]:n[0]:n}if(typeof l.response.data=="string")return l.response.data;if(typeof l.response.data=="object")return Object.keys(l.response.data).map(n=>`${n} ${l.response.data[n]}`).join(", ")}return l.message||e("errors.unexpected")}}}function Ol(e){const l=window.location.origin,a=l.endsWith("/")?l:`${l}/`;try{const r=e.join("/"),o=`${a}${r}`,i=e.some(n=>n.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!i&&new URL(o))return`${a}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function St(e,l){const a=t.ref(t.unref(e)),r=t.ref(t.unref(l)),o=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),i=t.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return n=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:f}=n;try{let s=new URL(i.value.href);return o.value&&f?(s.search="",s=a.value.app==="konnect"?new URL(`${s.href}?filter[name][contains]=${f}`):new URL(`${s.href}/${f}/`)):(o.value||new URLSearchParams(f).forEach((x,b)=>{s.searchParams.append(b,x)}),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),r.value}}}function ql(e,l,a="data"){const r=t.unref(l),{axiosInstance:o}=Ze({headers:e.requestHeaders}),i=St(e,r),n=t.ref({status:pe.Idle});return{fetcher:async d=>{try{n.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 o.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 n.value={status:pe.Idle,response:f},f}catch(c){const h={data:[],total:0};return d.query&&c.response.status===404?(n.value={status:pe.NoResults,response:h,error:c},h):(n.value={status:pe.Error,response:h,error:c},h)}},fetcherState:n}}function $l(){const e=(a,r="_")=>a?a.split(r).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",l=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(l,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const 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 l=e.match(xt);if(!l)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return l.shift(),l},Vt=e=>e==="*"||e==="x"||e==="X",Bt=e=>{const l=parseInt(e,10);return isNaN(l)?e:l},Ul=(e,l)=>typeof e!=typeof l?[String(e),String(l)]:[e,l],vl=(e,l)=>{if(Vt(e)||Vt(l))return 0;const[a,r]=Ul(Bt(e),Bt(l));return a>r?1:a<r?-1:0},It=(e,l)=>{for(let a=0;a<Math.max(e.length,l.length);a++){const r=vl(e[a]||"0",l[a]||"0");if(r!==0)return r}return 0},Dl=(e,l)=>{const a=Nt(e),r=Nt(l),o=a.pop(),i=r.pop(),n=It(a,r);return n!==0?n:o&&i?It(o.split("."),i.split(".")):o||i?o?-1:1:0},Tt=(e,l,a)=>{jl(a);const r=Dl(e,l);return At[a].includes(r)},At={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Et=Object.keys(At),jl=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("|")}`)},Ml=e=>typeof e=="string"&&/^[v\d]/.test(e)&&xt.test(e);function Kl(e){const{gatewayInfo:l,supportedRange:a}=e;if(!l)return!0;const{edition:r,version:o}=l;if(!Ml(o))return console.error("Invalid version"),!1;const i=a[r];if(!i)return!1;const[n,d]=i;return!(n&&Tt(o,n,"<")||d&&Tt(o,d,">"))}function Pl(e){const l=t.ref(0),a=t.ref(0),r=t.ref(!1);return t.watch(e,o=>{o&&!r.value&&(l.value=o.offsetWidth,a.value=o.scrollWidth,r.value=!0)}),{isTruncated:t.computed(()=>l.value<a.value)}}const Z={useAxios:Ze,useDebouncedFilter:El,useDeleteUrlBuilder:Hl,useErrors:Fl,useExternalLinkCreator:Ol,useFetcher:ql,useFetchUrlBuilder:St,useHelpers:_t,useStringHelpers:$l,useI18n:Ge,useGatewayFeatureSupported:Kl,useTruncationDetector:Pl},Ll={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Rl="Copy to clipboard",zl={message:Ll,iconTitle:Rl},Jl="kong-ui-copy-uuid-notify",Ht="24px",Wl=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Ql=e=>(t.pushScopeId("data-v-13f41aa3"),e=e(),t.popScopeId(),e),Yl=["aria-hidden"],Zl={key:0,"data-testid":"kui-icon-svg-title"},Gl=Ql(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Xl=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Ht,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return Ht}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Zl,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Gl],8,Yl))]),_:1},8,["aria-hidden","style"]))}}),eo=Wl(Xl,[["__scopeId","data-v-13f41aa3"]]),to="16px",ao={class:"kong-ui-copy-uuid"},ro=["onClick"],Ft=15,lo=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:l}){const{t:a}=Ie.createI18n("en-us",zl),r=e,o=l,i=r.notify||t.inject(Jl,()=>{}),n=t.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),d=t.computed(()=>!!(r.tooltip&&r.successTooltip)),c=t.ref(r.tooltip),h=t.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),p=t.computed(()=>{var s;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(s=r.uuid)==null?void 0:s.substring(0,5)}`:r.uuid}),u=s=>{c.value=s,setTimeout(()=>{c.value=r.tooltip},1800)},f=s=>{var x,b;if(!s(r.uuid)){typeof i=="function"&&i({type:"error",message:a("message.fail")}),d.value?u(a("message.fail")):o("error",r.uuid);return}const m=((x=r.uuid)==null?void 0:x.length)>Ft,w=r.format==="hidden"||r.format==="redacted"?a("message.success.prefix"):`"${((b=r.uuid)==null?void 0:b.substring(0,Ft))+(m?"...":"")}"`;typeof i=="function"&&i({type:"success",message:`${w}${a("message.success.content")}`}),d.value?u(r.successTooltip):o("success",r.uuid)};return(s,x)=>{const b=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",ao,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},n.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(p.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(h.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(b,null,{default:t.withCtx(({copyToClipboard:m})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(w=>f(m),["stop"])},[t.createVNode(t.unref(eo),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(to),title:t.unref(a)("iconTitle")},null,8,["color","decorative","size","title"])],8,ro)]),_:1})]),_:1},16))])}}}),oo=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Ot=oo(lo,[["__scopeId","data-v-0c07874b"]]),no={key:0,class:"config-card-fieldset-title"},io=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const l=e,{i18n:{t:a}}=Z.useI18n(),{convertKeyToTitle:r}=Z.useStringHelpers(),o=t.computed(()=>l.item.key??"json-array-item"),i=t.computed(()=>l.item.value??l.item),n=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return l.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return l.isArrayItem?(c=i.value)!=null&&c.name?r(i.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:l.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",no,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(n.value),(p,u)=>(t.openBlock(),t.createBlock(Xe,{key:`${o.value}-property-${u}`,item:{key:p,label:t.unref(r)(p),value:n.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),oe=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},qt=oe(io,[["__scopeId","data-v-68ca83ec"]]),so=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:l}}=Z.useI18n();return(a,r)=>{const o=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=i=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(l)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),co=oe(so,[["__scopeId","data-v-c96811e5"]]),ho=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:l}}=Z.useI18n();return(a,r)=>{const o=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(o,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(l)("baseConfigCard.statusBadge.enabledLabel"):t.unref(l)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),po="#0044f4",uo="#e0e4ea",fo="#3a3f51",mo="1px",go="20px",yo={class:"config-card-details-row"},ko=["data-testid"],bo=["data-testid"],Co=["data-testid"],wo=["data-testid"],_o={key:1},So=["data-testid"],xo=["data-testid"],No=["data-testid"],Vo=["data-testid"],Bo={name:"ConfigCardItem",components:{CopyUuid:Ot,JsonCardItem:qt,StatusBadge:ho,InternalLinkItem:co}},Io=t.defineComponent({...Bo,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:l}){t.useCssVars(x=>({"5ae2770e":p.value?"none":`solid ${t.unref(mo)} ${t.unref(uo)}`,"4db3977e":h.value&&d.value?"block":"flex","1a7c5e02":h.value&&d.value?"100%":a.slim?"50%":"25%","1a77d24c":h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,r=l,o=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:n}}=Z.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||o["label-tooltip"])),h=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),p=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:n(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:x=>{r("navigation-click",x)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),f=t.ref(),{isTruncated:s}=Z.useTruncationDetector(f);return(x,b)=>{const m=t.resolveComponent("KLabel"),w=t.resolveComponent("KBadge"),V=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",yo,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(x.$slots,"label",{item:e.item},()=>[t.createVNode(m,{"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(x.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,bo)]),key:"0"}:void 0]),1024)],!0)],8,ko),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(x.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",_o,[(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,(T,N)=>(t.openBlock(),t.createBlock(w,{key:`${e.item.key}-badge-tag-${N}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${N}`,tooltip:T,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,So)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(T,N)=>(t.openBlock(),t.createBlock(t.unref(Ot),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${N}`,"data-testid":`${e.item.key}-copy-uuid-${N}`,uuid:T}),null,16,["data-testid","uuid"]))),128))],8,xo)):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,(T,N)=>(t.openBlock(),t.createBlock(w,{key:`${e.item.key}-badge-method-${N}`,appearance:Object.values(t.unref(gl.BadgeMethodAppearances)).includes(T.toLowerCase())?T.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${N}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(T),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,No)):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,(T,N)=>(t.openBlock(),t.createBlock(qt,{key:`json-array-item-${N}`,index:N,"is-array-item":"",item:T},null,8,["index","item"]))),128))],8,Vo)):(t.openBlock(),t.createBlock(V,{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,wo))],!0)],8,Co)])}}}),Xe=oe(Io,[["__scopeId","data-v-f65fc52c"]]),To={class:"json-config"},Ao={key:0,class:"json-endpoint"},$t=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(o=>({"2d178975":`${r.value}ch`}));const l=e,a=t.computed(()=>l.jsonRecord),r=t.computed(()=>{var o;if(!l.fetcherUrl)return 0;const i=(o=l.fetcherUrl)==null?void 0:o.split("/");return i.length<2?0:41+(l.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(o,i)=>{var n;const d=t.resolveComponent("KBadge"),c=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",To,[l.fetcherUrl&&(n=l.config)!=null&&n.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",Ao,[t.createVNode(d,{appearance:l.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(c,{id:"json-endpoint-codeblock",code:l.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),l.jsonRecord?(t.openBlock(),t.createBlock(c,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":l.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 Ut(e){return typeof e>"u"||e===null}function Eo(e){return typeof e=="object"&&e!==null}function Ho(e){return Array.isArray(e)?e:Ut(e)?[]:[e]}function Fo(e,l){var a,r,o,i;if(l)for(i=Object.keys(l),a=0,r=i.length;a<r;a+=1)o=i[a],e[o]=l[o];return e}function Oo(e,l){var a="",r;for(r=0;r<l;r+=1)a+=e;return a}function qo(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var $o=Ut,Uo=Eo,vo=Ho,Do=Oo,jo=qo,Mo=Fo,Y={isNothing:$o,isObject:Uo,toArray:vo,repeat:Do,isNegativeZero:jo,extend:Mo};function vt(e,l){var a="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!l&&e.mark.snippet&&(a+=`
|
|
2
2
|
|
|
3
|
-
`+e.mark.snippet),
|
|
4
|
-
`+d;for(h=
|
|
5
|
-
`,d+=Y.repeat("-",
|
|
6
|
-
`,c=1;c<=
|
|
7
|
-
`;return d.replace(/\n$/,"")}var Ko
|
|
8
|
-
\r`;function
|
|
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
|
|
10
|
-
`,
|
|
11
|
-
`,i?1+c:c):o===
|
|
12
|
-
`);break}for(
|
|
3
|
+
`+e.mark.snippet),r+" "+a):r}function Te(e,l){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=l,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,l,a,r,o){var i="",n="",d=Math.floor(o/2)-1;return r-l>d&&(i=" ... ",l=r-d+i.length),a-r>d&&(n=" ...",a=r+d-n.length),{str:i+e.slice(l,a).replace(/\t/g,"→")+n,pos:r-l+i.length}}function tt(e,l){return Y.repeat(" ",l-e.length)+e}function Ko(e,l){if(l=Object.create(l||null),!e.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);for(var a=/\r?\n|\r|\0/g,r=[0],o=[],i,n=-1;i=a.exec(e.buffer);)o.push(i.index),r.push(i.index+i[0].length),e.position<=i.index&&n<0&&(n=r.length-2);n<0&&(n=r.length-1);var d="",c,h,p=Math.min(e.line+l.linesAfter,o.length).toString().length,u=l.maxLength-(l.indent+p+3);for(c=1;c<=l.linesBefore&&!(n-c<0);c++)h=et(e.buffer,r[n-c],o[n-c],e.position-(r[n]-r[n-c]),u),d=Y.repeat(" ",l.indent)+tt((e.line-c+1).toString(),p)+" | "+h.str+`
|
|
4
|
+
`+d;for(h=et(e.buffer,r[n],o[n],e.position,u),d+=Y.repeat(" ",l.indent)+tt((e.line+1).toString(),p)+" | "+h.str+`
|
|
5
|
+
`,d+=Y.repeat("-",l.indent+p+3+h.pos)+`^
|
|
6
|
+
`,c=1;c<=l.linesAfter&&!(n+c>=o.length);c++)h=et(e.buffer,r[n+c],o[n+c],e.position-(r[n]-r[n+c]),u),d+=Y.repeat(" ",l.indent)+tt((e.line+c+1).toString(),p)+" | "+h.str+`
|
|
7
|
+
`;return d.replace(/\n$/,"")}var Po=Ko,Lo=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ro=["scalar","sequence","mapping"];function zo(e){var l={};return e!==null&&Object.keys(e).forEach(function(a){e[a].forEach(function(r){l[String(r)]=a})}),l}function Jo(e,l){if(l=l||{},Object.keys(l).forEach(function(a){if(Lo.indexOf(a)===-1)throw new re('Unknown option "'+a+'" is met in definition of "'+e+'" YAML type.')}),this.options=l,this.tag=e,this.kind=l.kind||null,this.resolve=l.resolve||function(){return!0},this.construct=l.construct||function(a){return a},this.instanceOf=l.instanceOf||null,this.predicate=l.predicate||null,this.represent=l.represent||null,this.representName=l.representName||null,this.defaultStyle=l.defaultStyle||null,this.multi=l.multi||!1,this.styleAliases=zo(l.styleAliases||null),Ro.indexOf(this.kind)===-1)throw new re('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var G=Jo;function Dt(e,l){var a=[];return e[l].forEach(function(r){var o=a.length;a.forEach(function(i,n){i.tag===r.tag&&i.kind===r.kind&&i.multi===r.multi&&(o=n)}),a[o]=r}),a}function Wo(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},l,a;function r(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(l=0,a=arguments.length;l<a;l+=1)arguments[l].forEach(r);return e}function at(e){return this.extend(e)}at.prototype.extend=function(e){var l=[],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&&(l=l.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: [...] })");l.forEach(function(o){if(!(o instanceof G))throw new re("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.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(o.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(o){if(!(o instanceof G))throw new re("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(at.prototype);return r.implicit=(this.implicit||[]).concat(l),r.explicit=(this.explicit||[]).concat(a),r.compiledImplicit=Dt(r,"implicit"),r.compiledExplicit=Dt(r,"explicit"),r.compiledTypeMap=Wo(r.compiledImplicit,r.compiledExplicit),r};var jt=at,Mt=new G("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Kt=new G("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Pt=new G("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Lt=new jt({explicit:[Mt,Kt,Pt]});function Qo(e){if(e===null)return!0;var l=e.length;return l===1&&e==="~"||l===4&&(e==="null"||e==="Null"||e==="NULL")}function Yo(){return null}function Zo(e){return e===null}var Rt=new G("tag:yaml.org,2002:null",{kind:"scalar",resolve:Qo,construct:Yo,predicate:Zo,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Go(e){if(e===null)return!1;var l=e.length;return l===4&&(e==="true"||e==="True"||e==="TRUE")||l===5&&(e==="false"||e==="False"||e==="FALSE")}function Xo(e){return e==="true"||e==="True"||e==="TRUE"}function en(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var zt=new G("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Go,construct:Xo,predicate:en,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 tn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function an(e){return 48<=e&&e<=55}function rn(e){return 48<=e&&e<=57}function ln(e){if(e===null)return!1;var l=e.length,a=0,r=!1,o;if(!l)return!1;if(o=e[a],(o==="-"||o==="+")&&(o=e[++a]),o==="0"){if(a+1===l)return!0;if(o=e[++a],o==="b"){for(a++;a<l;a++)if(o=e[a],o!=="_"){if(o!=="0"&&o!=="1")return!1;r=!0}return r&&o!=="_"}if(o==="x"){for(a++;a<l;a++)if(o=e[a],o!=="_"){if(!tn(e.charCodeAt(a)))return!1;r=!0}return r&&o!=="_"}if(o==="o"){for(a++;a<l;a++)if(o=e[a],o!=="_"){if(!an(e.charCodeAt(a)))return!1;r=!0}return r&&o!=="_"}}if(o==="_")return!1;for(;a<l;a++)if(o=e[a],o!=="_"){if(!rn(e.charCodeAt(a)))return!1;r=!0}return!(!r||o==="_")}function on(e){var l=e,a=1,r;if(l.indexOf("_")!==-1&&(l=l.replace(/_/g,"")),r=l[0],(r==="-"||r==="+")&&(r==="-"&&(a=-1),l=l.slice(1),r=l[0]),l==="0")return 0;if(r==="0"){if(l[1]==="b")return a*parseInt(l.slice(2),2);if(l[1]==="x")return a*parseInt(l.slice(2),16);if(l[1]==="o")return a*parseInt(l.slice(2),8)}return a*parseInt(l,10)}function nn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Y.isNegativeZero(e)}var Jt=new G("tag:yaml.org,2002:int",{kind:"scalar",resolve:ln,construct:on,predicate:nn,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"]}}),sn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function cn(e){return!(e===null||!sn.test(e)||e[e.length-1]==="_")}function dn(e){var l,a;return l=e.replace(/_/g,"").toLowerCase(),a=l[0]==="-"?-1:1,"+-".indexOf(l[0])>=0&&(l=l.slice(1)),l===".inf"?a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:l===".nan"?NaN:a*parseFloat(l,10)}var hn=/^[-+]?[0-9]+e/;function pn(e,l){var a;if(isNaN(e))switch(l){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(l){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(l){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Y.isNegativeZero(e))return"-0.0";return a=e.toString(10),hn.test(a)?a.replace("e",".e"):a}function un(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Y.isNegativeZero(e))}var Wt=new G("tag:yaml.org,2002:float",{kind:"scalar",resolve:cn,construct:dn,predicate:un,represent:pn,defaultStyle:"lowercase"}),Qt=Lt.extend({implicit:[Rt,zt,Jt,Wt]}),Yt=Qt,Zt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Gt=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 fn(e){return e===null?!1:Zt.exec(e)!==null||Gt.exec(e)!==null}function mn(e){var l,a,r,o,i,n,d,c=0,h=null,p,u,f;if(l=Zt.exec(e),l===null&&(l=Gt.exec(e)),l===null)throw new Error("Date resolve error");if(a=+l[1],r=+l[2]-1,o=+l[3],!l[4])return new Date(Date.UTC(a,r,o));if(i=+l[4],n=+l[5],d=+l[6],l[7]){for(c=l[7].slice(0,3);c.length<3;)c+="0";c=+c}return l[9]&&(p=+l[10],u=+(l[11]||0),h=(p*60+u)*6e4,l[9]==="-"&&(h=-h)),f=new Date(Date.UTC(a,r,o,i,n,d,c)),h&&f.setTime(f.getTime()-h),f}function gn(e){return e.toISOString()}var Xt=new G("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:fn,construct:mn,instanceOf:Date,represent:gn});function yn(e){return e==="<<"||e===null}var ea=new G("tag:yaml.org,2002:merge",{kind:"scalar",resolve:yn}),rt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
+
\r`;function kn(e){if(e===null)return!1;var l,a,r=0,o=e.length,i=rt;for(a=0;a<o;a++)if(l=i.indexOf(e.charAt(a)),!(l>64)){if(l<0)return!1;r+=6}return r%8===0}function bn(e){var l,a,r=e.replace(/[\r\n=]/g,""),o=r.length,i=rt,n=0,d=[];for(l=0;l<o;l++)l%4===0&&l&&(d.push(n>>16&255),d.push(n>>8&255),d.push(n&255)),n=n<<6|i.indexOf(r.charAt(l));return a=o%4*6,a===0?(d.push(n>>16&255),d.push(n>>8&255),d.push(n&255)):a===18?(d.push(n>>10&255),d.push(n>>2&255)):a===12&&d.push(n>>4&255),new Uint8Array(d)}function Cn(e){var l="",a=0,r,o,i=e.length,n=rt;for(r=0;r<i;r++)r%3===0&&r&&(l+=n[a>>18&63],l+=n[a>>12&63],l+=n[a>>6&63],l+=n[a&63]),a=(a<<8)+e[r];return o=i%3,o===0?(l+=n[a>>18&63],l+=n[a>>12&63],l+=n[a>>6&63],l+=n[a&63]):o===2?(l+=n[a>>10&63],l+=n[a>>4&63],l+=n[a<<2&63],l+=n[64]):o===1&&(l+=n[a>>2&63],l+=n[a<<4&63],l+=n[64],l+=n[64]),l}function wn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var ta=new G("tag:yaml.org,2002:binary",{kind:"scalar",resolve:kn,construct:bn,predicate:wn,represent:Cn}),_n=Object.prototype.hasOwnProperty,Sn=Object.prototype.toString;function xn(e){if(e===null)return!0;var l=[],a,r,o,i,n,d=e;for(a=0,r=d.length;a<r;a+=1){if(o=d[a],n=!1,Sn.call(o)!=="[object Object]")return!1;for(i in o)if(_n.call(o,i))if(!n)n=!0;else return!1;if(!n)return!1;if(l.indexOf(i)===-1)l.push(i);else return!1}return!0}function Nn(e){return e!==null?e:[]}var aa=new G("tag:yaml.org,2002:omap",{kind:"sequence",resolve:xn,construct:Nn}),Vn=Object.prototype.toString;function Bn(e){if(e===null)return!0;var l,a,r,o,i,n=e;for(i=new Array(n.length),l=0,a=n.length;l<a;l+=1){if(r=n[l],Vn.call(r)!=="[object Object]"||(o=Object.keys(r),o.length!==1))return!1;i[l]=[o[0],r[o[0]]]}return!0}function In(e){if(e===null)return[];var l,a,r,o,i,n=e;for(i=new Array(n.length),l=0,a=n.length;l<a;l+=1)r=n[l],o=Object.keys(r),i[l]=[o[0],r[o[0]]];return i}var ra=new G("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Bn,construct:In}),Tn=Object.prototype.hasOwnProperty;function An(e){if(e===null)return!0;var l,a=e;for(l in a)if(Tn.call(a,l)&&a[l]!==null)return!1;return!0}function En(e){return e!==null?e:{}}var la=new G("tag:yaml.org,2002:set",{kind:"mapping",resolve:An,construct:En}),lt=Yt.extend({implicit:[Xt,ea],explicit:[ta,aa,ra,la]}),ue=Object.prototype.hasOwnProperty,$e=1,oa=2,na=3,Ue=4,ot=1,Hn=2,ia=3,Fn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,On=/[\x85\u2028\u2029]/,qn=/[,\[\]\{\}]/,sa=/^(?:!|!!|![a-z\-]+!)$/i,ca=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function da(e){return Object.prototype.toString.call(e)}function ie(e){return e===10||e===13}function me(e){return e===9||e===32}function le(e){return e===9||e===32||e===10||e===13}function ye(e){return e===44||e===91||e===93||e===123||e===125}function $n(e){var l;return 48<=e&&e<=57?e-48:(l=e|32,97<=l&&l<=102?l-97+10:-1)}function Un(e){return e===120?2:e===117?4:e===85?8:0}function vn(e){return 48<=e&&e<=57?e-48:-1}function ha(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 Dn(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var pa=new Array(256),ua=new Array(256),ke=0;ke<256;ke++)pa[ke]=ha(ke)?1:0,ua[ke]=ha(ke);function jn(e,l){this.input=e,this.filename=l.filename||null,this.schema=l.schema||lt,this.onWarning=l.onWarning||null,this.legacy=l.legacy||!1,this.json=l.json||!1,this.listener=l.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 fa(e,l){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=Po(a),new re(l,a)}function O(e,l){throw fa(e,l)}function ve(e,l){e.onWarning&&e.onWarning.call(null,fa(e,l))}var ma={YAML:function(e,l,a){var r,o,i;e.version!==null&&O(e,"duplication of %YAML directive"),a.length!==1&&O(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(a[0]),r===null&&O(e,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),i=parseInt(r[2],10),o!==1&&O(e,"unacceptable YAML version of the document"),e.version=a[0],e.checkLineBreaks=i<2,i!==1&&i!==2&&ve(e,"unsupported YAML version of the document")},TAG:function(e,l,a){var r,o;a.length!==2&&O(e,"TAG directive accepts exactly two arguments"),r=a[0],o=a[1],sa.test(r)||O(e,"ill-formed tag handle (first argument) of the TAG directive"),ue.call(e.tagMap,r)&&O(e,'there is a previously declared suffix for "'+r+'" tag handle'),ca.test(o)||O(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{O(e,"tag prefix is malformed: "+o)}e.tagMap[r]=o}};function fe(e,l,a,r){var o,i,n,d;if(l<a){if(d=e.input.slice(l,a),r)for(o=0,i=d.length;o<i;o+=1)n=d.charCodeAt(o),n===9||32<=n&&n<=1114111||O(e,"expected valid JSON character");else Fn.test(d)&&O(e,"the stream contains non-printable characters");e.result+=d}}function ga(e,l,a,r){var o,i,n,d;for(Y.isObject(a)||O(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(a),n=0,d=o.length;n<d;n+=1)i=o[n],ue.call(l,i)||(l[i]=a[i],r[i]=!0)}function be(e,l,a,r,o,i,n,d,c){var h,p;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),h=0,p=o.length;h<p;h+=1)Array.isArray(o[h])&&O(e,"nested arrays are not supported inside keys"),typeof o=="object"&&da(o[h])==="[object Object]"&&(o[h]="[object Object]");if(typeof o=="object"&&da(o)==="[object Object]"&&(o="[object Object]"),o=String(o),l===null&&(l={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(h=0,p=i.length;h<p;h+=1)ga(e,l,i[h],a);else ga(e,l,i,a);else!e.json&&!ue.call(a,o)&&ue.call(l,o)&&(e.line=n||e.line,e.lineStart=d||e.lineStart,e.position=c||e.position,O(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(l,o,{configurable:!0,enumerable:!0,writable:!0,value:i}):l[o]=i,delete a[o];return l}function nt(e){var l;l=e.input.charCodeAt(e.position),l===10?e.position++:l===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):O(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Q(e,l,a){for(var r=0,o=e.input.charCodeAt(e.position);o!==0;){for(;me(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(l&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(ie(o))for(nt(e),o=e.input.charCodeAt(e.position),r++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return a!==-1&&r!==0&&e.lineIndent<a&&ve(e,"deficient indentation"),r}function De(e){var l=e.position,a;return a=e.input.charCodeAt(l),!!((a===45||a===46)&&a===e.input.charCodeAt(l+1)&&a===e.input.charCodeAt(l+2)&&(l+=3,a=e.input.charCodeAt(l),a===0||le(a)))}function it(e,l){l===1?e.result+=" ":l>1&&(e.result+=Y.repeat(`
|
|
10
|
+
`,l-1))}function Mn(e,l,a){var r,o,i,n,d,c,h,p,u=e.kind,f=e.result,s;if(s=e.input.charCodeAt(e.position),le(s)||ye(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)&&(o=e.input.charCodeAt(e.position+1),le(o)||a&&ye(o)))return!1;for(e.kind="scalar",e.result="",i=n=e.position,d=!1;s!==0;){if(s===58){if(o=e.input.charCodeAt(e.position+1),le(o)||a&&ye(o))break}else if(s===35){if(r=e.input.charCodeAt(e.position-1),le(r))break}else{if(e.position===e.lineStart&&De(e)||a&&ye(s))break;if(ie(s))if(c=e.line,h=e.lineStart,p=e.lineIndent,Q(e,!1,-1),e.lineIndent>=l){d=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=n,e.line=c,e.lineStart=h,e.lineIndent=p;break}}d&&(fe(e,i,n,!1),it(e,e.line-c),i=n=e.position,d=!1),me(s)||(n=e.position+1),s=e.input.charCodeAt(++e.position)}return fe(e,i,n,!1),e.result?!0:(e.kind=u,e.result=f,!1)}function Kn(e,l){var a,r,o;if(a=e.input.charCodeAt(e.position),a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(fe(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)r=e.position,e.position++,o=e.position;else return!0;else ie(a)?(fe(e,r,o,!0),it(e,Q(e,!1,l)),r=o=e.position):e.position===e.lineStart&&De(e)?O(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);O(e,"unexpected end of the stream within a single quoted scalar")}function Pn(e,l){var a,r,o,i,n,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,a=r=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))Q(e,!1,l);else if(d<256&&pa[d])e.result+=ua[d],e.position++;else if((n=Un(d))>0){for(o=n,i=0;o>0;o--)d=e.input.charCodeAt(++e.position),(n=$n(d))>=0?i=(i<<4)+n:O(e,"expected hexadecimal character");e.result+=Dn(i),e.position++}else O(e,"unknown escape sequence");a=r=e.position}else ie(d)?(fe(e,a,r,!0),it(e,Q(e,!1,l)),a=r=e.position):e.position===e.lineStart&&De(e)?O(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}O(e,"unexpected end of the stream within a double quoted scalar")}function Ln(e,l){var a=!0,r,o,i,n=e.tag,d,c=e.anchor,h,p,u,f,s,x=Object.create(null),b,m,w,V;if(V=e.input.charCodeAt(e.position),V===91)p=93,s=!1,d=[];else if(V===123)p=125,s=!0,d={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),V=e.input.charCodeAt(++e.position);V!==0;){if(Q(e,!0,l),V=e.input.charCodeAt(e.position),V===p)return e.position++,e.tag=n,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=d,!0;a?V===44&&O(e,"expected the node content, but found ','"):O(e,"missed comma between flow collection entries"),m=b=w=null,u=f=!1,V===63&&(h=e.input.charCodeAt(e.position+1),le(h)&&(u=f=!0,e.position++,Q(e,!0,l))),r=e.line,o=e.lineStart,i=e.position,Ce(e,l,$e,!1,!0),m=e.tag,b=e.result,Q(e,!0,l),V=e.input.charCodeAt(e.position),(f||e.line===r)&&V===58&&(u=!0,V=e.input.charCodeAt(++e.position),Q(e,!0,l),Ce(e,l,$e,!1,!0),w=e.result),s?be(e,d,x,m,b,w,r,o,i):u?d.push(be(e,null,x,m,b,w,r,o,i)):d.push(b),Q(e,!0,l),V=e.input.charCodeAt(e.position),V===44?(a=!0,V=e.input.charCodeAt(++e.position)):a=!1}O(e,"unexpected end of the stream within a flow collection")}function Rn(e,l){var a,r,o=ot,i=!1,n=!1,d=l,c=0,h=!1,p,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)ot===o?o=u===43?ia:Hn:O(e,"repeat of a chomping mode identifier");else if((p=vn(u))>=0)p===0?O(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):n?O(e,"repeat of an indentation width identifier"):(d=l+p-1,n=!0);else break;if(me(u)){do u=e.input.charCodeAt(++e.position);while(me(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ie(u)&&u!==0)}for(;u!==0;){for(nt(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!n||e.lineIndent<d)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!n&&e.lineIndent>d&&(d=e.lineIndent),ie(u)){c++;continue}if(e.lineIndent<d){o===ia?e.result+=Y.repeat(`
|
|
11
|
+
`,i?1+c:c):o===ot&&i&&(e.result+=`
|
|
12
|
+
`);break}for(r?me(u)?(h=!0,e.result+=Y.repeat(`
|
|
13
13
|
`,i?1+c:c)):h?(h=!1,e.result+=Y.repeat(`
|
|
14
14
|
`,c+1)):c===0?i&&(e.result+=" "):e.result+=Y.repeat(`
|
|
15
15
|
`,c):e.result+=Y.repeat(`
|
|
16
|
-
`,i?1+c:c),i=!0,n=!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
|
|
17
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var a=new
|
|
18
|
-
`,
|
|
19
|
-
`&&(i+=a),i+=n;return i}function
|
|
20
|
-
`+Y.repeat(" ",e.indent*
|
|
21
|
-
`,o=
|
|
16
|
+
`,i?1+c:c),i=!0,n=!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 ya(e,l){var a,r=e.tag,o=e.anchor,i=[],n,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,O(e,"tab characters must not be used in indentation")),!(c!==45||(n=e.input.charCodeAt(e.position+1),!le(n))));){if(d=!0,e.position++,Q(e,!0,-1)&&e.lineIndent<=l){i.push(null),c=e.input.charCodeAt(e.position);continue}if(a=e.line,Ce(e,l,na,!1,!0),i.push(e.result),Q(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>l)&&c!==0)O(e,"bad indentation of a sequence entry");else if(e.lineIndent<l)break}return d?(e.tag=r,e.anchor=o,e.kind="sequence",e.result=i,!0):!1}function zn(e,l,a){var r,o,i,n,d,c,h=e.tag,p=e.anchor,u={},f=Object.create(null),s=null,x=null,b=null,m=!1,w=!1,V;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),V=e.input.charCodeAt(e.position);V!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,O(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),i=e.line,(V===63||V===58)&&le(r))V===63?(m&&(be(e,u,f,s,x,null,n,d,c),s=x=b=null),w=!0,m=!0,o=!0):m?(m=!1,o=!0):O(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,V=r;else{if(n=e.line,d=e.lineStart,c=e.position,!Ce(e,a,oa,!1,!0))break;if(e.line===i){for(V=e.input.charCodeAt(e.position);me(V);)V=e.input.charCodeAt(++e.position);if(V===58)V=e.input.charCodeAt(++e.position),le(V)||O(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(be(e,u,f,s,x,null,n,d,c),s=x=b=null),w=!0,m=!1,o=!1,s=e.tag,x=e.result;else if(w)O(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=p,!0}else if(w)O(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>l)&&(m&&(n=e.line,d=e.lineStart,c=e.position),Ce(e,l,Ue,!0,o)&&(m?x=e.result:b=e.result),m||(be(e,u,f,s,x,b,n,d,c),s=x=b=null),Q(e,!0,-1),V=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>l)&&V!==0)O(e,"bad indentation of a mapping entry");else if(e.lineIndent<l)break}return m&&be(e,u,f,s,x,null,n,d,c),w&&(e.tag=h,e.anchor=p,e.kind="mapping",e.result=u),w}function Jn(e){var l,a=!1,r=!1,o,i,n;if(n=e.input.charCodeAt(e.position),n!==33)return!1;if(e.tag!==null&&O(e,"duplication of a tag property"),n=e.input.charCodeAt(++e.position),n===60?(a=!0,n=e.input.charCodeAt(++e.position)):n===33?(r=!0,o="!!",n=e.input.charCodeAt(++e.position)):o="!",l=e.position,a){do n=e.input.charCodeAt(++e.position);while(n!==0&&n!==62);e.position<e.length?(i=e.input.slice(l,e.position),n=e.input.charCodeAt(++e.position)):O(e,"unexpected end of the stream within a verbatim tag")}else{for(;n!==0&&!le(n);)n===33&&(r?O(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(l-1,e.position+1),sa.test(o)||O(e,"named tag handle cannot contain such characters"),r=!0,l=e.position+1)),n=e.input.charCodeAt(++e.position);i=e.input.slice(l,e.position),qn.test(i)&&O(e,"tag suffix cannot contain flow indicator characters")}i&&!ca.test(i)&&O(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{O(e,"tag name is malformed: "+i)}return a?e.tag=i:ue.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:O(e,'undeclared tag handle "'+o+'"'),!0}function Wn(e){var l,a;if(a=e.input.charCodeAt(e.position),a!==38)return!1;for(e.anchor!==null&&O(e,"duplication of an anchor property"),a=e.input.charCodeAt(++e.position),l=e.position;a!==0&&!le(a)&&!ye(a);)a=e.input.charCodeAt(++e.position);return e.position===l&&O(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(l,e.position),!0}function Qn(e){var l,a,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),l=e.position;r!==0&&!le(r)&&!ye(r);)r=e.input.charCodeAt(++e.position);return e.position===l&&O(e,"name of an alias node must contain at least one character"),a=e.input.slice(l,e.position),ue.call(e.anchorMap,a)||O(e,'unidentified alias "'+a+'"'),e.result=e.anchorMap[a],Q(e,!0,-1),!0}function Ce(e,l,a,r,o){var i,n,d,c=1,h=!1,p=!1,u,f,s,x,b,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=n=d=Ue===a||na===a,r&&Q(e,!0,-1)&&(h=!0,e.lineIndent>l?c=1:e.lineIndent===l?c=0:e.lineIndent<l&&(c=-1)),c===1)for(;Jn(e)||Wn(e);)Q(e,!0,-1)?(h=!0,d=i,e.lineIndent>l?c=1:e.lineIndent===l?c=0:e.lineIndent<l&&(c=-1)):d=!1;if(d&&(d=h||o),(c===1||Ue===a)&&($e===a||oa===a?b=l:b=l+1,m=e.position-e.lineStart,c===1?d&&(ya(e,m)||zn(e,m,b))||Ln(e,b)?p=!0:(n&&Rn(e,b)||Kn(e,b)||Pn(e,b)?p=!0:Qn(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&O(e,"alias node should not have any properties")):Mn(e,b,$e===a)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=d&&ya(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&O(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u<f;u+=1)if(x=e.implicitTypes[u],x.resolve(e.result)){e.result=x.construct(e.result),e.tag=x.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))x=e.typeMap[e.kind||"fallback"][e.tag];else for(x=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){x=s[u];break}x||O(e,"unknown tag !<"+e.tag+">"),e.result!==null&&x.kind!==e.kind&&O(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+x.kind+'", not "'+e.kind+'"'),x.resolve(e.result,e.tag)?(e.result=x.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):O(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 Yn(e){var l=e.position,a,r,o,i=!1,n;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(n=e.input.charCodeAt(e.position))!==0&&(Q(e,!0,-1),n=e.input.charCodeAt(e.position),!(e.lineIndent>0||n!==37));){for(i=!0,n=e.input.charCodeAt(++e.position),a=e.position;n!==0&&!le(n);)n=e.input.charCodeAt(++e.position);for(r=e.input.slice(a,e.position),o=[],r.length<1&&O(e,"directive name must not be less than one character in length");n!==0;){for(;me(n);)n=e.input.charCodeAt(++e.position);if(n===35){do n=e.input.charCodeAt(++e.position);while(n!==0&&!ie(n));break}if(ie(n))break;for(a=e.position;n!==0&&!le(n);)n=e.input.charCodeAt(++e.position);o.push(e.input.slice(a,e.position))}n!==0&&nt(e),ue.call(ma,r)?ma[r](e,r,o):ve(e,'unknown document directive "'+r+'"')}if(Q(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,Q(e,!0,-1)):i&&O(e,"directives end mark is expected"),Ce(e,e.lineIndent-1,Ue,!1,!0),Q(e,!0,-1),e.checkLineBreaks&&On.test(e.input.slice(l,e.position))&&ve(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&De(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Q(e,!0,-1));return}if(e.position<e.length-1)O(e,"end of the stream or a document separator is expected");else return}function ka(e,l){e=String(e),l=l||{},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 jn(e,l),r=e.indexOf("\0");for(r!==-1&&(a.position=r,O(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;)Yn(a);return a.documents}function Zn(e,l,a){l!==null&&typeof l=="object"&&typeof a>"u"&&(a=l,l=null);var r=ka(e,a);if(typeof l!="function")return r;for(var o=0,i=r.length;o<i;o+=1)l(r[o])}function Gn(e,l){var a=ka(e,l);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 Xn=Zn,ei=Gn,ba={loadAll:Xn,load:ei},Ca=Object.prototype.toString,wa=Object.prototype.hasOwnProperty,st=65279,ti=9,Ae=10,ai=13,ri=32,li=33,oi=34,ct=35,ni=37,ii=38,si=39,ci=42,_a=44,di=45,je=58,hi=61,pi=62,ui=63,fi=64,Sa=91,xa=93,mi=96,Na=123,gi=124,Va=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 yi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ki=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function bi(e,l){var a,r,o,i,n,d,c;if(l===null)return{};for(a={},r=Object.keys(l),o=0,i=r.length;o<i;o+=1)n=r[o],d=String(l[n]),n.slice(0,2)==="!!"&&(n="tag:yaml.org,2002:"+n.slice(2)),c=e.compiledTypeMap.fallback[n],c&&wa.call(c.styleAliases,d)&&(d=c.styleAliases[d]),a[n]=d;return a}function Ci(e){var l,a,r;if(l=e.toString(16).toUpperCase(),e<=255)a="x",r=2;else if(e<=65535)a="u",r=4;else if(e<=4294967295)a="U",r=8;else throw new re("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+Y.repeat("0",r-l.length)+l}var wi=1,Ee=2;function _i(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=Y.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=bi(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:wi,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 Ba(e,l){for(var a=Y.repeat(" ",l),r=0,o=-1,i="",n,d=e.length;r<d;)o=e.indexOf(`
|
|
18
|
+
`,r),o===-1?(n=e.slice(r),r=d):(n=e.slice(r,o+1),r=o+1),n.length&&n!==`
|
|
19
|
+
`&&(i+=a),i+=n;return i}function dt(e,l){return`
|
|
20
|
+
`+Y.repeat(" ",e.indent*l)}function Si(e,l){var a,r,o;for(a=0,r=e.implicitTypes.length;a<r;a+=1)if(o=e.implicitTypes[a],o.resolve(l))return!0;return!1}function Me(e){return e===ri||e===ti}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 Ia(e){return He(e)&&e!==st&&e!==ai&&e!==Ae}function Ta(e,l,a){var r=Ia(e),o=r&&!Me(e);return(a?r:r&&e!==_a&&e!==Sa&&e!==xa&&e!==Na&&e!==Va)&&e!==ct&&!(l===je&&!o)||Ia(l)&&!Me(l)&&e===ct||l===je&&o}function xi(e){return He(e)&&e!==st&&!Me(e)&&e!==di&&e!==ui&&e!==je&&e!==_a&&e!==Sa&&e!==xa&&e!==Na&&e!==Va&&e!==ct&&e!==ii&&e!==ci&&e!==li&&e!==gi&&e!==hi&&e!==pi&&e!==si&&e!==oi&&e!==ni&&e!==fi&&e!==mi}function Ni(e){return!Me(e)&&e!==je}function Fe(e,l){var a=e.charCodeAt(l),r;return a>=55296&&a<=56319&&l+1<e.length&&(r=e.charCodeAt(l+1),r>=56320&&r<=57343)?(a-55296)*1024+r-56320+65536:a}function Aa(e){var l=/^\n* /;return l.test(e)}var Ea=1,ht=2,Ha=3,Fa=4,we=5;function Vi(e,l,a,r,o,i,n,d){var c,h=0,p=null,u=!1,f=!1,s=r!==-1,x=-1,b=xi(Fe(e,0))&&Ni(Fe(e,e.length-1));if(l||n)for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=Fe(e,c),!He(h))return we;b=b&&Ta(h,p,d),p=h}else{for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=Fe(e,c),h===Ae)u=!0,s&&(f=f||c-x-1>r&&e[x+1]!==" ",x=c);else if(!He(h))return we;b=b&&Ta(h,p,d),p=h}f=f||s&&c-x-1>r&&e[x+1]!==" "}return!u&&!f?b&&!n&&!o(e)?Ea:i===Ee?we:ht:a>9&&Aa(e)?we:n?i===Ee?we:ht:f?Fa:Ha}function Bi(e,l,a,r,o){e.dump=function(){if(l.length===0)return e.quotingType===Ee?'""':"''";if(!e.noCompatMode&&(yi.indexOf(l)!==-1||ki.test(l)))return e.quotingType===Ee?'"'+l+'"':"'"+l+"'";var i=e.indent*Math.max(1,a),n=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),d=r||e.flowLevel>-1&&a>=e.flowLevel;function c(h){return Si(e,h)}switch(Vi(l,d,e.indent,n,c,e.quotingType,e.forceQuotes&&!r,o)){case Ea:return l;case ht:return"'"+l.replace(/'/g,"''")+"'";case Ha:return"|"+Oa(l,e.indent)+qa(Ba(l,i));case Fa:return">"+Oa(l,e.indent)+qa(Ba(Ii(l,n),i));case we:return'"'+Ti(l)+'"';default:throw new re("impossible error: invalid scalar style")}}()}function Oa(e,l){var a=Aa(e)?String(l):"",r=e[e.length-1]===`
|
|
21
|
+
`,o=r&&(e[e.length-2]===`
|
|
22
22
|
`||e===`
|
|
23
|
-
`),i=o?"+":
|
|
24
|
-
`}function
|
|
25
|
-
`?e.slice(0,-1):e}function
|
|
26
|
-
`);return h=h!==-1?h:e.length,a.lastIndex=h
|
|
27
|
-
`||e[0]===" ",i,n;n=a.exec(e);){var d=n[1],c=n[2];i=c[0]===" ",
|
|
28
|
-
`:"")
|
|
23
|
+
`),i=o?"+":r?"":"-";return a+i+`
|
|
24
|
+
`}function qa(e){return e[e.length-1]===`
|
|
25
|
+
`?e.slice(0,-1):e}function Ii(e,l){for(var a=/(\n+)([^\n]*)/g,r=function(){var h=e.indexOf(`
|
|
26
|
+
`);return h=h!==-1?h:e.length,a.lastIndex=h,$a(e.slice(0,h),l)}(),o=e[0]===`
|
|
27
|
+
`||e[0]===" ",i,n;n=a.exec(e);){var d=n[1],c=n[2];i=c[0]===" ",r+=d+(!o&&!i&&c!==""?`
|
|
28
|
+
`:"")+$a(c,l),o=i}return r}function $a(e,l){if(e===""||e[0]===" ")return e;for(var a=/ [^ ]/g,r,o=0,i,n=0,d=0,c="";r=a.exec(e);)d=r.index,d-o>l&&(i=n>o?n:d,c+=`
|
|
29
29
|
`+e.slice(o,i),o=i+1),n=d;return c+=`
|
|
30
|
-
`,e.length-o>
|
|
31
|
-
`+e.slice(n+1):c+=e.slice(o),c.slice(1)}function
|
|
32
|
-
`:""}var Oi=Fi,qi={dump:Oi};function pt(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 Ui=G,$i=Dt,vi=Pt,Di=Wt,ji=Qt,Mi=lt,Ki=ka.load,Pi=ka.loadAll,Li=qi.dump,Ri=le,zi={binary:ea,float:Jt,map:Kt,null:Lt,pairs:aa,set:la,timestamp:Gt,bool:Rt,int:zt,merge:Xt,omap:ta,seq:Mt,str:jt},Ji=pt("safeLoad","load"),Wi=pt("safeLoadAll","loadAll"),Qi=pt("safeDump","dump"),Yi={Type:Ui,Schema:$i,FAILSAFE_SCHEMA:vi,JSON_SCHEMA:Di,CORE_SCHEMA:ji,DEFAULT_SCHEMA:Mi,load:Ki,loadAll:Pi,dump:Li,YAMLException:Ri,types:zi,safeLoad:Ji,safeLoadAll:Wi,safeDump:Qi};const Zi={class:"yaml-config"},va=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(([,o])=>o&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(l).length===0&&l.constructor===Object?"":Yi.dump(l).trim()});return(l,o)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Zi,[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)])}}}),Gi={key:0,class:"config-card-display-form"},Xi=["data-testid"],es={key:0,class:"config-card-prop-section-title"},ts=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(),o=n=>!!(n.tooltip||a[`${n.key}-label-tooltip`]),i=t.computed(()=>{if(!r.record)return r.record;const n=JSON.parse(JSON.stringify(r.record));return delete n.created_at,delete n.updated_at,n});return(n,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Gi,[(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",es,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(Ge,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(n.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(n.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[o(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(n.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Xi))),128))])):t.createCommentVNode("",!0),e.format==="json"&&r.record?(t.openBlock(),t.createBlock(qt,{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(va,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),as=oe(ts,[["__scopeId","data-v-2b74ac63"]]),Da="24px",ls=(e,r)=>{const a=e.__vccOpts||e;for(const[l,o]of r)a[l]=o;return a},rs=e=>(t.pushScopeId("data-v-40a7f387"),e=e(),t.popScopeId(),e),os=["aria-hidden"],ns={key:0,"data-testid":"kui-icon-svg-title"},is=rs(()=>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)),ss=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:Da,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 o=String(r.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return Da}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(o,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",ns,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),is],8,os))]),_:1},8,["aria-hidden","style"]))}}),cs=ls(ss,[["__scopeId","data-v-40a7f387"]]),ds={"data-testid":"config-card-title"},hs={class:"config-card-actions"},ps=["href"],us={key:2,class:"config-card-details-section"},fs={key:3,class:"config-card-details-section"},ms=["data-testid"],gs={key:0,class:"config-card-prop-section-title"},ys=t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:r}){var a;const l=r,o=e,i=t.useSlots(),{i18n:{t:n}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{convertKeyToTitle:c}=Z.useStringHelpers(),{axiosInstance:h}=Z.useAxios({headers:(a=o.config)==null?void 0:a.requestHeaders}),p=[{label:n("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=t.ref("structured"),f=w=>{u.value=w==null?void 0:w.value},s={id:{type:L.ID,label:n("baseConfigCard.commonFields.id_label"),order:0,section:W.Basic},name:{order:1,section:W.Basic},enabled:{type:L.BadgeStatus,order:2,section:W.Basic},updated_at:{type:L.Date,label:n("baseConfigCard.commonFields.updated_at_label"),order:3,section:W.Basic},created_at:{type:L.Date,label:n("baseConfigCard.commonFields.created_at_label"),order:4,section:W.Basic},tags:{type:L.BadgeTag,order:-1,section:W.Basic}},x=t.ref(!1),b=t.ref(!1),m=t.ref(""),k=t.ref({}),N=t.computed(()=>{var w,E,S;if(!k.value)return[];const H=[],v=Object.keys(k.value).length;for(const D in k.value){const U=(E=(w=o.configSchema)==null?void 0:w[D])==null?void 0:E.order,q=(S=s[D])==null?void 0:S.order;let j=v;(q||q===0)&&(j=q===-1?v+1:q),U&&(j=U===-1?v+1:U),H.push([D,j])}return H.sort(function(D,U){return D[1]-U[1]}),H.map(D=>{var U,q;const j=D[0],M=(U=k.value)==null?void 0:U[j],I=((q=o.configSchema)==null?void 0:q[j])||{},$=s[j];return{key:j,value:M,hidden:I.hidden||!1,type:I.type??(($==null?void 0:$.type)||L.Text),label:I.label??(($==null?void 0:$.label)||c(j)),tooltip:I.tooltip??(($==null?void 0:$.tooltip)||void 0),section:I.section??(($==null?void 0:$.section)||W.Advanced)}}).filter(D=>!D.hidden&&D.key!==o.pluginConfigKey)}),A=t.computed(()=>{var w,E;if(!k.value||!o.pluginConfigKey)return[];const S=k.value[o.pluginConfigKey]||{},H=Object.keys(S).length,v=[];for(const D in S){const U=(E=(w=o.pluginConfigSchema)==null?void 0:w[D])==null?void 0:E.order,q=S[D];let j=q!=null&&q!==""?H-1:H;U&&(j=U===-1?H+1:U),v.push([D,j])}return v.sort(function(D,U){return D[1]-U[1]}),v.map(D=>{var U;const q=D[0],j=S[q],M=((U=o.pluginConfigSchema)==null?void 0:U[q])||{};return{key:q,value:j,hidden:M.hidden||!1,type:M.type??L.Text,label:M.label??c(q),tooltip:M.tooltip??void 0,section:W.Plugin}}).filter(D=>!D.hidden)}),V=t.computed(()=>{var w,E,S,H;return{basic:(w=N.value)==null?void 0:w.filter(v=>v.section===W.Basic),advanced:(E=N.value)==null?void 0:E.filter(v=>v.section===W.Advanced),plugin:(H=A.value)==null?void 0:H.concat((S=N.value)==null?void 0:S.filter(v=>v.section===W.Plugin))}}),T=t.computed(()=>{const w=[];return V.value.basic.length&&w.push("basic"),V.value.advanced.length&&w.push("advanced"),V.value.plugin.length&&w.push("plugin"),w}),_=w=>!!(w.tooltip||i[`${w.key}-label-tooltip`]),F=t.computed(()=>{var w,E;let S=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((w=o.config)==null?void 0:w.controlPlaneId)||""):o.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(E=o.config)!=null&&E.workspace?`/${o.config.workspace}`:"")),S=S.replace(/{id}/gi,o.config.entityId),S}),B=w=>{k.value&&w(JSON.stringify(k.value))?l("copy:success",k.value):l("copy:error")};return t.watch(x,w=>{l("loading",w)},{immediate:!0}),t.onBeforeMount(async()=>{b.value=!1,x.value=!0;try{const{data:w}=await h.get(F.value);if(o.dataKey)if(typeof w[o.dataKey]<"u")k.value={...w[o.dataKey]};else throw new Error(n("errors.dataKeyUndefined",{dataKey:o.dataKey}));else k.value={...w};Object.keys(o.configSchema).filter(E=>o.configSchema[E].forceShow).forEach(E=>{k.value&&typeof k.value[E]>"u"&&(k.value[E]=null)}),l("fetch:success",w)}catch(w){const E=d(w);m.value=E.startsWith("code")?n("baseConfigCard.errors.load"):E,b.value=!0,l("fetch:error",w)}finally{x.value=!1}}),(w,E)=>{const S=t.resolveComponent("KLabel"),H=t.resolveComponent("KSelect"),v=t.resolveComponent("KButton"),D=t.resolveComponent("KClipboardProvider"),U=t.resolveComponent("KSkeleton"),q=t.resolveComponent("KEmptyState"),j=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(j,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",hs,[t.renderSlot(w.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(S,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(H,{key:1,"data-testid":"select-config-format",items:p,onChange:f})):t.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock(v,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(cs),{size:t.unref(mo)},null,8,["size"])],8,ps)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(D,{key:3},{default:t.withCtx(({copyToClipboard:M})=>[!x.value&&!b.value?(t.openBlock(),t.createBlock(v,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:I=>B(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),default:t.withCtx(()=>[x.value?(t.openBlock(),t.createBlock(U,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):b.value?(t.openBlock(),t.createBlock(q,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(m.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",us,[t.createVNode(as,{config:e.config,"fetcher-url":F.value,format:u.value,"prop-list-types":T.value,"property-collections":V.value,record:k.value},t.createSlots({_:2},[t.renderList(Object.keys(w.$slots),M=>({name:M,fn:t.withCtx(({row:I,rowValue:$})=>[t.renderSlot(w.$slots,M,{row:I,rowValue:$},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",fs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.value,M=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${M}-props`,class:t.normalizeClass(`config-card-details-${M}-props`),"data-testid":`config-card-details-${M}-props`},[M!=="basic"?(t.openBlock(),t.createElementBlock("div",gs,t.toDisplayString(M==="advanced"?t.unref(n)("baseConfigCard.sections.advanced"):t.unref(n)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.value[M],I=>(t.openBlock(),t.createBlock(Ge,{key:I.key,item:I},t.createSlots({label:t.withCtx(()=>[t.renderSlot(w.$slots,`${I.key}-label`,{row:I},void 0,!0)]),[I.key]:t.withCtx(({rowValue:$})=>[t.renderSlot(w.$slots,I.key,{row:I,rowValue:$},void 0,!0)]),_:2},[_(I)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(w.$slots,`${I.key}-label-tooltip`,{row:I},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,ms))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",ds,[t.renderSlot(w.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),ks=oe(ys,[["__scopeId","data-v-3fd4a3a4"]]),bs={class:"form-actions","data-testid":"form-actions"},Cs={key:0},ws=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,o=e,i=Je.useRouter(),{i18n:{t:n}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios({headers:(a=o.config)==null?void 0:a.requestHeaders}),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),f=t.computed(()=>o.canSubmit===!1||o.isReadonly),s=t.ref(!1),x=t.computed(()=>{var V,T;let _=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((V=o.config)==null?void 0:V.controlPlaneId)||""):o.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(T=o.config)!=null&&T.workspace?`/${o.config.workspace}`:"")),o.editId?(_=_.replace(/{id}/gi,o.editId),_):(_=_.replace(/\/{id}/gi,""),_)}),b=()=>{s.value=!s.value},m=()=>{o.config.cancelRoute?i.push(o.config.cancelRoute):k()},k=()=>{l("cancel")},N=()=>{f.value||l("submit")},A=t.ref([{title:n("baseForm.configuration.yaml"),hash:"#yaml"},{title:n("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,V=>{l("loading",V)},{immediate:!0}),t.onBeforeMount(async()=>{if(o.editId)try{p.value=!1,h.value=!0;const{data:V}=await c.get(x.value);l("fetch:success",V)}catch(V){const T=d(V);u.value=T.startsWith("code")?n("baseForm.errors.edit"):T,p.value=!0,l("fetch:error",V)}finally{h.value=!1}}),(V,T)=>{const _=t.resolveComponent("KSkeleton"),F=t.resolveComponent("KEmptyState"),B=t.resolveComponent("KAlert"),w=t.resolveComponent("KButton"),E=t.resolveComponent("KTabs"),S=t.resolveComponent("KSlideout"),H=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(H,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(_,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(F,{key:1,"cta-text":t.unref(n)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":m,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(k,["prevent"]),onSubmit:t.withModifiers(N,["prevent"])},[t.renderSlot(V.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(B,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",bs,[t.renderSlot(V.$slots,"form-actions",{},()=>[e.config.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",Cs,[t.createVNode(w,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:T[0]||(T[0]=v=>b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("baseForm.actions.viewConfiguration")),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(w,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(w,{appearance:"primary","data-testid":"form-submit",disabled:f.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("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(n)("baseForm.configuration.title"),visible:s.value,onClose:T[1]||(T[1]=v=>b())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(n)("baseForm.configuration.message")),1),t.createVNode(E,{"data-testid":"form-view-configuration-slideout-tabs",tabs:A.value},{json:t.withCtx(()=>[t.createVNode(qt,{config:e.config,"fetcher-url":x.value,"json-record":o.formFields,"request-method":o.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(va,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),ja=oe(ws,[["__scopeId","data-v-2e2d1350"]]),_s={key:0,"data-testid":"first-col"},Ss=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 b;return((b=r.rowEl)==null?void 0:b.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var b;return((b=a.value)==null?void 0:b.querySelector('[data-testid="first-col"]'))||null}),o=t.computed(()=>{var b,m;const k=(b=r.rowEl)==null?void 0:b.querySelectorAll("td");return k?((m=k[0])==null?void 0:m.getAttribute("data-testid"))===r.keyName:!1});let i;const n=()=>{i&&(i.disconnect(),i=void 0)},d=()=>{var b,m,k;h.value=((b=l.value)==null?void 0:b.getBoundingClientRect().width)||0,p.value=((m=a.value)==null?void 0:m.clientWidth)||0,u.value=((k=c.value)==null?void 0:k.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,b=>{if(o.value&&(n(),"ResizeObserver"in window&&window)){i=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||d()})});for(const m of b)m&&i.observe(m)}},{immediate:!0,flush:"post",deep:!0}),x=t.computed(()=>o.value?h.value>p.value:!1);return t.onMounted(()=>{d()}),t.onUnmounted(()=>{s()}),(b,m)=>{const k=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[o.value?(t.openBlock(),t.createElementBlock("span",_s,[t.createVNode(k,{"max-width":"300",placement:"bottomStart",text:x.value?u.value:""},{default:t.withCtx(()=>[t.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):t.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),xs=oe(Ss,[["__scopeId","data-v-c4379fd4"]]),Ns={class:"toolbar-container"},Vs={key:0,class:"toolbar-button-container"},Bs=["data-testid"],Is=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:o}}=Z.useI18n(),i=t.computed(()=>{var T,_;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(T=a.errorMessage)==null?void 0:T.title,message:(_=a.errorMessage)==null?void 0:_.message}}),n=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=T=>T.hasData||!!a.query,c=t.computed(()=>{const T=[];return Object.keys(a.tableHeaders).forEach(_=>{const F=a.tableHeaders[_];T.push({label:F.label??_,key:_,sortable:F.sortable??!1})}),a.enableEntityActions&&T.push({key:"actions",hideLabel:!0}),T}),h=T=>({"data-rowid":T.id,"data-testid":T.name,...a.rowAttributes(T)}),p=t.ref({}),u=T=>{var _;return(_=p.value)==null?void 0:_.$el.querySelector(`[data-rowid="${T.id}"]`)},f=T=>{const _={"data-testid":T.headerKey,...a.cellAttributes(T)};return T.colIndex===0&&(_.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),_},s=()=>{l("empty-state-cta-clicked"),x()},x=()=>{l("clear-search-input")},b=t.computed(()=>a.disableRowClick?void 0:(T,_)=>{l("click:row",_)}),m=T=>{l("sort",T)},{setTablePreferences:k,getTablePreferences:N}=br(),A=t.computed(()=>{const T=N(a.preferencesStorageKey);return{...a.initialFetcherParams,...T}}),V=T=>{a.preferencesStorageKey&&k(a.preferencesStorageKey,T)};return(T,_)=>{const F=t.resolveComponent("KIcon"),B=t.resolveComponent("KButton"),w=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":n.value,"cell-attrs":f,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(o)("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":A.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":h,"search-input":e.query,onKtableEmptyStateCtaClicked:s,"onRow:click":b.value,onSort:_[0]||(_[0]=H=>m(H)),"onUpdate:tablePreferences":V},t.createSlots({toolbar:t.withCtx(({state:H})=>[t.withDirectives(t.createElementVNode("div",Ns,[t.renderSlot(T.$slots,"toolbar-filter",{},void 0,!0),T.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Vs,[t.renderSlot(T.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(H)]])]),actions:t.withCtx(({row:H,rowKey:v,rowValue:D})=>[t.createElementVNode("div",{class:"actions-container","data-testid":H.name},[t.createVNode(w,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(T.$slots,"actions",{row:H,rowKey:v,rowValue:D},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(B,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(F,{color:t.unref(uo),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,Bs)]),_:2},[t.renderList(e.tableHeaders,(H,v)=>({name:v,fn:t.withCtx(({row:D,rowKey:U,rowValue:q})=>[t.createVNode(xs,{"key-name":String(v),"row-el":u(D)},{default:t.withCtx(()=>[t.renderSlot(T.$slots,v,{row:D,rowKey:U,rowValue:q},()=>[t.createTextVNode(t.toDisplayString(q),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Ma=oe(Is,[["__scopeId","data-v-ecfaa7cf"]]),Ts={key:0,class:"kong-ui-entity-delete-error"},As={key:1,class:"description"},Es=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,o=r,i=t.computed(()=>l.needConfirm?l.entityName:""),n=()=>{o("cancel")},d=()=>{o("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:n,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Ts,[t.createVNode(p,{appearance:"danger"},{alertMessage: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",As,[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"])}}}),Ka=oe(Es,[["__scopeId","data-v-efe8f34b"]]),Hs={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Fs={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Os=["fill"],qs={mask:"url(#mask0_180_20349)"},Us=["fill"],Pa=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${ho})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Hs,[t.createElementVNode("mask",Fs,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Os)]),t.createElementVNode("g",qs,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Us)])]))}}),$s={key:1,class:"kong-ui-entity-filter"},vs={class:"menu-item-title"},Ds={class:"menu-item-indicator"},js={class:"menu-item-body"},Ms=["for"],Ks={class:"menu-item-buttons"},Ps={class:"filter-clear-button-container"},Ls=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,o=r,i=t.ref(!1),n=t.ref({}),d=t.computed(()=>{const k=[];return new URLSearchParams(l.modelValue).forEach((N,A)=>{N!==""&&k.push(A)}),k}),c=t.computed(()=>{const k=l.config.fields;return Object.keys(k).filter(N=>k[N].searchable).map(N=>({label:k[N].label||N,value:N}))});t.watch(()=>l.modelValue,k=>{n.value={},new URLSearchParams(k).forEach((N,A)=>{n.value[A]=N})});const h=()=>{i.value=!i.value},p=k=>{o("update:modelValue",k)},u=k=>`filter-${k}`,f=k=>{var N,A;return(((A=(N=l.config.schema)==null?void 0:N[k])==null?void 0:A.values)??[]).map(V=>({value:V,label:V}))},s=k=>{var N,A;return((A=(N=l.config.schema)==null?void 0:N[k])==null?void 0:A.type)??"text"},x=k=>{n.value={...n.value,[k]:""},m()},b=()=>{n.value={},m(!0)},m=(k=!1)=>{const N=Object.keys(n.value).reduce((A,V)=>(n.value[V]&&(A[V]=`${n.value[V]}`),A),{});k&&(i.value=!1),o("update:modelValue",new URLSearchParams(N).toString())};return(k,N)=>{const A=t.resolveComponent("KInput"),V=t.resolveComponent("KButton"),T=t.resolveComponent("KSelect"),_=t.resolveComponent("KMenuItem"),F=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(A,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":p},{before:t.withCtx(()=>[t.createVNode(Pa)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",$s,[t.createVNode(V,{appearance:"tertiary","data-testid":"filter-button",onClick:h},{default:t.withCtx(()=>[t.createVNode(Pa),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(d.value.length>0?`(${d.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:h},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createVNode(F,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(B,w)=>(t.openBlock(),t.createBlock(_,{key:B.value,"data-testid":B.value,expandable:"","last-menu-item":w===c.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",vs,[t.createTextVNode(t.toDisplayString(B.label)+" ",1),t.withDirectives(t.createElementVNode("span",Ds,null,512),[[t.vShow,d.value.includes(B.value)]])])]),itemBody:t.withCtx(()=>{var E,S;return[t.createElementVNode("div",js,[t.createElementVNode("label",{class:"menu-item-label",for:u(B.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,Ms),((S=(E=e.config.schema)==null?void 0:E[B.value])==null?void 0:S.type)==="select"?(t.openBlock(),t.createBlock(T,{key:0,id:u(B.value),modelValue:n.value[B.value],"onUpdate:modelValue":H=>n.value[B.value]=H,items:f(B.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(A,{key:1,id:u(B.value),modelValue:n.value[B.value],"onUpdate:modelValue":H=>n.value[B.value]=H,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:s(B.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",Ks,[t.createVNode(V,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:N[0]||(N[0]=H=>m(!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:H=>x(B.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",Ps,[t.createVNode(V,{appearance:"tertiary",size:"small",onClick:b},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,i.value]])]))}}}),Rs=oe(Ls,[["__scopeId","data-v-e9512e8f"]]),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}),(o,i)=>l.value?t.renderSlot(o.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),zs={class:"form-section-wrapper"},Js={key:0,class:"form-section-title"},Ws={key:1,class:"form-section-description"},Qs={key:2,class:"form-section-footer"},Ys={class:"form-section-content"},Zs=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",zs,[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",Js,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",Ws,[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",Qs,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",Ys,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),Oe=oe(Zs,[["__scopeId","data-v-3565daa7"]]),{useAxios:Ke,useDeleteUrlBuilder:La,useErrors:Ra,useExternalLinkCreator:Jc,useFetchUrlBuilder:Wc,useFetcher:za,useDebouncedFilter:Ja,useStringHelpers:Qc,useHelpers:Gs,useGatewayFeatureSupported:Yc,useTruncationDetector:Zc}=Z,Xs={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 ec(){const e=Ie.createI18n("en-us",Xs);return{i18n:e,i18nT:Ie.i18nTComponent(e)}}function qe(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(o,i)=>{if(i){const n={...o};r&&(n.value=o.label),a.value.push(n)}else a.value=a.value.filter(n=>n.value!==o.value)}}}const Pe=[{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"}],ut=10,ft=65536,tc=0,ac=65535,_e=0,Se=255,Wa=0,Qa=255,lc=0,rc=65535,Ya=0,Za=65535,oc=0,nc=2**31,mt=["200","302"],gt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],yt=["429","404","500","501","502","503","504","505"],kt=["429","500","503"];function Le(){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()),o=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:mt,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:yt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:gt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:kt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,f,s,x,b,m,k,N,A,V,T,_,F,B,w,E,S,H,v,D,U,q,j,M,I,$,P,y,g,C,z,K,J,X,R,te,ge,Be,Xa,el,tl,al,ll,rl,ol,nl,il,sl,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,wl,_l,Sl,xl,Nl,Vl,Bl,Il,Tl,Al,El,Hl,Fl,Ol,ql,Ul,$l,vl,Dl,jl,Ml,Kl,Pl,Ll,Rl,zl,Jl,Wl,Ql,Yl,Zl,Gl,Xl,er,tr,ar,lr,rr,or,nr,ir,sr,cr,dr,hr,pr,ur,fr;const h=o();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||((b=(x=c.healthchecks.active)==null?void 0:x.unhealthy)==null?void 0:b.interval)!==0,h.activeHealthCheck.type=((m=c.healthchecks.active)==null?void 0:m.type)||"http",h.activeHealthCheck.httpPath=((k=c.healthchecks.active)==null?void 0:k.http_path)||"/",h.activeHealthCheck.timeout=((N=c.healthchecks.active)==null?void 0:N.timeout)!==null&&((A=c.healthchecks.active)==null?void 0:A.timeout)!==void 0?(T=(V=c.healthchecks.active)==null?void 0:V.timeout)==null?void 0:T.toString():"",h.activeHealthCheck.concurrency=((_=c.healthchecks.active)==null?void 0:_.concurrency)!==null&&((F=c.healthchecks.active)==null?void 0:F.concurrency)!==void 0?(w=(B=c.healthchecks.active)==null?void 0:B.concurrency)==null?void 0:w.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=(H=c.healthchecks.active)!=null&&H.headers&&Object.entries((v=c.healthchecks.active)==null?void 0:v.headers).length>0?Object.entries((D=c.healthchecks.active)==null?void 0:D.headers).map(([zc,bt])=>({key:zc,values:bt==null?void 0:bt.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((q=(U=c.healthchecks.active)==null?void 0:U.healthy)==null?void 0:q.interval)!==null&&((M=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:M.interval)!==void 0?(P=($=(I=c.healthchecks.active)==null?void 0:I.healthy)==null?void 0:$.interval)==null?void 0:P.toString():"0",h.activeHealthCheck.interval=((g=(y=c.healthchecks.active)==null?void 0:y.healthy)==null?void 0:g.interval)!==null&&((z=(C=c.healthchecks.active)==null?void 0:C.healthy)==null?void 0:z.interval)!==void 0?(X=(J=(K=c.healthchecks.active)==null?void 0:K.healthy)==null?void 0:J.interval)==null?void 0:X.toString():"0",h.activeHealthCheck.successes=((te=(R=c.healthchecks.active)==null?void 0:R.healthy)==null?void 0:te.successes)!==null&&((Be=(ge=c.healthchecks.active)==null?void 0:ge.healthy)==null?void 0:Be.successes)!==void 0?(tl=(el=(Xa=c.healthchecks.active)==null?void 0:Xa.healthy)==null?void 0:el.successes)==null?void 0:tl.toString():"0",h.activeHealthCheck.httpStatuses=(ll=(al=c.healthchecks.active)==null?void 0:al.healthy)!=null&&ll.http_statuses?l(((ol=(rl=c.healthchecks.active)==null?void 0:rl.healthy)==null?void 0:ol.http_statuses)||[]):mt,h.activeHealthCheck.unhealthyInterval=((il=(nl=c.healthchecks.active)==null?void 0:nl.unhealthy)==null?void 0:il.interval)!==null&&((cl=(sl=c.healthchecks.active)==null?void 0:sl.unhealthy)==null?void 0:cl.interval)!==void 0?(pl=(hl=(dl=c.healthchecks.active)==null?void 0:dl.unhealthy)==null?void 0:hl.interval)==null?void 0:pl.toString():"0",h.activeHealthCheck.httpFailures=((fl=(ul=c.healthchecks.active)==null?void 0:ul.unhealthy)==null?void 0:fl.http_failures)!==null&&((gl=(ml=c.healthchecks.active)==null?void 0:ml.unhealthy)==null?void 0:gl.http_failures)!==void 0?(bl=(kl=(yl=c.healthchecks.active)==null?void 0:yl.unhealthy)==null?void 0:kl.http_failures)==null?void 0:bl.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((wl=(Cl=c.healthchecks.active)==null?void 0:Cl.unhealthy)==null?void 0:wl.timeouts)!==null&&((Sl=(_l=c.healthchecks.active)==null?void 0:_l.unhealthy)==null?void 0:Sl.timeouts)!==void 0?(Vl=(Nl=(xl=c.healthchecks.active)==null?void 0:xl.unhealthy)==null?void 0:Nl.timeouts)==null?void 0:Vl.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(Il=(Bl=c.healthchecks.active)==null?void 0:Bl.unhealthy)!=null&&Il.http_statuses?l(((Al=(Tl=c.healthchecks.active)==null?void 0:Tl.unhealthy)==null?void 0:Al.http_statuses)||[]):yt,h.passiveHealthSwitch=((Hl=(El=c.healthchecks.passive)==null?void 0:El.healthy)==null?void 0:Hl.successes)!==0||((Ol=(Fl=c.healthchecks.passive)==null?void 0:Fl.unhealthy)==null?void 0:Ol.timeouts)!==0||((Ul=(ql=c.healthchecks.passive)==null?void 0:ql.unhealthy)==null?void 0:Ul.tcp_failures)!==0||((vl=($l=c.healthchecks.passive)==null?void 0:$l.unhealthy)==null?void 0:vl.http_failures)!==0,h.passiveHealthCheck.type=((Dl=c.healthchecks.passive)==null?void 0:Dl.type)||"http",h.passiveHealthCheck.successes=((Ml=(jl=c.healthchecks.passive)==null?void 0:jl.healthy)==null?void 0:Ml.successes)!==null&&((Pl=(Kl=c.healthchecks.passive)==null?void 0:Kl.healthy)==null?void 0:Pl.successes)!==void 0?(zl=(Rl=(Ll=c.healthchecks.passive)==null?void 0:Ll.healthy)==null?void 0:Rl.successes)==null?void 0:zl.toString():"0",h.passiveHealthCheck.httpStatuses=(Wl=(Jl=c.healthchecks.passive)==null?void 0:Jl.healthy)!=null&&Wl.http_statuses?l(((Yl=(Ql=c.healthchecks.passive)==null?void 0:Ql.healthy)==null?void 0:Yl.http_statuses)||[]):gt,h.passiveHealthCheck.timeouts=((Gl=(Zl=c.healthchecks.passive)==null?void 0:Zl.unhealthy)==null?void 0:Gl.timeouts)!==null&&((er=(Xl=c.healthchecks.passive)==null?void 0:Xl.unhealthy)==null?void 0:er.timeouts)!==void 0?(lr=(ar=(tr=c.healthchecks.passive)==null?void 0:tr.unhealthy)==null?void 0:ar.timeouts)==null?void 0:lr.toString():"0",h.passiveHealthCheck.tcpFailures=((or=(rr=c.healthchecks.passive)==null?void 0:rr.unhealthy)==null?void 0:or.tcp_failures)!==null&&((ir=(nr=c.healthchecks.passive)==null?void 0:nr.unhealthy)==null?void 0:ir.tcp_failures)!==void 0?(dr=(cr=(sr=c.healthchecks.passive)==null?void 0:sr.unhealthy)==null?void 0:cr.tcp_failures)==null?void 0:dr.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(pr=(hr=c.healthchecks.passive)==null?void 0:hr.unhealthy)!=null&&pr.http_statuses?l(((fr=(ur=c.healthchecks.passive)==null?void 0:ur.unhealthy)==null?void 0:fr.http_statuses)||[]):kt,h},getDefaultUpstreamFields:o,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const de={useI18n:ec,useMultiselectCreation:qe,useHelpers:Le},xe="/api/runtime_groups/{controlPlaneId}",Ne="/{workspace}",Ve={list:{konnect:`${xe}/upstreams`,kongManager:`${Ne}/upstreams`},form:{konnect:{getServices:`${xe}/services`,getCertificates:`${xe}/certificates`,validate:`${xe}/v1/schemas/json/upstream/validate`,create:`${xe}/upstreams`,edit:`${xe}/upstreams/{id}`},kongManager:{getServices:`${Ne}/services`,getCertificates:`${Ne}/certificates`,validate:`${Ne}/schemas/upstreams/validate`,create:`${Ne}/upstreams`,edit:`${Ne}/upstreams/{id}`}}},ic={class:"kong-ui-entities-upstreams-list"},sc={class:"upstream-name"},cc=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 M;const a=r,l=e,{i18n:{t:o}}=de.useI18n(),i=Je.useRouter(),{axiosInstance:n}=Ke({headers:(M=l.config)==null?void 0:M.requestHeaders}),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:o("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:o("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:o("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var $,P;let I=`${l.config.apiBaseUrl}${Ve.list[l.config.app]}`;return l.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,(($=l.config)==null?void 0:$.controlPlaneId)||""):l.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(P=l.config)!=null&&P.workspace?`/${l.config.workspace}`:"")),I}),f=t.ref(""),s=t.computed(()=>{const I=l.config.app==="konnect"||l.config.isExactMatch;if(I)return{isExactMatch:I,placeholder:o("upstreams.search.placeholder")};const{name:$,slots:P}=h;return{isExactMatch:I,fields:{name:$,slots:P},schema:l.config.filterSchema}}),{fetcher:x,fetcherState:b}=za(l.config,u.value),m=()=>{f.value=""},k=()=>{d.value++},N=t.ref(null),A=(I,$)=>{const P=I.id;if(!$(P)){a("copy:error",{entity:I,field:"id",message:o("upstreams.errors.copy")});return}a("copy:success",{entity:I,field:"id",message:o("upstreams.copy.success",{val:P})})},V=(I,$)=>{const P=JSON.stringify(I);if(!$(P)){a("copy:error",{entity:I,message:o("upstreams.errors.copy")});return}a("copy:success",{entity:I,message:o("upstreams.copy.success_brief")})},T=async I=>{var P;await((P=l.canRetrieve)==null?void 0:P.call(l,I))&&i.push(l.config.getViewRoute(I.id))},_=I=>({label:o("upstreams.actions.view"),to:l.config.getViewRoute(I)}),F=I=>({label:o("upstreams.actions.edit"),to:l.config.getEditRoute(I)}),B=t.ref(void 0),w=t.ref(!1),E=t.ref(!1),S=t.ref(""),H=La(l.config,u.value),v=I=>{B.value=I,w.value=!0},D=()=>{w.value=!1},U=async()=>{var I,$,P;if((I=B.value)!=null&&I.id){E.value=!0;try{await n.delete(H(B.value.id)),E.value=!1,w.value=!1,d.value++,a("delete:success",B.value)}catch(y){S.value=((P=($=y.response)==null?void 0:$.data)==null?void 0:P.message)||y.message||o("upstreams.errors.delete"),a("error",y)}finally{E.value=!1}}},q=t.ref(!0);t.watch(b,I=>{var $,P,y,g;if(Array.isArray(($=I==null?void 0:I.response)==null?void 0:$.data)&&(q.value=I.response.data.length>0),I.status===pe.Error){N.value={title:o("upstreams.errors.general")},(g=(y=(P=I.error)==null?void 0:P.response)==null?void 0:y.data)!=null&&g.message&&(N.value.message=I.error.response.data.message),a("error",I.error);return}N.value=null});const j=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:o("upstreams.list.empty_state.description"),title:o("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(j.value.title=o("upstreams.list.empty_state.title"),j.value.ctaText=o("upstreams.actions.create"))}),(I,$)=>{const P=t.resolveComponent("KButton"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KTruncate"),C=t.resolveComponent("KDropdownItem"),z=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",ic,[t.createVNode(t.unref(Ma),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":N.value,fetcher:t.unref(x),"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:m,"onClick:row":$[1]||($[1]=K=>T(K)),onSort:k},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Rs),{modelValue:f.value,"onUpdate:modelValue":$[0]||($[0]=K=>f.value=K),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(P,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,q.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),name:t.withCtx(({rowValue:K})=>[t.createElementVNode("span",sc,t.toDisplayString(K),1)]),tags:t.withCtx(({rowValue:K})=>[t.createVNode(g,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(K,J=>(t.openBlock(),t.createBlock(y,{key:J,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(J),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:K})=>[t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-id",onClick:X=>A(K,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-json",onClick:X=>V(K,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canRetrieve(K)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-view","has-divider":"",item:_(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(K)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-edit",item:F(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(K)},{default:t.withCtx(()=>[t.createVNode(C,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:J=>v(K)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("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(Ka),{"action-pending":E.value,description:t.unref(o)("upstreams.delete.description"),"entity-name":B.value&&(B.value.name||B.value.id),"entity-type":t.unref(We).Upstream,error:S.value,title:t.unref(o)("upstreams.delete.title"),visible:w.value,onCancel:D,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,o]of r)a[l]=o;return a},dc=he(cc,[["__scopeId","data-v-ddf62ed4"]]),Re={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"}}},hc={class:"kong-ui-entities-target-form"},pc={class:"target-form-container"},uc={key:0,class:"target-form-info"},Ga=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 T;const a=r,l=e,{i18n:{t:o}}=de.useI18n(),{getMessageFromError:i}=Ra(),{axiosInstance:n}=Ke({headers:(T=l.config)==null?void 0:T.requestHeaders}),d=t.computed(()=>{var _;return Re.form[l.config.app].edit.replace(/{upstreamId}/gi,((_=l.config)==null?void 0:_.upstreamId)||"")}),c=t.computed(()=>l.targetId?ne.Edit:ne.Create),h=t.computed(()=>c.value===ne.Edit?o("targets.form.edit.title"):o("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 _=parseInt(p.fields.weight.toString(),10);return _<0||_>65535}),x=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),b=_=>{var F;p.fields.target=(_==null?void 0:_.target)||"",p.fields.weight=(_==null?void 0:_.weight)??"",p.fields.tags=((F=_==null?void 0:_.tags)==null?void 0:F.join(", "))||"",Object.assign(u,p.fields)},m=()=>{p.errorMessage="",a("cancel")},k=t.computed(()=>{var F,B;let _=`${l.config.apiBaseUrl}${Re.form[l.config.app].validate}`;return l.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((F=l.config)==null?void 0:F.controlPlaneId)||""):l.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(B=l.config)!=null&&B.workspace?`/${l.config.workspace}`:"")),_=_.replace(/{id}/gi,l.targetId),_}),N=t.computed(()=>{var F,B,w,E;let _=`${l.config.apiBaseUrl}${Re.form[l.config.app][c.value]}`;return l.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((F=l.config)==null?void 0:F.controlPlaneId)||"").replace(/{upstreamId}/gi,((B=l.config)==null?void 0:B.upstreamId)||""):l.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(w=l.config)!=null&&w.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((E=l.config)==null?void 0:E.upstreamId)||"")),_=_.replace(/{id}/gi,l.targetId),_}),A=t.computed(()=>{var _,F,B;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(B=(F=(_=p.fields.tags)==null?void 0:_.split(","))==null?void 0:F.map(w=>String(w||"").trim()))==null?void 0:B.filter(w=>w!==""),upstream:{id:l.config.upstreamId}}}),V=async()=>{var _,F;try{p.isReadonly=!0,p.errorMessage="";let B;if(await n.post(k.value,A.value),c.value==="create"?B=await n.post(N.value,A.value):c.value==="edit"&&(B=((_=l.config)==null?void 0:_.app)==="konnect"?await n.put(N.value,A.value):await n.patch(N.value,A.value)),B){const{data:w}=B;p.fields.target=(w==null?void 0:w.name)||"",p.fields.weight=(w==null?void 0:w.weight)??100,p.fields.tags=((F=w==null?void 0:w.tags)==null?void 0:F.join(", "))||"",a("update",w),Object.assign(p.fields,f)}}catch(B){p.errorMessage=i(B),a("error",B)}finally{p.isReadonly=!1}};return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,f)}),(_,F)=>{const B=t.resolveComponent("KInput"),w=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(w,{"action-button-disabled":!x.value||p.isReadonly,"action-button-text":t.unref(o)("targets.form.buttons.save"),"cancel-button-text":t.unref(o)("targets.form.buttons.cancel"),title:h.value,visible:e.isVisible,onCancel:m,onProceed:V},{default:t.withCtx(()=>[t.createElementVNode("div",hc,[t.createVNode(t.unref(ja),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":A.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":F[3]||(F[3]=E=>_.$emit("error",E)),"onFetch:success":b,onLoading:F[4]||(F[4]=E=>_.$emit("loading",E))},{default:t.withCtx(()=>[t.createElementVNode("div",pc,[_.$slots.info?(t.openBlock(),t.createElementBlock("div",uc,[t.renderSlot(_.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(B,{modelValue:p.fields.target,"onUpdate:modelValue":F[0]||(F[0]=E=>p.fields.target=E),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(o)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(o)("targets.form.fields.target.tooltip")},placeholder:t.unref(o)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(B,{modelValue:p.fields.weight,"onUpdate:modelValue":F[1]||(F[1]=E=>p.fields.weight=E),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(o)("targets.errors.weight"),label:t.unref(o)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(o)("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(B,{modelValue:p.fields.tags,"onUpdate:modelValue":F[2]||(F[2]=E=>p.fields.tags=E),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(o)("targets.form.fields.tags.help"),label:t.unref(o)("targets.form.fields.tags.label"),placeholder:t.unref(o)("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"]]),fc={class:"kong-ui-entities-targets-list"},mc={class:"target-address"},gc=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 P;const a=r,l=e,{i18n:{t:o}}=de.useI18n(),{axiosInstance:i}=Ke({headers:(P=l.config)==null?void 0:P.requestHeaders}),n=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:o("targets.list.table_headers.target_address"),sortable:!0},weight:{label:o("targets.list.table_headers.weight"),sortable:!0},tags:{label:o("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var g,C,z,K;let y=`${l.config.apiBaseUrl}${Re.list[l.config.app]}`;return l.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((g=l.config)==null?void 0:g.controlPlaneId)||"").replace(/{upstreamId}/gi,((C=l.config)==null?void 0:C.upstreamId)||""):l.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(z=l.config)!=null&&z.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((K=l.config)==null?void 0:K.upstreamId)||"")),y}),{fetcher:u,fetcherState:f}=za(l.config,p.value),s=()=>{n.value++},x=t.ref(null),b=()=>{j.value=!0},m=(y,g)=>{const C=y.id;if(!g(C)){a("copy:error",{entity:y,field:"id",message:o("targets.errors.copy")});return}a("copy:success",{entity:y,field:"id",message:o("targets.copy.success",{val:C})})},k=(y,g)=>{const C=JSON.stringify(y);if(!g(C)){a("copy:error",{entity:y,message:o("targets.errors.copy")});return}a("copy:success",{entity:y,message:o("targets.copy.success_brief")})},N=y=>{q.value=y,j.value=!0},A=y=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(y),V=y=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(y),T=t.ref(void 0),_=t.ref(!1),F=t.ref(!1),B=t.ref(""),w=La(l.config,p.value),E=y=>{T.value=y,_.value=!0},S=()=>{_.value=!1},H=async()=>{var y,g,C;if((y=T.value)!=null&&y.id){F.value=!0;try{await i.delete(w(T.value.id)),F.value=!1,_.value=!1,n.value++,a("delete:success",T.value)}catch(z){B.value=((C=(g=z.response)==null?void 0:g.data)==null?void 0:C.message)||z.message||o("targets.errors.delete"),a("error",z)}finally{F.value=!1}}},v=t.ref(!0);t.watch(f,y=>{var g,C,z,K;if(Array.isArray((g=y==null?void 0:y.response)==null?void 0:g.data)&&(v.value=y.response.data.length>0),y.status===pe.Error){x.value={title:o("targets.errors.general")},(K=(z=(C=y.error)==null?void 0:C.response)==null?void 0:z.data)!=null&&K.message&&(x.value.message=y.error.response.data.message),a("error",y.error);return}x.value=null});const D=t.ref({ctaText:void 0,message:o("targets.list.empty_state.description"),title:o("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(D.value.title=o("targets.list.empty_state.title"),D.value.ctaText=o("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}})),q=t.ref(""),j=t.ref(!1),M=y=>{q.value?a("update:target",y):a("create:target",y),I()},I=()=>{$(),n.value++},$=()=>{j.value=!1,q.value=""};return(y,g)=>{const C=t.resolveComponent("KButton"),z=t.resolveComponent("KBadge"),K=t.resolveComponent("KTruncate"),J=t.resolveComponent("KDropdownItem"),X=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",fc,[t.createVNode(t.unref(Ma),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":D.value,"enable-entity-actions":"","error-message":x.value,fetcher:t.unref(u),"fetcher-cache-key":n.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:g[1]||(g[1]=()=>l.config.createRoute?void 0:b()),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(C,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:l.config.createRoute?l.config.createRoute:void 0,onClick:g[0]||(g[0]=()=>l.config.createRoute?void 0:b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,v.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),target:t.withCtx(({rowValue:R})=>[t.createElementVNode("span",mc,t.toDisplayString(R),1)]),tags:t.withCtx(({rowValue:R})=>[t.createVNode(K,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R,te=>(t.openBlock(),t.createBlock(z,{key:te,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(te),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:R})=>[t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:ge=>m(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:ge=>k(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-entity-edit","has-divider":"",onClick:te=>N(R.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>A(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-healthy",onClick:te=>a("health-actions:healthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>V(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-unhealthy",onClick:te=>a("health-actions:unhealthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(R)},{default:t.withCtx(()=>[t.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:te=>E(R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("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(Ka),{"action-pending":F.value,description:t.unref(o)("targets.delete.description"),"entity-type":t.unref(We).Target,error:B.value,"need-confirm":!1,title:t.unref(o)("targets.delete.title"),visible:_.value,onCancel:S,onProceed:H},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Ga,{config:U.value,"is-visible":j.value,"target-id":q.value,onCancel:$,onUpdate:M},t.createSlots({_:2},[y.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-6e346906"]]),yc={key:1},kc=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,H,v,D;const{i18nT:a,i18n:{t:l}}=de.useI18n(),o=e,i=r,{debouncedQueryChange:n,loading:d,loadItems:c,results:h,allRecords:p}=Ja(o.config,(H=Ve.form[(S=o.config)==null?void 0:S.app])==null?void 0:H.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:s,results:x}=Ja(o.config,(D=Ve.form[(v=o.config)==null?void 0:v.app])==null?void 0:D.getCertificates),b=t.ref(""),m=t.computed(()=>{var U;return!!o.name&&!((U=p.value)!=null&&U.some(q=>q.host===o.name))}),k=t.computed(()=>{var q,j,M;const U=m.value&&o.name.includes((q=b.value)==null?void 0:q.toLowerCase());return(M=h.value)==null?void 0:M.map(I=>({label:I.host,value:I.id})).concat(U?[{label:o.name,value:((j=V.value)==null?void 0:j.value)||o.name}]:[])}),N=t.computed(()=>{var U;return(U=x.value)==null?void 0:U.map(q=>({label:q.id,value:q.id}))}),A=t.ref(""),V=t.ref({value:"",label:""}),T=t.computed(()=>{var U,q;return((U=k.value.find(j=>j.value===A.value))==null?void 0:U.label)||((q=V.value)==null?void 0:q.label)}),_=U=>{b.value=U,n(U)},F=U=>{V.value=U},B=()=>{V.value={value:"",label:""}},w=U=>{A.value=U,i("update:name",T.value)},E=t.ref(!1);return t.onBeforeMount(async()=>{var U,q;try{E.value=!0,await c(),o.name&&(A.value=((q=(U=k.value.find(j=>j.label===o.name))==null?void 0:U.value)==null?void 0:q.toString())||o.name),await s()}finally{E.value=!1}}),(U,q)=>{const j=t.resolveComponent("KSkeleton"),M=t.resolveComponent("KSelect"),I=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[E.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",yc,[t.createVNode(M,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:k.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":A.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:F,onItemRemoved:B,onQueryChange:_,"onUpdate:modelValue":w},{"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(I,{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":q[0]||(q[0]=$=>i("update:host-header",$))},null,8,["label","model-value","readonly"]),t.createVNode(M,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:N.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":q[1]||(q[1]=$=>i("update:client-certificate",$))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(I,{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":q[2]||(q[2]=$=>i("update:tags",$))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),ze={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},bc={class:"fields-group-title"},Cc={class:"fields-group-text"},wc={class:"fields-group-title"},_c={class:"fields-group-text"},Sc=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:o}=Le(),i=e,n=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&&n("update:hash-on-header",""),f==="cookie"&&u!==f&&(n("update:hash-on-cookie",""),n("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&n("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&n("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(n("update:hash-fallback","none"),n("update:hash-fallback-header",""),n("update:hash-fallback-query-argument",""),n("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,f)=>{f==="header"&&u!==f&&n("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(n("update:hash-on-cookie",""),n("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&n("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&n("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?o(i.slots,ut,ft)?"":l("upstreams.form.errors.in_range"):"");return(u,f)=>{const s=t.resolveComponent("KExternalLink"),x=t.resolveComponent("KSelect"),b=t.resolveComponent("KInput"),m=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(ze).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(x,{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]=k=>n("update:algorithm",k))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,{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(ft),min:t.unref(ut),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":f[1]||(f[1]=k=>n("update:slots",k))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",bc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",Cc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(x,{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]=k=>n("update:hash-on",k))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(b,{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]=k=>n("update:hash-on-header",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{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]=k=>n("update:hash-on-cookie",k))},null,8,["label","model-value","readonly"]),t.createVNode(b,{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]=k=>n("update:hash-on-cookie-path",k))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(b,{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]=k=>n("update:hash-on-query-argument",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(b,{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]=k=>n("update:hash-on-uri-capture",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",wc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",_c,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(x,{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]=k=>n("update:hash-fallback",k))},{"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(b,{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]=k=>n("update:hash-fallback-header",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{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]=k=>n("update:hash-on-cookie",k))},null,8,["label","model-value","readonly"]),t.createVNode(b,{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]=k=>n("update:hash-on-cookie-path",k))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(b,{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]=k=>n("update:hash-fallback-query-argument",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(b,{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]=k=>n("update:hash-fallback-uri-capture",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),xc={class:"fields-group-title"},Nc={class:"fields-group-text"},Vc={class:"fields-group-title"},Bc={class:"fields-group-text"},Ic=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(o,i)=>{const n=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(n,{"hide-icon":"",href:t.unref(ze).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",xc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",Nc,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",Vc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",Bc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:i[1]||(i[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(ac),min:t.unref(tc),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),Tc={key:2},Ac={class:"fields-group-title"},Ec={class:"fields-group-text"},Hc={class:"fields-group-title"},Fc={class:"fields-group-text"},Oc=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}=Le(),o=e,i=r,n=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(()=>o.type==="https"||o.type==="grpcs"),c=t.computed(()=>o.type==="tcp"),{trackNewItems:h}=qe({replaceId:!0}),{trackNewItems:p}=qe({replaceId:!0});t.watch(()=>o.type,(b,m)=>{m==="tcp"&&b!==m&&i("update:tcp-failures","5"),(m==="https"||m==="grpcs")&&b!==m&&(i("update:https-sni",""),i("update:verify-ssl",!1)),m!=="tcp"&&b==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",mt),i("update:unhealthy-http-statuses",yt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>o.headers,b=>{l(u.value,b)||(u.value=[...b])},{immediate:!0,deep:!0});const f=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),f()},x=b=>{b===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(b,1),f()};return(b,m)=>{const k=t.resolveComponent("KExternalLink"),N=t.resolveComponent("KSelect"),A=t.resolveComponent("KInput"),V=t.resolveComponent("KCheckbox"),T=t.resolveComponent("KLabel"),_=t.resolveComponent("KIcon"),F=t.resolveComponent("KButton"),B=t.resolveComponent("KMultiselect"),w=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(k,{"hide-icon":"",href:t.unref(ze).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(N,{class:"active-healthcheck-type-select",items:n.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[0]||(m[0]=S=>i("update:type",S))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(A,{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":m[1]||(m[1]=S=>i("update:http-path",S))},null,8,["label","model-value","readonly"])),t.createVNode(A,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(rc),min:t.unref(lc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":m[2]||(m[2]=S=>i("update:timeout",S))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(A,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(nc),min:t.unref(oc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":m[3]||(m[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(A,{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":m[4]||(m[4]=S=>i("update:https-sni",S))},null,8,["label","model-value","readonly"]),t.createVNode(V,{"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":m[5]||(m[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",Tc,[t.createVNode(T,{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,H)=>(t.openBlock(),t.createElementBlock("div",{key:`${S.header}_${H}`,class:t.normalizeClass(["headers-row",{"margin-top-6":H>0}])},[t.createVNode(A,{modelValue:u.value[H].key,"onUpdate:modelValue":v=>u.value[H].key=v,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${H+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(A,{modelValue:u.value[H].values,"onUpdate:modelValue":v=>u.value[H].values=v,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${H+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(F,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:v=>x(H)},{icon:t.withCtx(()=>[t.createVNode(_,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&H===u.value.length-1?(t.openBlock(),t.createBlock(F,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:s},{icon:t.withCtx(()=>[t.createVNode(_,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(w,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Ac,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Ec,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(A,{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(Za),min:t.unref(Ya),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[6]||(m[6]=S=>i("update:interval",S))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(A,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":m[7]||(m[7]=S=>i("update:successes",S))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(B,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:m[8]||(m[8]=S=>t.unref(h)(S,!0)),onItemRemoved:m[9]||(m[9]=S=>t.unref(h)(S,!1)),"onUpdate:modelValue":m[10]||(m[10]=S=>i("update:http-statuses",S))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(w,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Hc,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Fc,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(A,{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(Za),min:t.unref(Ya),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[11]||(m[11]=S=>i("update:unhealthy-interval",S))},null,8,["help","label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createBlock(A,{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(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[12]||(m[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(A,{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(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[13]||(m[13]=S=>i("update:http-failures",S))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:m[14]||(m[14]=S=>t.unref(p)(S,!0)),onItemRemoved:m[15]||(m[15]=S=>t.unref(p)(S,!1)),"onUpdate:modelValue":m[16]||(m[16]=S=>i("update:unhealthy-http-statuses",S))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(A,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Qa),min:t.unref(Wa),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":m[17]||(m[17]=S=>i("update:unhealthy-timeouts",S))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-9e6394cf"]]),qc={class:"fields-group-title"},Uc={class:"fields-group-text"},$c={class:"fields-group-title"},vc={class:"fields-group-text"},Dc=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,o=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}]),n=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&&o("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(o("update:http-statuses",gt),o("update:unhealthy-http-statuses",kt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),x=t.resolveComponent("KMultiselect"),b=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(ze).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]=m=>o("update:type",m))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",qc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",Uc,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(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=m=>o("update:successes",m))},null,8,["label","max","min","model-value","readonly"]),n.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(x,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=m=>t.unref(d)(m,!0)),onItemRemoved:p[3]||(p[3]=m=>t.unref(d)(m,!1)),"onUpdate:modelValue":p[4]||(p[4]=m=>o("update:http-statuses",m))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",$c,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(Qa),min:t.unref(Wa),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=m=>o("update:timeouts",m))},null,8,["label","max","min","model-value","readonly"]),n.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(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=m=>o("update:tcp-failures",m))},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(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=m=>o("update:http-failures",m))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(x,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=m=>t.unref(c)(m,!0)),onItemRemoved:p[9]||(p[9]=m=>t.unref(c)(m,!1)),"onUpdate:modelValue":p[10]||(p[10]=m=>o("update:unhealthy-http-statuses",m))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-cca8adae"]]),jc={class:"kong-ui-entities-upstreams-form"},Mc=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 P;const a=e,l=r,{inRange:o,stringToNumberArray:i,upstreamsResponseToFields:n,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=Le(),{axiosInstance:p}=Ke({headers:(P=a.config)==null?void 0:P.requestHeaders}),{getMessageFromError:u}=Ra(),f=Je.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),x=t.reactive(d()),b=t.computed(()=>!c(s.fields,x)),m=y=>{s.fields.activeHealthCheck.interval=y?"5":"0",s.fields.activeHealthCheck.successes=y?"5":"0",s.fields.activeHealthCheck.httpFailures=y?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=y?"5":"0"},k=y=>{s.fields.passiveHealthCheck.timeouts=y?"5":"0",s.fields.passiveHealthCheck.successes=y?"80":"0"},N=t.computed(()=>s.fields.slots?o(s.fields.slots,ut,ft):!0),A=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),V=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),T=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),_=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),F=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),B=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),w=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&&N.value&&A.value&&V.value&&T.value&&_.value&&F.value&&B.value&&w.value&&E.value),H=t.computed(()=>a.upstreamId?ne.Edit:ne.Create),v=t.computed(()=>{var y,g;return(g=Ve.form[(y=a.config)==null?void 0:y.app])==null?void 0:g.edit}),D=y=>{Object.assign(s.fields,n(y)),Object.assign(x,h(s.fields))},U=()=>{var y;f.push(((y=a.config)==null?void 0:y.cancelRoute)||{name:"upstreams-list"})},q=y=>{l("loading",y)},j=y=>{l("error",y)},M=t.computed(()=>{var g,C,z,K,J;const y={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&&(y.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(y.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(y.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(y.tags=(C=(g=s.fields.tags.split(","))==null?void 0:g.map(X=>String(X||"").trim()))==null?void 0:C.filter(X=>X!=="")),s.fields.hashOn==="header"&&(y.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(y.hash_on_cookie=s.fields.hashOnCookie,y.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(y.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(y.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(y.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(y.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(y.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(y.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(y.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(y.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(y.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((z=a.config)==null?void 0:z.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?y.healthchecks.active.headers=[]:y.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((X,R)=>{var te,ge;return R.key?{...X,[R.key]:(ge=(te=R.values.split(","))==null?void 0:te.map(Be=>String(Be||"").trim()))==null?void 0:ge.filter(Be=>Be!=="")}:{...X}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(y.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(y.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(y.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(y.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(y.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(y.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(y.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(y.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.type==="tcp"&&s.fields.activeHealthCheck.tcpFailures&&(y.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((K=a.config)==null?void 0:K.app)==="kongManager"&&H.value===ne.Edit&&(y.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),s.fields.passiveHealthSwitch?(y.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(y.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(y.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(y.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(y.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.type==="tcp"&&s.fields.passiveHealthCheck.tcpFailures&&(y.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((J=a.config)==null?void 0:J.app)==="kongManager"&&H.value===ne.Edit&&(y.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),y}),I=y=>{var C,z,K,J,X,R;let g=`${(C=a.config)==null?void 0:C.apiBaseUrl}${Ve.form[(z=a.config)==null?void 0:z.app][y]}`;return((K=a.config)==null?void 0:K.app)==="konnect"?g=g.replace(/{controlPlaneId}/gi,((J=a.config)==null?void 0:J.controlPlaneId)||""):((X=a.config)==null?void 0:X.app)==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(R=a.config)!=null&&R.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.upstreamId),g},$=async()=>{var y;try{s.readonly=!0,await p.post(I("validate"),M.value);let g;H.value===ne.Create?g=await p.post(I("create"),M.value):H.value===ne.Edit&&(g=((y=a.config)==null?void 0:y.app)==="konnect"?await p.put(I("edit"),M.value):await p.patch(I("edit"),M.value)),l("update",g==null?void 0:g.data)}catch(g){s.errorMessage=u(g),l("error",g)}finally{s.readonly=!1}};return(y,g)=>(t.openBlock(),t.createElementBlock("div",jc,[t.createVNode(t.unref(ja),{"can-submit":S.value&&b.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":v.value,"form-fields":M.value,"is-readonly":s.readonly,onCancel:U,"onFetch:error":j,"onFetch:success":D,onLoading:q,onSubmit:$},{default:t.withCtx(()=>[t.createVNode(kc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":g[0]||(g[0]=C=>s.fields.clientCertificate=C),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":g[1]||(g[1]=C=>s.fields.hostHeader=C),name:s.fields.name,"onUpdate:name":g[2]||(g[2]=C=>s.fields.name=C),tags:s.fields.tags,"onUpdate:tags":g[3]||(g[3]=C=>s.fields.tags=C),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(Sc,{algorithm:s.fields.algorithm,"onUpdate:algorithm":g[4]||(g[4]=C=>s.fields.algorithm=C),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":g[5]||(g[5]=C=>s.fields.hashFallback=C),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":g[6]||(g[6]=C=>s.fields.hashFallbackHeader=C),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":g[7]||(g[7]=C=>s.fields.hashFallbackQueryArgument=C),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":g[8]||(g[8]=C=>s.fields.hashFallbackUriCapture=C),"hash-on":s.fields.hashOn,"onUpdate:hashOn":g[9]||(g[9]=C=>s.fields.hashOn=C),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":g[10]||(g[10]=C=>s.fields.hashOnCookie=C),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":g[11]||(g[11]=C=>s.fields.hashOnCookiePath=C),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":g[12]||(g[12]=C=>s.fields.hashOnHeader=C),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":g[13]||(g[13]=C=>s.fields.hashOnQueryArgument=C),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":g[14]||(g[14]=C=>s.fields.hashOnUriCapture=C),slots:s.fields.slots,"onUpdate:slots":g[15]||(g[15]=C=>s.fields.slots=C),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(Ic,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[g[16]||(g[16]=C=>s.fields.activeHealthSwitch=C),m],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":g[17]||(g[17]=C=>s.fields.healthchecksThreshold=C),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[g[18]||(g[18]=C=>s.fields.passiveHealthSwitch=C),k],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Oc,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":g[19]||(g[19]=C=>s.fields.activeHealthCheck.concurrency=C),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":g[20]||(g[20]=C=>s.fields.activeHealthCheck.headers=C),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":g[21]||(g[21]=C=>s.fields.activeHealthCheck.httpFailures=C),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":g[22]||(g[22]=C=>s.fields.activeHealthCheck.httpPath=C),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[23]||(g[23]=C=>s.fields.activeHealthCheck.httpStatuses=C),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":g[24]||(g[24]=C=>s.fields.activeHealthCheck.httpsSni=C),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":g[25]||(g[25]=C=>s.fields.activeHealthCheck.interval=C),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":g[26]||(g[26]=C=>s.fields.activeHealthCheck.successes=C),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[27]||(g[27]=C=>s.fields.activeHealthCheck.tcpFailures=C),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":g[28]||(g[28]=C=>s.fields.activeHealthCheck.timeout=C),type:s.fields.activeHealthCheck.type,"onUpdate:type":g[29]||(g[29]=C=>s.fields.activeHealthCheck.type=C),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[30]||(g[30]=C=>s.fields.activeHealthCheck.unhealthyHttpStatuses=C),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":g[31]||(g[31]=C=>s.fields.activeHealthCheck.unhealthyInterval=C),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":g[32]||(g[32]=C=>s.fields.activeHealthCheck.unhealthyTimeouts=C),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":g[33]||(g[33]=C=>s.fields.activeHealthCheck.verifySsl=C),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(Dc,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":g[34]||(g[34]=C=>s.fields.passiveHealthCheck.httpFailures=C),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[35]||(g[35]=C=>s.fields.passiveHealthCheck.httpStatuses=C),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":g[36]||(g[36]=C=>s.fields.passiveHealthCheck.successes=C),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[37]||(g[37]=C=>s.fields.passiveHealthCheck.tcpFailures=C),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":g[38]||(g[38]=C=>s.fields.passiveHealthCheck.timeouts=C),type:s.fields.passiveHealthCheck.type,"onUpdate:type":g[39]||(g[39]=C=>s.fields.passiveHealthCheck.type=C),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[40]||(g[40]=C=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=C),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-05687a98"]]),Kc=t.createElementVNode("code",null,"10",-1),Pc=t.createElementVNode("code",null,"65536",-1),Lc={"data-testid":"client_certificate-plain-text"},Rc=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=de.useI18n(),{getPropValue:o}=Gs(),i=t.computed(()=>Ve.form[r.config.app].edit),n=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:W.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:W.Basic},hash_on:{order:7,section:W.Basic},hash_on_header:{order:8,section:W.Basic},hash_on_uri_capture:{order:9,section:W.Basic},hash_on_query_arg:{order:10,section:W.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:W.Basic},hash_on_cookie_path:{order:12,section:W.Basic},healthchecks:{order:13,section:W.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(ks),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":n.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onCopy:success":c[0]||(c[0]=h=>d.$emit("copy:success",h)),"onFetch:error":c[1]||(c[1]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[2]||(c[2]=h=>d.$emit("fetch:success",h)),onLoading:c[3]||(c[3]=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(()=>[Kc]),max:t.withCtx(()=>[Pc]),_: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",Lc,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(o)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});ae.TargetForm=Ga,ae.TargetsList=gc,ae.UpstreamsConfigCard=Rc,ae.UpstreamsForm=Mc,ae.UpstreamsList=dc,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
|
|
30
|
+
`,e.length-o>l&&n>o?c+=e.slice(o,n)+`
|
|
31
|
+
`+e.slice(n+1):c+=e.slice(o),c.slice(1)}function Ti(e){for(var l="",a=0,r,o=0;o<e.length;a>=65536?o+=2:o++)a=Fe(e,o),r=ee[a],!r&&He(a)?(l+=e[o],a>=65536&&(l+=e[o+1])):l+=r||Ci(a);return l}function Ai(e,l,a){var r="",o=e.tag,i,n,d;for(i=0,n=a.length;i<n;i+=1)d=a[i],e.replacer&&(d=e.replacer.call(a,String(i),d)),(se(e,l,d,!1,!1)||typeof d>"u"&&se(e,l,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=o,e.dump="["+r+"]"}function Ua(e,l,a,r){var o="",i=e.tag,n,d,c;for(n=0,d=a.length;n<d;n+=1)c=a[n],e.replacer&&(c=e.replacer.call(a,String(n),c)),(se(e,l+1,c,!0,!0,!1,!0)||typeof c>"u"&&se(e,l+1,null,!0,!0,!1,!0))&&((!r||o!=="")&&(o+=dt(e,l)),e.dump&&Ae===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function Ei(e,l,a){var r="",o=e.tag,i=Object.keys(a),n,d,c,h,p;for(n=0,d=i.length;n<d;n+=1)p="",r!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[n],h=a[c],e.replacer&&(h=e.replacer.call(a,c,h)),se(e,l,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),se(e,l,h,!1,!1)&&(p+=e.dump,r+=p));e.tag=o,e.dump="{"+r+"}"}function Hi(e,l,a,r){var o="",i=e.tag,n=Object.keys(a),d,c,h,p,u,f;if(e.sortKeys===!0)n.sort();else if(typeof e.sortKeys=="function")n.sort(e.sortKeys);else if(e.sortKeys)throw new re("sortKeys must be a boolean or a function");for(d=0,c=n.length;d<c;d+=1)f="",(!r||o!=="")&&(f+=dt(e,l)),h=n[d],p=a[h],e.replacer&&(p=e.replacer.call(a,h,p)),se(e,l+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,l)),se(e,l+1,p,!0,u)&&(e.dump&&Ae===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=i,e.dump=o||"{}"}function va(e,l,a){var r,o,i,n,d,c;for(o=a?e.explicitTypes:e.implicitTypes,i=0,n=o.length;i<n;i+=1)if(d=o[i],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof l=="object"&&l instanceof d.instanceOf)&&(!d.predicate||d.predicate(l))){if(a?d.multi&&d.representName?e.tag=d.representName(l):e.tag=d.tag:e.tag="?",d.represent){if(c=e.styleMap[d.tag]||d.defaultStyle,Ca.call(d.represent)==="[object Function]")r=d.represent(l,c);else if(wa.call(d.represent,c))r=d.represent[c](l,c);else throw new re("!<"+d.tag+'> tag resolver accepts not "'+c+'" style');e.dump=r}return!0}return!1}function se(e,l,a,r,o,i,n){e.tag=null,e.dump=a,va(e,a,!1)||va(e,a,!0);var d=Ca.call(e.dump),c=r,h;r&&(r=e.flowLevel<0||e.flowLevel>l);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&&l>0)&&(o=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")r&&Object.keys(e.dump).length!==0?(Hi(e,l,e.dump,o),f&&(e.dump="&ref_"+u+e.dump)):(Ei(e,l,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!n&&l>0?Ua(e,l-1,e.dump,o):Ua(e,l,e.dump,o),f&&(e.dump="&ref_"+u+e.dump)):(Ai(e,l,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&Bi(e,e.dump,l,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 Fi(e,l){var a=[],r=[],o,i;for(pt(e,a,r),o=0,i=r.length;o<i;o+=1)l.duplicates.push(a[r[o]]);l.usedDuplicates=new Array(i)}function pt(e,l,a){var r,o,i;if(e!==null&&typeof e=="object")if(o=l.indexOf(e),o!==-1)a.indexOf(o)===-1&&a.push(o);else if(l.push(e),Array.isArray(e))for(o=0,i=e.length;o<i;o+=1)pt(e[o],l,a);else for(r=Object.keys(e),o=0,i=r.length;o<i;o+=1)pt(e[r[o]],l,a)}function Oi(e,l){l=l||{};var a=new _i(l);a.noRefs||Fi(e,a);var r=e;return a.replacer&&(r=a.replacer.call({"":r},"",r)),se(a,0,r,!0,!0)?a.dump+`
|
|
32
|
+
`:""}var qi=Oi,$i={dump:qi};function ut(e,l){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+l+" instead, which is now safe by default.")}}var Ui=G,vi=jt,Di=Lt,ji=Qt,Mi=Yt,Ki=lt,Pi=ba.load,Li=ba.loadAll,Ri=$i.dump,zi=re,Ji={binary:ta,float:Wt,map:Pt,null:Rt,pairs:ra,set:la,timestamp:Xt,bool:zt,int:Jt,merge:ea,omap:aa,seq:Kt,str:Mt},Wi=ut("safeLoad","load"),Qi=ut("safeLoadAll","loadAll"),Yi=ut("safeDump","dump"),Zi={Type:Ui,Schema:vi,FAILSAFE_SCHEMA:Di,JSON_SCHEMA:ji,CORE_SCHEMA:Mi,DEFAULT_SCHEMA:Ki,load:Pi,loadAll:Li,dump:Ri,YAMLException:zi,types:Ji,safeLoad:Wi,safeLoadAll:Qi,safeDump:Yi};const Gi={class:"yaml-config"},Da=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const l=e,a=t.computed(()=>{const r=Object.fromEntries(Object.entries(l.yamlRecord).filter(([,o])=>o&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(r).length===0&&r.constructor===Object?"":Zi.dump(r).trim()});return(r,o)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Gi,[l.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Xi={key:0,class:"config-card-display-form"},es=["data-testid"],ts={key:0,class:"config-card-prop-section-title"},as=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 l=e,a=t.useSlots(),{i18n:{t:r}}=Z.useI18n(),o=n=>!!(n.tooltip||a[`${n.key}-label-tooltip`]),i=t.computed(()=>{if(!l.record)return l.record;const n=JSON.parse(JSON.stringify(l.record));return delete n.created_at,delete n.updated_at,n});return(n,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Xi,[(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",ts,t.toDisplayString(c==="advanced"?t.unref(r)("baseConfigCard.sections.advanced"):t.unref(r)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],h=>(t.openBlock(),t.createBlock(Xe,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(n.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(n.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[o(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(n.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,es))),128))])):t.createCommentVNode("",!0),e.format==="json"&&l.record?(t.openBlock(),t.createBlock($t,{key:1,config:l.config,"fetcher-url":l.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&l.record?(t.openBlock(),t.createBlock(Da,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),rs=oe(as,[["__scopeId","data-v-2b74ac63"]]),Ke="24px",ja=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},ls=e=>(t.pushScopeId("data-v-40a7f387"),e=e(),t.popScopeId(),e),os=["aria-hidden"],ns={key:0,"data-testid":"kui-icon-svg-title"},is=ls(()=>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)),ss=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:Ke,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return Ke}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,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(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ns,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),is],8,os))]),_:1},8,["aria-hidden","style"]))}}),cs=ja(ss,[["__scopeId","data-v-40a7f387"]]),ds=e=>(t.pushScopeId("data-v-19f4cbbe"),e=e(),t.popScopeId(),e),hs=["aria-hidden"],ps={key:0,"data-testid":"kui-icon-svg-title"},us=ds(()=>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)),fs=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:Ke,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),i=Number(o);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return Ke}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,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(r.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",ps,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),us],8,hs))]),_:1},8,["aria-hidden","style"]))}}),ms=ja(fs,[["__scopeId","data-v-19f4cbbe"]]),gs={"data-testid":"config-card-title"},ys={class:"config-card-actions"},ks=["href"],bs={key:2,class:"config-card-details-section"},Cs={key:3,class:"config-card-details-section"},ws=["data-testid"],_s={key:0,class:"config-card-prop-section-title"},Ss=t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:l}){var a;const r=l,o=e,i=t.useSlots(),{i18n:{t:n}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{convertKeyToTitle:c}=Z.useStringHelpers(),{axiosInstance:h}=Z.useAxios({headers:(a=o.config)==null?void 0:a.requestHeaders}),p=[{label:n("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=t.ref("structured"),f=k=>{u.value=k==null?void 0:k.value},s={id:{type:L.ID,label:n("baseConfigCard.commonFields.id_label"),order:0,section:W.Basic},name:{order:1,section:W.Basic},enabled:{type:L.BadgeStatus,order:2,section:W.Basic},updated_at:{type:L.Date,label:n("baseConfigCard.commonFields.updated_at_label"),order:3,section:W.Basic},created_at:{type:L.Date,label:n("baseConfigCard.commonFields.created_at_label"),order:4,section:W.Basic},tags:{type:L.BadgeTag,order:-1,section:W.Basic}},x=t.ref(!1),b=t.ref(!1),m=t.ref(""),w=t.ref({}),V=t.computed(()=>{var k,A,S;if(!w.value)return[];const H=[],$=Object.keys(w.value).length;for(const D in w.value){const U=(A=(k=o.configSchema)==null?void 0:k[D])==null?void 0:A.order,q=(S=s[D])==null?void 0:S.order;let j=$;(q||q===0)&&(j=q===-1?$+1:q),U&&(j=U===-1?$+1:U),H.push([D,j])}return H.sort(function(D,U){return D[1]-U[1]}),H.map(D=>{var U,q;const j=D[0],M=(U=w.value)==null?void 0:U[j],I=((q=o.configSchema)==null?void 0:q[j])||{},v=s[j];return{key:j,value:M,hidden:I.hidden||!1,type:I.type??((v==null?void 0:v.type)||L.Text),label:I.label??((v==null?void 0:v.label)||c(j)),tooltip:I.tooltip??((v==null?void 0:v.tooltip)||void 0),section:I.section??((v==null?void 0:v.section)||W.Advanced)}}).filter(D=>!D.hidden&&D.key!==o.pluginConfigKey)}),T=t.computed(()=>{var k,A;if(!w.value||!o.pluginConfigKey)return[];const S=w.value[o.pluginConfigKey]||{},H=Object.keys(S).length,$=[];for(const D in S){const U=(A=(k=o.pluginConfigSchema)==null?void 0:k[D])==null?void 0:A.order,q=S[D];let j=q!=null&&q!==""?H-1:H;U&&(j=U===-1?H+1:U),$.push([D,j])}return $.sort(function(D,U){return D[1]-U[1]}),$.map(D=>{var U;const q=D[0],j=S[q],M=((U=o.pluginConfigSchema)==null?void 0:U[q])||{};return{key:q,value:j,hidden:M.hidden||!1,type:M.type??L.Text,label:M.label??c(q),tooltip:M.tooltip??void 0,section:W.Plugin}}).filter(D=>!D.hidden)}),N=t.computed(()=>{var k,A,S,H;return{basic:(k=V.value)==null?void 0:k.filter($=>$.section===W.Basic),advanced:(A=V.value)==null?void 0:A.filter($=>$.section===W.Advanced),plugin:(H=T.value)==null?void 0:H.concat((S=V.value)==null?void 0:S.filter($=>$.section===W.Plugin))}}),B=t.computed(()=>{const k=[];return N.value.basic.length&&k.push("basic"),N.value.advanced.length&&k.push("advanced"),N.value.plugin.length&&k.push("plugin"),k}),_=k=>!!(k.tooltip||i[`${k.key}-label-tooltip`]),F=t.computed(()=>{var k,A;let S=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((k=o.config)==null?void 0:k.controlPlaneId)||""):o.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(A=o.config)!=null&&A.workspace?`/${o.config.workspace}`:"")),S=S.replace(/{id}/gi,o.config.entityId),S}),E=k=>{w.value&&k(JSON.stringify(w.value))?r("copy:success",w.value):r("copy:error")};return t.watch(x,k=>{r("loading",k)},{immediate:!0}),t.onBeforeMount(async()=>{b.value=!1,x.value=!0;try{const{data:k}=await h.get(F.value);if(o.dataKey)if(typeof k[o.dataKey]<"u")w.value={...k[o.dataKey]};else throw new Error(n("errors.dataKeyUndefined",{dataKey:o.dataKey}));else w.value={...k};Object.keys(o.configSchema).filter(A=>o.configSchema[A].forceShow).forEach(A=>{w.value&&typeof w.value[A]>"u"&&(w.value[A]=null)}),r("fetch:success",k)}catch(k){const A=d(k);m.value=A.startsWith("code")?n("baseConfigCard.errors.load"):A,b.value=!0,r("fetch:error",k)}finally{x.value=!1}}),(k,A)=>{const S=t.resolveComponent("KLabel"),H=t.resolveComponent("KSelect"),$=t.resolveComponent("KButton"),D=t.resolveComponent("KClipboardProvider"),U=t.resolveComponent("KSkeleton"),q=t.resolveComponent("KEmptyState"),j=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(j,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",ys,[t.renderSlot(k.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(S,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(H,{key:1,"data-testid":"select-config-format",items:p,onChange:f})):t.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock($,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(cs),{size:t.unref(go)},null,8,["size"])],8,ks)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(D,{key:3},{default:t.withCtx(({copyToClipboard:M})=>[!x.value&&!b.value?(t.openBlock(),t.createBlock($,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:I=>E(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),default:t.withCtx(()=>[x.value?(t.openBlock(),t.createBlock(U,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):b.value?(t.openBlock(),t.createBlock(q,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(m.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",bs,[t.createVNode(rs,{config:e.config,"fetcher-url":F.value,format:u.value,"prop-list-types":B.value,"property-collections":N.value,record:w.value},t.createSlots({_:2},[t.renderList(Object.keys(k.$slots),M=>({name:M,fn:t.withCtx(({row:I,rowValue:v})=>[t.renderSlot(k.$slots,M,{row:I,rowValue:v},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",Cs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value,M=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${M}-props`,class:t.normalizeClass(`config-card-details-${M}-props`),"data-testid":`config-card-details-${M}-props`},[M!=="basic"?(t.openBlock(),t.createElementBlock("div",_s,t.toDisplayString(M==="advanced"?t.unref(n)("baseConfigCard.sections.advanced"):t.unref(n)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(N.value[M],I=>(t.openBlock(),t.createBlock(Xe,{key:I.key,item:I},t.createSlots({label:t.withCtx(()=>[t.renderSlot(k.$slots,`${I.key}-label`,{row:I},void 0,!0)]),[I.key]:t.withCtx(({rowValue:v})=>[t.renderSlot(k.$slots,I.key,{row:I,rowValue:v},void 0,!0)]),_:2},[_(I)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(k.$slots,`${I.key}-label-tooltip`,{row:I},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,ws))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",gs,[t.renderSlot(k.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),xs=oe(Ss,[["__scopeId","data-v-3fd4a3a4"]]),Ns={class:"form-actions","data-testid":"form-actions"},Vs={key:0},Bs=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:l}){var a;const r=l,o=e,i=We.useRouter(),{i18n:{t:n}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios({headers:(a=o.config)==null?void 0:a.requestHeaders}),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),f=t.computed(()=>o.canSubmit===!1||o.isReadonly),s=t.ref(!1),x=t.computed(()=>{var N,B;let _=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):o.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(B=o.config)!=null&&B.workspace?`/${o.config.workspace}`:"")),o.editId?(_=_.replace(/{id}/gi,o.editId),_):(_=_.replace(/\/{id}/gi,""),_)}),b=()=>{s.value=!s.value},m=()=>{o.config.cancelRoute?i.push(o.config.cancelRoute):w()},w=()=>{r("cancel")},V=()=>{f.value||r("submit")},T=t.ref([{title:n("baseForm.configuration.yaml"),hash:"#yaml"},{title:n("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,N=>{r("loading",N)},{immediate:!0}),t.onBeforeMount(async()=>{if(o.editId)try{p.value=!1,h.value=!0;const{data:N}=await c.get(x.value);r("fetch:success",N)}catch(N){const B=d(N);u.value=B.startsWith("code")?n("baseForm.errors.edit"):B,p.value=!0,r("fetch:error",N)}finally{h.value=!1}}),(N,B)=>{const _=t.resolveComponent("KSkeleton"),F=t.resolveComponent("KEmptyState"),E=t.resolveComponent("KAlert"),k=t.resolveComponent("KButton"),A=t.resolveComponent("KTabs"),S=t.resolveComponent("KSlideout"),H=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(H,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(_,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(F,{key:1,"cta-text":t.unref(n)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":m,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(w,["prevent"]),onSubmit:t.withModifiers(V,["prevent"])},[t.renderSlot(N.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(E,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Ns,[t.renderSlot(N.$slots,"form-actions",{},()=>[e.config.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",Vs,[t.createVNode(k,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:B[0]||(B[0]=$=>b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("baseForm.actions.viewConfiguration")),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(k,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(k,{appearance:"primary","data-testid":"form-submit",disabled:f.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("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(n)("baseForm.configuration.title"),visible:s.value,onClose:B[1]||(B[1]=$=>b())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(n)("baseForm.configuration.message")),1),t.createVNode(A,{"data-testid":"form-view-configuration-slideout-tabs",tabs:T.value},{json:t.withCtx(()=>[t.createVNode($t,{config:e.config,"fetcher-url":x.value,"json-record":o.formFields,"request-method":o.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(Da,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Ma=oe(Bs,[["__scopeId","data-v-2e2d1350"]]),Is={key:0,"data-testid":"first-col"},Ts=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const l=e,a=t.computed(()=>{var b;return((b=l.rowEl)==null?void 0:b.querySelector(`[data-testid="${l.keyName}"]`))||null}),r=t.computed(()=>{var b;return((b=a.value)==null?void 0:b.querySelector('[data-testid="first-col"]'))||null}),o=t.computed(()=>{var b,m;const w=(b=l.rowEl)==null?void 0:b.querySelectorAll("td");return w?((m=w[0])==null?void 0:m.getAttribute("data-testid"))===l.keyName:!1});let i;const n=()=>{i&&(i.disconnect(),i=void 0)},d=()=>{var b,m,w;h.value=((b=r.value)==null?void 0:b.getBoundingClientRect().width)||0,p.value=((m=a.value)==null?void 0:m.clientWidth)||0,u.value=((w=c.value)==null?void 0:w.innerText)||""},c=t.ref({}),h=t.ref(0),p=t.ref(0),u=t.ref(""),f=t.computed(()=>[r.value,a.value]),s=t.watch(f,b=>{if(o.value&&(n(),"ResizeObserver"in window&&window)){i=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||d()})});for(const m of b)m&&i.observe(m)}},{immediate:!0,flush:"post",deep:!0}),x=t.computed(()=>o.value?h.value>p.value:!1);return t.onMounted(()=>{d()}),t.onUnmounted(()=>{s()}),(b,m)=>{const w=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[o.value?(t.openBlock(),t.createElementBlock("span",Is,[t.createVNode(w,{"max-width":"300",placement:"bottomStart",text:x.value?u.value:""},{default:t.withCtx(()=>[t.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):t.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),As=oe(Ts,[["__scopeId","data-v-c4379fd4"]]),Es={class:"toolbar-container"},Hs={key:0,class:"toolbar-button-container"},Fs=["data-testid"],Os=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:l}){const a=e,r=l,{i18n:{t:o}}=Z.useI18n(),i=t.computed(()=>{var B,_;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(B=a.errorMessage)==null?void 0:B.title,message:(_=a.errorMessage)==null?void 0:_.message}}),n=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=B=>B.hasData||!!a.query,c=t.computed(()=>{const B=[];return Object.keys(a.tableHeaders).forEach(_=>{const F=a.tableHeaders[_];B.push({label:F.label??_,key:_,sortable:F.sortable??!1})}),a.enableEntityActions&&B.push({key:"actions",hideLabel:!0}),B}),h=B=>({"data-rowid":B.id,"data-testid":B.name,...a.rowAttributes(B)}),p=t.ref({}),u=B=>{var _;return(_=p.value)==null?void 0:_.$el.querySelector(`[data-rowid="${B.id}"]`)},f=B=>{const _={"data-testid":B.headerKey,...a.cellAttributes(B)};return B.colIndex===0&&(_.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),_},s=()=>{r("empty-state-cta-clicked"),x()},x=()=>{r("clear-search-input")},b=t.computed(()=>a.disableRowClick?void 0:(B,_)=>{r("click:row",_)}),m=B=>{r("sort",B)},{setTablePreferences:w,getTablePreferences:V}=Cl(),T=t.computed(()=>{const B=V(a.preferencesStorageKey);return{...a.initialFetcherParams,...B}}),N=B=>{a.preferencesStorageKey&&w(a.preferencesStorageKey,B)};return(B,_)=>{const F=t.resolveComponent("KIcon"),E=t.resolveComponent("KButton"),k=t.resolveComponent("KDropdown"),A=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(A,{ref_key:"tableRefs",ref:p,"cache-identifier":n.value,"cell-attrs":f,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(o)("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":T.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":h,"search-input":e.query,onKtableEmptyStateCtaClicked:s,"onRow:click":b.value,onSort:_[0]||(_[0]=H=>m(H)),"onUpdate:tablePreferences":N},t.createSlots({toolbar:t.withCtx(({state:H})=>[t.withDirectives(t.createElementVNode("div",Es,[t.renderSlot(B.$slots,"toolbar-filter",{},void 0,!0),B.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Hs,[t.renderSlot(B.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(H)]])]),actions:t.withCtx(({row:H,rowKey:$,rowValue:D})=>[t.createElementVNode("div",{class:"actions-container","data-testid":H.name},[t.createVNode(k,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(B.$slots,"actions",{row:H,rowKey:$,rowValue:D},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(E,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(F,{color:t.unref(fo),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,Fs)]),_:2},[t.renderList(e.tableHeaders,(H,$)=>({name:$,fn:t.withCtx(({row:D,rowKey:U,rowValue:q})=>[t.createVNode(As,{"key-name":String($),"row-el":u(D)},{default:t.withCtx(()=>[t.renderSlot(B.$slots,$,{row:D,rowKey:U,rowValue:q},()=>[t.createTextVNode(t.toDisplayString(q),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Ka=oe(Os,[["__scopeId","data-v-ecfaa7cf"]]),qs={key:0,class:"kong-ui-entity-delete-error"},$s={key:1,class:"description"},Us=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:l}){const{i18nT:a}=Z.useI18n(),r=e,o=l,i=t.computed(()=>r.needConfirm?r.entityName:""),n=()=>{o("cancel")},d=()=>{o("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:n,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",qs,[t.createVNode(p,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:r.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.entityType),1)]),_:2},[r.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(r.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),r.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",$s,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(r.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Pa=oe(Us,[["__scopeId","data-v-efe8f34b"]]),vs={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ds={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},js=["fill"],Ms={mask:"url(#mask0_180_20349)"},Ks=["fill"],La=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${po})`}},setup(e){return(l,a)=>(t.openBlock(),t.createElementBlock("svg",vs,[t.createElementVNode("mask",Ds,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,js)]),t.createElementVNode("g",Ms,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ks)])]))}}),Ps={key:1,class:"kong-ui-entity-filter"},Ls={class:"menu-item-title"},Rs={class:"menu-item-indicator"},zs={class:"menu-item-body"},Js=["for"],Ws={class:"menu-item-buttons"},Qs={class:"filter-clear-button-container"},Ys=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:l}){const{i18n:{t:a}}=Z.useI18n(),r=e,o=l,i=t.ref(!1),n=t.ref({}),d=t.computed(()=>{const V=[];return new URLSearchParams(r.modelValue).forEach((T,N)=>{T!==""&&V.push(N)}),V}),c=t.computed(()=>{const V=r.config.fields;return Object.keys(V).filter(T=>V[T].searchable).map(T=>({label:V[T].label||T,value:T}))});t.watch(()=>r.modelValue,V=>{n.value={},new URLSearchParams(V).forEach((T,N)=>{n.value[N]=T})});const h=()=>{i.value=!i.value},p=V=>{o("update:modelValue",V)},u=()=>{p("")},f=V=>`filter-${V}`,s=V=>{var T,N;return(((N=(T=r.config.schema)==null?void 0:T[V])==null?void 0:N.values)??[]).map(B=>({value:B,label:B}))},x=V=>{var T,N;return((N=(T=r.config.schema)==null?void 0:T[V])==null?void 0:N.type)??"text"},b=V=>{n.value={...n.value,[V]:""},w()},m=()=>{n.value={},w(!0)},w=(V=!1)=>{const T=Object.keys(n.value).reduce((N,B)=>(n.value[B]&&(N[B]=`${n.value[B]}`),N),{});V&&(i.value=!1),o("update:modelValue",new URLSearchParams(T).toString())};return(V,T)=>{const N=t.resolveComponent("KInput"),B=t.resolveComponent("KButton"),_=t.resolveComponent("KSelect"),F=t.resolveComponent("KMenuItem"),E=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(N,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":p},{before:t.withCtx(()=>[t.createVNode(La)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(ms),{class:"kong-ui-entity-filter-clear",onClick:u},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Ps,[t.createVNode(B,{appearance:"tertiary","data-testid":"filter-button",onClick:h},{default:t.withCtx(()=>[t.createVNode(La),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(d.value.length>0?`(${d.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:h},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createVNode(E,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(k,A)=>(t.openBlock(),t.createBlock(F,{key:k.value,"data-testid":k.value,expandable:"","last-menu-item":A===c.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",Ls,[t.createTextVNode(t.toDisplayString(k.label)+" ",1),t.withDirectives(t.createElementVNode("span",Rs,null,512),[[t.vShow,d.value.includes(k.value)]])])]),itemBody:t.withCtx(()=>{var S,H;return[t.createElementVNode("div",zs,[t.createElementVNode("label",{class:"menu-item-label",for:f(k.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,Js),((H=(S=e.config.schema)==null?void 0:S[k.value])==null?void 0:H.type)==="select"?(t.openBlock(),t.createBlock(_,{key:0,id:f(k.value),modelValue:n.value[k.value],"onUpdate:modelValue":$=>n.value[k.value]=$,items:s(k.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(N,{key:1,id:f(k.value),modelValue:n.value[k.value],"onUpdate:modelValue":$=>n.value[k.value]=$,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:x(k.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",Ws,[t.createVNode(B,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:T[0]||(T[0]=$=>w(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(B,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:$=>b(k.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",Qs,[t.createVNode(B,{appearance:"tertiary",size:"small",onClick:m},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,i.value]])]))}}}),Zs=oe(Ys,[["__scopeId","data-v-206cc415"]]),ce=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const l=e,a=t.ref(void 0),r=t.computed(()=>a.value===!0||a.value!==void 0&&l.forceShow===!0);return t.watch(()=>l.authFunction,async()=>{a.value=await l.authFunction()},{immediate:!0}),(o,i)=>r.value?t.renderSlot(o.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Gs={class:"form-section-wrapper"},Xs={key:0,class:"form-section-title"},ec={key:1,class:"form-section-description"},tc={key:2,class:"form-section-footer"},ac={class:"form-section-content"},rc=t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const l=t.useSlots();return(a,r)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Gs,[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",Xs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(l).description?(t.openBlock(),t.createElementBlock("div",ec,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(l).footer?(t.openBlock(),t.createElementBlock("div",tc,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",ac,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),Oe=oe(rc,[["__scopeId","data-v-3565daa7"]]),{useAxios:Pe,useDeleteUrlBuilder:Ra,useErrors:za,useExternalLinkCreator:Xc,useFetchUrlBuilder:ed,useFetcher:Ja,useDebouncedFilter:Wa,useStringHelpers:td,useHelpers:lc,useGatewayFeatureSupported:ad,useTruncationDetector:rd}=Z,oc={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 nc(){const e=Ie.createI18n("en-us",oc);return{i18n:e,i18nT:Ie.i18nTComponent(e)}}function qe(e){const{replaceId:l=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(o,i)=>{if(i){const n={...o};l&&(n.value=o.label),a.value.push(n)}else a.value=a.value.filter(n=>n.value!==o.value)}}}const Le=[{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,ic=0,sc=65535,_e=0,Se=255,Qa=0,Ya=255,cc=0,dc=65535,Za=0,Ga=65535,hc=0,pc=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 Re(){const e=c=>/^\d+$/.test(c),l=(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)),r=c=>c.map(h=>h.toString()),o=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses: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:l,stringToNumberArray:a,numberToStringArray:r,upstreamsResponseToFields:c=>{var p,u,f,s,x,b,m,w,V,T,N,B,_,F,E,k,A,S,H,$,D,U,q,j,M,I,v,P,y,g,C,z,K,J,X,R,te,ge,Be,er,tr,ar,rr,lr,or,nr,ir,sr,cr,dr,hr,pr,ur,fr,mr,gr,yr,kr,br,Cr,wr,_r,Sr,xr,Nr,Vr,Br,Ir,Tr,Ar,Er,Hr,Fr,Or,qr,$r,Ur,vr,Dr,jr,Mr,Kr,Pr,Lr,Rr,zr,Jr,Wr,Qr,Yr,Zr,Gr,Xr,el,tl,al,rl,ll,ol,nl,il,sl,cl,dl,hl,pl,ul,fl,ml;const h=o();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||((b=(x=c.healthchecks.active)==null?void 0:x.unhealthy)==null?void 0:b.interval)!==0,h.activeHealthCheck.type=((m=c.healthchecks.active)==null?void 0:m.type)||"http",h.activeHealthCheck.httpPath=((w=c.healthchecks.active)==null?void 0:w.http_path)||"/",h.activeHealthCheck.timeout=((V=c.healthchecks.active)==null?void 0:V.timeout)!==null&&((T=c.healthchecks.active)==null?void 0:T.timeout)!==void 0?(B=(N=c.healthchecks.active)==null?void 0:N.timeout)==null?void 0:B.toString():"",h.activeHealthCheck.concurrency=((_=c.healthchecks.active)==null?void 0:_.concurrency)!==null&&((F=c.healthchecks.active)==null?void 0:F.concurrency)!==void 0?(k=(E=c.healthchecks.active)==null?void 0:E.concurrency)==null?void 0:k.toString():"",h.activeHealthCheck.httpsSni=((A=c.healthchecks.active)==null?void 0:A.https_sni)||"",h.activeHealthCheck.verifySsl=((S=c.healthchecks.active)==null?void 0:S.https_verify_certificate)||!1,h.activeHealthCheck.headers=(H=c.healthchecks.active)!=null&&H.headers&&Object.entries(($=c.healthchecks.active)==null?void 0:$.headers).length>0?Object.entries((D=c.healthchecks.active)==null?void 0:D.headers).map(([Gc,Ct])=>({key:Gc,values:Ct==null?void 0:Ct.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((q=(U=c.healthchecks.active)==null?void 0:U.healthy)==null?void 0:q.interval)!==null&&((M=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:M.interval)!==void 0?(P=(v=(I=c.healthchecks.active)==null?void 0:I.healthy)==null?void 0:v.interval)==null?void 0:P.toString():"0",h.activeHealthCheck.interval=((g=(y=c.healthchecks.active)==null?void 0:y.healthy)==null?void 0:g.interval)!==null&&((z=(C=c.healthchecks.active)==null?void 0:C.healthy)==null?void 0:z.interval)!==void 0?(X=(J=(K=c.healthchecks.active)==null?void 0:K.healthy)==null?void 0:J.interval)==null?void 0:X.toString():"0",h.activeHealthCheck.successes=((te=(R=c.healthchecks.active)==null?void 0:R.healthy)==null?void 0:te.successes)!==null&&((Be=(ge=c.healthchecks.active)==null?void 0:ge.healthy)==null?void 0:Be.successes)!==void 0?(ar=(tr=(er=c.healthchecks.active)==null?void 0:er.healthy)==null?void 0:tr.successes)==null?void 0:ar.toString():"0",h.activeHealthCheck.httpStatuses=(lr=(rr=c.healthchecks.active)==null?void 0:rr.healthy)!=null&&lr.http_statuses?r(((nr=(or=c.healthchecks.active)==null?void 0:or.healthy)==null?void 0:nr.http_statuses)||[]):gt,h.activeHealthCheck.unhealthyInterval=((sr=(ir=c.healthchecks.active)==null?void 0:ir.unhealthy)==null?void 0:sr.interval)!==null&&((dr=(cr=c.healthchecks.active)==null?void 0:cr.unhealthy)==null?void 0:dr.interval)!==void 0?(ur=(pr=(hr=c.healthchecks.active)==null?void 0:hr.unhealthy)==null?void 0:pr.interval)==null?void 0:ur.toString():"0",h.activeHealthCheck.httpFailures=((mr=(fr=c.healthchecks.active)==null?void 0:fr.unhealthy)==null?void 0:mr.http_failures)!==null&&((yr=(gr=c.healthchecks.active)==null?void 0:gr.unhealthy)==null?void 0:yr.http_failures)!==void 0?(Cr=(br=(kr=c.healthchecks.active)==null?void 0:kr.unhealthy)==null?void 0:br.http_failures)==null?void 0:Cr.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((_r=(wr=c.healthchecks.active)==null?void 0:wr.unhealthy)==null?void 0:_r.timeouts)!==null&&((xr=(Sr=c.healthchecks.active)==null?void 0:Sr.unhealthy)==null?void 0:xr.timeouts)!==void 0?(Br=(Vr=(Nr=c.healthchecks.active)==null?void 0:Nr.unhealthy)==null?void 0:Vr.timeouts)==null?void 0:Br.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(Tr=(Ir=c.healthchecks.active)==null?void 0:Ir.unhealthy)!=null&&Tr.http_statuses?r(((Er=(Ar=c.healthchecks.active)==null?void 0:Ar.unhealthy)==null?void 0:Er.http_statuses)||[]):kt,h.passiveHealthSwitch=((Fr=(Hr=c.healthchecks.passive)==null?void 0:Hr.healthy)==null?void 0:Fr.successes)!==0||((qr=(Or=c.healthchecks.passive)==null?void 0:Or.unhealthy)==null?void 0:qr.timeouts)!==0||((Ur=($r=c.healthchecks.passive)==null?void 0:$r.unhealthy)==null?void 0:Ur.tcp_failures)!==0||((Dr=(vr=c.healthchecks.passive)==null?void 0:vr.unhealthy)==null?void 0:Dr.http_failures)!==0,h.passiveHealthCheck.type=((jr=c.healthchecks.passive)==null?void 0:jr.type)||"http",h.passiveHealthCheck.successes=((Kr=(Mr=c.healthchecks.passive)==null?void 0:Mr.healthy)==null?void 0:Kr.successes)!==null&&((Lr=(Pr=c.healthchecks.passive)==null?void 0:Pr.healthy)==null?void 0:Lr.successes)!==void 0?(Jr=(zr=(Rr=c.healthchecks.passive)==null?void 0:Rr.healthy)==null?void 0:zr.successes)==null?void 0:Jr.toString():"0",h.passiveHealthCheck.httpStatuses=(Qr=(Wr=c.healthchecks.passive)==null?void 0:Wr.healthy)!=null&&Qr.http_statuses?r(((Zr=(Yr=c.healthchecks.passive)==null?void 0:Yr.healthy)==null?void 0:Zr.http_statuses)||[]):yt,h.passiveHealthCheck.timeouts=((Xr=(Gr=c.healthchecks.passive)==null?void 0:Gr.unhealthy)==null?void 0:Xr.timeouts)!==null&&((tl=(el=c.healthchecks.passive)==null?void 0:el.unhealthy)==null?void 0:tl.timeouts)!==void 0?(ll=(rl=(al=c.healthchecks.passive)==null?void 0:al.unhealthy)==null?void 0:rl.timeouts)==null?void 0:ll.toString():"0",h.passiveHealthCheck.tcpFailures=((nl=(ol=c.healthchecks.passive)==null?void 0:ol.unhealthy)==null?void 0:nl.tcp_failures)!==null&&((sl=(il=c.healthchecks.passive)==null?void 0:il.unhealthy)==null?void 0:sl.tcp_failures)!==void 0?(hl=(dl=(cl=c.healthchecks.passive)==null?void 0:cl.unhealthy)==null?void 0:dl.tcp_failures)==null?void 0:hl.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(ul=(pl=c.healthchecks.passive)==null?void 0:pl.unhealthy)!=null&&ul.http_statuses?r(((ml=(fl=c.healthchecks.passive)==null?void 0:fl.unhealthy)==null?void 0:ml.http_statuses)||[]):bt,h},getDefaultUpstreamFields:o,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const de={useI18n:nc,useMultiselectCreation:qe,useHelpers:Re},xe="/api/runtime_groups/{controlPlaneId}",Ne="/{workspace}",Ve={list:{konnect:`${xe}/upstreams`,kongManager:`${Ne}/upstreams`},form:{konnect:{getServices:`${xe}/services`,getCertificates:`${xe}/certificates`,validate:`${xe}/v1/schemas/json/upstream/validate`,create:`${xe}/upstreams`,edit:`${xe}/upstreams/{id}`},kongManager:{getServices:`${Ne}/services`,getCertificates:`${Ne}/certificates`,validate:`${Ne}/schemas/upstreams/validate`,create:`${Ne}/upstreams`,edit:`${Ne}/upstreams/{id}`}}},uc={class:"kong-ui-entities-upstreams-list"},fc={class:"upstream-name"},mc=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:l}){var M;const a=l,r=e,{i18n:{t:o}}=de.useI18n(),i=We.useRouter(),{axiosInstance:n}=Pe({headers:(M=r.config)==null?void 0:M.requestHeaders}),d=t.ref(1),c=t.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),h={name:{label:o("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:o("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:o("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var v,P;let I=`${r.config.apiBaseUrl}${Ve.list[r.config.app]}`;return r.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((v=r.config)==null?void 0:v.controlPlaneId)||""):r.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(P=r.config)!=null&&P.workspace?`/${r.config.workspace}`:"")),I}),f=t.ref(""),s=t.computed(()=>{const I=r.config.app==="konnect"||r.config.isExactMatch;if(I)return{isExactMatch:I,placeholder:o("upstreams.search.placeholder")};const{name:v,slots:P}=h;return{isExactMatch:I,fields:{name:v,slots:P},schema:r.config.filterSchema}}),{fetcher:x,fetcherState:b}=Ja(r.config,u.value),m=()=>{f.value=""},w=()=>{d.value++},V=t.ref(null),T=(I,v)=>{const P=I.id;if(!v(P)){a("copy:error",{entity:I,field:"id",message:o("upstreams.errors.copy")});return}a("copy:success",{entity:I,field:"id",message:o("upstreams.copy.success",{val:P})})},N=(I,v)=>{const P=JSON.stringify(I);if(!v(P)){a("copy:error",{entity:I,message:o("upstreams.errors.copy")});return}a("copy:success",{entity:I,message:o("upstreams.copy.success_brief")})},B=async I=>{var P;await((P=r.canRetrieve)==null?void 0:P.call(r,I))&&i.push(r.config.getViewRoute(I.id))},_=I=>({label:o("upstreams.actions.view"),to:r.config.getViewRoute(I)}),F=I=>({label:o("upstreams.actions.edit"),to:r.config.getEditRoute(I)}),E=t.ref(void 0),k=t.ref(!1),A=t.ref(!1),S=t.ref(""),H=Ra(r.config,u.value),$=I=>{E.value=I,k.value=!0},D=()=>{k.value=!1},U=async()=>{var I,v,P;if((I=E.value)!=null&&I.id){A.value=!0;try{await n.delete(H(E.value.id)),A.value=!1,k.value=!1,d.value++,a("delete:success",E.value)}catch(y){S.value=((P=(v=y.response)==null?void 0:v.data)==null?void 0:P.message)||y.message||o("upstreams.errors.delete"),a("error",y)}finally{A.value=!1}}},q=t.ref(!0);t.watch(b,I=>{var v,P,y,g;if(Array.isArray((v=I==null?void 0:I.response)==null?void 0:v.data)&&(q.value=I.response.data.length>0),I.status===pe.Error){V.value={title:o("upstreams.errors.general")},(g=(y=(P=I.error)==null?void 0:P.response)==null?void 0:y.data)!=null&&g.message&&(V.value.message=I.error.response.data.message),a("error",I.error);return}V.value=null});const j=t.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:o("upstreams.list.empty_state.description"),title:o("upstreams.title")});return t.onBeforeMount(async()=>{await r.canCreate()&&(j.value.title=o("upstreams.list.empty_state.title"),j.value.ctaText=o("upstreams.actions.create"))}),(I,v)=>{const P=t.resolveComponent("KButton"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KTruncate"),C=t.resolveComponent("KDropdownItem"),z=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",uc,[t.createVNode(t.unref(Ka),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":V.value,fetcher:t.unref(x),"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:m,"onClick:row":v[1]||(v[1]=K=>B(K)),onSort:w},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Zs),{modelValue:f.value,"onUpdate:modelValue":v[0]||(v[0]=K=>f.value=K),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(P,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,q.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),name:t.withCtx(({rowValue:K})=>[t.createElementVNode("span",fc,t.toDisplayString(K),1)]),tags:t.withCtx(({rowValue:K})=>[t.createVNode(g,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(K,J=>(t.openBlock(),t.createBlock(y,{key:J,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(J),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:K})=>[t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-id",onClick:X=>T(K,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-json",onClick:X=>N(K,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canRetrieve(K)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-view","has-divider":"",item:_(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(K)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-edit",item:F(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(K)},{default:t.withCtx(()=>[t.createVNode(C,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:J=>$(K)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("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(Pa),{"action-pending":A.value,description:t.unref(o)("upstreams.delete.description"),"entity-name":E.value&&(E.value.name||E.value.id),"entity-type":t.unref(Qe).Upstream,error:S.value,title:t.unref(o)("upstreams.delete.title"),visible:k.value,onCancel:D,onProceed:U},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),he=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},gc=he(mc,[["__scopeId","data-v-ddf62ed4"]]),ze={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"}}},yc={class:"kong-ui-entities-target-form"},kc={class:"target-form-container"},bc={key:0,class:"target-form-info"},Xa=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:l}){var B;const a=l,r=e,{i18n:{t:o}}=de.useI18n(),{getMessageFromError:i}=za(),{axiosInstance:n}=Pe({headers:(B=r.config)==null?void 0:B.requestHeaders}),d=t.computed(()=>{var _;return ze.form[r.config.app].edit.replace(/{upstreamId}/gi,((_=r.config)==null?void 0:_.upstreamId)||"")}),c=t.computed(()=>r.targetId?ne.Edit:ne.Create),h=t.computed(()=>c.value===ne.Edit?o("targets.form.edit.title"):o("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 _=parseInt(p.fields.weight.toString(),10);return _<0||_>65535}),x=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),b=_=>{var F;p.fields.target=(_==null?void 0:_.target)||"",p.fields.weight=(_==null?void 0:_.weight)??"",p.fields.tags=((F=_==null?void 0:_.tags)==null?void 0:F.join(", "))||"",Object.assign(u,p.fields)},m=()=>{p.errorMessage="",a("cancel")},w=t.computed(()=>{var F,E;let _=`${r.config.apiBaseUrl}${ze.form[r.config.app].validate}`;return r.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((F=r.config)==null?void 0:F.controlPlaneId)||""):r.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(E=r.config)!=null&&E.workspace?`/${r.config.workspace}`:"")),_=_.replace(/{id}/gi,r.targetId),_}),V=t.computed(()=>{var F,E,k,A;let _=`${r.config.apiBaseUrl}${ze.form[r.config.app][c.value]}`;return r.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((F=r.config)==null?void 0:F.controlPlaneId)||"").replace(/{upstreamId}/gi,((E=r.config)==null?void 0:E.upstreamId)||""):r.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(k=r.config)!=null&&k.workspace?`/${r.config.workspace}`:"").replace(/{upstreamId}/gi,((A=r.config)==null?void 0:A.upstreamId)||"")),_=_.replace(/{id}/gi,r.targetId),_}),T=t.computed(()=>{var _,F,E;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(E=(F=(_=p.fields.tags)==null?void 0:_.split(","))==null?void 0:F.map(k=>String(k||"").trim()))==null?void 0:E.filter(k=>k!==""),upstream:{id:r.config.upstreamId}}}),N=async()=>{var _,F;try{p.isReadonly=!0,p.errorMessage="";let E;if(await n.post(w.value,T.value),c.value==="create"?E=await n.post(V.value,T.value):c.value==="edit"&&(E=((_=r.config)==null?void 0:_.app)==="konnect"?await n.put(V.value,T.value):await n.patch(V.value,T.value)),E){const{data:k}=E;p.fields.target=(k==null?void 0:k.name)||"",p.fields.weight=(k==null?void 0:k.weight)??100,p.fields.tags=((F=k==null?void 0:k.tags)==null?void 0:F.join(", "))||"",a("update",k),Object.assign(p.fields,f)}}catch(E){p.errorMessage=i(E),a("error",E)}finally{p.isReadonly=!1}};return t.watch(()=>r.targetId,()=>{Object.assign(p.fields,f)}),(_,F)=>{const E=t.resolveComponent("KInput"),k=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(k,{"action-button-disabled":!x.value||p.isReadonly,"action-button-text":t.unref(o)("targets.form.buttons.save"),"cancel-button-text":t.unref(o)("targets.form.buttons.cancel"),title:h.value,visible:e.isVisible,onCancel:m,onProceed:N},{default:t.withCtx(()=>[t.createElementVNode("div",yc,[t.createVNode(t.unref(Ma),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":T.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":F[3]||(F[3]=A=>_.$emit("error",A)),"onFetch:success":b,onLoading:F[4]||(F[4]=A=>_.$emit("loading",A))},{default:t.withCtx(()=>[t.createElementVNode("div",kc,[_.$slots.info?(t.openBlock(),t.createElementBlock("div",bc,[t.renderSlot(_.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(E,{modelValue:p.fields.target,"onUpdate:modelValue":F[0]||(F[0]=A=>p.fields.target=A),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(o)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(o)("targets.form.fields.target.tooltip")},placeholder:t.unref(o)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(E,{modelValue:p.fields.weight,"onUpdate:modelValue":F[1]||(F[1]=A=>p.fields.weight=A),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(o)("targets.errors.weight"),label:t.unref(o)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(o)("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(E,{modelValue:p.fields.tags,"onUpdate:modelValue":F[2]||(F[2]=A=>p.fields.tags=A),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(o)("targets.form.fields.tags.help"),label:t.unref(o)("targets.form.fields.tags.label"),placeholder:t.unref(o)("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"]]),Cc={class:"kong-ui-entities-targets-list"},wc={class:"target-address"},_c=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:l}){var P;const a=l,r=e,{i18n:{t:o}}=de.useI18n(),{axiosInstance:i}=Pe({headers:(P=r.config)==null?void 0:P.requestHeaders}),n=t.ref(1),d=t.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),h={target:{label:o("targets.list.table_headers.target_address"),sortable:!0},weight:{label:o("targets.list.table_headers.weight"),sortable:!0},tags:{label:o("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var g,C,z,K;let y=`${r.config.apiBaseUrl}${ze.list[r.config.app]}`;return r.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((g=r.config)==null?void 0:g.controlPlaneId)||"").replace(/{upstreamId}/gi,((C=r.config)==null?void 0:C.upstreamId)||""):r.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(z=r.config)!=null&&z.workspace?`/${r.config.workspace}`:"").replace(/{upstreamId}/gi,((K=r.config)==null?void 0:K.upstreamId)||"")),y}),{fetcher:u,fetcherState:f}=Ja(r.config,p.value),s=()=>{n.value++},x=t.ref(null),b=()=>{j.value=!0},m=(y,g)=>{const C=y.id;if(!g(C)){a("copy:error",{entity:y,field:"id",message:o("targets.errors.copy")});return}a("copy:success",{entity:y,field:"id",message:o("targets.copy.success",{val:C})})},w=(y,g)=>{const C=JSON.stringify(y);if(!g(C)){a("copy:error",{entity:y,message:o("targets.errors.copy")});return}a("copy:success",{entity:y,message:o("targets.copy.success_brief")})},V=y=>{q.value=y,j.value=!0},T=y=>r.config.app==="konnect"?!1:r.config.canMarkHealthy(y),N=y=>r.config.app==="konnect"?!1:r.config.canMarkUnhealthy(y),B=t.ref(void 0),_=t.ref(!1),F=t.ref(!1),E=t.ref(""),k=Ra(r.config,p.value),A=y=>{B.value=y,_.value=!0},S=()=>{_.value=!1},H=async()=>{var y,g,C;if((y=B.value)!=null&&y.id){F.value=!0;try{await i.delete(k(B.value.id)),F.value=!1,_.value=!1,n.value++,a("delete:success",B.value)}catch(z){E.value=((C=(g=z.response)==null?void 0:g.data)==null?void 0:C.message)||z.message||o("targets.errors.delete"),a("error",z)}finally{F.value=!1}}},$=t.ref(!0);t.watch(f,y=>{var g,C,z,K;if(Array.isArray((g=y==null?void 0:y.response)==null?void 0:g.data)&&($.value=y.response.data.length>0),y.status===pe.Error){x.value={title:o("targets.errors.general")},(K=(z=(C=y.error)==null?void 0:C.response)==null?void 0:z.data)!=null&&K.message&&(x.value.message=y.error.response.data.message),a("error",y.error);return}x.value=null});const D=t.ref({ctaText:void 0,message:o("targets.list.empty_state.description"),title:o("targets.title"),...r.config.createRoute&&{ctaPath:r.config.createRoute}});t.onBeforeMount(async()=>{await r.canCreate()&&(D.value.title=o("targets.list.empty_state.title"),D.value.ctaText=o("targets.actions.create"))});const U=t.computed(()=>({app:r.config.app,apiBaseUrl:r.config.apiBaseUrl,upstreamId:r.config.upstreamId,...r.config.app==="konnect"&&{controlPlaneId:r.config.controlPlaneId},...r.config.app==="kongManager"&&{workspace:r.config.workspace,requestHeaders:r.config.requestHeaders}})),q=t.ref(""),j=t.ref(!1),M=y=>{q.value?a("update:target",y):a("create:target",y),I()},I=()=>{v(),n.value++},v=()=>{j.value=!1,q.value=""};return(y,g)=>{const C=t.resolveComponent("KButton"),z=t.resolveComponent("KBadge"),K=t.resolveComponent("KTruncate"),J=t.resolveComponent("KDropdownItem"),X=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Cc,[t.createVNode(t.unref(Ka),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":D.value,"enable-entity-actions":"","error-message":x.value,fetcher:t.unref(u),"fetcher-cache-key":n.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:g[1]||(g[1]=()=>r.config.createRoute?void 0:b()),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(C,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:r.config.createRoute?r.config.createRoute:void 0,onClick:g[0]||(g[0]=()=>r.config.createRoute?void 0:b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,$.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),target:t.withCtx(({rowValue:R})=>[t.createElementVNode("span",wc,t.toDisplayString(R),1)]),tags:t.withCtx(({rowValue:R})=>[t.createVNode(K,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R,te=>(t.openBlock(),t.createBlock(z,{key:te,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(te),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:R})=>[t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:ge=>m(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:ge=>w(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-entity-edit","has-divider":"",onClick:te=>V(R.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>T(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-healthy",onClick:te=>a("health-actions:healthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>N(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-unhealthy",onClick:te=>a("health-actions:unhealthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(R)},{default:t.withCtx(()=>[t.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:te=>A(R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("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(Pa),{"action-pending":F.value,description:t.unref(o)("targets.delete.description"),"entity-type":t.unref(Qe).Target,error:E.value,"need-confirm":!1,title:t.unref(o)("targets.delete.title"),visible:_.value,onCancel:S,onProceed:H},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Xa,{config:U.value,"is-visible":j.value,"target-id":q.value,onCancel:v,onUpdate:M},t.createSlots({_:2},[y.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-6e346906"]]),Sc={key:1},xc=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:l}){var S,H,$,D;const{i18nT:a,i18n:{t:r}}=de.useI18n(),o=e,i=l,{debouncedQueryChange:n,loading:d,loadItems:c,results:h,allRecords:p}=Wa(o.config,(H=Ve.form[(S=o.config)==null?void 0:S.app])==null?void 0:H.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:s,results:x}=Wa(o.config,(D=Ve.form[($=o.config)==null?void 0:$.app])==null?void 0:D.getCertificates),b=t.ref(""),m=t.computed(()=>{var U;return!!o.name&&!((U=p.value)!=null&&U.some(q=>q.host===o.name))}),w=t.computed(()=>{var q,j,M;const U=m.value&&o.name.includes((q=b.value)==null?void 0:q.toLowerCase());return(M=h.value)==null?void 0:M.map(I=>({label:I.host,value:I.id})).concat(U?[{label:o.name,value:((j=N.value)==null?void 0:j.value)||o.name}]:[])}),V=t.computed(()=>{var U;return(U=x.value)==null?void 0:U.map(q=>({label:q.id,value:q.id}))}),T=t.ref(""),N=t.ref({value:"",label:""}),B=t.computed(()=>{var U,q;return((U=w.value.find(j=>j.value===T.value))==null?void 0:U.label)||((q=N.value)==null?void 0:q.label)}),_=U=>{b.value=U,n(U)},F=U=>{N.value=U},E=()=>{N.value={value:"",label:""}},k=U=>{T.value=U,i("update:name",B.value)},A=t.ref(!1);return t.onBeforeMount(async()=>{var U,q;try{A.value=!0,await c(),o.name&&(T.value=((q=(U=w.value.find(j=>j.label===o.name))==null?void 0:U.value)==null?void 0:q.toString())||o.name),await s()}finally{A.value=!1}}),(U,q)=>{const j=t.resolveComponent("KSkeleton"),M=t.resolveComponent("KSelect"),I=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(r)("upstreams.form.general_info.help"),title:t.unref(r)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[A.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",Sc,[t.createVNode(M,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:w.value,label:t.unref(r)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":T.value,placeholder:t.unref(r)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:F,onItemRemoved:E,onQueryChange:_,"onUpdate:modelValue":k},{"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(r)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(r)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":q[0]||(q[0]=v=>i("update:host-header",v))},null,8,["label","model-value","readonly"]),t.createVNode(M,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:V.value,label:t.unref(r)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(r)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(f),"model-value":e.clientCertificate,placeholder:t.unref(r)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":q[1]||(q[1]=v=>i("update:client-certificate",v))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(I,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(r)("upstreams.form.fields.tags.help"),label:t.unref(r)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(r)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(r)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":q[2]||(q[2]=v=>i("update:tags",v))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),Je={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},Nc={class:"fields-group-title"},Vc={class:"fields-group-text"},Bc={class:"fields-group-title"},Ic={class:"fields-group-text"},Tc=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:l}){const{i18nT:a,i18n:{t:r}}=de.useI18n(),{inRange:o}=Re(),i=e,n=l,d=t.ref([{label:r("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:r("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:r("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:r("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:r("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:r("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:r("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:r("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:r("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:r("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:r("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:r("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>i.hashOn,(u,f)=>{f==="header"&&u!==f&&n("update:hash-on-header",""),f==="cookie"&&u!==f&&(n("update:hash-on-cookie",""),n("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&n("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&n("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(n("update:hash-fallback","none"),n("update:hash-fallback-header",""),n("update:hash-fallback-query-argument",""),n("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,f)=>{f==="header"&&u!==f&&n("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(n("update:hash-on-cookie",""),n("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&n("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&n("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?o(i.slots,ft,mt)?"":r("upstreams.form.errors.in_range"):"");return(u,f)=>{const s=t.resolveComponent("KExternalLink"),x=t.resolveComponent("KSelect"),b=t.resolveComponent("KInput"),m=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(r)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(Je).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(x,{class:"algorithm-select",items:d.value,label:t.unref(r)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=w=>n("update:algorithm",w))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(r)("upstreams.form.fields.slots.help"),label:t.unref(r)("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]=w=>n("update:slots",w))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Nc,t.toDisplayString(t.unref(r)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",Vc,t.toDisplayString(t.unref(r)("upstreams.form.fields.hash_on.help")),1),t.createVNode(x,{class:"hash-on-select",items:c.value,label:t.unref(r)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[2]||(f[2]=w=>n("update:hash-on",w))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(r)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[3]||(f[3]=w=>n("update:hash-on-header",w))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(r)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[4]||(f[4]=w=>n("update:hash-on-cookie",w))},null,8,["label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(r)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[5]||(f[5]=w=>n("update:hash-on-cookie-path",w))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(b,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(r)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[6]||(f[6]=w=>n("update:hash-on-query-argument",w))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(b,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(r)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[7]||(f[7]=w=>n("update:hash-on-uri-capture",w))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Bc,t.toDisplayString(t.unref(r)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",Ic,t.toDisplayString(t.unref(r)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(x,{class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(r)("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]=w=>n("update:hash-fallback",w))},{"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(r)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(r)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(r)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[9]||(f[9]=w=>n("update:hash-fallback-header",w))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(r)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[10]||(f[10]=w=>n("update:hash-on-cookie",w))},null,8,["label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(r)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[11]||(f[11]=w=>n("update:hash-on-cookie-path",w))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(b,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(r)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[12]||(f[12]=w=>n("update:hash-fallback-query-argument",w))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(b,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(r)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[13]||(f[13]=w=>n("update:hash-fallback-uri-capture",w))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),Ac={class:"fields-group-title"},Ec={class:"fields-group-text"},Hc={class:"fields-group-title"},Fc={class:"fields-group-text"},Oc=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:l}){const{i18n:{t:a}}=de.useI18n(),r=l;return(o,i)=>{const n=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(n,{"hide-icon":"",href:t.unref(Je).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",Ac,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",Ec,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=>r("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Hc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",Fc,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=>r("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(sc),min:t.unref(ic),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>r("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),qc={key:2},$c={class:"fields-group-title"},Uc={class:"fields-group-text"},vc={class:"fields-group-title"},Dc={class:"fields-group-text"},jc=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:l}){const{i18n:{t:a}}=de.useI18n(),{objectsAreEqual:r}=Re(),o=e,i=l,n=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(()=>o.type==="https"||o.type==="grpcs"),c=t.computed(()=>o.type==="tcp"),{trackNewItems:h}=qe({replaceId:!0}),{trackNewItems:p}=qe({replaceId:!0});t.watch(()=>o.type,(b,m)=>{m==="tcp"&&b!==m&&i("update:tcp-failures","5"),(m==="https"||m==="grpcs")&&b!==m&&(i("update:https-sni",""),i("update:verify-ssl",!1)),m!=="tcp"&&b==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",gt),i("update:unhealthy-http-statuses",kt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>o.headers,b=>{r(u.value,b)||(u.value=[...b])},{immediate:!0,deep:!0});const f=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),f()},x=b=>{b===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(b,1),f()};return(b,m)=>{const w=t.resolveComponent("KExternalLink"),V=t.resolveComponent("KSelect"),T=t.resolveComponent("KInput"),N=t.resolveComponent("KCheckbox"),B=t.resolveComponent("KLabel"),_=t.resolveComponent("KIcon"),F=t.resolveComponent("KButton"),E=t.resolveComponent("KMultiselect"),k=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(w,{"hide-icon":"",href:t.unref(Je).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var A;return[t.createVNode(V,{class:"active-healthcheck-type-select",items:n.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[0]||(m[0]=S=>i("update:type",S))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(T,{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":m[1]||(m[1]=S=>i("update:http-path",S))},null,8,["label","model-value","readonly"])),t.createVNode(T,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(dc),min:t.unref(cc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":m[2]||(m[2]=S=>i("update:timeout",S))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(T,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(pc),min:t.unref(hc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":m[3]||(m[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(T,{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":m[4]||(m[4]=S=>i("update:https-sni",S))},null,8,["label","model-value","readonly"]),t.createVNode(N,{"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":m[5]||(m[5]=S=>i("update:verify-ssl",S))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((A=e.config)==null?void 0:A.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",qc,[t.createVNode(B,{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,H)=>(t.openBlock(),t.createElementBlock("div",{key:`${S.header}_${H}`,class:t.normalizeClass(["headers-row",{"margin-top-6":H>0}])},[t.createVNode(T,{modelValue:u.value[H].key,"onUpdate:modelValue":$=>u.value[H].key=$,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${H+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(T,{modelValue:u.value[H].values,"onUpdate:modelValue":$=>u.value[H].values=$,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${H+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(F,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:$=>x(H)},{icon:t.withCtx(()=>[t.createVNode(_,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&H===u.value.length-1?(t.openBlock(),t.createBlock(F,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:s},{icon:t.withCtx(()=>[t.createVNode(_,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(k,null,{default:t.withCtx(()=>[t.createElementVNode("h5",$c,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Uc,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(T,{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(Ga),min:t.unref(Za),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[6]||(m[6]=S=>i("update:interval",S))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(T,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":m[7]||(m[7]=S=>i("update:successes",S))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(E,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Le),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:m[8]||(m[8]=S=>t.unref(h)(S,!0)),onItemRemoved:m[9]||(m[9]=S=>t.unref(h)(S,!1)),"onUpdate:modelValue":m[10]||(m[10]=S=>i("update:http-statuses",S))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(k,null,{default:t.withCtx(()=>[t.createElementVNode("h5",vc,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Dc,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(T,{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(Ga),min:t.unref(Za),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[11]||(m[11]=S=>i("update:unhealthy-interval",S))},null,8,["help","label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createBlock(T,{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(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[12]||(m[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(T,{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(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[13]||(m[13]=S=>i("update:http-failures",S))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(E,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Le),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:m[14]||(m[14]=S=>t.unref(p)(S,!0)),onItemRemoved:m[15]||(m[15]=S=>t.unref(p)(S,!1)),"onUpdate:modelValue":m[16]||(m[16]=S=>i("update:unhealthy-http-statuses",S))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(T,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Ya),min:t.unref(Qa),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":m[17]||(m[17]=S=>i("update:unhealthy-timeouts",S))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-9e6394cf"]]),Mc={class:"fields-group-title"},Kc={class:"fields-group-text"},Pc={class:"fields-group-title"},Lc={class:"fields-group-text"},Rc=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:l}){const{i18n:{t:a}}=de.useI18n(),r=e,o=l,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}]),n=t.computed(()=>r.type==="tcp"),{trackNewItems:d}=qe({replaceId:!0}),{trackNewItems:c}=qe({replaceId:!0});return t.watch(()=>r.type,(h,p)=>{p==="tcp"&&h!==p&&o("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(o("update:http-statuses",yt),o("update:unhealthy-http-statuses",bt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),x=t.resolveComponent("KMultiselect"),b=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(Je).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]=m=>o("update:type",m))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Mc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",Kc,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(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=m=>o("update:successes",m))},null,8,["label","max","min","model-value","readonly"]),n.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(x,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Le),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=m=>t.unref(d)(m,!0)),onItemRemoved:p[3]||(p[3]=m=>t.unref(d)(m,!1)),"onUpdate:modelValue":p[4]||(p[4]=m=>o("update:http-statuses",m))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Pc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",Lc,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(Ya),min:t.unref(Qa),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=m=>o("update:timeouts",m))},null,8,["label","max","min","model-value","readonly"]),n.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(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=m=>o("update:tcp-failures",m))},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(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=m=>o("update:http-failures",m))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(x,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Le),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=m=>t.unref(c)(m,!0)),onItemRemoved:p[9]||(p[9]=m=>t.unref(c)(m,!1)),"onUpdate:modelValue":p[10]||(p[10]=m=>o("update:unhealthy-http-statuses",m))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-cca8adae"]]),zc={class:"kong-ui-entities-upstreams-form"},Jc=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:l}){var P;const a=e,r=l,{inRange:o,stringToNumberArray:i,upstreamsResponseToFields:n,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=Re(),{axiosInstance:p}=Pe({headers:(P=a.config)==null?void 0:P.requestHeaders}),{getMessageFromError:u}=za(),f=We.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),x=t.reactive(d()),b=t.computed(()=>!c(s.fields,x)),m=y=>{s.fields.activeHealthCheck.interval=y?"5":"0",s.fields.activeHealthCheck.successes=y?"5":"0",s.fields.activeHealthCheck.httpFailures=y?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=y?"5":"0"},w=y=>{s.fields.passiveHealthCheck.timeouts=y?"5":"0",s.fields.passiveHealthCheck.successes=y?"80":"0"},V=t.computed(()=>s.fields.slots?o(s.fields.slots,ft,mt):!0),T=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),N=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),B=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),_=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),F=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),E=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),k=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),A=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),S=t.computed(()=>!!s.fields.name&&V.value&&T.value&&N.value&&B.value&&_.value&&F.value&&E.value&&k.value&&A.value),H=t.computed(()=>a.upstreamId?ne.Edit:ne.Create),$=t.computed(()=>{var y,g;return(g=Ve.form[(y=a.config)==null?void 0:y.app])==null?void 0:g.edit}),D=y=>{Object.assign(s.fields,n(y)),Object.assign(x,h(s.fields))},U=()=>{var y;f.push(((y=a.config)==null?void 0:y.cancelRoute)||{name:"upstreams-list"})},q=y=>{r("loading",y)},j=y=>{r("error",y)},M=t.computed(()=>{var g,C,z,K,J;const y={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&&(y.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(y.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(y.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(y.tags=(C=(g=s.fields.tags.split(","))==null?void 0:g.map(X=>String(X||"").trim()))==null?void 0:C.filter(X=>X!=="")),s.fields.hashOn==="header"&&(y.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(y.hash_on_cookie=s.fields.hashOnCookie,y.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(y.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(y.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(y.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(y.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(y.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(y.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(y.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(y.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(y.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((z=a.config)==null?void 0:z.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?y.healthchecks.active.headers=[]:y.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((X,R)=>{var te,ge;return R.key?{...X,[R.key]:(ge=(te=R.values.split(","))==null?void 0:te.map(Be=>String(Be||"").trim()))==null?void 0:ge.filter(Be=>Be!=="")}:{...X}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(y.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(y.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(y.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(y.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(y.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(y.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(y.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(y.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.type==="tcp"&&s.fields.activeHealthCheck.tcpFailures&&(y.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((K=a.config)==null?void 0:K.app)==="kongManager"&&H.value===ne.Edit&&(y.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),s.fields.passiveHealthSwitch?(y.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(y.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(y.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(y.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(y.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.type==="tcp"&&s.fields.passiveHealthCheck.tcpFailures&&(y.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((J=a.config)==null?void 0:J.app)==="kongManager"&&H.value===ne.Edit&&(y.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),y}),I=y=>{var C,z,K,J,X,R;let g=`${(C=a.config)==null?void 0:C.apiBaseUrl}${Ve.form[(z=a.config)==null?void 0:z.app][y]}`;return((K=a.config)==null?void 0:K.app)==="konnect"?g=g.replace(/{controlPlaneId}/gi,((J=a.config)==null?void 0:J.controlPlaneId)||""):((X=a.config)==null?void 0:X.app)==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(R=a.config)!=null&&R.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.upstreamId),g},v=async()=>{var y;try{s.readonly=!0,await p.post(I("validate"),M.value);let g;H.value===ne.Create?g=await p.post(I("create"),M.value):H.value===ne.Edit&&(g=((y=a.config)==null?void 0:y.app)==="konnect"?await p.put(I("edit"),M.value):await p.patch(I("edit"),M.value)),r("update",g==null?void 0:g.data)}catch(g){s.errorMessage=u(g),r("error",g)}finally{s.readonly=!1}};return(y,g)=>(t.openBlock(),t.createElementBlock("div",zc,[t.createVNode(t.unref(Ma),{"can-submit":S.value&&b.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":$.value,"form-fields":M.value,"is-readonly":s.readonly,onCancel:U,"onFetch:error":j,"onFetch:success":D,onLoading:q,onSubmit:v},{default:t.withCtx(()=>[t.createVNode(xc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":g[0]||(g[0]=C=>s.fields.clientCertificate=C),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":g[1]||(g[1]=C=>s.fields.hostHeader=C),name:s.fields.name,"onUpdate:name":g[2]||(g[2]=C=>s.fields.name=C),tags:s.fields.tags,"onUpdate:tags":g[3]||(g[3]=C=>s.fields.tags=C),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(Tc,{algorithm:s.fields.algorithm,"onUpdate:algorithm":g[4]||(g[4]=C=>s.fields.algorithm=C),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":g[5]||(g[5]=C=>s.fields.hashFallback=C),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":g[6]||(g[6]=C=>s.fields.hashFallbackHeader=C),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":g[7]||(g[7]=C=>s.fields.hashFallbackQueryArgument=C),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":g[8]||(g[8]=C=>s.fields.hashFallbackUriCapture=C),"hash-on":s.fields.hashOn,"onUpdate:hashOn":g[9]||(g[9]=C=>s.fields.hashOn=C),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":g[10]||(g[10]=C=>s.fields.hashOnCookie=C),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":g[11]||(g[11]=C=>s.fields.hashOnCookiePath=C),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":g[12]||(g[12]=C=>s.fields.hashOnHeader=C),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":g[13]||(g[13]=C=>s.fields.hashOnQueryArgument=C),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":g[14]||(g[14]=C=>s.fields.hashOnUriCapture=C),slots:s.fields.slots,"onUpdate:slots":g[15]||(g[15]=C=>s.fields.slots=C),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(Oc,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[g[16]||(g[16]=C=>s.fields.activeHealthSwitch=C),m],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":g[17]||(g[17]=C=>s.fields.healthchecksThreshold=C),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[g[18]||(g[18]=C=>s.fields.passiveHealthSwitch=C),w],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(jc,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":g[19]||(g[19]=C=>s.fields.activeHealthCheck.concurrency=C),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":g[20]||(g[20]=C=>s.fields.activeHealthCheck.headers=C),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":g[21]||(g[21]=C=>s.fields.activeHealthCheck.httpFailures=C),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":g[22]||(g[22]=C=>s.fields.activeHealthCheck.httpPath=C),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[23]||(g[23]=C=>s.fields.activeHealthCheck.httpStatuses=C),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":g[24]||(g[24]=C=>s.fields.activeHealthCheck.httpsSni=C),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":g[25]||(g[25]=C=>s.fields.activeHealthCheck.interval=C),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":g[26]||(g[26]=C=>s.fields.activeHealthCheck.successes=C),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[27]||(g[27]=C=>s.fields.activeHealthCheck.tcpFailures=C),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":g[28]||(g[28]=C=>s.fields.activeHealthCheck.timeout=C),type:s.fields.activeHealthCheck.type,"onUpdate:type":g[29]||(g[29]=C=>s.fields.activeHealthCheck.type=C),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[30]||(g[30]=C=>s.fields.activeHealthCheck.unhealthyHttpStatuses=C),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":g[31]||(g[31]=C=>s.fields.activeHealthCheck.unhealthyInterval=C),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":g[32]||(g[32]=C=>s.fields.activeHealthCheck.unhealthyTimeouts=C),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":g[33]||(g[33]=C=>s.fields.activeHealthCheck.verifySsl=C),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(Rc,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":g[34]||(g[34]=C=>s.fields.passiveHealthCheck.httpFailures=C),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[35]||(g[35]=C=>s.fields.passiveHealthCheck.httpStatuses=C),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":g[36]||(g[36]=C=>s.fields.passiveHealthCheck.successes=C),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[37]||(g[37]=C=>s.fields.passiveHealthCheck.tcpFailures=C),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":g[38]||(g[38]=C=>s.fields.passiveHealthCheck.timeouts=C),type:s.fields.passiveHealthCheck.type,"onUpdate:type":g[39]||(g[39]=C=>s.fields.passiveHealthCheck.type=C),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[40]||(g[40]=C=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=C),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-05687a98"]]),Wc=t.createElementVNode("code",null,"10",-1),Qc=t.createElementVNode("code",null,"65536",-1),Yc={"data-testid":"client_certificate-plain-text"},Zc=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e){const l=e,{i18n:{t:a},i18nT:r}=de.useI18n(),{getPropValue:o}=lc(),i=t.computed(()=>Ve.form[l.config.app].edit),n=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:W.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:W.Basic},hash_on:{order:7,section:W.Basic},hash_on_header:{order:8,section:W.Basic},hash_on_uri_capture:{order:9,section:W.Basic},hash_on_query_arg:{order:10,section:W.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:W.Basic},hash_on_cookie_path:{order:12,section:W.Basic},healthchecks:{order:13,section:W.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(xs),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":n.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onCopy:success":c[0]||(c[0]=h=>d.$emit("copy:success",h)),"onFetch:error":c[1]||(c[1]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[2]||(c[2]=h=>d.$emit("fetch:success",h)),onLoading:c[3]||(c[3]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(r),{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(r),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[Wc]),max:t.withCtx(()=>[Qc]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",Yc,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(o)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});ae.TargetForm=Xa,ae.TargetsList=_c,ae.UpstreamsConfigCard=Zc,ae.UpstreamsForm=Jc,ae.UpstreamsList=gc,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
|