@kong-ui-public/entities-routes 3.9.4-pr.1964.c866400a2.0 → 3.9.4

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.
@@ -6,7 +6,7 @@ import { useAxios as Xe, useTableState as Ot, useFetcher as Nt, useDeleteUrlBuil
6
6
  import { createI18n as jt, i18nTComponent as Wt } from "@kong-ui-public/i18n";
7
7
  import Xt from "lodash.isequal";
8
8
  const zt = {
9
- create: "New Route",
9
+ create: "New route",
10
10
  copy_id: "Copy ID",
11
11
  copy_json: "Copy JSON",
12
12
  edit: "Edit",
@@ -1 +1 @@
1
- (function(R,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/kongponents"),require("@kong/icons"),require("@kong-ui-public/entities-shared"),require("@kong-ui-public/i18n"),require("lodash.isequal"),require("@kong-ui-public/expressions")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/kongponents","@kong/icons","@kong-ui-public/entities-shared","@kong-ui-public/i18n","lodash.isequal","@kong-ui-public/expressions"],e):(R=typeof globalThis<"u"?globalThis:R||self,e(R["kong-ui-public-entities-routes"]={},R.Vue,R.VueRouter,R.Kongponents,R.KongIcons,R["kong-ui-public-entities-shared"],R["kong-ui-public-i18n"],R.isEqual,R["kong-ui-public-expressions"]))})(this,function(R,e,Ie,Re,z,y,Be,Fe,me){"use strict";const Pe={actions:{create:"New Route",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details",loading:"Loading..."},search:{placeholder:{konnect:"Filter by name",exact:"Filter by exact name or ID",kongManager:"Filter by exact name or ID"},no_results:"No results found"},routes:{title:"Routes",list:{toolbar_actions:{new_route:"New route"},table_headers:{name:"Name",protocols:"Protocols",hosts:"Hosts",methods:"Methods",paths:"Paths",expression:"Expression",id:"ID",tags:"Tags",created_at:"Created At",updated_at:"Last Modified"},empty_state:{title:"Configure a New Route",description:"Routes proxy requests to an associated Service."},empty_state_v2:{title:"Configure your first route",description:"Routes direct incoming API requests to the appropriate services, facilitating organized and efficient traffic flow within your architecture."}}},delete:{title:"Delete a Route",description:"Deleting this route will also remove any associated plugins. This action cannot be reversed."},errors:{general:"Routes could not be retrieved",delete:"The route could not be deleted at this time.",copy:"Failed to copy to clipboard",services:{fetch:"Could not fetch available services"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{protocols:{grpc:"GRPC",grpcs:"GRPCS","grpc,grpcs":"GRPC, GRPCS",http:"HTTP",https:"HTTPS","http,https":"HTTP, HTTPS",tls:"TLS",tcp:"TCP",udp:"UDP","tls,udp":"TLS, UDP","tcp,udp":"TCP, UDP","tcp,tls":"TCP, TLS","tcp,tls,udp":"TCP, TLS, UDP",ws:"WS",wss:"WSS","ws,wss":"WS, WSS",tls_passthrough:"TLS_PASSTHROUGH"},sections:{general:{title:"General Information",description:"General information will help you identify and manage this route"},config:{title:"Route Configuration",description:"Route configuration determines how this route will handle incoming requests"},routingRules:{title:"Routing Rules"},routingExpression:{title:"Routing Expression"}},fields:{service_id:{label:"Service",placeholder:"Select a service"},name:{label:"Name",placeholder:"Enter a unique name",tooltip:"The name of the Route. Route names must be unique, and they are case sensitive. For example, there can be two different Routes named 'test' and 'Test'."},service:{label:"Gateway Service",tooltip:"The Service this Route is associated to. This is where the Route proxies traffic to."},tags:{label:"Tags",tooltip:"An optional set of strings associated with the Route for grouping and filtering.",placeholder:"Enter a list of tags separated by commas",help:"e.g. tag1, tag2, tag3"},protocols:{label:"Protocols",tooltip:"Routes have a protocols property to restrict the client protocol they should listen for.",tooltipConfig:"An array of the protocols this Route should allow. See the {code1} section for a list of accepted protocols. When set to only {code2}, HTTP requests are answered with an upgrade error. When it is set to only {code3}, this is essentially the same as {code4} in that both HTTP and HTTPS requests are allowed. Default: {code5}.",code1:"Route Object",code2:"https",code3:"http",code4:"['http', 'https']",code5:"['http', 'https']"},path_handling:{label:"Path Handling",tooltip:"This treats service.path, route.path and request path as segments of a URL.",tooltipConfig:"Controls how the Service path, Route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior."},https_redirect_status_code:{label:"HTTPS Redirect Status Code",tooltip:"The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is {code1} instead of {code2}. {code3} header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the Route is configured to only accept the {code4} protocol.",code1:"HTTP",code2:"HTTPS",code3:"Location",code4:"https"},regex_priority:{label:"Regex Priority",tooltip:"A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same {code1}, the older one (lowest {code2}) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones).",code1:"regex_priority",code2:"created_at"},strip_path:{label:"Strip Path",tooltip:"When matching a Route via one of the {code1}, strip the matching prefix from the upstream request URL.",code1:"paths"},preserve_host:{label:"Preserve Host",tooltip:"When matching a Route via one of the {code1} domain names, use the request {code2} header in the upstream request headers. If set to {code3}, the upstream {code4} header will be that of the Service's {code5}.",code1:"hosts",code2:"Host",code3:"false",code4:"Host",code5:"host"},paths:{label:"Paths",placeholder:"Enter a path",tooltip:"A list of paths that match this Route."},snis:{label:"SNIs",placeholder:"Enter a SNI",tooltip:"A list of SNIs (Server Name Indications from a TLS ClientHello) that match this Route."},hosts:{label:"Hosts",placeholder:"Enter a host",tooltip:"A list of domain names that match this Route.",tooltipConfig:"A list of domain names that match this Route. Note that the hosts value is case sensitive."},methods:{label:"Methods",tooltip:"A list of HTTP methods that match this Route.",custom:{label:"Custom",placeholder:"Enter a custom method",tooltip:"Custom methods can be used with default selections. Uppercase characters are required."}},headers:{label:"Headers",tooltip:"Header values can be separated by commas (value1, value2, value3).",name:{placeholder:"Enter a header name"},values:{placeholder:"Enter a header value"},tooltipConfig:"One or more lists of values indexed by header name that will cause this Route to match if present in the request. The {code1} header cannot be used with this attribute: hosts should be specified using the {code2} attribute. When {code3} contains only one value and that value starts with the special prefix {code4], the value is interpreted as a regular expression.",code1:"Host",code2:"hosts",code3:"headers",code4:"*"},sources:{label:"Sources",tooltip:"A list of IP sources of incoming connections that match this Route when using stream routing.",ip:{placeholder:"Enter a source IP"},port:{placeholder:"Enter a source port"}},destinations:{label:"Destinations",tooltip:"A list of IP destinations of incoming connections that match this Route when using stream routing.",ip:{placeholder:"Enter a destination IP"},port:{placeholder:"Enter a destination port"}},response_buffering:{label:"Response buffering",tooltip:"Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding."},request_buffering:{label:"Request buffering",tooltip:"Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding."},expression:{label:"Expression",tooltip:"The route expression."},priority:{label:"Priority",tooltip:"A number used to choose which route resolves a given request when several routes match it using expression simultaneously."}},flavors:{traditional:"Traditional",expressions:"Expressions"},viewAdvancedFields:"View Advanced Fields",addNewRule:"Add New Rule",warning:{rulesMessage:"For {protocol}, at least one of {routingRules} must be set.",singleRule:"{routingRules}",multipleRules:"{routingRules} or {lastRoutingRule}",cannotChangeFlavor:{create:"The format of the route cannot be changed once created.",edit:"This route was configured in the {format} format, and cannot be changed after creation. You can switch to the {format} tab to edit, or create a new route in a different format instead."}},expressions_editor:{loading:"Loading the Expressions editor…",error:"Error occurred while loading the Expressions editor. Please view the console for more details."},expression_playground:{test_link:"Test with Router Playground",supported_protocols_hint:"Currently only supports the following protocols: {protocols}"}}};function xe(){const s=Be.createI18n("en-us",Pe);return{i18n:s,i18nT:Be.i18nTComponent(s)}}const K={useI18n:xe},U="/v2/control-planes/{controlPlaneId}/core-entities",M="/{workspace}",ne={list:{konnect:{all:`${U}/routes`,forGatewayService:`${U}/services/{serviceId}/routes`},kongManager:{all:`${M}/routes`,forGatewayService:`${M}/services/{serviceId}/routes`}},form:{konnect:{services:`${U}/services`,create:{all:`${U}/routes`,forGatewayService:`${U}/services/{serviceId}/routes`},fetch:{all:`${U}/routes/{id}`,forGatewayService:`${U}/services/{serviceId}/routes/{id}`},edit:{all:`${U}/routes/{id}`,forGatewayService:`${U}/services/{serviceId}/routes/{id}`}},kongManager:{services:`${M}/services`,create:{all:`${M}/routes`,forGatewayService:`${M}/services/{serviceId}/routes`},fetch:{all:`${M}/routes/{id}`,forGatewayService:`${M}/services/{serviceId}/routes/{id}`},edit:{all:`${M}/routes/{id}`,forGatewayService:`${M}/services/{serviceId}/routes/{id}`}}},item:{konnect:{getService:`${U}/services/{serviceId}`,all:`${U}/routes/{id}`,forGatewayService:`${U}/services/{serviceId}/routes/{id}`},kongManager:{getService:`${M}/services/{serviceId}`,all:`${M}/routes/{id}`,forGatewayService:`${M}/services/{serviceId}/routes/{id}`}}},Ae="#d60027",He="#00abd2",Oe="#6c7489",Ve="16px",Ue="24px",Me={class:"kong-ui-entities-routes-list"},Le={class:"button-row"},qe={class:"empty-state-icon-gateway"},Ke={key:1},Ge={key:1},je={key:1},We={class:"route-list-cell-expression"},Xe=e.defineComponent({__name:"RouteList",props:{config:{type:Object,required:!0,validator:s=>!(!s||!["konnect","kongManager"].includes(s==null?void 0:s.app)||!s.createRoute||!s.getViewRoute||!s.getEditRoute||s.app==="kongManager"&&!s.isExactMatch&&!s.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},title:{type:String,default:""},titleTag:{type:String,default:"h2"},useActionOutside:{type:Boolean,default:!1},hideTraditionalColumns:{type:Boolean,default:!1},hasExpressionColumn:{type:Boolean,default:!1},enableV2EmptyStates:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(s,{emit:N}){var fe;const h=N,i=s,{i18n:{t:c,formatUnixTimeStamp:n}}=K.useI18n(),p=Ie.useRouter(),{axiosInstance:u}=y.useAxios((fe=i.config)==null?void 0:fe.axiosRequestConfig),{handleStateChange:b,hasRecords:V}=y.useTableState(()=>x.value),B=e.computed(()=>V.value&&i.config.app==="konnect"),f=e.computed(()=>!i.enableV2EmptyStates&&i.config.app==="konnect"),a=e.computed(()=>!!i.config.serviceId),D=e.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),W={name:{label:c("routes.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},protocols:{label:c("routes.list.table_headers.protocols"),searchable:!0},...!i.hideTraditionalColumns&&{hosts:{label:c("routes.list.table_headers.hosts"),searchable:!0},methods:{label:c("routes.list.table_headers.methods"),searchable:!0},paths:{label:c("routes.list.table_headers.paths"),searchable:!0}},...i.hasExpressionColumn&&{expression:{label:c("routes.list.table_headers.expression"),tooltip:!0}},tags:{label:c("routes.list.table_headers.tags"),sortable:!1},updated_at:{label:c("routes.list.table_headers.updated_at"),sortable:!0},created_at:{label:c("routes.list.table_headers.created_at"),sortable:!0}},E={columnVisibility:{created_at:!1}},_=W,P=e.computed(()=>{var C,I,O,H;let S=`${i.config.apiBaseUrl}${ne.list[i.config.app][i.config.serviceId?"forGatewayService":"all"]}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||"").replace(/{serviceId}/gi,((I=i.config)==null?void 0:I.serviceId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"").replace(/{serviceId}/gi,((H=i.config)==null?void 0:H.serviceId)||"")),S}),x=e.ref(""),t=e.computed(()=>{const S=i.config.app==="konnect"||i.config.isExactMatch;if(S)return{isExactMatch:S,placeholder:c(`search.placeholder.${i.config.isExactMatch?"exact":i.config.app}`)};const{name:C,protocols:I,hosts:O,methods:H,paths:J,expression:le}=W,g={name:C,protocols:I,hosts:O,methods:H,paths:J,...i.hasExpressionColumn&&{expression:le}};return{isExactMatch:S,fields:g,schema:i.config.filterSchema}}),{fetcher:L,fetcherState:re,fetcherCacheKey:ie}=y.useFetcher({...i.config,cacheIdentifier:i.cacheIdentifier},P.value),A=S=>S.headerKey==="expression"?{style:{maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}}:{},Ce=()=>{x.value=""},ke=()=>{ie.value++},ae=e.ref(null),ye=(S,C)=>{const I=S.id;if(!C(I)){h("copy:error",{entity:S,field:"id",message:c("errors.copy")});return}h("copy:success",{entity:S,field:"id",message:c("copy.success",{val:I})})},de=(S,C)=>{const I=JSON.stringify(S);if(!C(I)){h("copy:error",{entity:S,message:c("errors.copy")});return}h("copy:success",{entity:S,message:c("copy.success_brief")})},he=async S=>{var I;await((I=i.canRetrieve)==null?void 0:I.call(i,S))&&p.push(i.config.getViewRoute(S.id))},Ee=S=>({label:c("actions.view"),to:i.config.getViewRoute(S)}),Se=S=>({label:c("actions.edit"),to:i.config.getEditRoute(S)}),Q=e.ref(void 0),ce=e.ref(!1),pe=e.ref(!1),be=e.ref(""),$=y.useDeleteUrlBuilder(i.config,P.value),Z=S=>{Q.value=S,ce.value=!0},Ne=()=>{ce.value=!1},Y=async()=>{var S,C,I;if((S=Q.value)!=null&&S.id){pe.value=!0;try{await u.delete($(Q.value.id)),pe.value=!1,ce.value=!1,ie.value++,h("delete:success",Q.value)}catch(O){be.value=((I=(C=O.response)==null?void 0:C.data)==null?void 0:I.message)||O.message||c("errors.delete"),h("error",O)}finally{pe.value=!1}}},Te=()=>{p.push(i.config.createRoute)};e.watch(re,S=>{var C,I,O;if(S.status===y.FetcherStatus.Error){ae.value={title:c("errors.general")},(O=(I=(C=S.error)==null?void 0:C.response)==null?void 0:I.data)!=null&&O.message&&(ae.value.message=S.error.response.data.message),h("error",S.error);return}ae.value=null});const q=e.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${c("routes.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:c("routes.title")});return e.onBeforeMount(async()=>{await i.canCreate()&&(q.value.title=c("routes.list.empty_state.title"),q.value.ctaText=c("actions.create"))}),(S,C)=>{const I=e.resolveComponent("KButton"),O=e.resolveComponent("KBadge"),H=e.resolveComponent("KTruncate"),J=e.resolveComponent("KDropdownItem"),le=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.unref(y.EntityBaseTable),{"cache-identifier":s.cacheIdentifier,"cell-attributes":A,"default-table-preferences":E,"disable-sorting":D.value,"empty-state-options":q.value,"enable-entity-actions":"","error-message":ae.value,fetcher:e.unref(L),"fetcher-cache-key":e.unref(ie),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-routes-list",query:x.value,"table-headers":e.unref(_),title:s.title,"title-tag":s.titleTag,onClearSearchInput:Ce,"onClick:row":C[8]||(C[8]=g=>he(g)),onSort:ke,onState:e.unref(b)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(y.EntityFilter),{modelValue:x.value,"onUpdate:modelValue":C[0]||(C[0]=g=>x.value=g),config:t.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!s.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",Le,[!a.value&&B.value?(e.openBlock(),e.createBlock(I,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"routes-learn-more-button",icon:"",onClick:C[1]||(C[1]=g=>S.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(y.PermissionsWrapper),{"auth-function":()=>s.canCreate()},{default:e.withCtx(()=>[e.createVNode(I,{appearance:"primary","data-testid":"toolbar-add-route",size:s.useActionOutside?"medium":"large",to:s.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(z.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(c)("routes.list.toolbar_actions.new_route")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),name:e.withCtx(({rowValue:g})=>[e.createElementVNode("b",null,e.toDisplayString(g??"-"),1)]),protocols:e.withCtx(({rowValue:g})=>[e.createVNode(H,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createBlock(O,{key:w,appearance:"neutral",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1024))),128))]),_:2},1024)]),hosts:e.withCtx(({rowValue:g})=>[(g==null?void 0:g.length)>0?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createBlock(O,{key:w,appearance:"neutral",tooltip:w,"truncation-tooltip":"",onClick:C[5]||(C[5]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1032,["tooltip"]))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ke,"-"))]),methods:e.withCtx(({rowValue:g})=>[(g==null?void 0:g.length)>0?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createBlock(O,{key:w,appearance:Object.values(e.unref(Re.BadgeMethodAppearances)).includes(w.toLowerCase())?w.toLowerCase():"custom",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1032,["appearance"]))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ge,"-"))]),paths:e.withCtx(({rowValue:g})=>[(g==null?void 0:g.length)>0?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createBlock(O,{key:w,appearance:"neutral",tooltip:w,"truncation-tooltip":"",onClick:C[7]||(C[7]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1032,["tooltip"]))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",je,"-"))]),tags:e.withCtx(({rowValue:g})=>[e.createVNode(e.unref(y.TableTags),{tags:g},null,8,["tags"])]),expression:e.withCtx(({rowValue:g})=>[e.createElementVNode("span",We,e.toDisplayString(g||"-"),1)]),created_at:e.withCtx(({rowValue:g})=>[e.createTextVNode(e.toDisplayString(e.unref(n)(g)),1)]),updated_at:e.withCtx(({row:g,rowValue:w})=>[e.createTextVNode(e.toDisplayString(e.unref(n)(w??g.created_at)),1)]),actions:e.withCtx(({row:g})=>[e.createVNode(le,null,{default:e.withCtx(({copyToClipboard:w})=>[e.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:se=>ye(g,w)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(le,null,{default:e.withCtx(({copyToClipboard:w})=>[e.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:se=>de(g,w)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(y.PermissionsWrapper),{"auth-function":()=>s.canRetrieve(g)},{default:e.withCtx(()=>[e.createVNode(J,{"data-testid":"action-entity-view","has-divider":"",item:Ee(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(y.PermissionsWrapper),{"auth-function":()=>s.canEdit(g)},{default:e.withCtx(()=>[e.createVNode(J,{"data-testid":"action-entity-edit",item:Se(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(y.PermissionsWrapper),{"auth-function":()=>s.canDelete(g)},{default:e.withCtx(()=>[e.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:w=>Z(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!e.unref(V)&&f.value?{name:"outside-actions",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!s.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(I,{appearance:"secondary",class:"open-learning-hub","data-testid":"routes-learn-more-button",icon:"",onClick:C[2]||(C[2]=g=>S.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.BookIcon),{decorative:""})]),_:1})],8,["disabled"]))]),key:"0"}:void 0,s.enableV2EmptyStates&&s.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>[e.createVNode(e.unref(y.EntityEmptyState),{"action-button-text":e.unref(c)("routes.list.toolbar_actions.new_route"),appearance:"secondary","can-create":()=>s.canCreate(),description:e.unref(c)("routes.list.empty_state_v2.description"),"learn-more":s.config.app==="konnect",title:e.unref(c)("routes.list.empty_state_v2.title"),"onClick:create":Te,"onClick:learnMore":C[3]||(C[3]=g=>S.$emit("click:learn-more"))},{image:e.withCtx(()=>[e.createElementVNode("div",qe,[e.createVNode(e.unref(z.ForwardIcon),{color:e.unref(He),size:e.unref(Ue)},null,8,["color","size"])])]),_:1},8,["action-button-text","can-create","description","learn-more","title"])]),key:"1"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","title","title-tag","onState"]),e.createVNode(e.unref(y.EntityDeleteModal),{"action-pending":pe.value,description:e.unref(c)("delete.description"),"entity-name":Q.value&&(Q.value.name||Q.value.id),"entity-type":e.unref(y.EntityTypes).Route,error:be.value,title:e.unref(c)("delete.title"),visible:ce.value,onCancel:Ne,onProceed:Y},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),G=(s,N)=>{const h=s.__vccOpts||s;for(const[i,c]of N)h[i]=c;return h},ze=G(Xe,[["__scopeId","data-v-8a68dd63"]]);var De=(s=>(s.GET="GET",s.PUT="PUT",s.POST="POST",s.PATCH="PATCH",s.DELETE="DELETE",s.OPTIONS="OPTIONS",s.HEAD="HEAD",s.CONNECT="CONNECT",s.TRACE="TRACE",s.CUSTOM="CUSTOM",s))(De||{}),T=(s=>(s.TRADITIONAL="traditional",s.EXPRESSIONS="expressions",s))(T||{}),l=(s=>(s.PATHS="paths",s.SNIS="snis",s.HOSTS="hosts",s.METHODS="methods",s.HEADERS="headers",s.SOURCES="sources",s.DESTINATIONS="destinations",s.CUSTOM_METHOD="custom-method",s))(l||{}),te=(s=>(s.LOADING="loading",s.ERROR="error",s.READY="ready",s))(te||{});const j=s=>s.routeFlavors.traditional===!0,ue=s=>s.routeFlavors.expressions===!0,Je={class:"routing-rules-entities-controls-container"},oe=G(e.defineComponent({__name:"RoutingRulesEntitiesControls",props:{routingRulesEntity:{type:String,required:!0},isAddDisabled:{type:Boolean,default:!1}},emits:["remove","add"],setup(s){return(N,h)=>{const i=e.resolveComponent("KButton");return e.openBlock(),e.createElementBlock("div",Je,[e.createVNode(i,{appearance:"tertiary",class:"remove-button","data-testid":`remove-${s.routingRulesEntity}`,icon:"",onClick:h[0]||(h[0]=c=>N.$emit("remove"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.TrashIcon),{color:e.unref(Ae)},null,8,["color"])]),_:1},8,["data-testid"]),e.createVNode(i,{appearance:"tertiary","data-testid":`add-${s.routingRulesEntity}`,disabled:s.isAddDisabled,icon:"",onClick:h[1]||(h[1]=c=>N.$emit("add"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.AddIcon))]),_:1},8,["data-testid","disabled"])])}}}),[["__scopeId","data-v-e024298d"]]),Qe={class:"routing-rule-container"},Ye=G(e.defineComponent({__name:"RouteFormDestinationsFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",Qe,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.destinations.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.destinations.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f].ip,"onUpdate:modelValue":a=>n.value[f].ip=a,modelModifiers:{trim:!0},"data-testid":`route-form-destinations-ip-input-${f+1}`,placeholder:e.unref(c)("form.fields.destinations.ip.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(V,{modelValue:n.value[f].port,"onUpdate:modelValue":a=>n.value[f].port=a,modelModifiers:{number:!0},"data-testid":`route-form-destinations-port-input-${f+1}`,max:"65535",min:"0",placeholder:e.unref(c)("form.fields.destinations.port.placeholder"),type:"number"},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).DESTINATIONS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-d41b39fd"]]),Ze={class:"routing-rule-container"},ve=G(e.defineComponent({__name:"RouteFormHeadersFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",Ze,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.headers.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.headers.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f].header,"onUpdate:modelValue":a=>n.value[f].header=a,modelModifiers:{trim:!0},"data-testid":`route-form-headers-name-input-${f+1}`,placeholder:e.unref(c)("form.fields.headers.name.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(V,{modelValue:n.value[f].values,"onUpdate:modelValue":a=>n.value[f].values=a,modelModifiers:{trim:!0},"data-testid":`route-form-headers-values-input-${f+1}`,placeholder:e.unref(c)("form.fields.headers.values.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).HEADERS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-ca0bb10b"]]),et={class:"routing-rule-container"},tt=G(e.defineComponent({__name:"RouteFormHostsFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",et,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.hosts.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.hosts.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f],"onUpdate:modelValue":a=>n.value[f]=a,modelModifiers:{trim:!0},"data-testid":`route-form-hosts-input-${f+1}`,placeholder:e.unref(c)("form.fields.hosts.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).HOSTS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-88d16377"]]),ot={class:"routing-rule-container"},rt={class:"routing-rule-input"},lt={class:"methods-input-container"},st={key:0,class:"routing-rule-container"},nt=G(e.defineComponent({__name:"RouteFormMethodsFields",props:{modelValue:{type:Object,required:!0},customMethods:{type:Array,required:!0}},emits:["add","remove","update:modelValue","update-custom-methods"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref({}),p=e.ref([...h.customMethods]),u=b=>{p.value.length===1?p.value[0]="":p.value.splice(b,1)};return e.watch(h.modelValue,b=>{n.value={...b}},{immediate:!0,deep:!0}),e.watch(n,b=>{i("update:modelValue",b)},{deep:!0}),e.watch(p,b=>{i("update-custom-methods",b)},{deep:!0}),(b,V)=>{const B=e.resolveComponent("KLabel"),f=e.resolveComponent("KInputSwitch"),a=e.resolveComponent("KBadge"),D=e.resolveComponent("KButton"),W=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",ot,[V[2]||(V[2]=e.createElementVNode("hr",null,null,-1)),e.createVNode(B,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.methods.label")),1)]),_:1}),e.createElementVNode("div",rt,[e.createElementVNode("div",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(n.value),E=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"methods-input"},[e.createVNode(f,{modelValue:n.value[E],"onUpdate:modelValue":_=>n.value[E]=_,"data-testid":`${E.toLowerCase()}-method-toggle`},null,8,["modelValue","onUpdate:modelValue","data-testid"]),e.createVNode(a,{appearance:Object.values(e.unref(Re.BadgeMethodAppearances)).includes(E.toLowerCase())?E.toLowerCase():"custom"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E.toLowerCase()),1)]),_:2},1032,["appearance"])]))),128))]),e.createVNode(D,{appearance:"tertiary",class:"remove-button","data-testid":"remove-methods",icon:"",onClick:V[0]||(V[0]=E=>b.$emit("remove"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.TrashIcon),{color:e.unref(Ae)},null,8,["color"])]),_:1})]),n.value.CUSTOM?(e.openBlock(),e.createElementBlock("div",st,[e.createVNode(B,{info:e.unref(c)("form.fields.methods.custom.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.methods.custom.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(E,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:"routing-rule-input"},[e.createVNode(W,{modelValue:p.value[_],"onUpdate:modelValue":P=>p.value[_]=P,modelModifiers:{trim:!0},"data-testid":`route-form-custom-method-input-${_+1}`,placeholder:e.unref(c)("form.fields.methods.custom.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":_!==p.value.length-1,"routing-rules-entity":e.unref(l).CUSTOM_METHOD,onAdd:V[1]||(V[1]=P=>p.value.push("")),onRemove:P=>u(_)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-c8ae1bc5"]]),it={class:"routing-rule-container"},at=G(e.defineComponent({__name:"RouteFormPathsFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",it,[e.createVNode(b,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.paths.label")),1)]),_:1}),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f],"onUpdate:modelValue":a=>n.value[f]=a,modelModifiers:{trim:!0},"data-testid":`route-form-paths-input-${f+1}`,placeholder:e.unref(c)("form.fields.paths.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).PATHS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-bc31ca96"]]),dt={class:"routing-rule-container"},ct=G(e.defineComponent({__name:"RouteFormSnisFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",dt,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.snis.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.snis.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f],"onUpdate:modelValue":a=>n.value[f]=a,modelModifiers:{trim:!0},"data-testid":`route-form-snis-input-${f+1}`,placeholder:e.unref(c)("form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).SNIS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-c3679dd9"]]),pt={class:"routing-rule-container"},ft=G(e.defineComponent({__name:"RouteFormSourcesFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",pt,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.sources.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.sources.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f].ip,"onUpdate:modelValue":a=>n.value[f].ip=a,modelModifiers:{trim:!0},"data-testid":`route-form-sources-ip-input-${f+1}`,placeholder:e.unref(c)("form.fields.sources.ip.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(V,{modelValue:n.value[f].port,"onUpdate:modelValue":a=>n.value[f].port=a,modelModifiers:{number:!0},"data-testid":`route-form-sources-port-input-${f+1}`,max:"65535",min:"0",placeholder:e.unref(c)("form.fields.sources.port.placeholder"),type:"number"},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).SOURCES,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-50c52494"]]),mt=G(e.defineComponent({__name:"RouteFormConfigTabs",props:e.mergeModels({routeFlavors:{},tooltips:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const N=e.useModel(s,"modelValue"),h=s,{i18n:{t:i}}=xe(),c=e.computed(()=>[...h.routeFlavors.traditional?[{hash:`#${T.TRADITIONAL}`,title:i("form.flavors.traditional")}]:[],...h.routeFlavors.expressions?[{hash:`#${T.EXPRESSIONS}`,title:i("form.flavors.expressions")}]:[]]);return(n,p)=>{const u=e.resolveComponent("KTooltip"),b=e.resolveComponent("KTabs");return c.value.length>1?(e.openBlock(),e.createBlock(b,{key:0,modelValue:N.value,"onUpdate:modelValue":p[0]||(p[0]=V=>N.value=V),"data-testid":"route-form-config-tabs",tabs:c.value},e.createSlots({_:2},[n.routeFlavors.traditional?{name:`${e.unref(T).TRADITIONAL}-anchor`,fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("form.flavors.traditional"))+" ",1),n.tooltips&&n.tooltips[e.unref(T).TRADITIONAL]?(e.openBlock(),e.createBlock(u,{key:0,class:"route-form-config-tabs-tooltip",text:n.tooltips[e.unref(T).TRADITIONAL],"tooltip-id":"route-form-config-tabs-tooltip-traditional"},{default:e.withCtx(()=>[e.createVNode(e.unref(z.InfoIcon),{color:e.unref(Oe),size:e.unref(Ve),tabindex:"0"},null,8,["color","size"])]),_:1},8,["text"])):e.createCommentVNode("",!0)]),key:"0"}:void 0,n.routeFlavors.traditional?{name:e.unref(T).TRADITIONAL,fn:e.withCtx(()=>[e.renderSlot(n.$slots,"before-content",{},void 0,!0),e.renderSlot(n.$slots,e.unref(T).TRADITIONAL,{},void 0,!0)]),key:"1"}:void 0,n.routeFlavors.expressions?{name:`${e.unref(T).EXPRESSIONS}-anchor`,fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("form.flavors.expressions"))+" ",1),n.tooltips&&n.tooltips[e.unref(T).EXPRESSIONS]?(e.openBlock(),e.createBlock(u,{key:0,class:"route-form-config-tabs-tooltip",text:n.tooltips[e.unref(T).EXPRESSIONS],"tooltip-id":"route-form-config-tabs-tooltip-expressions"},{default:e.withCtx(()=>[e.createVNode(e.unref(z.InfoIcon),{color:e.unref(Oe),size:e.unref(Ve),tabindex:"0"},null,8,["color","size"])]),_:1},8,["text"])):e.createCommentVNode("",!0)]),key:"2"}:void 0,n.routeFlavors.expressions?{name:e.unref(T).EXPRESSIONS,fn:e.withCtx(()=>[e.renderSlot(n.$slots,"before-content",{},void 0,!0),e.renderSlot(n.$slots,e.unref(T).EXPRESSIONS,{},void 0,!0)]),key:"3"}:void 0]),1032,["modelValue","tabs"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(n.$slots,"before-content",{},void 0,!0),n.routeFlavors.traditional?e.renderSlot(n.$slots,e.unref(T).TRADITIONAL,{key:0},void 0,!0):n.routeFlavors.expressions?e.renderSlot(n.$slots,e.unref(T).EXPRESSIONS,{key:1},void 0,!0):e.createCommentVNode("",!0)],64))}}}),[["__scopeId","data-v-f1c7a92f"]]),ut=e.defineComponent({__name:"RouteFormExpressionsEditorLoader",props:e.mergeModels({protocol:{},showExpressionsModalEntry:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["notify"],["update:modelValue"]),setup(s,{emit:N}){const{i18n:{t:h}}=K.useI18n(),i={render:()=>e.h("div",h("form.expressions_editor.loading"))},c={render:()=>e.h("div",h("form.expressions_editor.error"))},n=e.defineAsyncComponent({loader:async()=>Promise.resolve().then(()=>Dt),loadingComponent:i,errorComponent:c}),p=s,u=N,b=e.ref(te.LOADING),V=e.useModel(s,"modelValue"),B=f=>{V.value=f};return e.onMounted(async()=>{try{await(await import("@kong-ui-public/expressions")).asyncInit,b.value=te.READY}catch(f){b.value=te.ERROR,console.error(f)}}),(f,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[b.value===e.unref(te).ERROR?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c),{key:0,"data-testid":"route-form-expressions-editor-loader-error"})):b.value===e.unref(te).LOADING?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i),{key:1,"data-testid":"route-form-expressions-editor-loader-loading"})):(e.openBlock(),e.createBlock(e.unref(n),{key:2,modelValue:V.value,"onUpdate:modelValue":a[0]||(a[0]=D=>V.value=D),"hint-text":e.unref(h)("form.expression_playground.supported_protocols_hint"),protocol:p.protocol,"show-expressions-modal-entry":f.showExpressionsModalEntry,onNotify:a[1]||(a[1]=D=>u("notify",D))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.RocketIcon),{size:e.unref(Ve)},null,8,["size"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(h)("form.expression_playground.test_link")),1)]),_:1},8,["modelValue","hint-text","protocol","show-expressions-modal-entry"])),e.renderSlot(f.$slots,"after-editor",{expression:{value:V.value,update:B},state:b.value})],64))}}),ht={class:"kong-ui-entities-route-form"},gt={key:1},yt={"data-testid":"no-search-results"},St={class:"route-form-service-dropdown-item"},bt={class:"select-item-label"},Vt={class:"select-item-description"},Ct={class:"route-form-routing-rules-title-container"},kt={class:"routing-rules-title"},Et={key:1,class:"route-form-routing-rules-selector-container"},Nt={class:"route-form-routing-rules-selector-options"},Tt=["aria-disabled","data-testid","onClick"],_t={class:"route-form-fields-container route-form-advanced-fields-container"},wt={class:"route-form-routing-rules-title-container"},It={class:"routing-rules-title"},Rt={class:"route-form-fields-container route-form-advanced-fields-container"},Bt=G(e.defineComponent({__name:"RouteForm",props:{config:{type:Object,required:!0,validator:s=>!(!s||!["konnect","kongManager"].includes(s==null?void 0:s.app)||(s==null?void 0:s.app)==="konnect"&&!(s!=null&&s.controlPlaneId)||(s==null?void 0:s.app)==="kongManager"&&typeof(s==null?void 0:s.workspace)!="string"||!(s!=null&&s.cancelRoute))},routeId:{type:String,required:!1,default:""},serviceId:{type:String,required:!1,default:""},hideSectionsInfo:{type:Boolean,required:!1,default:!1},hideNameField:{type:Boolean,required:!1,default:!1},hideServiceField:{type:Boolean,required:!1,default:!1},showTagsFiledUnderAdvanced:{type:Boolean,required:!1,default:!1},routeFlavors:{type:Object,required:!1,default:()=>({traditional:!0})},configTabTooltips:{type:Object,required:!1,default:()=>{}},showExpressionsModalEntry:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading","model-updated","notify"],setup(s,{expose:N,emit:h}){var $e;const i=s,c=h,n=e.ref(i.routeFlavors.traditional?`#${T.TRADITIONAL}`:i.routeFlavors.expressions?`#${T.EXPRESSIONS}`:""),p=e.computed(()=>{if(n.value)return n.value.substring(1)}),u=e.ref(void 0),b=e.ref(!0),V=e.computed(()=>{if(u.value)return u.value;if(p.value)return p.value;if(i.routeFlavors.traditional)return T.TRADITIONAL;if(i.routeFlavors.expressions)return T.EXPRESSIONS}),{i18nT:B,i18n:f,i18n:{t:a}}=K.useI18n(),D=f.source.form.protocols,W=Ie.useRouter(),{axiosInstance:E}=y.useAxios(($e=i.config)==null?void 0:$e.axiosRequestConfig),{getMessageFromError:_}=y.useErrors(),P=e.computed(()=>!(i.hideNameField&&(i.hideServiceField||i.serviceId)&&i.showTagsFiledUnderAdvanced)),x=o=>o.name?`${o.name} - ${o.value}`:o.value,t=e.reactive({routeFlavors:i.routeFlavors,fields:{name:"",protocols:"http,https",https_redirect_status_code:426,strip_path:!0,preserve_host:!1,request_buffering:!0,response_buffering:!0,tags:"",service_id:"",...!i.routeId&&{paths:[""]},regex_priority:0,path_handling:"v0",expression:"",priority:0},isReadonly:!1,errorMessage:""});e.watch(()=>i.routeFlavors,o=>{t.routeFlavors=o});const L=e.computed(()=>t.fields.protocols.split(",")[0]),re=e.ref([""]),ie=e.reactive({name:"",protocols:"http,https",https_redirect_status_code:426,strip_path:!0,preserve_host:!1,request_buffering:!0,response_buffering:!0,tags:"",service_id:"",path_handling:"v0",regex_priority:0,expression:"",priority:0}),A={[l.PATHS]:[""],[l.SNIS]:[""],[l.HOSTS]:[""],[l.METHODS]:{GET:!1,PUT:!1,POST:!1,PATCH:!1,DELETE:!1,OPTIONS:!1,HEAD:!1,CONNECT:!1,TRACE:!1,CUSTOM:!1},[l.HEADERS]:[{header:"",values:""}],[l.SOURCES]:[{ip:"",port:null}],[l.DESTINATIONS]:[{ip:"",port:null}]},Ce=i.config.app==="konnect"||y.useGatewayFeatureSupported({gatewayInfo:i.config.gatewayInfo,supportedRange:{enterprise:["3.0"]}}),ke=[{label:a("form.protocols.grpc"),value:"grpc"},{label:a("form.protocols.grpcs"),value:"grpcs"},{label:a("form.protocols.grpc,grpcs"),value:"grpc,grpcs"},{label:a("form.protocols.http"),value:"http"},{label:a("form.protocols.https"),value:"https"},{label:a("form.protocols.http,https"),value:"http,https"},{label:a("form.protocols.tcp"),value:"tcp"},{label:a("form.protocols.tls"),value:"tls"},{label:a("form.protocols.tls,udp"),value:"tls,udp"},{label:a("form.protocols.tcp,udp"),value:"tcp,udp"},{label:a("form.protocols.tcp,tls"),value:"tcp,tls"},{label:a("form.protocols.tcp,tls,udp"),value:"tcp,tls,udp"},{label:a("form.protocols.tls_passthrough"),value:"tls_passthrough"},{label:a("form.protocols.udp"),value:"udp"},...Ce?[{label:a("form.protocols.ws"),value:"ws"},{label:a("form.protocols.wss"),value:"wss"},{label:a("form.protocols.ws,wss"),value:"ws,wss"}]:[]],ae=[{label:"v0",value:"v0"},{label:"v1",value:"v1"}],ye=[{label:"426",value:426},{label:"301",value:301},{label:"302",value:302},{label:"307",value:307},{label:"308",value:308}],de={http:[l.HOSTS,l.METHODS,l.PATHS,l.HEADERS],https:[l.HOSTS,l.METHODS,l.PATHS,l.HEADERS,l.SNIS],"http,https":[l.HOSTS,l.METHODS,l.PATHS,l.HEADERS,l.SNIS],"https,http":[l.HOSTS,l.METHODS,l.PATHS,l.HEADERS,l.SNIS],grpc:[l.HOSTS,l.PATHS,l.HEADERS],grpcs:[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],"grpc,grpcs":[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],"grpcs,grpc":[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],udp:[l.SOURCES,l.DESTINATIONS],tls:[l.SOURCES,l.DESTINATIONS,l.SNIS],tcp:[l.SOURCES,l.DESTINATIONS],"tls,udp":[l.SOURCES,l.DESTINATIONS,l.SNIS],"udp,tls":[l.SOURCES,l.DESTINATIONS,l.SNIS],"tcp,udp":[l.SOURCES,l.DESTINATIONS],"udp,tcp":[l.SOURCES,l.DESTINATIONS],"tcp,tls":[l.SOURCES,l.DESTINATIONS,l.SNIS],"tls,tcp":[l.SOURCES,l.DESTINATIONS,l.SNIS],"tcp,tls,udp":[l.SOURCES,l.DESTINATIONS,l.SNIS],"tls,udp,tcp":[l.SOURCES,l.DESTINATIONS,l.SNIS],"udp,tcp,tls":[l.SOURCES,l.DESTINATIONS,l.SNIS],tls_passthrough:[l.SNIS],ws:[l.HOSTS,l.PATHS,l.HEADERS],wss:[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],"ws,wss":[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],"wss,ws":[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS]},he=e.computed(()=>i.routeId?y.EntityBaseFormType.Edit:y.EntityBaseFormType.Create),Ee=e.computed(()=>{var o,r,m;return(m=(r=ne.form[(o=i.config)==null?void 0:o.app])==null?void 0:r.fetch)==null?void 0:m[i.serviceId?"forGatewayService":"all"].replace(/{serviceId}/gi,i.serviceId||"")}),Se=()=>{var o;W.push((o=i.config)==null?void 0:o.cancelRoute)},Q=o=>{c("loading",o)},ce=o=>{c("error",o)},pe=o=>{j(t)&&(t.fields.methods=A[l.METHODS],o.forEach(r=>{t.fields.methods&&(t.fields.methods[r]=!0)}))},be=o=>Object.entries(o).map(r=>{var m;return{header:r[0],values:(m=r[1])==null?void 0:m.join()}}),$=o=>o.some(r=>t.fields.protocols.includes(r)),Z=(o,r)=>{if(o===l.PATHS||o===l.HOSTS||o===l.SNIS)return[...r].filter(m=>!!m);if(o===l.SOURCES||o===l.DESTINATIONS)return[...r].filter(m=>!!m.ip).map(m=>({...m,port:!m.port&&m.port!==0?null:m.port}));if(o===l.HEADERS)return[...r].filter(m=>!!m.header)},Ne=()=>{if(j(t)){const o=Z(l.HEADERS,t.fields.headers||[])||A[l.HEADERS];if(o.length===0)return null;const r={};return o.forEach(m=>{r[m.header]=m.values.split(",")}),r}return null},Y=o=>{j(t)&&(o&&o===l.PATHS&&(t.fields.paths?t.fields.paths.push([...A[l.PATHS]][0]):t.fields.paths=[...A[l.PATHS]]),o===l.SNIS&&(t.fields.snis?t.fields.snis.push([...A[l.SNIS]][0]):t.fields.snis=[...A[l.SNIS]]),o===l.HOSTS&&(t.fields.hosts?t.fields.hosts.push([...A[l.HOSTS]][0]):t.fields.hosts=[...A[l.HOSTS]]),o===l.METHODS&&(t.fields.methods||(t.fields.methods={...A[l.METHODS]})),o===l.HEADERS&&(t.fields.headers?t.fields.headers.push({...A[l.HEADERS][0]}):t.fields.headers=[{...A[l.HEADERS][0]}]),o===l.SOURCES&&(t.fields.sources?t.fields.sources.push({...A[l.SOURCES][0]}):t.fields.sources=[{...A[l.SOURCES][0]}]),o===l.DESTINATIONS&&(t.fields.destinations?t.fields.destinations.push({...A[l.DESTINATIONS][0]}):t.fields.destinations=[{...A[l.DESTINATIONS][0]}]))},Te=e.computed(()=>{var o;return j(t)?(o=de[t.fields.protocols])==null?void 0:o.filter(r=>!t.fields[r]):!1}),q=async(o,r)=>{if(j(t)){if(typeof r<"u"){let m=[];if(m=t.fields[o],m.splice(r,1),m.length){t.fields[o]=m;return}}await e.nextTick(()=>{delete t.fields[o],o===l.METHODS&&(re.value=[""])})}},fe=o=>{var m;return((m=f.source.form.fields[o])==null?void 0:m.label)||""};e.watch(()=>t.fields.protocols,()=>{S()});const S=()=>{const o=Object.keys(A),r=de[t.fields.protocols];Object.keys(t.fields).filter(k=>o.includes(k)).forEach(k=>{r!=null&&r.includes(k)||q(k)})},C=e.computed(()=>{if(j(t)){const o=[];return t.fields.methods&&Object.entries(t.fields.methods).forEach(([r,m])=>{m&&o.push(r)}),o}return[]}),I=e.computed(()=>{var o;return((o=t.fields.protocols)==null?void 0:o.split(","))||[]}),O=e.computed(()=>{const o=Object.keys(A);return!Object.keys(t.fields).filter(m=>o.includes(m)).length}),H=e.computed(()=>{if($(["tls_passthrough"]))return[fe(l.SNIS)];const o=de[t.fields.protocols].map(r=>fe(r));return[[...o].splice(0,o.length-1).join(", "),o[o.length-1]]}),J=o=>{var m,k;if(i.routeId){const F=typeof o.expression=="string"&&o.expression.length>0?T.EXPRESSIONS:T.TRADITIONAL;u.value=F,n.value=`#${F}`}(m=o==null?void 0:o.service)!=null&&m.id&&(t.fields.service_id=o.service.id),t.fields.name=(o==null?void 0:o.name)||"";const r=(o==null?void 0:o.tags)||[];t.fields.tags=(r==null?void 0:r.join(", "))||"",t.fields.preserve_host=typeof(o==null?void 0:o.preserve_host)>"u"?!1:o==null?void 0:o.preserve_host,t.fields.https_redirect_status_code=(o==null?void 0:o.https_redirect_status_code)||426,(k=o==null?void 0:o.protocols)!=null&&k.length&&(o.protocols.length>1?t.fields.protocols=o.protocols.join():t.fields.protocols=o.protocols[0]),t.fields.request_buffering=typeof(o==null?void 0:o.request_buffering)>"u"?!0:o==null?void 0:o.request_buffering,t.fields.response_buffering=typeof(o==null?void 0:o.response_buffering)>"u"?!0:o==null?void 0:o.response_buffering,t.fields.strip_path=typeof(o==null?void 0:o.strip_path)>"u"?!0:o==null?void 0:o.strip_path,j(t)&&(t.fields.regex_priority=(o==null?void 0:o.regex_priority)||0,t.fields.path_handling=(o==null?void 0:o.path_handling)||"v0",o!=null&&o.paths&&(t.fields.paths=o.paths),o!=null&&o.snis&&(t.fields.snis=o.snis),o!=null&&o.hosts&&(t.fields.hosts=o.hosts),o!=null&&o.methods&&pe(o.methods),o!=null&&o.headers&&(t.fields.headers=be(o.headers)),o!=null&&o.sources&&(t.fields.sources=o.sources),o!=null&&o.destinations&&(t.fields.destinations=o.destinations)),ue(t)&&(t.fields.expression=(o==null?void 0:o.expression)||"",t.fields.priority=(o==null?void 0:o.priority)||0),Object.assign(ie,JSON.parse(JSON.stringify(t.fields)))},le=e.computed(()=>{var o;switch(V.value){case T.TRADITIONAL:{if(j(t)){const r=t.fields.hosts?!!t.fields.hosts.filter(Boolean).length:null,m=t.fields.paths?!!t.fields.paths.filter(Boolean).length:null,k=t.fields.headers?t.fields.headers.some(({header:ee})=>!!ee):null,F=t.fields.snis?!!t.fields.snis.filter(Boolean).length:null,v=t.fields.destinations?t.fields.destinations.some(({ip:ee})=>!!ee):null,X=t.fields.sources?t.fields.sources.some(({ip:ee})=>!!ee):null,d=((o=t.fields.methods)==null?void 0:o.CUSTOM)?re.value.some(ee=>!!ee):Object.values(t.fields.methods||{}).includes(!0);return!!t.fields.protocols&&($(["http"])&&!!(r||d||m||k)||$(["https"])&&!!(r||d||m||k||F)||$(["grpc"])&&!!(r||m||k)||$(["grpcs","wss"])&&!!(r||m||k||F)||$(["udp","tls"])&&!!(v||X||F)||$(["tcp"])&&!!(v||X)||$(["tls_passthrough"])&&!!F||$(["ws"])&&!!(r||m||k))}break}case T.EXPRESSIONS:{if(ue(t))return t.fields.expression.length>0;break}}return!0}),g=e.computed(()=>!Fe(t.fields,ie)),w=e.computed(()=>{var r,m;let o=`${i.config.apiBaseUrl}${ne.form[i.config.app][he.value][i.serviceId?"forGatewayService":"all"]}`;return i.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((r=i.config)==null?void 0:r.controlPlaneId)||"").replace(/{serviceId}/gi,i.serviceId||""):i.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(m=i.config)!=null&&m.workspace?`/${i.config.workspace}`:"").replace(/{serviceId}/gi,i.serviceId||"")),o=o.replace(/{id}/gi,i.routeId),o});e.watch(()=>t.fields,()=>{c("model-updated",ge.value)},{deep:!0});const se=o=>o!=null&&o.length?o:null,$t=()=>{var o,r;if(j(t)){const m={methods:null,hosts:se(Z(l.HOSTS,t.fields.hosts||[])),paths:se(Z(l.PATHS,t.fields.paths||[])),headers:Ne(),regex_priority:Number(t.fields.regex_priority),path_handling:t.fields.path_handling,sources:se(Z(l.SOURCES,t.fields.sources||[])),destinations:se(Z(l.DESTINATIONS,t.fields.destinations||[])),snis:se(Z(l.SNIS,t.fields.snis||[]))};if((o=C.value)!=null&&o.length&&(m.methods=[...C.value],(r=C.value)!=null&&r.includes("CUSTOM"))){const k=m.methods.indexOf("CUSTOM");k!==-1&&m.methods.splice(k,1),re.value.forEach(F=>{var v;F&&m.methods&&!((v=m.methods)!=null&&v.includes(F))&&m.methods.push(F.toUpperCase())})}return m}},Ft=()=>{if(ue(t))return{expression:t.fields.expression,priority:Number(t.fields.priority)}},ge=e.computed(()=>{var r,m;const o={...!i.hideNameField&&{name:t.fields.name||null},protocols:t.fields.protocols.split(","),https_redirect_status_code:t.fields.https_redirect_status_code,strip_path:$(["grpc","gprcs"])?!1:t.fields.strip_path,preserve_host:t.fields.preserve_host,request_buffering:t.fields.request_buffering,response_buffering:t.fields.response_buffering,tags:(m=(r=t.fields.tags.split(","))==null?void 0:r.map(k=>String(k||"").trim()))==null?void 0:m.filter(k=>k!==""),service:t.fields.service_id?{id:t.fields.service_id}:null};switch(V.value){case T.TRADITIONAL:return{...o,...$t()};case T.EXPRESSIONS:return{...o,...Ft()};default:return o}}),Pt=o=>{switch(V.value){case T.TRADITIONAL:{if(!("regex_priority"in o&&"path_handling"in o))return!1;break}case T.EXPRESSIONS:{if(!("priority"in o))return!1;break}}return"service"in o&&"tags"in o&&"protocols"in o},_e=async o=>{var m;const r=o&&Pt(o)?o:ge.value;try{t.isReadonly=!0;let k;he.value==="create"?k=await E.post(w.value,r):he.value==="edit"&&(k=((m=i.config)==null?void 0:m.app)==="konnect"?await E.put(w.value,r):await E.patch(w.value,r)),J(k==null?void 0:k.data),c("update",k==null?void 0:k.data)}catch(k){t.errorMessage=_(k),c("error",k)}finally{t.isReadonly=!1}},{debouncedQueryChange:Ht,loading:Ut,error:Mt,loadItems:Lt,results:qt}=y.useDebouncedFilter(i.config,ne.form[i.config.app].services,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),Kt=e.computed(()=>Mt.value?a("errors.services.fetch"):""),Gt=e.computed(()=>{var o;return(o=qt.value)==null?void 0:o.map(r=>({label:r.id,name:r.name,value:r.id}))});return e.onBeforeMount(async()=>{!i.hideServiceField&&!i.serviceId?await Lt():t.fields.service_id=i.serviceId}),e.onMounted(()=>{c("model-updated",ge.value)}),N({saveFormData:_e,getPayload:ge}),(o,r)=>{const m=e.resolveComponent("KInput"),k=e.resolveComponent("KSelect"),F=e.resolveComponent("KAlert"),v=e.resolveComponent("KCard"),X=e.resolveComponent("KCheckbox"),we=e.resolveComponent("KCollapse");return e.openBlock(),e.createElementBlock("div",ht,[e.createVNode(e.unref(y.EntityBaseForm),{"can-submit":le.value&&g.value,config:s.config,"edit-id":s.routeId,"entity-type":e.unref(y.SupportedEntityType).Route,"error-message":t.errorMessage||Kt.value,"fetch-url":Ee.value,"form-fields":ge.value,"is-readonly":t.isReadonly,onCancel:Se,"onFetch:error":ce,"onFetch:success":J,onLoading:Q,onSubmit:_e},{"form-actions":e.withCtx(()=>[e.renderSlot(o.$slots,"form-actions",{canSubmit:le.value&&g.value,cancel:Se,submit:_e},void 0,!0)]),default:e.withCtx(()=>[P.value?(e.openBlock(),e.createBlock(e.unref(y.EntityFormSection),{key:0,description:e.unref(a)("form.sections.general.description"),"hide-info-header":s.hideSectionsInfo,title:e.unref(a)("form.sections.general.title")},{default:e.withCtx(()=>[s.hideNameField?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0,modelValue:t.fields.name,"onUpdate:modelValue":r[0]||(r[0]=d=>t.fields.name=d),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"route-form-name",label:e.unref(a)("form.fields.name.label"),placeholder:e.unref(a)("form.fields.name.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"])),!s.hideServiceField&&!s.serviceId?(e.openBlock(),e.createElementBlock("div",gt,[e.createVNode(k,{modelValue:t.fields.service_id,"onUpdate:modelValue":r[1]||(r[1]=d=>t.fields.service_id=d),clearable:"","data-testid":"route-form-service-id","enable-filtering":"","filter-function":()=>!0,items:Gt.value,label:e.unref(a)("form.fields.service_id.label"),loading:e.unref(Ut),placeholder:e.unref(a)("form.fields.service_id.placeholder"),readonly:t.isReadonly,"reuse-item-template":"",width:"100%",onQueryChange:e.unref(Ht)},{loading:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(a)("actions.loading")),1)]),empty:e.withCtx(()=>[e.createElementVNode("div",yt,e.toDisplayString(e.unref(a)("search.no_results")),1)]),"selected-item-template":e.withCtx(({item:d})=>[e.createTextVNode(e.toDisplayString(x(d)),1)]),"item-template":e.withCtx(({item:d})=>[e.createElementVNode("div",St,[e.createElementVNode("span",bt,e.toDisplayString(d.name),1),e.createElementVNode("span",Vt,e.toDisplayString(d.value),1)])]),_:1},8,["modelValue","items","label","loading","placeholder","readonly","onQueryChange"])])):e.createCommentVNode("",!0),s.showTagsFiledUnderAdvanced?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:2,modelValue:t.fields.tags,"onUpdate:modelValue":r[2]||(r[2]=d=>t.fields.tags=d),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"route-form-tags",help:e.unref(a)("form.fields.tags.help"),label:e.unref(a)("form.fields.tags.label"),placeholder:e.unref(a)("form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"]))]),_:1},8,["description","hide-info-header","title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y.EntityFormSection),{description:e.unref(a)("form.sections.config.description"),"hide-info-header":s.hideSectionsInfo,title:e.unref(a)("form.sections.config.title")},{default:e.withCtx(()=>[e.createVNode(k,{modelValue:t.fields.protocols,"onUpdate:modelValue":r[3]||(r[3]=d=>t.fields.protocols=d),"data-testid":"route-form-protocols",items:ke,label:e.unref(a)("form.fields.protocols.label"),"label-attributes":{info:e.unref(a)("form.fields.protocols.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:t.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","label-attributes","readonly"]),e.createVNode(mt,{modelValue:n.value,"onUpdate:modelValue":r[44]||(r[44]=d=>n.value=d),"route-flavors":s.routeFlavors,tooltips:s.configTabTooltips},e.createSlots({_:2},[s.routeFlavors.traditional&&s.routeFlavors.expressions&&(!u.value||u.value!==p.value)?{name:"before-content",fn:e.withCtx(()=>[e.createVNode(F,{appearance:u.value?"warning":"info",class:"route-form-config-type-immutable-alert","data-testid":"route-config-type-immutable-alert"},{default:e.withCtx(()=>[u.value?u.value!==p.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(a)("form.warning.cannotChangeFlavor.edit",{format:e.unref(a)(`form.flavors.${u.value}`)})),1)],64)):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(a)("form.warning.cannotChangeFlavor.create")),1)],64))]),_:1},8,["appearance"])]),key:"0"}:void 0,e.unref(j)(t)?{name:"traditional",fn:e.withCtx(()=>[!u.value||u.value===e.unref(T).TRADITIONAL?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.fields.protocols?(e.openBlock(),e.createBlock(v,{key:0},{title:e.withCtx(()=>[e.createElementVNode("div",Ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,d=>(e.openBlock(),e.createElementBlock("span",{key:d,class:"protocol-title"},e.toDisplayString(d.toUpperCase()),1))),128)),e.createElementVNode("span",kt,e.toDisplayString(e.unref(a)("form.sections.routingRules.title")),1)])]),default:e.withCtx(()=>[O.value?(e.openBlock(),e.createBlock(F,{key:0,appearance:"warning","data-testid":"routing-rules-warning"},{default:e.withCtx(()=>[e.createVNode(e.unref(B),{keypath:"form.warning.rulesMessage"},{protocol:e.withCtx(()=>[e.createElementVNode("b",null,e.toDisplayString(e.unref(D)[t.fields.protocols]),1)]),routingRules:e.withCtx(()=>[e.createVNode(e.unref(B),{keypath:H.value[1]?"form.warning.multipleRules":"form.warning.singleRule"},{routingRules:e.withCtx(()=>[e.createElementVNode("b",null,e.toDisplayString(H.value[0]),1)]),lastRoutingRule:e.withCtx(()=>[e.createElementVNode("b",null,e.toDisplayString(H.value[1]),1)]),_:1},8,["keypath"])]),_:1})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[t.fields.paths?(e.openBlock(),e.createBlock(at,{key:"paths-container",modelValue:t.fields.paths,"onUpdate:modelValue":r[4]||(r[4]=d=>t.fields.paths=d),onAdd:r[5]||(r[5]=d=>Y(e.unref(l).PATHS)),onRemove:r[6]||(r[6]=d=>q(e.unref(l).PATHS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.snis?(e.openBlock(),e.createBlock(ct,{key:"snis-container",modelValue:t.fields.snis,"onUpdate:modelValue":r[7]||(r[7]=d=>t.fields.snis=d),onAdd:r[8]||(r[8]=d=>Y(e.unref(l).SNIS)),onRemove:r[9]||(r[9]=d=>q(e.unref(l).SNIS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.hosts?(e.openBlock(),e.createBlock(tt,{key:"hosts-container",modelValue:t.fields.hosts,"onUpdate:modelValue":r[10]||(r[10]=d=>t.fields.hosts=d),onAdd:r[11]||(r[11]=d=>Y(e.unref(l).HOSTS)),onRemove:r[12]||(r[12]=d=>q(e.unref(l).HOSTS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.methods?(e.openBlock(),e.createBlock(nt,{key:"methods-container",modelValue:t.fields.methods,"onUpdate:modelValue":r[13]||(r[13]=d=>t.fields.methods=d),"custom-methods":re.value,onRemove:r[14]||(r[14]=d=>q(e.unref(l).METHODS)),onUpdateCustomMethods:r[15]||(r[15]=d=>re.value=d)},null,8,["modelValue","custom-methods"])):e.createCommentVNode("",!0),t.fields.headers?(e.openBlock(),e.createBlock(ve,{key:"headers-container",modelValue:t.fields.headers,"onUpdate:modelValue":r[16]||(r[16]=d=>t.fields.headers=d),onAdd:r[17]||(r[17]=d=>Y(e.unref(l).HEADERS)),onRemove:r[18]||(r[18]=d=>q(e.unref(l).HEADERS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.sources?(e.openBlock(),e.createBlock(ft,{key:"sources-container",modelValue:t.fields.sources,"onUpdate:modelValue":r[19]||(r[19]=d=>t.fields.sources=d),onAdd:r[20]||(r[20]=d=>Y(e.unref(l).SOURCES)),onRemove:r[21]||(r[21]=d=>q(e.unref(l).SOURCES,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.destinations?(e.openBlock(),e.createBlock(Ye,{key:"destinations-container",modelValue:t.fields.destinations,"onUpdate:modelValue":r[22]||(r[22]=d=>t.fields.destinations=d),onAdd:r[23]||(r[23]=d=>Y(e.unref(l).DESTINATIONS)),onRemove:r[24]||(r[24]=d=>q(e.unref(l).DESTINATIONS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0)]),_:1}),Te.value?(e.openBlock(),e.createElementBlock("div",Et,[r[45]||(r[45]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("div",Nt,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de[t.fields.protocols],d=>(e.openBlock(),e.createElementBlock("li",{key:d},[e.createElementVNode("label",{"aria-disabled":!!t.fields[d],class:e.normalizeClass(["option",{"is-selected":t.fields[d]}]),"data-testid":`routing-rule-${d}`,role:"button",onClick:ee=>Y(d)},e.toDisplayString(fe(d)),11,Tt)]))),128))])])])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createVNode(we,{modelValue:b.value,"onUpdate:modelValue":r[33]||(r[33]=d=>b.value=d),class:"route-form-advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(a)("form.viewAdvancedFields")},{default:e.withCtx(()=>[e.createElementVNode("div",_t,[t.fields.paths?(e.openBlock(),e.createBlock(k,{key:0,modelValue:t.fields.path_handling,"onUpdate:modelValue":r[25]||(r[25]=d=>t.fields.path_handling=d),"data-testid":"route-form-path-handling",items:ae,label:e.unref(a)("form.fields.path_handling.label"),"label-attributes":{info:e.unref(a)("form.fields.path_handling.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:t.isReadonly,width:"100%"},null,8,["modelValue","label","label-attributes","readonly"])):e.createCommentVNode("",!0),e.createVNode(k,{modelValue:t.fields.https_redirect_status_code,"onUpdate:modelValue":r[26]||(r[26]=d=>t.fields.https_redirect_status_code=d),"data-testid":"route-form-http-redirect-status-code",items:ye,label:e.unref(a)("form.fields.https_redirect_status_code.label"),readonly:t.isReadonly,width:"100%"},null,8,["modelValue","label","readonly"]),e.createVNode(m,{modelValue:t.fields.regex_priority,"onUpdate:modelValue":r[27]||(r[27]=d=>t.fields.regex_priority=d),autocomplete:"off","data-testid":"route-form-regex-priority",label:e.unref(a)("form.fields.regex_priority.label"),readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","readonly"]),s.showTagsFiledUnderAdvanced?(e.openBlock(),e.createBlock(m,{key:1,modelValue:t.fields.tags,"onUpdate:modelValue":r[28]||(r[28]=d=>t.fields.tags=d),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"route-form-tags",help:e.unref(a)("form.fields.tags.help"),label:e.unref(a)("form.fields.tags.label"),placeholder:e.unref(a)("form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])):e.createCommentVNode("",!0),$(["http","https","ws","wss","tls","tcp","udp","tls_passthrough"])?(e.openBlock(),e.createBlock(X,{key:2,modelValue:t.fields.strip_path,"onUpdate:modelValue":r[29]||(r[29]=d=>t.fields.strip_path=d),"data-testid":"route-form-strip-path",label:e.unref(a)("form.fields.strip_path.label")},null,8,["modelValue","label"])):e.createCommentVNode("",!0),e.createVNode(X,{modelValue:t.fields.preserve_host,"onUpdate:modelValue":r[30]||(r[30]=d=>t.fields.preserve_host=d),"data-testid":"route-form-preserve-host",label:e.unref(a)("form.fields.preserve_host.label")},null,8,["modelValue","label"]),e.createVNode(X,{modelValue:t.fields.request_buffering,"onUpdate:modelValue":r[31]||(r[31]=d=>t.fields.request_buffering=d),"data-testid":"route-form-request-buffering",label:e.unref(a)("form.fields.request_buffering.label")},null,8,["modelValue","label"]),e.createVNode(X,{modelValue:t.fields.response_buffering,"onUpdate:modelValue":r[32]||(r[32]=d=>t.fields.response_buffering=d),"data-testid":"route-form-response-buffering",label:e.unref(a)("form.fields.response_buffering.label")},null,8,["modelValue","label"])])]),_:1},8,["modelValue","trigger-label"])],64)):e.createCommentVNode("",!0)]),key:"1"}:void 0,e.unref(ue)(t)?{name:"expressions",fn:e.withCtx(()=>[!u.value||u.value===e.unref(T).EXPRESSIONS?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.fields.protocols?(e.openBlock(),e.createBlock(v,{key:0},{title:e.withCtx(()=>[e.createElementVNode("div",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,d=>(e.openBlock(),e.createElementBlock("span",{key:d,class:"protocol-title"},e.toDisplayString(d.toUpperCase()),1))),128)),e.createElementVNode("span",It,e.toDisplayString(e.unref(a)("form.sections.routingExpression.title")),1)])]),default:e.withCtx(()=>[e.createVNode(ut,{modelValue:t.fields.expression,"onUpdate:modelValue":r[34]||(r[34]=d=>t.fields.expression=d),protocol:L.value,"show-expressions-modal-entry":s.showExpressionsModalEntry,onNotify:r[35]||(r[35]=d=>c("notify",d))},{"after-editor":e.withCtx(d=>[e.renderSlot(o.$slots,"after-expressions-editor",{expression:d.expression,state:d.state},void 0,!0)]),_:3},8,["modelValue","protocol","show-expressions-modal-entry"])]),_:3})):e.createCommentVNode("",!0),e.createVNode(we,{modelValue:b.value,"onUpdate:modelValue":r[43]||(r[43]=d=>b.value=d),class:"route-form-advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(a)("form.viewAdvancedFields")},{default:e.withCtx(()=>[e.createElementVNode("div",Rt,[e.createVNode(k,{modelValue:t.fields.https_redirect_status_code,"onUpdate:modelValue":r[36]||(r[36]=d=>t.fields.https_redirect_status_code=d),"data-testid":"route-form-http-redirect-status-code",items:ye,label:e.unref(a)("form.fields.https_redirect_status_code.label"),readonly:t.isReadonly,width:"100%"},null,8,["modelValue","label","readonly"]),e.createVNode(m,{modelValue:t.fields.priority,"onUpdate:modelValue":r[37]||(r[37]=d=>t.fields.priority=d),autocomplete:"off","data-testid":"route-form-priority",label:e.unref(a)("form.fields.priority.label"),"label-attributes":{info:e.unref(a)("form.fields.priority.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"]),s.showTagsFiledUnderAdvanced?(e.openBlock(),e.createBlock(m,{key:0,modelValue:t.fields.tags,"onUpdate:modelValue":r[38]||(r[38]=d=>t.fields.tags=d),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"route-form-tags",help:e.unref(a)("form.fields.tags.help"),label:e.unref(a)("form.fields.tags.label"),placeholder:e.unref(a)("form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])):e.createCommentVNode("",!0),$(["http","https","ws","wss","tls","tcp","udp","tls_passthrough"])?(e.openBlock(),e.createBlock(X,{key:1,modelValue:t.fields.strip_path,"onUpdate:modelValue":r[39]||(r[39]=d=>t.fields.strip_path=d),"data-testid":"route-form-strip-path",label:e.unref(a)("form.fields.strip_path.label")},null,8,["modelValue","label"])):e.createCommentVNode("",!0),e.createVNode(X,{modelValue:t.fields.preserve_host,"onUpdate:modelValue":r[40]||(r[40]=d=>t.fields.preserve_host=d),"data-testid":"route-form-preserve-host",label:e.unref(a)("form.fields.preserve_host.label")},null,8,["modelValue","label"]),e.createVNode(X,{modelValue:t.fields.request_buffering,"onUpdate:modelValue":r[41]||(r[41]=d=>t.fields.request_buffering=d),"data-testid":"route-form-request-buffering",label:e.unref(a)("form.fields.request_buffering.label")},null,8,["modelValue","label"]),e.createVNode(X,{modelValue:t.fields.response_buffering,"onUpdate:modelValue":r[42]||(r[42]=d=>t.fields.response_buffering=d),"data-testid":"route-form-response-buffering",label:e.unref(a)("form.fields.response_buffering.label")},null,8,["modelValue","label"])])]),_:1},8,["modelValue","trigger-label"])],64)):e.createCommentVNode("",!0)]),key:"2"}:void 0]),1032,["modelValue","route-flavors","tooltips"])]),_:3},8,["description","hide-info-header","title"])]),_:3},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-e155aee1"]]),xt={class:"kong-ui-entities-route-entity-config-card"},At={key:2},Ot=e.defineComponent({__name:"RouteConfigCard",props:{config:{type:Object,required:!0,validator:s=>!(!s||!["konnect","kongManager"].includes(s==null?void 0:s.app)||s.app==="konnect"&&!s.controlPlaneId||s.app==="kongManager"&&typeof s.workspace!="string"||!s.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},serviceId:{type:String,required:!1,default:""}},emits:["loading","fetch:error","fetch:success","navigation-click"],setup(s,{emit:N}){var W;const h=N,i=s,{axiosInstance:c}=y.useAxios((W=i.config)==null?void 0:W.axiosRequestConfig),{i18n:{t:n},i18nT:p}=K.useI18n(),u=e.ref(""),b=e.ref(""),V=e.ref(!1),B=e.computed(()=>{var E,_;return(_=ne.item[(E=i.config)==null?void 0:E.app])==null?void 0:_[i.serviceId?"forGatewayService":"all"].replace(/{serviceId}/gi,i.serviceId)}),f=e.computed(()=>{var E;return(E=ne.item[i.config.app])==null?void 0:E.getService}),a=async E=>{var P,x,t;if(u.value=i.serviceId||((P=E==null?void 0:E.service)==null?void 0:P.id),h("fetch:success",E),!u.value)return;let _=`${i.config.apiBaseUrl}${f.value}`;i.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((x=i.config)==null?void 0:x.controlPlaneId)||"").replace(/{serviceId}/gi,u.value||""):i.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(t=i.config)!=null&&t.workspace?`/${i.config.workspace}`:"").replace(/{serviceId}/gi,u.value||""));try{V.value=!0;const{data:L}=await c.get(_);b.value=(L==null?void 0:L.name)||(L==null?void 0:L.id)}catch(L){h("fetch:error",L)}finally{V.value=!1}},D=e.ref({id:{},name:{tooltip:n("form.fields.name.tooltip")},created_at:{},updated_at:{},service:{label:n("form.fields.service.label"),section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.service.tooltip"),order:5},tags:{tooltip:n("form.fields.tags.tooltip"),order:6},protocols:{section:y.ConfigurationSchemaSection.Basic,type:y.ConfigurationSchemaType.BadgeTag,order:7},paths:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.paths.tooltip"),type:y.ConfigurationSchemaType.CopyBadge,order:8},hosts:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.hosts.tooltipConfig"),type:y.ConfigurationSchemaType.CopyBadge,order:9},snis:{label:n("form.fields.snis.label"),tooltip:n("form.fields.snis.tooltip"),order:10},headers:{section:y.ConfigurationSchemaSection.Basic,order:11},methods:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.methods.tooltip"),type:y.ConfigurationSchemaType.BadgeMethod,order:12},sources:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.sources.tooltip"),type:y.ConfigurationSchemaType.JsonArray,order:13},destinations:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.destinations.tooltip"),type:y.ConfigurationSchemaType.JsonArray,order:14},https_redirect_status_code:{order:1},regex_priority:{tooltip:n("form.fields.regex_priority.tooltip"),order:2},strip_path:{order:3},preserve_host:{order:4},request_buffering:{tooltip:n("form.fields.request_buffering.tooltip"),order:5},response_buffering:{tooltip:n("form.fields.response_buffering.tooltip"),order:6},path_handling:{tooltip:n("form.fields.path_handling.tooltipConfig"),order:7}});return(E,_)=>{const P=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",xt,[e.createVNode(e.unref(y.EntityBaseConfigCard),{config:s.config,"config-card-doc":s.configCardDoc,"config-schema":D.value,"entity-type":e.unref(y.SupportedEntityType).Route,"fetch-url":B.value,"hide-title":s.hideTitle,"onFetch:error":_[0]||(_[0]=x=>E.$emit("fetch:error",x)),"onFetch:success":a,onLoading:_[1]||(_[1]=x=>E.$emit("loading",x))},{"https_redirect_status_code-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.https_redirect_status_code.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.https_redirect_status_code.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.https_redirect_status_code.code2")),1)]),code3:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.https_redirect_status_code.code3")),1)]),code4:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.https_redirect_status_code.code4")),1)]),_:1})]),"regex_priority-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.regex_priority.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.regex_priority.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.regex_priority.code2")),1)]),_:1})]),"protocols-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.protocols.tooltipConfig",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code2")),1)]),code3:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code3")),1)]),code4:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code4")),1)]),code5:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code5")),1)]),_:1})]),"headers-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.headers.tooltipConfig",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code2")),1)]),code3:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code3")),1)]),code4:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code4")),1)]),_:1})]),"strip_path-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.strip_path.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code1")),1)]),_:1})]),"preserve_host-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.preserve_host.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code2")),1)]),code3:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code3")),1)]),code4:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code4")),1)]),code5:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code5")),1)]),_:1})]),service:e.withCtx(({row:x})=>[V.value?(e.openBlock(),e.createBlock(P,{key:0,"data-testid":"service-name-loader",type:"spinner"})):x.value&&x.value.id===u.value&&b.value?(e.openBlock(),e.createBlock(e.unref(y.InternalLinkItem),{key:1,item:{key:x.value.id,value:b.value,type:e.unref(y.ConfigurationSchemaType).LinkInternal},onNavigationClick:()=>E.$emit("navigation-click",x.value.id,"services")},null,8,["item","onNavigationClick"])):(e.openBlock(),e.createElementBlock("div",At,e.toDisplayString("-")))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),Dt=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"RouteFormExpressionsEditor",props:e.mergeModels({protocol:{},showExpressionsModalEntry:{type:Boolean},hintText:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["notify"],["update:modelValue"]),setup(s,{emit:N}){const h=s,i=e.useModel(s,"modelValue"),c=N,n=e.ref(!1),p=e.computed(()=>me.PROTOCOL_TO_SCHEMA[h.protocol]),u=e.computed(()=>me.HTTP_BASED_PROTOCOLS.includes(h.protocol??"")),b=e.computed(()=>u.value?void 0:`${h.hintText}${me.HTTP_BASED_PROTOCOLS}`),V=a=>{i.value=a,n.value=!1},B=a=>{c("notify",a)},f=()=>{u.value&&(n.value=!0)};return(a,D)=>{const W=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock(e.Fragment,null,[p.value!==void 0?(e.openBlock(),e.createBlock(e.unref(me.ExpressionsEditor),{key:0,modelValue:i.value,"onUpdate:modelValue":D[0]||(D[0]=E=>i.value=E),schema:p.value},null,8,["modelValue","schema"])):e.createCommentVNode("",!0),e.createVNode(W,{placement:"bottom-start",text:b.value},{default:e.withCtx(()=>[a.showExpressionsModalEntry?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass({disabled:!u.value,"route-form-open-in-playground":!0}),"data-testid":"open-router-playground",onClick:f},[e.renderSlot(a.$slots,"default")],2)):e.createCommentVNode("",!0)]),_:3},8,["text"]),a.showExpressionsModalEntry&&u.value?(e.openBlock(),e.createBlock(e.unref(me.RouterPlaygroundModal),{key:1,"initial-expression":i.value,"is-visible":n.value,onCancel:D[1]||(D[1]=E=>n.value=!1),onCommit:V,onNotify:B},null,8,["initial-expression","is-visible"])):e.createCommentVNode("",!0)],64)}}})},Symbol.toStringTag,{value:"Module"}));R.ExpressionsEditorState=te,R.Methods=De,R.RouteConfigCard=Ot,R.RouteFlavor=T,R.RouteForm=Bt,R.RouteList=ze,R.RoutingRulesEntities=l,R.stateHasExpressionsFlavor=ue,R.stateHasTraditionalFlavor=j,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
1
+ (function(R,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/kongponents"),require("@kong/icons"),require("@kong-ui-public/entities-shared"),require("@kong-ui-public/i18n"),require("lodash.isequal"),require("@kong-ui-public/expressions")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/kongponents","@kong/icons","@kong-ui-public/entities-shared","@kong-ui-public/i18n","lodash.isequal","@kong-ui-public/expressions"],e):(R=typeof globalThis<"u"?globalThis:R||self,e(R["kong-ui-public-entities-routes"]={},R.Vue,R.VueRouter,R.Kongponents,R.KongIcons,R["kong-ui-public-entities-shared"],R["kong-ui-public-i18n"],R.isEqual,R["kong-ui-public-expressions"]))})(this,function(R,e,Ie,Re,z,y,Be,Fe,me){"use strict";const Pe={actions:{create:"New route",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details",loading:"Loading..."},search:{placeholder:{konnect:"Filter by name",exact:"Filter by exact name or ID",kongManager:"Filter by exact name or ID"},no_results:"No results found"},routes:{title:"Routes",list:{toolbar_actions:{new_route:"New route"},table_headers:{name:"Name",protocols:"Protocols",hosts:"Hosts",methods:"Methods",paths:"Paths",expression:"Expression",id:"ID",tags:"Tags",created_at:"Created At",updated_at:"Last Modified"},empty_state:{title:"Configure a New Route",description:"Routes proxy requests to an associated Service."},empty_state_v2:{title:"Configure your first route",description:"Routes direct incoming API requests to the appropriate services, facilitating organized and efficient traffic flow within your architecture."}}},delete:{title:"Delete a Route",description:"Deleting this route will also remove any associated plugins. This action cannot be reversed."},errors:{general:"Routes could not be retrieved",delete:"The route could not be deleted at this time.",copy:"Failed to copy to clipboard",services:{fetch:"Could not fetch available services"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{protocols:{grpc:"GRPC",grpcs:"GRPCS","grpc,grpcs":"GRPC, GRPCS",http:"HTTP",https:"HTTPS","http,https":"HTTP, HTTPS",tls:"TLS",tcp:"TCP",udp:"UDP","tls,udp":"TLS, UDP","tcp,udp":"TCP, UDP","tcp,tls":"TCP, TLS","tcp,tls,udp":"TCP, TLS, UDP",ws:"WS",wss:"WSS","ws,wss":"WS, WSS",tls_passthrough:"TLS_PASSTHROUGH"},sections:{general:{title:"General Information",description:"General information will help you identify and manage this route"},config:{title:"Route Configuration",description:"Route configuration determines how this route will handle incoming requests"},routingRules:{title:"Routing Rules"},routingExpression:{title:"Routing Expression"}},fields:{service_id:{label:"Service",placeholder:"Select a service"},name:{label:"Name",placeholder:"Enter a unique name",tooltip:"The name of the Route. Route names must be unique, and they are case sensitive. For example, there can be two different Routes named 'test' and 'Test'."},service:{label:"Gateway Service",tooltip:"The Service this Route is associated to. This is where the Route proxies traffic to."},tags:{label:"Tags",tooltip:"An optional set of strings associated with the Route for grouping and filtering.",placeholder:"Enter a list of tags separated by commas",help:"e.g. tag1, tag2, tag3"},protocols:{label:"Protocols",tooltip:"Routes have a protocols property to restrict the client protocol they should listen for.",tooltipConfig:"An array of the protocols this Route should allow. See the {code1} section for a list of accepted protocols. When set to only {code2}, HTTP requests are answered with an upgrade error. When it is set to only {code3}, this is essentially the same as {code4} in that both HTTP and HTTPS requests are allowed. Default: {code5}.",code1:"Route Object",code2:"https",code3:"http",code4:"['http', 'https']",code5:"['http', 'https']"},path_handling:{label:"Path Handling",tooltip:"This treats service.path, route.path and request path as segments of a URL.",tooltipConfig:"Controls how the Service path, Route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior."},https_redirect_status_code:{label:"HTTPS Redirect Status Code",tooltip:"The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is {code1} instead of {code2}. {code3} header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the Route is configured to only accept the {code4} protocol.",code1:"HTTP",code2:"HTTPS",code3:"Location",code4:"https"},regex_priority:{label:"Regex Priority",tooltip:"A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same {code1}, the older one (lowest {code2}) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones).",code1:"regex_priority",code2:"created_at"},strip_path:{label:"Strip Path",tooltip:"When matching a Route via one of the {code1}, strip the matching prefix from the upstream request URL.",code1:"paths"},preserve_host:{label:"Preserve Host",tooltip:"When matching a Route via one of the {code1} domain names, use the request {code2} header in the upstream request headers. If set to {code3}, the upstream {code4} header will be that of the Service's {code5}.",code1:"hosts",code2:"Host",code3:"false",code4:"Host",code5:"host"},paths:{label:"Paths",placeholder:"Enter a path",tooltip:"A list of paths that match this Route."},snis:{label:"SNIs",placeholder:"Enter a SNI",tooltip:"A list of SNIs (Server Name Indications from a TLS ClientHello) that match this Route."},hosts:{label:"Hosts",placeholder:"Enter a host",tooltip:"A list of domain names that match this Route.",tooltipConfig:"A list of domain names that match this Route. Note that the hosts value is case sensitive."},methods:{label:"Methods",tooltip:"A list of HTTP methods that match this Route.",custom:{label:"Custom",placeholder:"Enter a custom method",tooltip:"Custom methods can be used with default selections. Uppercase characters are required."}},headers:{label:"Headers",tooltip:"Header values can be separated by commas (value1, value2, value3).",name:{placeholder:"Enter a header name"},values:{placeholder:"Enter a header value"},tooltipConfig:"One or more lists of values indexed by header name that will cause this Route to match if present in the request. The {code1} header cannot be used with this attribute: hosts should be specified using the {code2} attribute. When {code3} contains only one value and that value starts with the special prefix {code4], the value is interpreted as a regular expression.",code1:"Host",code2:"hosts",code3:"headers",code4:"*"},sources:{label:"Sources",tooltip:"A list of IP sources of incoming connections that match this Route when using stream routing.",ip:{placeholder:"Enter a source IP"},port:{placeholder:"Enter a source port"}},destinations:{label:"Destinations",tooltip:"A list of IP destinations of incoming connections that match this Route when using stream routing.",ip:{placeholder:"Enter a destination IP"},port:{placeholder:"Enter a destination port"}},response_buffering:{label:"Response buffering",tooltip:"Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding."},request_buffering:{label:"Request buffering",tooltip:"Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding."},expression:{label:"Expression",tooltip:"The route expression."},priority:{label:"Priority",tooltip:"A number used to choose which route resolves a given request when several routes match it using expression simultaneously."}},flavors:{traditional:"Traditional",expressions:"Expressions"},viewAdvancedFields:"View Advanced Fields",addNewRule:"Add New Rule",warning:{rulesMessage:"For {protocol}, at least one of {routingRules} must be set.",singleRule:"{routingRules}",multipleRules:"{routingRules} or {lastRoutingRule}",cannotChangeFlavor:{create:"The format of the route cannot be changed once created.",edit:"This route was configured in the {format} format, and cannot be changed after creation. You can switch to the {format} tab to edit, or create a new route in a different format instead."}},expressions_editor:{loading:"Loading the Expressions editor…",error:"Error occurred while loading the Expressions editor. Please view the console for more details."},expression_playground:{test_link:"Test with Router Playground",supported_protocols_hint:"Currently only supports the following protocols: {protocols}"}}};function xe(){const s=Be.createI18n("en-us",Pe);return{i18n:s,i18nT:Be.i18nTComponent(s)}}const K={useI18n:xe},U="/v2/control-planes/{controlPlaneId}/core-entities",M="/{workspace}",ne={list:{konnect:{all:`${U}/routes`,forGatewayService:`${U}/services/{serviceId}/routes`},kongManager:{all:`${M}/routes`,forGatewayService:`${M}/services/{serviceId}/routes`}},form:{konnect:{services:`${U}/services`,create:{all:`${U}/routes`,forGatewayService:`${U}/services/{serviceId}/routes`},fetch:{all:`${U}/routes/{id}`,forGatewayService:`${U}/services/{serviceId}/routes/{id}`},edit:{all:`${U}/routes/{id}`,forGatewayService:`${U}/services/{serviceId}/routes/{id}`}},kongManager:{services:`${M}/services`,create:{all:`${M}/routes`,forGatewayService:`${M}/services/{serviceId}/routes`},fetch:{all:`${M}/routes/{id}`,forGatewayService:`${M}/services/{serviceId}/routes/{id}`},edit:{all:`${M}/routes/{id}`,forGatewayService:`${M}/services/{serviceId}/routes/{id}`}}},item:{konnect:{getService:`${U}/services/{serviceId}`,all:`${U}/routes/{id}`,forGatewayService:`${U}/services/{serviceId}/routes/{id}`},kongManager:{getService:`${M}/services/{serviceId}`,all:`${M}/routes/{id}`,forGatewayService:`${M}/services/{serviceId}/routes/{id}`}}},Ae="#d60027",He="#00abd2",Oe="#6c7489",Ve="16px",Ue="24px",Me={class:"kong-ui-entities-routes-list"},Le={class:"button-row"},qe={class:"empty-state-icon-gateway"},Ke={key:1},Ge={key:1},je={key:1},We={class:"route-list-cell-expression"},Xe=e.defineComponent({__name:"RouteList",props:{config:{type:Object,required:!0,validator:s=>!(!s||!["konnect","kongManager"].includes(s==null?void 0:s.app)||!s.createRoute||!s.getViewRoute||!s.getEditRoute||s.app==="kongManager"&&!s.isExactMatch&&!s.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},title:{type:String,default:""},titleTag:{type:String,default:"h2"},useActionOutside:{type:Boolean,default:!1},hideTraditionalColumns:{type:Boolean,default:!1},hasExpressionColumn:{type:Boolean,default:!1},enableV2EmptyStates:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(s,{emit:N}){var fe;const h=N,i=s,{i18n:{t:c,formatUnixTimeStamp:n}}=K.useI18n(),p=Ie.useRouter(),{axiosInstance:u}=y.useAxios((fe=i.config)==null?void 0:fe.axiosRequestConfig),{handleStateChange:b,hasRecords:V}=y.useTableState(()=>x.value),B=e.computed(()=>V.value&&i.config.app==="konnect"),f=e.computed(()=>!i.enableV2EmptyStates&&i.config.app==="konnect"),a=e.computed(()=>!!i.config.serviceId),D=e.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),W={name:{label:c("routes.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},protocols:{label:c("routes.list.table_headers.protocols"),searchable:!0},...!i.hideTraditionalColumns&&{hosts:{label:c("routes.list.table_headers.hosts"),searchable:!0},methods:{label:c("routes.list.table_headers.methods"),searchable:!0},paths:{label:c("routes.list.table_headers.paths"),searchable:!0}},...i.hasExpressionColumn&&{expression:{label:c("routes.list.table_headers.expression"),tooltip:!0}},tags:{label:c("routes.list.table_headers.tags"),sortable:!1},updated_at:{label:c("routes.list.table_headers.updated_at"),sortable:!0},created_at:{label:c("routes.list.table_headers.created_at"),sortable:!0}},E={columnVisibility:{created_at:!1}},_=W,P=e.computed(()=>{var C,I,O,H;let S=`${i.config.apiBaseUrl}${ne.list[i.config.app][i.config.serviceId?"forGatewayService":"all"]}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||"").replace(/{serviceId}/gi,((I=i.config)==null?void 0:I.serviceId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"").replace(/{serviceId}/gi,((H=i.config)==null?void 0:H.serviceId)||"")),S}),x=e.ref(""),t=e.computed(()=>{const S=i.config.app==="konnect"||i.config.isExactMatch;if(S)return{isExactMatch:S,placeholder:c(`search.placeholder.${i.config.isExactMatch?"exact":i.config.app}`)};const{name:C,protocols:I,hosts:O,methods:H,paths:J,expression:le}=W,g={name:C,protocols:I,hosts:O,methods:H,paths:J,...i.hasExpressionColumn&&{expression:le}};return{isExactMatch:S,fields:g,schema:i.config.filterSchema}}),{fetcher:L,fetcherState:re,fetcherCacheKey:ie}=y.useFetcher({...i.config,cacheIdentifier:i.cacheIdentifier},P.value),A=S=>S.headerKey==="expression"?{style:{maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}}:{},Ce=()=>{x.value=""},ke=()=>{ie.value++},ae=e.ref(null),ye=(S,C)=>{const I=S.id;if(!C(I)){h("copy:error",{entity:S,field:"id",message:c("errors.copy")});return}h("copy:success",{entity:S,field:"id",message:c("copy.success",{val:I})})},de=(S,C)=>{const I=JSON.stringify(S);if(!C(I)){h("copy:error",{entity:S,message:c("errors.copy")});return}h("copy:success",{entity:S,message:c("copy.success_brief")})},he=async S=>{var I;await((I=i.canRetrieve)==null?void 0:I.call(i,S))&&p.push(i.config.getViewRoute(S.id))},Ee=S=>({label:c("actions.view"),to:i.config.getViewRoute(S)}),Se=S=>({label:c("actions.edit"),to:i.config.getEditRoute(S)}),Q=e.ref(void 0),ce=e.ref(!1),pe=e.ref(!1),be=e.ref(""),$=y.useDeleteUrlBuilder(i.config,P.value),Z=S=>{Q.value=S,ce.value=!0},Ne=()=>{ce.value=!1},Y=async()=>{var S,C,I;if((S=Q.value)!=null&&S.id){pe.value=!0;try{await u.delete($(Q.value.id)),pe.value=!1,ce.value=!1,ie.value++,h("delete:success",Q.value)}catch(O){be.value=((I=(C=O.response)==null?void 0:C.data)==null?void 0:I.message)||O.message||c("errors.delete"),h("error",O)}finally{pe.value=!1}}},Te=()=>{p.push(i.config.createRoute)};e.watch(re,S=>{var C,I,O;if(S.status===y.FetcherStatus.Error){ae.value={title:c("errors.general")},(O=(I=(C=S.error)==null?void 0:C.response)==null?void 0:I.data)!=null&&O.message&&(ae.value.message=S.error.response.data.message),h("error",S.error);return}ae.value=null});const q=e.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${c("routes.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:c("routes.title")});return e.onBeforeMount(async()=>{await i.canCreate()&&(q.value.title=c("routes.list.empty_state.title"),q.value.ctaText=c("actions.create"))}),(S,C)=>{const I=e.resolveComponent("KButton"),O=e.resolveComponent("KBadge"),H=e.resolveComponent("KTruncate"),J=e.resolveComponent("KDropdownItem"),le=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(e.unref(y.EntityBaseTable),{"cache-identifier":s.cacheIdentifier,"cell-attributes":A,"default-table-preferences":E,"disable-sorting":D.value,"empty-state-options":q.value,"enable-entity-actions":"","error-message":ae.value,fetcher:e.unref(L),"fetcher-cache-key":e.unref(ie),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-routes-list",query:x.value,"table-headers":e.unref(_),title:s.title,"title-tag":s.titleTag,onClearSearchInput:Ce,"onClick:row":C[8]||(C[8]=g=>he(g)),onSort:ke,onState:e.unref(b)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(y.EntityFilter),{modelValue:x.value,"onUpdate:modelValue":C[0]||(C[0]=g=>x.value=g),config:t.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!s.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",Le,[!a.value&&B.value?(e.openBlock(),e.createBlock(I,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"routes-learn-more-button",icon:"",onClick:C[1]||(C[1]=g=>S.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(y.PermissionsWrapper),{"auth-function":()=>s.canCreate()},{default:e.withCtx(()=>[e.createVNode(I,{appearance:"primary","data-testid":"toolbar-add-route",size:s.useActionOutside?"medium":"large",to:s.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(z.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(c)("routes.list.toolbar_actions.new_route")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),name:e.withCtx(({rowValue:g})=>[e.createElementVNode("b",null,e.toDisplayString(g??"-"),1)]),protocols:e.withCtx(({rowValue:g})=>[e.createVNode(H,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createBlock(O,{key:w,appearance:"neutral",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1024))),128))]),_:2},1024)]),hosts:e.withCtx(({rowValue:g})=>[(g==null?void 0:g.length)>0?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createBlock(O,{key:w,appearance:"neutral",tooltip:w,"truncation-tooltip":"",onClick:C[5]||(C[5]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1032,["tooltip"]))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ke,"-"))]),methods:e.withCtx(({rowValue:g})=>[(g==null?void 0:g.length)>0?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createBlock(O,{key:w,appearance:Object.values(e.unref(Re.BadgeMethodAppearances)).includes(w.toLowerCase())?w.toLowerCase():"custom",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1032,["appearance"]))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ge,"-"))]),paths:e.withCtx(({rowValue:g})=>[(g==null?void 0:g.length)>0?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createBlock(O,{key:w,appearance:"neutral",tooltip:w,"truncation-tooltip":"",onClick:C[7]||(C[7]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1032,["tooltip"]))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",je,"-"))]),tags:e.withCtx(({rowValue:g})=>[e.createVNode(e.unref(y.TableTags),{tags:g},null,8,["tags"])]),expression:e.withCtx(({rowValue:g})=>[e.createElementVNode("span",We,e.toDisplayString(g||"-"),1)]),created_at:e.withCtx(({rowValue:g})=>[e.createTextVNode(e.toDisplayString(e.unref(n)(g)),1)]),updated_at:e.withCtx(({row:g,rowValue:w})=>[e.createTextVNode(e.toDisplayString(e.unref(n)(w??g.created_at)),1)]),actions:e.withCtx(({row:g})=>[e.createVNode(le,null,{default:e.withCtx(({copyToClipboard:w})=>[e.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:se=>ye(g,w)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(le,null,{default:e.withCtx(({copyToClipboard:w})=>[e.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:se=>de(g,w)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(y.PermissionsWrapper),{"auth-function":()=>s.canRetrieve(g)},{default:e.withCtx(()=>[e.createVNode(J,{"data-testid":"action-entity-view","has-divider":"",item:Ee(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(y.PermissionsWrapper),{"auth-function":()=>s.canEdit(g)},{default:e.withCtx(()=>[e.createVNode(J,{"data-testid":"action-entity-edit",item:Se(g.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(y.PermissionsWrapper),{"auth-function":()=>s.canDelete(g)},{default:e.withCtx(()=>[e.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:w=>Z(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!e.unref(V)&&f.value?{name:"outside-actions",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!s.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(I,{appearance:"secondary",class:"open-learning-hub","data-testid":"routes-learn-more-button",icon:"",onClick:C[2]||(C[2]=g=>S.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.BookIcon),{decorative:""})]),_:1})],8,["disabled"]))]),key:"0"}:void 0,s.enableV2EmptyStates&&s.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>[e.createVNode(e.unref(y.EntityEmptyState),{"action-button-text":e.unref(c)("routes.list.toolbar_actions.new_route"),appearance:"secondary","can-create":()=>s.canCreate(),description:e.unref(c)("routes.list.empty_state_v2.description"),"learn-more":s.config.app==="konnect",title:e.unref(c)("routes.list.empty_state_v2.title"),"onClick:create":Te,"onClick:learnMore":C[3]||(C[3]=g=>S.$emit("click:learn-more"))},{image:e.withCtx(()=>[e.createElementVNode("div",qe,[e.createVNode(e.unref(z.ForwardIcon),{color:e.unref(He),size:e.unref(Ue)},null,8,["color","size"])])]),_:1},8,["action-button-text","can-create","description","learn-more","title"])]),key:"1"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","title","title-tag","onState"]),e.createVNode(e.unref(y.EntityDeleteModal),{"action-pending":pe.value,description:e.unref(c)("delete.description"),"entity-name":Q.value&&(Q.value.name||Q.value.id),"entity-type":e.unref(y.EntityTypes).Route,error:be.value,title:e.unref(c)("delete.title"),visible:ce.value,onCancel:Ne,onProceed:Y},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),G=(s,N)=>{const h=s.__vccOpts||s;for(const[i,c]of N)h[i]=c;return h},ze=G(Xe,[["__scopeId","data-v-8a68dd63"]]);var De=(s=>(s.GET="GET",s.PUT="PUT",s.POST="POST",s.PATCH="PATCH",s.DELETE="DELETE",s.OPTIONS="OPTIONS",s.HEAD="HEAD",s.CONNECT="CONNECT",s.TRACE="TRACE",s.CUSTOM="CUSTOM",s))(De||{}),T=(s=>(s.TRADITIONAL="traditional",s.EXPRESSIONS="expressions",s))(T||{}),l=(s=>(s.PATHS="paths",s.SNIS="snis",s.HOSTS="hosts",s.METHODS="methods",s.HEADERS="headers",s.SOURCES="sources",s.DESTINATIONS="destinations",s.CUSTOM_METHOD="custom-method",s))(l||{}),te=(s=>(s.LOADING="loading",s.ERROR="error",s.READY="ready",s))(te||{});const j=s=>s.routeFlavors.traditional===!0,ue=s=>s.routeFlavors.expressions===!0,Je={class:"routing-rules-entities-controls-container"},oe=G(e.defineComponent({__name:"RoutingRulesEntitiesControls",props:{routingRulesEntity:{type:String,required:!0},isAddDisabled:{type:Boolean,default:!1}},emits:["remove","add"],setup(s){return(N,h)=>{const i=e.resolveComponent("KButton");return e.openBlock(),e.createElementBlock("div",Je,[e.createVNode(i,{appearance:"tertiary",class:"remove-button","data-testid":`remove-${s.routingRulesEntity}`,icon:"",onClick:h[0]||(h[0]=c=>N.$emit("remove"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.TrashIcon),{color:e.unref(Ae)},null,8,["color"])]),_:1},8,["data-testid"]),e.createVNode(i,{appearance:"tertiary","data-testid":`add-${s.routingRulesEntity}`,disabled:s.isAddDisabled,icon:"",onClick:h[1]||(h[1]=c=>N.$emit("add"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.AddIcon))]),_:1},8,["data-testid","disabled"])])}}}),[["__scopeId","data-v-e024298d"]]),Qe={class:"routing-rule-container"},Ye=G(e.defineComponent({__name:"RouteFormDestinationsFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",Qe,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.destinations.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.destinations.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f].ip,"onUpdate:modelValue":a=>n.value[f].ip=a,modelModifiers:{trim:!0},"data-testid":`route-form-destinations-ip-input-${f+1}`,placeholder:e.unref(c)("form.fields.destinations.ip.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(V,{modelValue:n.value[f].port,"onUpdate:modelValue":a=>n.value[f].port=a,modelModifiers:{number:!0},"data-testid":`route-form-destinations-port-input-${f+1}`,max:"65535",min:"0",placeholder:e.unref(c)("form.fields.destinations.port.placeholder"),type:"number"},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).DESTINATIONS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-d41b39fd"]]),Ze={class:"routing-rule-container"},ve=G(e.defineComponent({__name:"RouteFormHeadersFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",Ze,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.headers.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.headers.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f].header,"onUpdate:modelValue":a=>n.value[f].header=a,modelModifiers:{trim:!0},"data-testid":`route-form-headers-name-input-${f+1}`,placeholder:e.unref(c)("form.fields.headers.name.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(V,{modelValue:n.value[f].values,"onUpdate:modelValue":a=>n.value[f].values=a,modelModifiers:{trim:!0},"data-testid":`route-form-headers-values-input-${f+1}`,placeholder:e.unref(c)("form.fields.headers.values.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).HEADERS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-ca0bb10b"]]),et={class:"routing-rule-container"},tt=G(e.defineComponent({__name:"RouteFormHostsFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",et,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.hosts.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.hosts.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f],"onUpdate:modelValue":a=>n.value[f]=a,modelModifiers:{trim:!0},"data-testid":`route-form-hosts-input-${f+1}`,placeholder:e.unref(c)("form.fields.hosts.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).HOSTS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-88d16377"]]),ot={class:"routing-rule-container"},rt={class:"routing-rule-input"},lt={class:"methods-input-container"},st={key:0,class:"routing-rule-container"},nt=G(e.defineComponent({__name:"RouteFormMethodsFields",props:{modelValue:{type:Object,required:!0},customMethods:{type:Array,required:!0}},emits:["add","remove","update:modelValue","update-custom-methods"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref({}),p=e.ref([...h.customMethods]),u=b=>{p.value.length===1?p.value[0]="":p.value.splice(b,1)};return e.watch(h.modelValue,b=>{n.value={...b}},{immediate:!0,deep:!0}),e.watch(n,b=>{i("update:modelValue",b)},{deep:!0}),e.watch(p,b=>{i("update-custom-methods",b)},{deep:!0}),(b,V)=>{const B=e.resolveComponent("KLabel"),f=e.resolveComponent("KInputSwitch"),a=e.resolveComponent("KBadge"),D=e.resolveComponent("KButton"),W=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",ot,[V[2]||(V[2]=e.createElementVNode("hr",null,null,-1)),e.createVNode(B,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.methods.label")),1)]),_:1}),e.createElementVNode("div",rt,[e.createElementVNode("div",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(n.value),E=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"methods-input"},[e.createVNode(f,{modelValue:n.value[E],"onUpdate:modelValue":_=>n.value[E]=_,"data-testid":`${E.toLowerCase()}-method-toggle`},null,8,["modelValue","onUpdate:modelValue","data-testid"]),e.createVNode(a,{appearance:Object.values(e.unref(Re.BadgeMethodAppearances)).includes(E.toLowerCase())?E.toLowerCase():"custom"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E.toLowerCase()),1)]),_:2},1032,["appearance"])]))),128))]),e.createVNode(D,{appearance:"tertiary",class:"remove-button","data-testid":"remove-methods",icon:"",onClick:V[0]||(V[0]=E=>b.$emit("remove"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.TrashIcon),{color:e.unref(Ae)},null,8,["color"])]),_:1})]),n.value.CUSTOM?(e.openBlock(),e.createElementBlock("div",st,[e.createVNode(B,{info:e.unref(c)("form.fields.methods.custom.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.methods.custom.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(E,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:"routing-rule-input"},[e.createVNode(W,{modelValue:p.value[_],"onUpdate:modelValue":P=>p.value[_]=P,modelModifiers:{trim:!0},"data-testid":`route-form-custom-method-input-${_+1}`,placeholder:e.unref(c)("form.fields.methods.custom.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":_!==p.value.length-1,"routing-rules-entity":e.unref(l).CUSTOM_METHOD,onAdd:V[1]||(V[1]=P=>p.value.push("")),onRemove:P=>u(_)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-c8ae1bc5"]]),it={class:"routing-rule-container"},at=G(e.defineComponent({__name:"RouteFormPathsFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",it,[e.createVNode(b,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.paths.label")),1)]),_:1}),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f],"onUpdate:modelValue":a=>n.value[f]=a,modelModifiers:{trim:!0},"data-testid":`route-form-paths-input-${f+1}`,placeholder:e.unref(c)("form.fields.paths.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).PATHS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-bc31ca96"]]),dt={class:"routing-rule-container"},ct=G(e.defineComponent({__name:"RouteFormSnisFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",dt,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.snis.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.snis.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f],"onUpdate:modelValue":a=>n.value[f]=a,modelModifiers:{trim:!0},"data-testid":`route-form-snis-input-${f+1}`,placeholder:e.unref(c)("form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).SNIS,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-c3679dd9"]]),pt={class:"routing-rule-container"},ft=G(e.defineComponent({__name:"RouteFormSourcesFields",props:{modelValue:{type:Array,required:!0}},emits:["add","remove","update:modelValue"],setup(s,{emit:N}){const h=s,i=N,{i18n:{t:c}}=K.useI18n(),n=e.ref([]);return e.watch(h.modelValue,p=>{n.value=[...p]},{immediate:!0,deep:!0}),e.watch(n,p=>{i("update:modelValue",p)},{deep:!0}),(p,u)=>{const b=e.resolveComponent("KLabel"),V=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",pt,[u[1]||(u[1]=e.createElementVNode("hr",null,null,-1)),e.createVNode(b,{info:e.unref(c)("form.fields.sources.tooltip")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("form.fields.sources.label")),1)]),_:1},8,["info"]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(B,f)=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"routing-rule-input"},[e.createVNode(V,{modelValue:n.value[f].ip,"onUpdate:modelValue":a=>n.value[f].ip=a,modelModifiers:{trim:!0},"data-testid":`route-form-sources-ip-input-${f+1}`,placeholder:e.unref(c)("form.fields.sources.ip.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(V,{modelValue:n.value[f].port,"onUpdate:modelValue":a=>n.value[f].port=a,modelModifiers:{number:!0},"data-testid":`route-form-sources-port-input-${f+1}`,max:"65535",min:"0",placeholder:e.unref(c)("form.fields.sources.port.placeholder"),type:"number"},null,8,["modelValue","onUpdate:modelValue","data-testid","placeholder"]),e.createVNode(oe,{"is-add-disabled":f!==n.value.length-1,"routing-rules-entity":e.unref(l).SOURCES,onAdd:u[0]||(u[0]=a=>p.$emit("add")),onRemove:a=>p.$emit("remove",f)},null,8,["is-add-disabled","routing-rules-entity","onRemove"])]))),128))]),_:1})])}}}),[["__scopeId","data-v-50c52494"]]),mt=G(e.defineComponent({__name:"RouteFormConfigTabs",props:e.mergeModels({routeFlavors:{},tooltips:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const N=e.useModel(s,"modelValue"),h=s,{i18n:{t:i}}=xe(),c=e.computed(()=>[...h.routeFlavors.traditional?[{hash:`#${T.TRADITIONAL}`,title:i("form.flavors.traditional")}]:[],...h.routeFlavors.expressions?[{hash:`#${T.EXPRESSIONS}`,title:i("form.flavors.expressions")}]:[]]);return(n,p)=>{const u=e.resolveComponent("KTooltip"),b=e.resolveComponent("KTabs");return c.value.length>1?(e.openBlock(),e.createBlock(b,{key:0,modelValue:N.value,"onUpdate:modelValue":p[0]||(p[0]=V=>N.value=V),"data-testid":"route-form-config-tabs",tabs:c.value},e.createSlots({_:2},[n.routeFlavors.traditional?{name:`${e.unref(T).TRADITIONAL}-anchor`,fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("form.flavors.traditional"))+" ",1),n.tooltips&&n.tooltips[e.unref(T).TRADITIONAL]?(e.openBlock(),e.createBlock(u,{key:0,class:"route-form-config-tabs-tooltip",text:n.tooltips[e.unref(T).TRADITIONAL],"tooltip-id":"route-form-config-tabs-tooltip-traditional"},{default:e.withCtx(()=>[e.createVNode(e.unref(z.InfoIcon),{color:e.unref(Oe),size:e.unref(Ve),tabindex:"0"},null,8,["color","size"])]),_:1},8,["text"])):e.createCommentVNode("",!0)]),key:"0"}:void 0,n.routeFlavors.traditional?{name:e.unref(T).TRADITIONAL,fn:e.withCtx(()=>[e.renderSlot(n.$slots,"before-content",{},void 0,!0),e.renderSlot(n.$slots,e.unref(T).TRADITIONAL,{},void 0,!0)]),key:"1"}:void 0,n.routeFlavors.expressions?{name:`${e.unref(T).EXPRESSIONS}-anchor`,fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("form.flavors.expressions"))+" ",1),n.tooltips&&n.tooltips[e.unref(T).EXPRESSIONS]?(e.openBlock(),e.createBlock(u,{key:0,class:"route-form-config-tabs-tooltip",text:n.tooltips[e.unref(T).EXPRESSIONS],"tooltip-id":"route-form-config-tabs-tooltip-expressions"},{default:e.withCtx(()=>[e.createVNode(e.unref(z.InfoIcon),{color:e.unref(Oe),size:e.unref(Ve),tabindex:"0"},null,8,["color","size"])]),_:1},8,["text"])):e.createCommentVNode("",!0)]),key:"2"}:void 0,n.routeFlavors.expressions?{name:e.unref(T).EXPRESSIONS,fn:e.withCtx(()=>[e.renderSlot(n.$slots,"before-content",{},void 0,!0),e.renderSlot(n.$slots,e.unref(T).EXPRESSIONS,{},void 0,!0)]),key:"3"}:void 0]),1032,["modelValue","tabs"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(n.$slots,"before-content",{},void 0,!0),n.routeFlavors.traditional?e.renderSlot(n.$slots,e.unref(T).TRADITIONAL,{key:0},void 0,!0):n.routeFlavors.expressions?e.renderSlot(n.$slots,e.unref(T).EXPRESSIONS,{key:1},void 0,!0):e.createCommentVNode("",!0)],64))}}}),[["__scopeId","data-v-f1c7a92f"]]),ut=e.defineComponent({__name:"RouteFormExpressionsEditorLoader",props:e.mergeModels({protocol:{},showExpressionsModalEntry:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["notify"],["update:modelValue"]),setup(s,{emit:N}){const{i18n:{t:h}}=K.useI18n(),i={render:()=>e.h("div",h("form.expressions_editor.loading"))},c={render:()=>e.h("div",h("form.expressions_editor.error"))},n=e.defineAsyncComponent({loader:async()=>Promise.resolve().then(()=>Dt),loadingComponent:i,errorComponent:c}),p=s,u=N,b=e.ref(te.LOADING),V=e.useModel(s,"modelValue"),B=f=>{V.value=f};return e.onMounted(async()=>{try{await(await import("@kong-ui-public/expressions")).asyncInit,b.value=te.READY}catch(f){b.value=te.ERROR,console.error(f)}}),(f,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[b.value===e.unref(te).ERROR?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c),{key:0,"data-testid":"route-form-expressions-editor-loader-error"})):b.value===e.unref(te).LOADING?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i),{key:1,"data-testid":"route-form-expressions-editor-loader-loading"})):(e.openBlock(),e.createBlock(e.unref(n),{key:2,modelValue:V.value,"onUpdate:modelValue":a[0]||(a[0]=D=>V.value=D),"hint-text":e.unref(h)("form.expression_playground.supported_protocols_hint"),protocol:p.protocol,"show-expressions-modal-entry":f.showExpressionsModalEntry,onNotify:a[1]||(a[1]=D=>u("notify",D))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.RocketIcon),{size:e.unref(Ve)},null,8,["size"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(h)("form.expression_playground.test_link")),1)]),_:1},8,["modelValue","hint-text","protocol","show-expressions-modal-entry"])),e.renderSlot(f.$slots,"after-editor",{expression:{value:V.value,update:B},state:b.value})],64))}}),ht={class:"kong-ui-entities-route-form"},gt={key:1},yt={"data-testid":"no-search-results"},St={class:"route-form-service-dropdown-item"},bt={class:"select-item-label"},Vt={class:"select-item-description"},Ct={class:"route-form-routing-rules-title-container"},kt={class:"routing-rules-title"},Et={key:1,class:"route-form-routing-rules-selector-container"},Nt={class:"route-form-routing-rules-selector-options"},Tt=["aria-disabled","data-testid","onClick"],_t={class:"route-form-fields-container route-form-advanced-fields-container"},wt={class:"route-form-routing-rules-title-container"},It={class:"routing-rules-title"},Rt={class:"route-form-fields-container route-form-advanced-fields-container"},Bt=G(e.defineComponent({__name:"RouteForm",props:{config:{type:Object,required:!0,validator:s=>!(!s||!["konnect","kongManager"].includes(s==null?void 0:s.app)||(s==null?void 0:s.app)==="konnect"&&!(s!=null&&s.controlPlaneId)||(s==null?void 0:s.app)==="kongManager"&&typeof(s==null?void 0:s.workspace)!="string"||!(s!=null&&s.cancelRoute))},routeId:{type:String,required:!1,default:""},serviceId:{type:String,required:!1,default:""},hideSectionsInfo:{type:Boolean,required:!1,default:!1},hideNameField:{type:Boolean,required:!1,default:!1},hideServiceField:{type:Boolean,required:!1,default:!1},showTagsFiledUnderAdvanced:{type:Boolean,required:!1,default:!1},routeFlavors:{type:Object,required:!1,default:()=>({traditional:!0})},configTabTooltips:{type:Object,required:!1,default:()=>{}},showExpressionsModalEntry:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading","model-updated","notify"],setup(s,{expose:N,emit:h}){var $e;const i=s,c=h,n=e.ref(i.routeFlavors.traditional?`#${T.TRADITIONAL}`:i.routeFlavors.expressions?`#${T.EXPRESSIONS}`:""),p=e.computed(()=>{if(n.value)return n.value.substring(1)}),u=e.ref(void 0),b=e.ref(!0),V=e.computed(()=>{if(u.value)return u.value;if(p.value)return p.value;if(i.routeFlavors.traditional)return T.TRADITIONAL;if(i.routeFlavors.expressions)return T.EXPRESSIONS}),{i18nT:B,i18n:f,i18n:{t:a}}=K.useI18n(),D=f.source.form.protocols,W=Ie.useRouter(),{axiosInstance:E}=y.useAxios(($e=i.config)==null?void 0:$e.axiosRequestConfig),{getMessageFromError:_}=y.useErrors(),P=e.computed(()=>!(i.hideNameField&&(i.hideServiceField||i.serviceId)&&i.showTagsFiledUnderAdvanced)),x=o=>o.name?`${o.name} - ${o.value}`:o.value,t=e.reactive({routeFlavors:i.routeFlavors,fields:{name:"",protocols:"http,https",https_redirect_status_code:426,strip_path:!0,preserve_host:!1,request_buffering:!0,response_buffering:!0,tags:"",service_id:"",...!i.routeId&&{paths:[""]},regex_priority:0,path_handling:"v0",expression:"",priority:0},isReadonly:!1,errorMessage:""});e.watch(()=>i.routeFlavors,o=>{t.routeFlavors=o});const L=e.computed(()=>t.fields.protocols.split(",")[0]),re=e.ref([""]),ie=e.reactive({name:"",protocols:"http,https",https_redirect_status_code:426,strip_path:!0,preserve_host:!1,request_buffering:!0,response_buffering:!0,tags:"",service_id:"",path_handling:"v0",regex_priority:0,expression:"",priority:0}),A={[l.PATHS]:[""],[l.SNIS]:[""],[l.HOSTS]:[""],[l.METHODS]:{GET:!1,PUT:!1,POST:!1,PATCH:!1,DELETE:!1,OPTIONS:!1,HEAD:!1,CONNECT:!1,TRACE:!1,CUSTOM:!1},[l.HEADERS]:[{header:"",values:""}],[l.SOURCES]:[{ip:"",port:null}],[l.DESTINATIONS]:[{ip:"",port:null}]},Ce=i.config.app==="konnect"||y.useGatewayFeatureSupported({gatewayInfo:i.config.gatewayInfo,supportedRange:{enterprise:["3.0"]}}),ke=[{label:a("form.protocols.grpc"),value:"grpc"},{label:a("form.protocols.grpcs"),value:"grpcs"},{label:a("form.protocols.grpc,grpcs"),value:"grpc,grpcs"},{label:a("form.protocols.http"),value:"http"},{label:a("form.protocols.https"),value:"https"},{label:a("form.protocols.http,https"),value:"http,https"},{label:a("form.protocols.tcp"),value:"tcp"},{label:a("form.protocols.tls"),value:"tls"},{label:a("form.protocols.tls,udp"),value:"tls,udp"},{label:a("form.protocols.tcp,udp"),value:"tcp,udp"},{label:a("form.protocols.tcp,tls"),value:"tcp,tls"},{label:a("form.protocols.tcp,tls,udp"),value:"tcp,tls,udp"},{label:a("form.protocols.tls_passthrough"),value:"tls_passthrough"},{label:a("form.protocols.udp"),value:"udp"},...Ce?[{label:a("form.protocols.ws"),value:"ws"},{label:a("form.protocols.wss"),value:"wss"},{label:a("form.protocols.ws,wss"),value:"ws,wss"}]:[]],ae=[{label:"v0",value:"v0"},{label:"v1",value:"v1"}],ye=[{label:"426",value:426},{label:"301",value:301},{label:"302",value:302},{label:"307",value:307},{label:"308",value:308}],de={http:[l.HOSTS,l.METHODS,l.PATHS,l.HEADERS],https:[l.HOSTS,l.METHODS,l.PATHS,l.HEADERS,l.SNIS],"http,https":[l.HOSTS,l.METHODS,l.PATHS,l.HEADERS,l.SNIS],"https,http":[l.HOSTS,l.METHODS,l.PATHS,l.HEADERS,l.SNIS],grpc:[l.HOSTS,l.PATHS,l.HEADERS],grpcs:[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],"grpc,grpcs":[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],"grpcs,grpc":[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],udp:[l.SOURCES,l.DESTINATIONS],tls:[l.SOURCES,l.DESTINATIONS,l.SNIS],tcp:[l.SOURCES,l.DESTINATIONS],"tls,udp":[l.SOURCES,l.DESTINATIONS,l.SNIS],"udp,tls":[l.SOURCES,l.DESTINATIONS,l.SNIS],"tcp,udp":[l.SOURCES,l.DESTINATIONS],"udp,tcp":[l.SOURCES,l.DESTINATIONS],"tcp,tls":[l.SOURCES,l.DESTINATIONS,l.SNIS],"tls,tcp":[l.SOURCES,l.DESTINATIONS,l.SNIS],"tcp,tls,udp":[l.SOURCES,l.DESTINATIONS,l.SNIS],"tls,udp,tcp":[l.SOURCES,l.DESTINATIONS,l.SNIS],"udp,tcp,tls":[l.SOURCES,l.DESTINATIONS,l.SNIS],tls_passthrough:[l.SNIS],ws:[l.HOSTS,l.PATHS,l.HEADERS],wss:[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],"ws,wss":[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS],"wss,ws":[l.HOSTS,l.PATHS,l.HEADERS,l.SNIS]},he=e.computed(()=>i.routeId?y.EntityBaseFormType.Edit:y.EntityBaseFormType.Create),Ee=e.computed(()=>{var o,r,m;return(m=(r=ne.form[(o=i.config)==null?void 0:o.app])==null?void 0:r.fetch)==null?void 0:m[i.serviceId?"forGatewayService":"all"].replace(/{serviceId}/gi,i.serviceId||"")}),Se=()=>{var o;W.push((o=i.config)==null?void 0:o.cancelRoute)},Q=o=>{c("loading",o)},ce=o=>{c("error",o)},pe=o=>{j(t)&&(t.fields.methods=A[l.METHODS],o.forEach(r=>{t.fields.methods&&(t.fields.methods[r]=!0)}))},be=o=>Object.entries(o).map(r=>{var m;return{header:r[0],values:(m=r[1])==null?void 0:m.join()}}),$=o=>o.some(r=>t.fields.protocols.includes(r)),Z=(o,r)=>{if(o===l.PATHS||o===l.HOSTS||o===l.SNIS)return[...r].filter(m=>!!m);if(o===l.SOURCES||o===l.DESTINATIONS)return[...r].filter(m=>!!m.ip).map(m=>({...m,port:!m.port&&m.port!==0?null:m.port}));if(o===l.HEADERS)return[...r].filter(m=>!!m.header)},Ne=()=>{if(j(t)){const o=Z(l.HEADERS,t.fields.headers||[])||A[l.HEADERS];if(o.length===0)return null;const r={};return o.forEach(m=>{r[m.header]=m.values.split(",")}),r}return null},Y=o=>{j(t)&&(o&&o===l.PATHS&&(t.fields.paths?t.fields.paths.push([...A[l.PATHS]][0]):t.fields.paths=[...A[l.PATHS]]),o===l.SNIS&&(t.fields.snis?t.fields.snis.push([...A[l.SNIS]][0]):t.fields.snis=[...A[l.SNIS]]),o===l.HOSTS&&(t.fields.hosts?t.fields.hosts.push([...A[l.HOSTS]][0]):t.fields.hosts=[...A[l.HOSTS]]),o===l.METHODS&&(t.fields.methods||(t.fields.methods={...A[l.METHODS]})),o===l.HEADERS&&(t.fields.headers?t.fields.headers.push({...A[l.HEADERS][0]}):t.fields.headers=[{...A[l.HEADERS][0]}]),o===l.SOURCES&&(t.fields.sources?t.fields.sources.push({...A[l.SOURCES][0]}):t.fields.sources=[{...A[l.SOURCES][0]}]),o===l.DESTINATIONS&&(t.fields.destinations?t.fields.destinations.push({...A[l.DESTINATIONS][0]}):t.fields.destinations=[{...A[l.DESTINATIONS][0]}]))},Te=e.computed(()=>{var o;return j(t)?(o=de[t.fields.protocols])==null?void 0:o.filter(r=>!t.fields[r]):!1}),q=async(o,r)=>{if(j(t)){if(typeof r<"u"){let m=[];if(m=t.fields[o],m.splice(r,1),m.length){t.fields[o]=m;return}}await e.nextTick(()=>{delete t.fields[o],o===l.METHODS&&(re.value=[""])})}},fe=o=>{var m;return((m=f.source.form.fields[o])==null?void 0:m.label)||""};e.watch(()=>t.fields.protocols,()=>{S()});const S=()=>{const o=Object.keys(A),r=de[t.fields.protocols];Object.keys(t.fields).filter(k=>o.includes(k)).forEach(k=>{r!=null&&r.includes(k)||q(k)})},C=e.computed(()=>{if(j(t)){const o=[];return t.fields.methods&&Object.entries(t.fields.methods).forEach(([r,m])=>{m&&o.push(r)}),o}return[]}),I=e.computed(()=>{var o;return((o=t.fields.protocols)==null?void 0:o.split(","))||[]}),O=e.computed(()=>{const o=Object.keys(A);return!Object.keys(t.fields).filter(m=>o.includes(m)).length}),H=e.computed(()=>{if($(["tls_passthrough"]))return[fe(l.SNIS)];const o=de[t.fields.protocols].map(r=>fe(r));return[[...o].splice(0,o.length-1).join(", "),o[o.length-1]]}),J=o=>{var m,k;if(i.routeId){const F=typeof o.expression=="string"&&o.expression.length>0?T.EXPRESSIONS:T.TRADITIONAL;u.value=F,n.value=`#${F}`}(m=o==null?void 0:o.service)!=null&&m.id&&(t.fields.service_id=o.service.id),t.fields.name=(o==null?void 0:o.name)||"";const r=(o==null?void 0:o.tags)||[];t.fields.tags=(r==null?void 0:r.join(", "))||"",t.fields.preserve_host=typeof(o==null?void 0:o.preserve_host)>"u"?!1:o==null?void 0:o.preserve_host,t.fields.https_redirect_status_code=(o==null?void 0:o.https_redirect_status_code)||426,(k=o==null?void 0:o.protocols)!=null&&k.length&&(o.protocols.length>1?t.fields.protocols=o.protocols.join():t.fields.protocols=o.protocols[0]),t.fields.request_buffering=typeof(o==null?void 0:o.request_buffering)>"u"?!0:o==null?void 0:o.request_buffering,t.fields.response_buffering=typeof(o==null?void 0:o.response_buffering)>"u"?!0:o==null?void 0:o.response_buffering,t.fields.strip_path=typeof(o==null?void 0:o.strip_path)>"u"?!0:o==null?void 0:o.strip_path,j(t)&&(t.fields.regex_priority=(o==null?void 0:o.regex_priority)||0,t.fields.path_handling=(o==null?void 0:o.path_handling)||"v0",o!=null&&o.paths&&(t.fields.paths=o.paths),o!=null&&o.snis&&(t.fields.snis=o.snis),o!=null&&o.hosts&&(t.fields.hosts=o.hosts),o!=null&&o.methods&&pe(o.methods),o!=null&&o.headers&&(t.fields.headers=be(o.headers)),o!=null&&o.sources&&(t.fields.sources=o.sources),o!=null&&o.destinations&&(t.fields.destinations=o.destinations)),ue(t)&&(t.fields.expression=(o==null?void 0:o.expression)||"",t.fields.priority=(o==null?void 0:o.priority)||0),Object.assign(ie,JSON.parse(JSON.stringify(t.fields)))},le=e.computed(()=>{var o;switch(V.value){case T.TRADITIONAL:{if(j(t)){const r=t.fields.hosts?!!t.fields.hosts.filter(Boolean).length:null,m=t.fields.paths?!!t.fields.paths.filter(Boolean).length:null,k=t.fields.headers?t.fields.headers.some(({header:ee})=>!!ee):null,F=t.fields.snis?!!t.fields.snis.filter(Boolean).length:null,v=t.fields.destinations?t.fields.destinations.some(({ip:ee})=>!!ee):null,X=t.fields.sources?t.fields.sources.some(({ip:ee})=>!!ee):null,d=((o=t.fields.methods)==null?void 0:o.CUSTOM)?re.value.some(ee=>!!ee):Object.values(t.fields.methods||{}).includes(!0);return!!t.fields.protocols&&($(["http"])&&!!(r||d||m||k)||$(["https"])&&!!(r||d||m||k||F)||$(["grpc"])&&!!(r||m||k)||$(["grpcs","wss"])&&!!(r||m||k||F)||$(["udp","tls"])&&!!(v||X||F)||$(["tcp"])&&!!(v||X)||$(["tls_passthrough"])&&!!F||$(["ws"])&&!!(r||m||k))}break}case T.EXPRESSIONS:{if(ue(t))return t.fields.expression.length>0;break}}return!0}),g=e.computed(()=>!Fe(t.fields,ie)),w=e.computed(()=>{var r,m;let o=`${i.config.apiBaseUrl}${ne.form[i.config.app][he.value][i.serviceId?"forGatewayService":"all"]}`;return i.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((r=i.config)==null?void 0:r.controlPlaneId)||"").replace(/{serviceId}/gi,i.serviceId||""):i.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(m=i.config)!=null&&m.workspace?`/${i.config.workspace}`:"").replace(/{serviceId}/gi,i.serviceId||"")),o=o.replace(/{id}/gi,i.routeId),o});e.watch(()=>t.fields,()=>{c("model-updated",ge.value)},{deep:!0});const se=o=>o!=null&&o.length?o:null,$t=()=>{var o,r;if(j(t)){const m={methods:null,hosts:se(Z(l.HOSTS,t.fields.hosts||[])),paths:se(Z(l.PATHS,t.fields.paths||[])),headers:Ne(),regex_priority:Number(t.fields.regex_priority),path_handling:t.fields.path_handling,sources:se(Z(l.SOURCES,t.fields.sources||[])),destinations:se(Z(l.DESTINATIONS,t.fields.destinations||[])),snis:se(Z(l.SNIS,t.fields.snis||[]))};if((o=C.value)!=null&&o.length&&(m.methods=[...C.value],(r=C.value)!=null&&r.includes("CUSTOM"))){const k=m.methods.indexOf("CUSTOM");k!==-1&&m.methods.splice(k,1),re.value.forEach(F=>{var v;F&&m.methods&&!((v=m.methods)!=null&&v.includes(F))&&m.methods.push(F.toUpperCase())})}return m}},Ft=()=>{if(ue(t))return{expression:t.fields.expression,priority:Number(t.fields.priority)}},ge=e.computed(()=>{var r,m;const o={...!i.hideNameField&&{name:t.fields.name||null},protocols:t.fields.protocols.split(","),https_redirect_status_code:t.fields.https_redirect_status_code,strip_path:$(["grpc","gprcs"])?!1:t.fields.strip_path,preserve_host:t.fields.preserve_host,request_buffering:t.fields.request_buffering,response_buffering:t.fields.response_buffering,tags:(m=(r=t.fields.tags.split(","))==null?void 0:r.map(k=>String(k||"").trim()))==null?void 0:m.filter(k=>k!==""),service:t.fields.service_id?{id:t.fields.service_id}:null};switch(V.value){case T.TRADITIONAL:return{...o,...$t()};case T.EXPRESSIONS:return{...o,...Ft()};default:return o}}),Pt=o=>{switch(V.value){case T.TRADITIONAL:{if(!("regex_priority"in o&&"path_handling"in o))return!1;break}case T.EXPRESSIONS:{if(!("priority"in o))return!1;break}}return"service"in o&&"tags"in o&&"protocols"in o},_e=async o=>{var m;const r=o&&Pt(o)?o:ge.value;try{t.isReadonly=!0;let k;he.value==="create"?k=await E.post(w.value,r):he.value==="edit"&&(k=((m=i.config)==null?void 0:m.app)==="konnect"?await E.put(w.value,r):await E.patch(w.value,r)),J(k==null?void 0:k.data),c("update",k==null?void 0:k.data)}catch(k){t.errorMessage=_(k),c("error",k)}finally{t.isReadonly=!1}},{debouncedQueryChange:Ht,loading:Ut,error:Mt,loadItems:Lt,results:qt}=y.useDebouncedFilter(i.config,ne.form[i.config.app].services,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),Kt=e.computed(()=>Mt.value?a("errors.services.fetch"):""),Gt=e.computed(()=>{var o;return(o=qt.value)==null?void 0:o.map(r=>({label:r.id,name:r.name,value:r.id}))});return e.onBeforeMount(async()=>{!i.hideServiceField&&!i.serviceId?await Lt():t.fields.service_id=i.serviceId}),e.onMounted(()=>{c("model-updated",ge.value)}),N({saveFormData:_e,getPayload:ge}),(o,r)=>{const m=e.resolveComponent("KInput"),k=e.resolveComponent("KSelect"),F=e.resolveComponent("KAlert"),v=e.resolveComponent("KCard"),X=e.resolveComponent("KCheckbox"),we=e.resolveComponent("KCollapse");return e.openBlock(),e.createElementBlock("div",ht,[e.createVNode(e.unref(y.EntityBaseForm),{"can-submit":le.value&&g.value,config:s.config,"edit-id":s.routeId,"entity-type":e.unref(y.SupportedEntityType).Route,"error-message":t.errorMessage||Kt.value,"fetch-url":Ee.value,"form-fields":ge.value,"is-readonly":t.isReadonly,onCancel:Se,"onFetch:error":ce,"onFetch:success":J,onLoading:Q,onSubmit:_e},{"form-actions":e.withCtx(()=>[e.renderSlot(o.$slots,"form-actions",{canSubmit:le.value&&g.value,cancel:Se,submit:_e},void 0,!0)]),default:e.withCtx(()=>[P.value?(e.openBlock(),e.createBlock(e.unref(y.EntityFormSection),{key:0,description:e.unref(a)("form.sections.general.description"),"hide-info-header":s.hideSectionsInfo,title:e.unref(a)("form.sections.general.title")},{default:e.withCtx(()=>[s.hideNameField?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0,modelValue:t.fields.name,"onUpdate:modelValue":r[0]||(r[0]=d=>t.fields.name=d),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"route-form-name",label:e.unref(a)("form.fields.name.label"),placeholder:e.unref(a)("form.fields.name.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"])),!s.hideServiceField&&!s.serviceId?(e.openBlock(),e.createElementBlock("div",gt,[e.createVNode(k,{modelValue:t.fields.service_id,"onUpdate:modelValue":r[1]||(r[1]=d=>t.fields.service_id=d),clearable:"","data-testid":"route-form-service-id","enable-filtering":"","filter-function":()=>!0,items:Gt.value,label:e.unref(a)("form.fields.service_id.label"),loading:e.unref(Ut),placeholder:e.unref(a)("form.fields.service_id.placeholder"),readonly:t.isReadonly,"reuse-item-template":"",width:"100%",onQueryChange:e.unref(Ht)},{loading:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(a)("actions.loading")),1)]),empty:e.withCtx(()=>[e.createElementVNode("div",yt,e.toDisplayString(e.unref(a)("search.no_results")),1)]),"selected-item-template":e.withCtx(({item:d})=>[e.createTextVNode(e.toDisplayString(x(d)),1)]),"item-template":e.withCtx(({item:d})=>[e.createElementVNode("div",St,[e.createElementVNode("span",bt,e.toDisplayString(d.name),1),e.createElementVNode("span",Vt,e.toDisplayString(d.value),1)])]),_:1},8,["modelValue","items","label","loading","placeholder","readonly","onQueryChange"])])):e.createCommentVNode("",!0),s.showTagsFiledUnderAdvanced?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:2,modelValue:t.fields.tags,"onUpdate:modelValue":r[2]||(r[2]=d=>t.fields.tags=d),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"route-form-tags",help:e.unref(a)("form.fields.tags.help"),label:e.unref(a)("form.fields.tags.label"),placeholder:e.unref(a)("form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"]))]),_:1},8,["description","hide-info-header","title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y.EntityFormSection),{description:e.unref(a)("form.sections.config.description"),"hide-info-header":s.hideSectionsInfo,title:e.unref(a)("form.sections.config.title")},{default:e.withCtx(()=>[e.createVNode(k,{modelValue:t.fields.protocols,"onUpdate:modelValue":r[3]||(r[3]=d=>t.fields.protocols=d),"data-testid":"route-form-protocols",items:ke,label:e.unref(a)("form.fields.protocols.label"),"label-attributes":{info:e.unref(a)("form.fields.protocols.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:t.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","label-attributes","readonly"]),e.createVNode(mt,{modelValue:n.value,"onUpdate:modelValue":r[44]||(r[44]=d=>n.value=d),"route-flavors":s.routeFlavors,tooltips:s.configTabTooltips},e.createSlots({_:2},[s.routeFlavors.traditional&&s.routeFlavors.expressions&&(!u.value||u.value!==p.value)?{name:"before-content",fn:e.withCtx(()=>[e.createVNode(F,{appearance:u.value?"warning":"info",class:"route-form-config-type-immutable-alert","data-testid":"route-config-type-immutable-alert"},{default:e.withCtx(()=>[u.value?u.value!==p.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(a)("form.warning.cannotChangeFlavor.edit",{format:e.unref(a)(`form.flavors.${u.value}`)})),1)],64)):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(a)("form.warning.cannotChangeFlavor.create")),1)],64))]),_:1},8,["appearance"])]),key:"0"}:void 0,e.unref(j)(t)?{name:"traditional",fn:e.withCtx(()=>[!u.value||u.value===e.unref(T).TRADITIONAL?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.fields.protocols?(e.openBlock(),e.createBlock(v,{key:0},{title:e.withCtx(()=>[e.createElementVNode("div",Ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,d=>(e.openBlock(),e.createElementBlock("span",{key:d,class:"protocol-title"},e.toDisplayString(d.toUpperCase()),1))),128)),e.createElementVNode("span",kt,e.toDisplayString(e.unref(a)("form.sections.routingRules.title")),1)])]),default:e.withCtx(()=>[O.value?(e.openBlock(),e.createBlock(F,{key:0,appearance:"warning","data-testid":"routing-rules-warning"},{default:e.withCtx(()=>[e.createVNode(e.unref(B),{keypath:"form.warning.rulesMessage"},{protocol:e.withCtx(()=>[e.createElementVNode("b",null,e.toDisplayString(e.unref(D)[t.fields.protocols]),1)]),routingRules:e.withCtx(()=>[e.createVNode(e.unref(B),{keypath:H.value[1]?"form.warning.multipleRules":"form.warning.singleRule"},{routingRules:e.withCtx(()=>[e.createElementVNode("b",null,e.toDisplayString(H.value[0]),1)]),lastRoutingRule:e.withCtx(()=>[e.createElementVNode("b",null,e.toDisplayString(H.value[1]),1)]),_:1},8,["keypath"])]),_:1})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[t.fields.paths?(e.openBlock(),e.createBlock(at,{key:"paths-container",modelValue:t.fields.paths,"onUpdate:modelValue":r[4]||(r[4]=d=>t.fields.paths=d),onAdd:r[5]||(r[5]=d=>Y(e.unref(l).PATHS)),onRemove:r[6]||(r[6]=d=>q(e.unref(l).PATHS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.snis?(e.openBlock(),e.createBlock(ct,{key:"snis-container",modelValue:t.fields.snis,"onUpdate:modelValue":r[7]||(r[7]=d=>t.fields.snis=d),onAdd:r[8]||(r[8]=d=>Y(e.unref(l).SNIS)),onRemove:r[9]||(r[9]=d=>q(e.unref(l).SNIS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.hosts?(e.openBlock(),e.createBlock(tt,{key:"hosts-container",modelValue:t.fields.hosts,"onUpdate:modelValue":r[10]||(r[10]=d=>t.fields.hosts=d),onAdd:r[11]||(r[11]=d=>Y(e.unref(l).HOSTS)),onRemove:r[12]||(r[12]=d=>q(e.unref(l).HOSTS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.methods?(e.openBlock(),e.createBlock(nt,{key:"methods-container",modelValue:t.fields.methods,"onUpdate:modelValue":r[13]||(r[13]=d=>t.fields.methods=d),"custom-methods":re.value,onRemove:r[14]||(r[14]=d=>q(e.unref(l).METHODS)),onUpdateCustomMethods:r[15]||(r[15]=d=>re.value=d)},null,8,["modelValue","custom-methods"])):e.createCommentVNode("",!0),t.fields.headers?(e.openBlock(),e.createBlock(ve,{key:"headers-container",modelValue:t.fields.headers,"onUpdate:modelValue":r[16]||(r[16]=d=>t.fields.headers=d),onAdd:r[17]||(r[17]=d=>Y(e.unref(l).HEADERS)),onRemove:r[18]||(r[18]=d=>q(e.unref(l).HEADERS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.sources?(e.openBlock(),e.createBlock(ft,{key:"sources-container",modelValue:t.fields.sources,"onUpdate:modelValue":r[19]||(r[19]=d=>t.fields.sources=d),onAdd:r[20]||(r[20]=d=>Y(e.unref(l).SOURCES)),onRemove:r[21]||(r[21]=d=>q(e.unref(l).SOURCES,d))},null,8,["modelValue"])):e.createCommentVNode("",!0),t.fields.destinations?(e.openBlock(),e.createBlock(Ye,{key:"destinations-container",modelValue:t.fields.destinations,"onUpdate:modelValue":r[22]||(r[22]=d=>t.fields.destinations=d),onAdd:r[23]||(r[23]=d=>Y(e.unref(l).DESTINATIONS)),onRemove:r[24]||(r[24]=d=>q(e.unref(l).DESTINATIONS,d))},null,8,["modelValue"])):e.createCommentVNode("",!0)]),_:1}),Te.value?(e.openBlock(),e.createElementBlock("div",Et,[r[45]||(r[45]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("div",Nt,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de[t.fields.protocols],d=>(e.openBlock(),e.createElementBlock("li",{key:d},[e.createElementVNode("label",{"aria-disabled":!!t.fields[d],class:e.normalizeClass(["option",{"is-selected":t.fields[d]}]),"data-testid":`routing-rule-${d}`,role:"button",onClick:ee=>Y(d)},e.toDisplayString(fe(d)),11,Tt)]))),128))])])])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createVNode(we,{modelValue:b.value,"onUpdate:modelValue":r[33]||(r[33]=d=>b.value=d),class:"route-form-advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(a)("form.viewAdvancedFields")},{default:e.withCtx(()=>[e.createElementVNode("div",_t,[t.fields.paths?(e.openBlock(),e.createBlock(k,{key:0,modelValue:t.fields.path_handling,"onUpdate:modelValue":r[25]||(r[25]=d=>t.fields.path_handling=d),"data-testid":"route-form-path-handling",items:ae,label:e.unref(a)("form.fields.path_handling.label"),"label-attributes":{info:e.unref(a)("form.fields.path_handling.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:t.isReadonly,width:"100%"},null,8,["modelValue","label","label-attributes","readonly"])):e.createCommentVNode("",!0),e.createVNode(k,{modelValue:t.fields.https_redirect_status_code,"onUpdate:modelValue":r[26]||(r[26]=d=>t.fields.https_redirect_status_code=d),"data-testid":"route-form-http-redirect-status-code",items:ye,label:e.unref(a)("form.fields.https_redirect_status_code.label"),readonly:t.isReadonly,width:"100%"},null,8,["modelValue","label","readonly"]),e.createVNode(m,{modelValue:t.fields.regex_priority,"onUpdate:modelValue":r[27]||(r[27]=d=>t.fields.regex_priority=d),autocomplete:"off","data-testid":"route-form-regex-priority",label:e.unref(a)("form.fields.regex_priority.label"),readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","readonly"]),s.showTagsFiledUnderAdvanced?(e.openBlock(),e.createBlock(m,{key:1,modelValue:t.fields.tags,"onUpdate:modelValue":r[28]||(r[28]=d=>t.fields.tags=d),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"route-form-tags",help:e.unref(a)("form.fields.tags.help"),label:e.unref(a)("form.fields.tags.label"),placeholder:e.unref(a)("form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])):e.createCommentVNode("",!0),$(["http","https","ws","wss","tls","tcp","udp","tls_passthrough"])?(e.openBlock(),e.createBlock(X,{key:2,modelValue:t.fields.strip_path,"onUpdate:modelValue":r[29]||(r[29]=d=>t.fields.strip_path=d),"data-testid":"route-form-strip-path",label:e.unref(a)("form.fields.strip_path.label")},null,8,["modelValue","label"])):e.createCommentVNode("",!0),e.createVNode(X,{modelValue:t.fields.preserve_host,"onUpdate:modelValue":r[30]||(r[30]=d=>t.fields.preserve_host=d),"data-testid":"route-form-preserve-host",label:e.unref(a)("form.fields.preserve_host.label")},null,8,["modelValue","label"]),e.createVNode(X,{modelValue:t.fields.request_buffering,"onUpdate:modelValue":r[31]||(r[31]=d=>t.fields.request_buffering=d),"data-testid":"route-form-request-buffering",label:e.unref(a)("form.fields.request_buffering.label")},null,8,["modelValue","label"]),e.createVNode(X,{modelValue:t.fields.response_buffering,"onUpdate:modelValue":r[32]||(r[32]=d=>t.fields.response_buffering=d),"data-testid":"route-form-response-buffering",label:e.unref(a)("form.fields.response_buffering.label")},null,8,["modelValue","label"])])]),_:1},8,["modelValue","trigger-label"])],64)):e.createCommentVNode("",!0)]),key:"1"}:void 0,e.unref(ue)(t)?{name:"expressions",fn:e.withCtx(()=>[!u.value||u.value===e.unref(T).EXPRESSIONS?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.fields.protocols?(e.openBlock(),e.createBlock(v,{key:0},{title:e.withCtx(()=>[e.createElementVNode("div",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,d=>(e.openBlock(),e.createElementBlock("span",{key:d,class:"protocol-title"},e.toDisplayString(d.toUpperCase()),1))),128)),e.createElementVNode("span",It,e.toDisplayString(e.unref(a)("form.sections.routingExpression.title")),1)])]),default:e.withCtx(()=>[e.createVNode(ut,{modelValue:t.fields.expression,"onUpdate:modelValue":r[34]||(r[34]=d=>t.fields.expression=d),protocol:L.value,"show-expressions-modal-entry":s.showExpressionsModalEntry,onNotify:r[35]||(r[35]=d=>c("notify",d))},{"after-editor":e.withCtx(d=>[e.renderSlot(o.$slots,"after-expressions-editor",{expression:d.expression,state:d.state},void 0,!0)]),_:3},8,["modelValue","protocol","show-expressions-modal-entry"])]),_:3})):e.createCommentVNode("",!0),e.createVNode(we,{modelValue:b.value,"onUpdate:modelValue":r[43]||(r[43]=d=>b.value=d),class:"route-form-advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(a)("form.viewAdvancedFields")},{default:e.withCtx(()=>[e.createElementVNode("div",Rt,[e.createVNode(k,{modelValue:t.fields.https_redirect_status_code,"onUpdate:modelValue":r[36]||(r[36]=d=>t.fields.https_redirect_status_code=d),"data-testid":"route-form-http-redirect-status-code",items:ye,label:e.unref(a)("form.fields.https_redirect_status_code.label"),readonly:t.isReadonly,width:"100%"},null,8,["modelValue","label","readonly"]),e.createVNode(m,{modelValue:t.fields.priority,"onUpdate:modelValue":r[37]||(r[37]=d=>t.fields.priority=d),autocomplete:"off","data-testid":"route-form-priority",label:e.unref(a)("form.fields.priority.label"),"label-attributes":{info:e.unref(a)("form.fields.priority.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"]),s.showTagsFiledUnderAdvanced?(e.openBlock(),e.createBlock(m,{key:0,modelValue:t.fields.tags,"onUpdate:modelValue":r[38]||(r[38]=d=>t.fields.tags=d),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"route-form-tags",help:e.unref(a)("form.fields.tags.help"),label:e.unref(a)("form.fields.tags.label"),placeholder:e.unref(a)("form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])):e.createCommentVNode("",!0),$(["http","https","ws","wss","tls","tcp","udp","tls_passthrough"])?(e.openBlock(),e.createBlock(X,{key:1,modelValue:t.fields.strip_path,"onUpdate:modelValue":r[39]||(r[39]=d=>t.fields.strip_path=d),"data-testid":"route-form-strip-path",label:e.unref(a)("form.fields.strip_path.label")},null,8,["modelValue","label"])):e.createCommentVNode("",!0),e.createVNode(X,{modelValue:t.fields.preserve_host,"onUpdate:modelValue":r[40]||(r[40]=d=>t.fields.preserve_host=d),"data-testid":"route-form-preserve-host",label:e.unref(a)("form.fields.preserve_host.label")},null,8,["modelValue","label"]),e.createVNode(X,{modelValue:t.fields.request_buffering,"onUpdate:modelValue":r[41]||(r[41]=d=>t.fields.request_buffering=d),"data-testid":"route-form-request-buffering",label:e.unref(a)("form.fields.request_buffering.label")},null,8,["modelValue","label"]),e.createVNode(X,{modelValue:t.fields.response_buffering,"onUpdate:modelValue":r[42]||(r[42]=d=>t.fields.response_buffering=d),"data-testid":"route-form-response-buffering",label:e.unref(a)("form.fields.response_buffering.label")},null,8,["modelValue","label"])])]),_:1},8,["modelValue","trigger-label"])],64)):e.createCommentVNode("",!0)]),key:"2"}:void 0]),1032,["modelValue","route-flavors","tooltips"])]),_:3},8,["description","hide-info-header","title"])]),_:3},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-e155aee1"]]),xt={class:"kong-ui-entities-route-entity-config-card"},At={key:2},Ot=e.defineComponent({__name:"RouteConfigCard",props:{config:{type:Object,required:!0,validator:s=>!(!s||!["konnect","kongManager"].includes(s==null?void 0:s.app)||s.app==="konnect"&&!s.controlPlaneId||s.app==="kongManager"&&typeof s.workspace!="string"||!s.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},serviceId:{type:String,required:!1,default:""}},emits:["loading","fetch:error","fetch:success","navigation-click"],setup(s,{emit:N}){var W;const h=N,i=s,{axiosInstance:c}=y.useAxios((W=i.config)==null?void 0:W.axiosRequestConfig),{i18n:{t:n},i18nT:p}=K.useI18n(),u=e.ref(""),b=e.ref(""),V=e.ref(!1),B=e.computed(()=>{var E,_;return(_=ne.item[(E=i.config)==null?void 0:E.app])==null?void 0:_[i.serviceId?"forGatewayService":"all"].replace(/{serviceId}/gi,i.serviceId)}),f=e.computed(()=>{var E;return(E=ne.item[i.config.app])==null?void 0:E.getService}),a=async E=>{var P,x,t;if(u.value=i.serviceId||((P=E==null?void 0:E.service)==null?void 0:P.id),h("fetch:success",E),!u.value)return;let _=`${i.config.apiBaseUrl}${f.value}`;i.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((x=i.config)==null?void 0:x.controlPlaneId)||"").replace(/{serviceId}/gi,u.value||""):i.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(t=i.config)!=null&&t.workspace?`/${i.config.workspace}`:"").replace(/{serviceId}/gi,u.value||""));try{V.value=!0;const{data:L}=await c.get(_);b.value=(L==null?void 0:L.name)||(L==null?void 0:L.id)}catch(L){h("fetch:error",L)}finally{V.value=!1}},D=e.ref({id:{},name:{tooltip:n("form.fields.name.tooltip")},created_at:{},updated_at:{},service:{label:n("form.fields.service.label"),section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.service.tooltip"),order:5},tags:{tooltip:n("form.fields.tags.tooltip"),order:6},protocols:{section:y.ConfigurationSchemaSection.Basic,type:y.ConfigurationSchemaType.BadgeTag,order:7},paths:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.paths.tooltip"),type:y.ConfigurationSchemaType.CopyBadge,order:8},hosts:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.hosts.tooltipConfig"),type:y.ConfigurationSchemaType.CopyBadge,order:9},snis:{label:n("form.fields.snis.label"),tooltip:n("form.fields.snis.tooltip"),order:10},headers:{section:y.ConfigurationSchemaSection.Basic,order:11},methods:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.methods.tooltip"),type:y.ConfigurationSchemaType.BadgeMethod,order:12},sources:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.sources.tooltip"),type:y.ConfigurationSchemaType.JsonArray,order:13},destinations:{section:y.ConfigurationSchemaSection.Basic,tooltip:n("form.fields.destinations.tooltip"),type:y.ConfigurationSchemaType.JsonArray,order:14},https_redirect_status_code:{order:1},regex_priority:{tooltip:n("form.fields.regex_priority.tooltip"),order:2},strip_path:{order:3},preserve_host:{order:4},request_buffering:{tooltip:n("form.fields.request_buffering.tooltip"),order:5},response_buffering:{tooltip:n("form.fields.response_buffering.tooltip"),order:6},path_handling:{tooltip:n("form.fields.path_handling.tooltipConfig"),order:7}});return(E,_)=>{const P=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",xt,[e.createVNode(e.unref(y.EntityBaseConfigCard),{config:s.config,"config-card-doc":s.configCardDoc,"config-schema":D.value,"entity-type":e.unref(y.SupportedEntityType).Route,"fetch-url":B.value,"hide-title":s.hideTitle,"onFetch:error":_[0]||(_[0]=x=>E.$emit("fetch:error",x)),"onFetch:success":a,onLoading:_[1]||(_[1]=x=>E.$emit("loading",x))},{"https_redirect_status_code-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.https_redirect_status_code.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.https_redirect_status_code.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.https_redirect_status_code.code2")),1)]),code3:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.https_redirect_status_code.code3")),1)]),code4:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.https_redirect_status_code.code4")),1)]),_:1})]),"regex_priority-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.regex_priority.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.regex_priority.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.regex_priority.code2")),1)]),_:1})]),"protocols-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.protocols.tooltipConfig",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code2")),1)]),code3:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code3")),1)]),code4:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code4")),1)]),code5:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.protocols.code5")),1)]),_:1})]),"headers-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.headers.tooltipConfig",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code2")),1)]),code3:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code3")),1)]),code4:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code4")),1)]),_:1})]),"strip_path-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.strip_path.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.headers.code1")),1)]),_:1})]),"preserve_host-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"form.fields.preserve_host.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code2")),1)]),code3:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code3")),1)]),code4:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code4")),1)]),code5:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(n)("form.fields.preserve_host.code5")),1)]),_:1})]),service:e.withCtx(({row:x})=>[V.value?(e.openBlock(),e.createBlock(P,{key:0,"data-testid":"service-name-loader",type:"spinner"})):x.value&&x.value.id===u.value&&b.value?(e.openBlock(),e.createBlock(e.unref(y.InternalLinkItem),{key:1,item:{key:x.value.id,value:b.value,type:e.unref(y.ConfigurationSchemaType).LinkInternal},onNavigationClick:()=>E.$emit("navigation-click",x.value.id,"services")},null,8,["item","onNavigationClick"])):(e.openBlock(),e.createElementBlock("div",At,e.toDisplayString("-")))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),Dt=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"RouteFormExpressionsEditor",props:e.mergeModels({protocol:{},showExpressionsModalEntry:{type:Boolean},hintText:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["notify"],["update:modelValue"]),setup(s,{emit:N}){const h=s,i=e.useModel(s,"modelValue"),c=N,n=e.ref(!1),p=e.computed(()=>me.PROTOCOL_TO_SCHEMA[h.protocol]),u=e.computed(()=>me.HTTP_BASED_PROTOCOLS.includes(h.protocol??"")),b=e.computed(()=>u.value?void 0:`${h.hintText}${me.HTTP_BASED_PROTOCOLS}`),V=a=>{i.value=a,n.value=!1},B=a=>{c("notify",a)},f=()=>{u.value&&(n.value=!0)};return(a,D)=>{const W=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock(e.Fragment,null,[p.value!==void 0?(e.openBlock(),e.createBlock(e.unref(me.ExpressionsEditor),{key:0,modelValue:i.value,"onUpdate:modelValue":D[0]||(D[0]=E=>i.value=E),schema:p.value},null,8,["modelValue","schema"])):e.createCommentVNode("",!0),e.createVNode(W,{placement:"bottom-start",text:b.value},{default:e.withCtx(()=>[a.showExpressionsModalEntry?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass({disabled:!u.value,"route-form-open-in-playground":!0}),"data-testid":"open-router-playground",onClick:f},[e.renderSlot(a.$slots,"default")],2)):e.createCommentVNode("",!0)]),_:3},8,["text"]),a.showExpressionsModalEntry&&u.value?(e.openBlock(),e.createBlock(e.unref(me.RouterPlaygroundModal),{key:1,"initial-expression":i.value,"is-visible":n.value,onCancel:D[1]||(D[1]=E=>n.value=!1),onCommit:V,onNotify:B},null,8,["initial-expression","is-visible"])):e.createCommentVNode("",!0)],64)}}})},Symbol.toStringTag,{value:"Module"}));R.ExpressionsEditorState=te,R.Methods=De,R.RouteConfigCard=Ot,R.RouteFlavor=T,R.RouteForm=Bt,R.RouteList=ze,R.RoutingRulesEntities=l,R.stateHasExpressionsFlavor=ue,R.stateHasTraditionalFlavor=j,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-routes",
3
- "version": "3.9.4-pr.1964.c866400a2.0",
3
+ "version": "3.9.4",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-routes.umd.js",
6
6
  "module": "./dist/entities-routes.es.js",
@@ -38,8 +38,8 @@
38
38
  "vite-plugin-monaco-editor": "^1.1.0",
39
39
  "vue": "^3.5.12",
40
40
  "vue-router": "^4.4.5",
41
- "@kong-ui-public/entities-shared": "^3.17.1",
42
- "@kong-ui-public/i18n": "^2.2.10"
41
+ "@kong-ui-public/i18n": "^2.2.10",
42
+ "@kong-ui-public/entities-shared": "^3.17.1"
43
43
  },
44
44
  "repository": {
45
45
  "type": "git",