@kong-ui-public/entities-gateway-services 3.10.5 → 3.10.6-pr.2001.e73b22c4d.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import { defineComponent as Te, computed as b, ref as E, watch as Ie, onBeforeMount as Le, resolveComponent as F, openBlock as S, createElementBlock as U, createVNode as d, unref as o, createSlots as Ee, withCtx as f, createBlock as ue, Teleport as Pe, createElementVNode as k, createCommentVNode as L, createTextVNode as R, toDisplayString as y, withModifiers as Se, reactive as Ue, onMounted as De, renderSlot as Ge } from "vue";
2
- import { useRouter as xe } from "vue-router";
3
- import { BookIcon as Re, AddIcon as Ke, ServicesIcon as qe } from "@kong/icons";
4
- import { createI18n as Oe, i18nTComponent as Ne } from "@kong-ui-public/i18n";
5
- import { useAxios as Ae, useTableState as We, useFetcher as je, useDeleteUrlBuilder as He, FetcherStatus as Je, EntityBaseTable as ze, EntityFilter as Qe, PermissionsWrapper as ie, TableTags as Xe, EntityEmptyState as Ze, EntityToggleModal as Ye, EntityDeleteModal as et, EntityTypes as tt, useErrors as ot, useValidators as lt, EntityBaseFormType as Me, useGatewayFeatureSupported as it, EntityBaseForm as st, SupportedEntityType as Fe, EntityFormSection as $e, useHelpers as rt, ConfigurationSchemaSection as fe, ConfigurationSchemaType as at, EntityBaseConfigCard as nt } from "@kong-ui-public/entities-shared";
6
- const ct = {
1
+ import { defineComponent as Le, computed as h, ref as W, watch as Ue, onBeforeMount as lt, resolveComponent as D, openBlock as C, createElementBlock as F, createVNode as d, unref as o, createSlots as xe, withCtx as v, createBlock as Fe, Teleport as je, createElementVNode as S, createCommentVNode as T, createTextVNode as z, toDisplayString as P, withModifiers as Ke, reactive as Te, onMounted as Je, renderSlot as Qe, toValue as ze, Transition as We, Fragment as ot, renderList as it } from "vue";
2
+ import { useRouter as qe } from "vue-router";
3
+ import { BookIcon as He, AddIcon as rt, ServicesIcon as st } from "@kong/icons";
4
+ import { createI18n as at, i18nTComponent as nt } from "@kong-ui-public/i18n";
5
+ import { useAxios as Oe, useTableState as ct, useFetcher as dt, useDeleteUrlBuilder as ut, FetcherStatus as ft, EntityBaseTable as pt, EntityFilter as mt, PermissionsWrapper as Ee, TableTags as vt, EntityEmptyState as gt, EntityToggleModal as yt, EntityDeleteModal as _t, EntityTypes as bt, useErrors as Xe, useValidators as Ye, EntityBaseFormType as Me, useGatewayFeatureSupported as et, EntityBaseForm as tt, SupportedEntityType as Ge, EntityFormSection as Be, useHelpers as ht, ConfigurationSchemaSection as $e, ConfigurationSchemaType as wt, EntityBaseConfigCard as kt } from "@kong-ui-public/entities-shared";
6
+ const Vt = {
7
7
  create: "New gateway service",
8
8
  serverless_create: "Add a Service",
9
9
  copy_id: "Copy ID",
@@ -16,12 +16,12 @@ const ct = {
16
16
  description: "Deleting this Gateway Service will also remove any associated plugins. This action cannot be reversed.",
17
17
  menu_label: "Delete"
18
18
  }
19
- }, dt = {
19
+ }, Ct = {
20
20
  placeholder: {
21
21
  konnect: "Filter by name",
22
22
  kongManager: "Filter by exact name or ID"
23
23
  }
24
- }, ut = {
24
+ }, St = {
25
25
  title: "Gateway Services",
26
26
  list: {
27
27
  toolbar_actions: {
@@ -53,24 +53,53 @@ const ct = {
53
53
  description: "Gateway services represent backend APIs or microservices that receive traffic routed through the gateway."
54
54
  },
55
55
  form: {
56
+ buttons: {
57
+ try_sample: "Try sample API"
58
+ },
59
+ errors: {
60
+ host: {
61
+ empty: "host cannot be empty",
62
+ invalid: "invalid host"
63
+ },
64
+ port: {
65
+ type: "Port must be a number",
66
+ invalid: "Port must be between 0 and 65535"
67
+ },
68
+ path: {
69
+ prefix: "Path must begin with /",
70
+ invalid: "Path should not include characters outside of the reserved list of RFC 3986"
71
+ },
72
+ protocol: {
73
+ empty: "protocol cannot be empty",
74
+ invalid: "protocol - value must be one of http, https, grpc, grpcs, tcp, udp, tls, tls_passthrough, ws, wss"
75
+ }
76
+ },
56
77
  sections: {
57
78
  general: {
58
79
  title: "General Information",
59
- description: "General information will help identify and manage this Gateway Service."
80
+ description: "Provide a name and tags to help identify and manage this service."
60
81
  },
61
82
  keys: {
62
- title: "Service Endpoint",
63
- description: "Define the endpoint for this service by specifying the full URL or by its separate elements.",
83
+ title: "Service endpoint",
84
+ description: "Define where this service should send requests.",
64
85
  checkedGroupLabel: "Choose how and where to send traffic",
65
86
  urlLabel: "Full URL",
66
87
  checkedGroupAltLabel: "Protocol, Host, Port and Path",
67
- viewAdvancedFields: "View Advanced Fields"
88
+ url: {
89
+ label: "Full URL",
90
+ description: "Define the service using a single, complete API URL for simple setup."
91
+ },
92
+ protocol: {
93
+ label: "Protocol, host, port, and path",
94
+ description: "Manually specify each component of the API’s URL for advanced configurations."
95
+ },
96
+ viewAdvancedFields: "View advanced fields"
68
97
  }
69
98
  },
70
99
  fields: {
71
100
  upstream_url: {
72
- label: "Upstream URL",
73
- placeholder: "Enter a URL",
101
+ label: "Full URL",
102
+ placeholder: "e.g. https://www.myapi.com/",
74
103
  tooltip_for_konnect: "This is the URL of the API you will manage in Konnect.",
75
104
  tooltip_for_km: "This is the URL of the API you will manage in Kong Gateway."
76
105
  },
@@ -97,12 +126,12 @@ const ct = {
97
126
  },
98
127
  host: {
99
128
  label: "Host",
100
- placeholder: "Enter a host",
129
+ placeholder: "e.g. www.myapi.com, 127.0.0.1",
101
130
  tooltip: "The host of the upstream server. Note that the host value is case sensitive."
102
131
  },
103
132
  path: {
104
133
  label: "Path",
105
- placeholder: "Enter a path",
134
+ placeholder: "e.g. /sample",
106
135
  tooltip: "The path to be used in request to the upstream server."
107
136
  },
108
137
  port: {
@@ -114,31 +143,31 @@ const ct = {
114
143
  tooltip: "The number of retries to execute upon failure to proxy."
115
144
  },
116
145
  connect_timeout: {
117
- label: "Connection Timeout",
146
+ label: "Connection timeout",
118
147
  tooltip: "The timeout in milliseconds for establishing a connection to the upstream server."
119
148
  },
120
149
  write_timeout: {
121
- label: "Write Timeout",
150
+ label: "Write timeout",
122
151
  tooltip: "The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server."
123
152
  },
124
153
  read_timeout: {
125
- label: "Read Timeout",
154
+ label: "Read timeout",
126
155
  tooltip: "The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server."
127
156
  },
128
157
  client_certificate: {
129
- label: "Client Certificate",
158
+ label: "Client certificate",
130
159
  placeholder: "Enter a Certificate ID",
131
160
  tooltip: "Certificate to be used as client certificate while TLS handshaking to the upstream server."
132
161
  },
133
162
  ca_certificates: {
134
- label: "CA Certificates",
163
+ label: "CA certificates",
135
164
  placeholder: "Enter a comma separated list of CA Certificate IDs",
136
165
  tooltip: "Array of {code1} object UUIDs that are used to build the trust store while verifying upstream server's TLS certificate. If set to {code2} when Nginx default is respected. If default CA list in Nginx are not specified and TLS verification is enabled, then handshake with upstream server will always fail (because no CA are trusted).",
137
166
  code1: "CA Certificate",
138
167
  code2: "null"
139
168
  },
140
169
  tls_verify_enabled: {
141
- label: "TLS Verify",
170
+ label: "TLS verify",
142
171
  help: "If unchecked, use default system setting",
143
172
  tooltip: "Whether to enable verification of upstream server TLS certificate. If set to {code1}, then the Nginx default is respected.",
144
173
  code1: "null"
@@ -160,7 +189,8 @@ const ct = {
160
189
  label: "Tags",
161
190
  tooltip: "An optional set of strings associated with the Service for grouping and filtering.",
162
191
  placeholder: "Enter a list of tags separated by comma",
163
- help: "e.g. tag1, tag2, tag3"
192
+ help: "e.g. tag1, tag2, tag3",
193
+ collapse: "Add tags"
164
194
  },
165
195
  enabled: {
166
196
  label: "Enabled",
@@ -170,39 +200,39 @@ const ct = {
170
200
  }
171
201
  }
172
202
  }
173
- }, ft = {
203
+ }, It = {
174
204
  general: "Gateway Services could not be retrieved",
175
205
  delete: "The gateway service could not be deleted at this time.",
176
206
  copy: "Failed to copy to clipboard",
177
207
  urlErrorMessage: "Error: invalid URL"
178
- }, pt = {
208
+ }, Pt = {
179
209
  success: "Copied {val} to clipboard",
180
210
  success_brief: "Successfully copied to clipboard"
181
- }, mt = {
211
+ }, Et = {
182
212
  gateway_services: "gateway services"
183
- }, vt = {
184
- actions: ct,
185
- search: dt,
186
- gateway_services: ut,
187
- errors: ft,
188
- copy: pt,
189
- glossary: mt
213
+ }, Ft = {
214
+ actions: Vt,
215
+ search: Ct,
216
+ gateway_services: St,
217
+ errors: It,
218
+ copy: Pt,
219
+ glossary: Et
190
220
  };
191
- function gt() {
192
- const n = Oe("en-us", vt);
221
+ function Ut() {
222
+ const n = at("en-us", Ft);
193
223
  return {
194
224
  i18n: n,
195
- i18nT: Ne(n)
225
+ i18nT: nt(n)
196
226
  // Translation component <i18n-t>
197
227
  };
198
228
  }
199
- function yt() {
229
+ function $t() {
200
230
  return {
201
- getPortFromProtocol: (D, p) => {
202
- const c = [80, 443], r = Number(p);
203
- if ((r || r === 0) && !c.includes(r))
204
- return r;
205
- switch (D) {
231
+ getPortFromProtocol: (M, y) => {
232
+ const p = [80, 443], a = Number(y);
233
+ if ((a || a === 0) && !p.includes(a))
234
+ return a;
235
+ switch (M) {
206
236
  case "grpcs":
207
237
  case "tls":
208
238
  case "https":
@@ -218,31 +248,48 @@ function yt() {
218
248
  }
219
249
  };
220
250
  }
221
- const ve = {
222
- useI18n: gt,
223
- usePortFromProtocol: yt
224
- }, pe = "/v2/control-planes/{controlPlaneId}/core-entities", me = "/{workspace}", se = {
251
+ function At() {
252
+ const { i18n: { t: n } } = ge.useI18n();
253
+ return {
254
+ validateHost: (b) => !b || b.trim() === "" ? n("gateway_services.form.errors.host.empty") : /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$|^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(b) ? "" : n("gateway_services.form.errors.host.invalid"),
255
+ validateProtocol: (b, B) => !b || b.trim() === "" ? n("gateway_services.form.errors.protocol.empty") : (b = b.slice(0, -1), B.find((r) => {
256
+ if (r.value === b) return r;
257
+ }) === void 0 ? n("gateway_services.form.errors.protocol.invalid") : ""),
258
+ validatePath: (b) => !b || b === "" ? "" : b.startsWith("/") ? /[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/.test(b) ? n("gateway_services.form.errors.path.invalid") : "" : n("gateway_services.form.errors.path.prefix"),
259
+ validatePort: (b) => {
260
+ if (b == null || b === "")
261
+ return "";
262
+ const B = typeof b == "string" ? parseInt(b, 10) : b;
263
+ return isNaN(B) ? n("gateway_services.form.errors.port.type") : B < 0 || B > 65535 ? n("gateway_services.form.errors.port.invalid") : "";
264
+ }
265
+ };
266
+ }
267
+ const ge = {
268
+ useI18n: Ut,
269
+ usePortFromProtocol: $t,
270
+ useUrlValidators: At
271
+ }, Ae = "/v2/control-planes/{controlPlaneId}/core-entities", Re = "/{workspace}", ye = {
225
272
  list: {
226
273
  konnect: {
227
- all: `${pe}/services`
274
+ all: `${Ae}/services`
228
275
  },
229
276
  kongManager: {
230
- all: `${me}/services`
277
+ all: `${Re}/services`
231
278
  }
232
279
  },
233
280
  form: {
234
281
  konnect: {
235
- create: `${pe}/services`,
236
- validate: `${pe}/v1/schemas/json/service/validate`,
237
- edit: `${pe}/services/{id}`
282
+ create: `${Ae}/services`,
283
+ validate: `${Ae}/v1/schemas/json/service/validate`,
284
+ edit: `${Ae}/services/{id}`
238
285
  },
239
286
  kongManager: {
240
- create: `${me}/services`,
241
- validate: `${me}/schemas/services/validate`,
242
- edit: `${me}/services/{id}`
287
+ create: `${Re}/services`,
288
+ validate: `${Re}/schemas/services/validate`,
289
+ edit: `${Re}/services/{id}`
243
290
  }
244
291
  }
245
- }, _t = "#00abd2", bt = "24px", ht = { class: "kong-ui-entities-gateway-services-list" }, wt = { class: "button-row" }, kt = { class: "empty-state-icon-gateway" }, Ct = { key: 1 }, Vt = /* @__PURE__ */ Te({
292
+ }, Rt = "#00abd2", xt = "24px", Tt = { class: "kong-ui-entities-gateway-services-list" }, Mt = { class: "button-row" }, Bt = { class: "empty-state-icon-gateway" }, Lt = { key: 1 }, Kt = /* @__PURE__ */ Le({
246
293
  __name: "GatewayServiceList",
247
294
  props: {
248
295
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -300,211 +347,211 @@ const ve = {
300
347
  }
301
348
  },
302
349
  emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
303
- setup(n, { emit: D }) {
304
- var l;
305
- const p = D, c = n, { i18n: { t: r, formatUnixTimeStamp: x } } = ve.useI18n(), N = xe(), { axiosInstance: q } = Ae((l = c.config) == null ? void 0 : l.axiosRequestConfig), { hasRecords: a, handleStateChange: P } = We(() => G.value), C = b(() => a.value && c.config.app === "konnect"), ge = b(() => !c.enableV2EmptyStates && c.config.app === "konnect"), ye = b(() => c.config.app !== "kongManager" || !!c.config.disableSorting), O = {
350
+ setup(n, { emit: M }) {
351
+ var c;
352
+ const y = M, p = n, { i18n: { t: a, formatUnixTimeStamp: b } } = ge.useI18n(), B = qe(), { axiosInstance: Z } = Oe((c = p.config) == null ? void 0 : c.axiosRequestConfig), { hasRecords: r, handleStateChange: K } = ct(() => ee.value), I = h(() => r.value && p.config.app === "konnect"), ie = h(() => !p.enableV2EmptyStates && p.config.app === "konnect"), ue = h(() => p.config.app !== "kongManager" || !!p.config.disableSorting), X = {
306
353
  // the Name column is non-hidable
307
- name: { label: r("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
308
- ...c.config.showControlPlaneColumn ? { control_plane: { label: r("gateway_services.list.table_headers.control_plane") } } : {},
309
- protocol: { label: r("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
310
- host: { label: r("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
311
- port: { label: r("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
312
- path: { label: r("gateway_services.list.table_headers.path"), searchable: !0, sortable: !0 },
313
- enabled: { label: r("gateway_services.list.table_headers.enabled"), searchable: !0, sortable: !0 },
314
- tags: { label: r("gateway_services.list.table_headers.tags"), sortable: !1 },
315
- updated_at: { label: r("gateway_services.list.table_headers.updated_at"), sortable: !0 },
316
- created_at: { label: r("gateway_services.list.table_headers.created_at"), sortable: !0 }
317
- }, _e = {
354
+ name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
355
+ ...p.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
356
+ protocol: { label: a("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
357
+ host: { label: a("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
358
+ port: { label: a("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
359
+ path: { label: a("gateway_services.list.table_headers.path"), searchable: !0, sortable: !0 },
360
+ enabled: { label: a("gateway_services.list.table_headers.enabled"), searchable: !0, sortable: !0 },
361
+ tags: { label: a("gateway_services.list.table_headers.tags"), sortable: !1 },
362
+ updated_at: { label: a("gateway_services.list.table_headers.updated_at"), sortable: !0 },
363
+ created_at: { label: a("gateway_services.list.table_headers.created_at"), sortable: !0 }
364
+ }, ke = {
318
365
  columnVisibility: {
319
366
  created_at: !1
320
367
  }
321
- }, H = O, _ = b(() => {
322
- var s, g;
323
- let u = `${c.config.apiBaseUrl}${se.list[c.config.app].all}`;
324
- return c.config.app === "konnect" ? u = u.replace(/{controlPlaneId}/gi, ((s = c.config) == null ? void 0 : s.controlPlaneId) || "") : c.config.app === "kongManager" && (u = u.replace(/\/{workspace}/gi, (g = c.config) != null && g.workspace ? `/${c.config.workspace}` : "")), u;
325
- }), Y = b(() => c.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${_.value}`) : new URL(_.value)), G = E(""), be = b(() => {
326
- const u = c.config.app === "konnect" || c.config.isExactMatch;
327
- if (u)
368
+ }, fe = X, A = h(() => {
369
+ var m, w;
370
+ let g = `${p.config.apiBaseUrl}${ye.list[p.config.app].all}`;
371
+ return p.config.app === "konnect" ? g = g.replace(/{controlPlaneId}/gi, ((m = p.config) == null ? void 0 : m.controlPlaneId) || "") : p.config.app === "kongManager" && (g = g.replace(/\/{workspace}/gi, (w = p.config) != null && w.workspace ? `/${p.config.workspace}` : "")), g;
372
+ }), Y = h(() => p.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${A.value}`) : new URL(A.value)), ee = W(""), re = h(() => {
373
+ const g = p.config.app === "konnect" || p.config.isExactMatch;
374
+ if (g)
328
375
  return {
329
- isExactMatch: u,
330
- placeholder: r(`search.placeholder.${c.config.app}`)
376
+ isExactMatch: g,
377
+ placeholder: a(`search.placeholder.${p.config.app}`)
331
378
  };
332
- const { name: s, enabled: g, protocol: I, host: Z, port: A, path: de } = O;
379
+ const { name: m, enabled: w, protocol: O, host: Q, port: j, path: he } = X;
333
380
  return {
334
- isExactMatch: u,
335
- fields: { name: s, enabled: g, protocol: I, host: Z, port: A, path: de },
336
- schema: c.config.filterSchema
381
+ isExactMatch: g,
382
+ fields: { name: m, enabled: w, protocol: O, host: Q, port: j, path: he },
383
+ schema: p.config.filterSchema
337
384
  };
338
385
  }), {
339
- fetcher: e,
340
- fetcherState: w,
341
- fetcherCacheKey: ee
342
- } = je({ ...c.config, cacheIdentifier: c.cacheIdentifier }, _.value), he = () => {
343
- G.value = "";
344
- }, re = () => {
345
- ee.value++;
346
- }, J = E(null), W = b(() => ({
347
- ctaPath: c.config.createRoute,
348
- ctaText: h.value ? c.isServerless ? r("actions.serverless_create") : r("actions.create") : void 0,
349
- message: `${r("gateway_services.list.empty_state.description")}${c.config.additionMessageForEmptyState ? ` ${c.config.additionMessageForEmptyState}` : ""}`,
350
- title: h.value ? c.isServerless ? r("gateway_services.list.empty_state.serverless_title") : r("gateway_services.list.empty_state.title") : r("gateway_services.title")
351
- })), z = E(!1), T = E(null), Q = b(() => {
352
- const u = {
386
+ fetcher: l,
387
+ fetcherState: R,
388
+ fetcherCacheKey: se
389
+ } = dt({ ...p.config, cacheIdentifier: p.cacheIdentifier }, A.value), Pe = () => {
390
+ ee.value = "";
391
+ }, t = () => {
392
+ se.value++;
393
+ }, U = W(null), ae = h(() => ({
394
+ ctaPath: p.config.createRoute,
395
+ ctaText: $.value ? p.isServerless ? a("actions.serverless_create") : a("actions.create") : void 0,
396
+ message: `${a("gateway_services.list.empty_state.description")}${p.config.additionMessageForEmptyState ? ` ${p.config.additionMessageForEmptyState}` : ""}`,
397
+ title: $.value ? p.isServerless ? a("gateway_services.list.empty_state.serverless_title") : a("gateway_services.list.empty_state.title") : a("gateway_services.title")
398
+ })), ne = W(!1), q = W(null), pe = h(() => {
399
+ const g = {
353
400
  action: "disable",
354
401
  id: "",
355
402
  name: ""
356
403
  };
357
- if (T.value) {
358
- const { enabled: s, id: g, name: I } = T.value;
359
- u.action = s ? "disable" : "enable", u.id = g, u.name = I || g;
404
+ if (q.value) {
405
+ const { enabled: m, id: w, name: O } = q.value;
406
+ g.action = m ? "disable" : "enable", g.id = w, g.name = O || w;
360
407
  }
361
- return u;
362
- }), we = (u) => {
363
- z.value = !0, T.value = u;
364
- }, ae = () => {
365
- z.value = !1, T.value = null;
366
- }, ke = async () => {
367
- var I, Z;
368
- if (!await ((I = c.canEdit) == null ? void 0 : I.call(c, T.value)) || !T.value)
408
+ return g;
409
+ }), ce = (g) => {
410
+ ne.value = !0, q.value = g;
411
+ }, _e = () => {
412
+ ne.value = !1, q.value = null;
413
+ }, Ve = async () => {
414
+ var O, Q;
415
+ if (!await ((O = p.canEdit) == null ? void 0 : O.call(p, q.value)) || !q.value)
369
416
  return;
370
- const s = `${Y.value.href}/${T.value.id}`, g = !T.value.enabled;
417
+ const m = `${Y.value.href}/${q.value.id}`, w = !q.value.enabled;
371
418
  try {
372
- const { data: A } = ((Z = c.config) == null ? void 0 : Z.app) === "konnect" ? await q.put(s, { ...T.value, enabled: g }) : await q.patch(s, { ...T.value, enabled: g });
373
- p("toggle:success", A), T.value.enabled = g;
374
- } catch (A) {
375
- p("error", A);
419
+ const { data: j } = ((Q = p.config) == null ? void 0 : Q.app) === "konnect" ? await Z.put(m, { ...q.value, enabled: w }) : await Z.patch(m, { ...q.value, enabled: w });
420
+ y("toggle:success", j), q.value.enabled = w;
421
+ } catch (j) {
422
+ y("error", j);
376
423
  }
377
- }, Ce = (u) => {
378
- c.config.getControlPlaneRoute && N.push(c.config.getControlPlaneRoute(u));
379
- }, te = (u, s) => {
380
- const g = u.id;
381
- if (!s(g)) {
382
- p("copy:error", {
383
- entity: u,
424
+ }, Ce = (g) => {
425
+ p.config.getControlPlaneRoute && B.push(p.config.getControlPlaneRoute(g));
426
+ }, me = (g, m) => {
427
+ const w = g.id;
428
+ if (!m(w)) {
429
+ y("copy:error", {
430
+ entity: g,
384
431
  field: "id",
385
- message: r("errors.copy")
432
+ message: a("errors.copy")
386
433
  });
387
434
  return;
388
435
  }
389
- p("copy:success", {
390
- entity: u,
436
+ y("copy:success", {
437
+ entity: g,
391
438
  field: "id",
392
- message: r("copy.success", { val: g })
439
+ message: a("copy.success", { val: w })
393
440
  });
394
- }, ne = (u, s) => {
395
- const g = JSON.stringify(u);
396
- if (!s(g)) {
397
- p("copy:error", {
398
- entity: u,
399
- message: r("errors.copy")
441
+ }, be = (g, m) => {
442
+ const w = JSON.stringify(g);
443
+ if (!m(w)) {
444
+ y("copy:error", {
445
+ entity: g,
446
+ message: a("errors.copy")
400
447
  });
401
448
  return;
402
449
  }
403
- p("copy:success", {
404
- entity: u,
405
- message: r("copy.success_brief")
450
+ y("copy:success", {
451
+ entity: g,
452
+ message: a("copy.success_brief")
406
453
  });
407
- }, ce = async (u) => {
408
- var g;
409
- await ((g = c.canRetrieve) == null ? void 0 : g.call(c, u)) && N.push(c.config.getViewRoute(u.id));
410
- }, Ve = (u) => ({
411
- label: r("actions.view"),
412
- to: c.config.getViewRoute(u)
413
- }), oe = (u) => ({
414
- label: r("actions.edit"),
415
- to: c.config.getEditRoute(u)
416
- }), B = E(void 0), K = E(!1), j = E(!1), X = E(""), t = He(c.config, _.value), i = (u) => {
417
- B.value = u, K.value = !0, X.value = "";
418
- }, v = () => {
419
- K.value = !1, B.value = void 0;
420
- }, M = async () => {
421
- var u, s, g;
422
- if ((u = B.value) != null && u.id) {
423
- j.value = !0;
454
+ }, Se = async (g) => {
455
+ var w;
456
+ await ((w = p.canRetrieve) == null ? void 0 : w.call(p, g)) && B.push(p.config.getViewRoute(g.id));
457
+ }, de = (g) => ({
458
+ label: a("actions.view"),
459
+ to: p.config.getViewRoute(g)
460
+ }), le = (g) => ({
461
+ label: a("actions.edit"),
462
+ to: p.config.getEditRoute(g)
463
+ }), N = W(void 0), J = W(!1), oe = W(!1), ve = W(""), i = ut(p.config, A.value), f = (g) => {
464
+ N.value = g, J.value = !0, ve.value = "";
465
+ }, k = () => {
466
+ J.value = !1, N.value = void 0;
467
+ }, H = async () => {
468
+ var g, m, w;
469
+ if ((g = N.value) != null && g.id) {
470
+ oe.value = !0;
424
471
  try {
425
- await q.delete(t(B.value.id)), p("delete:success", B.value), v(), ee.value++;
426
- } catch (I) {
427
- X.value = ((g = (s = I.response) == null ? void 0 : s.data) == null ? void 0 : g.message) || I.message || r("errors.delete"), p("error", I);
472
+ await Z.delete(i(N.value.id)), y("delete:success", N.value), k(), se.value++;
473
+ } catch (O) {
474
+ ve.value = ((w = (m = O.response) == null ? void 0 : m.data) == null ? void 0 : w.message) || O.message || a("errors.delete"), y("error", O);
428
475
  } finally {
429
- j.value = !1;
476
+ oe.value = !1;
430
477
  }
431
478
  }
432
- }, V = () => {
433
- N.push(c.config.createRoute);
479
+ }, L = () => {
480
+ B.push(p.config.createRoute);
434
481
  };
435
- Ie(w, (u) => {
436
- var s, g, I;
437
- if (u.status === Je.Error) {
438
- J.value = {
439
- title: r("errors.general")
440
- }, (I = (g = (s = u.error) == null ? void 0 : s.response) == null ? void 0 : g.data) != null && I.message && (J.value.message = u.error.response.data.message), p("error", u.error);
482
+ Ue(R, (g) => {
483
+ var m, w, O;
484
+ if (g.status === ft.Error) {
485
+ U.value = {
486
+ title: a("errors.general")
487
+ }, (O = (w = (m = g.error) == null ? void 0 : m.response) == null ? void 0 : w.data) != null && O.message && (U.value.message = g.error.response.data.message), y("error", g.error);
441
488
  return;
442
489
  }
443
- J.value = null;
490
+ U.value = null;
444
491
  });
445
- const h = E(!1);
446
- return Le(async () => {
447
- h.value = await c.canCreate();
448
- }), (u, s) => {
449
- const g = F("KButton"), I = F("KBadge"), Z = F("KInputSwitch"), A = F("KDropdownItem"), de = F("KClipboardProvider");
450
- return S(), U("div", ht, [
451
- d(o(ze), {
492
+ const $ = W(!1);
493
+ return lt(async () => {
494
+ $.value = await p.canCreate();
495
+ }), (g, m) => {
496
+ const w = D("KButton"), O = D("KBadge"), Q = D("KInputSwitch"), j = D("KDropdownItem"), he = D("KClipboardProvider");
497
+ return C(), F("div", Tt, [
498
+ d(o(pt), {
452
499
  "cache-identifier": n.cacheIdentifier,
453
- "default-table-preferences": _e,
454
- "disable-sorting": ye.value,
455
- "empty-state-options": W.value,
500
+ "default-table-preferences": ke,
501
+ "disable-sorting": ue.value,
502
+ "empty-state-options": ae.value,
456
503
  "enable-entity-actions": "",
457
- "error-message": J.value,
458
- fetcher: o(e),
459
- "fetcher-cache-key": o(ee),
504
+ "error-message": U.value,
505
+ fetcher: o(l),
506
+ "fetcher-cache-key": o(se),
460
507
  "pagination-type": "offset",
461
508
  "preferences-storage-key": "kong-ui-entities-gateway-services-list",
462
- query: G.value,
463
- "table-headers": o(H),
464
- onClearSearchInput: he,
465
- "onClick:row": s[5] || (s[5] = (m) => ce(m)),
466
- onSort: re,
467
- onState: o(P)
468
- }, Ee({
469
- "toolbar-filter": f(() => [
470
- d(o(Qe), {
471
- modelValue: G.value,
472
- "onUpdate:modelValue": s[0] || (s[0] = (m) => G.value = m),
473
- config: be.value
509
+ query: ee.value,
510
+ "table-headers": o(fe),
511
+ onClearSearchInput: Pe,
512
+ "onClick:row": m[5] || (m[5] = (e) => Se(e)),
513
+ onSort: t,
514
+ onState: o(K)
515
+ }, xe({
516
+ "toolbar-filter": v(() => [
517
+ d(o(mt), {
518
+ modelValue: ee.value,
519
+ "onUpdate:modelValue": m[0] || (m[0] = (e) => ee.value = e),
520
+ config: re.value
474
521
  }, null, 8, ["modelValue", "config"])
475
522
  ]),
476
- "toolbar-button": f(() => [
477
- (S(), ue(Pe, {
523
+ "toolbar-button": v(() => [
524
+ (C(), Fe(je, {
478
525
  disabled: !n.useActionOutside,
479
526
  to: "#kong-ui-app-page-header-action-button"
480
527
  }, [
481
- k("div", wt, [
482
- C.value ? (S(), ue(g, {
528
+ S("div", Mt, [
529
+ I.value ? (C(), Fe(w, {
483
530
  key: 0,
484
531
  appearance: "secondary",
485
532
  class: "open-learning-hub",
486
533
  "data-testid": "gateway-services-learn-more-button",
487
534
  icon: "",
488
- onClick: s[1] || (s[1] = (m) => u.$emit("click:learn-more"))
535
+ onClick: m[1] || (m[1] = (e) => g.$emit("click:learn-more"))
489
536
  }, {
490
- default: f(() => [
491
- d(o(Re), { decorative: "" })
537
+ default: v(() => [
538
+ d(o(He), { decorative: "" })
492
539
  ]),
493
540
  _: 1
494
- })) : L("", !0),
495
- d(o(ie), {
541
+ })) : T("", !0),
542
+ d(o(Ee), {
496
543
  "auth-function": () => n.canCreate()
497
544
  }, {
498
- default: f(() => [
499
- d(g, {
545
+ default: v(() => [
546
+ d(w, {
500
547
  appearance: "primary",
501
548
  "data-testid": "toolbar-add-gateway-service",
502
549
  size: n.useActionOutside ? "medium" : "large",
503
550
  to: n.config.createRoute
504
551
  }, {
505
- default: f(() => [
506
- d(o(Ke)),
507
- R(" " + y(o(r)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
552
+ default: v(() => [
553
+ d(o(rt)),
554
+ z(" " + P(o(a)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
508
555
  ]),
509
556
  _: 1
510
557
  }, 8, ["size", "to"])
@@ -514,120 +561,120 @@ const ve = {
514
561
  ])
515
562
  ], 8, ["disabled"]))
516
563
  ]),
517
- name: f(({ rowValue: m }) => [
518
- k("b", null, y(m ?? "-"), 1)
564
+ name: v(({ rowValue: e }) => [
565
+ S("b", null, P(e ?? "-"), 1)
519
566
  ]),
520
- control_plane: f(({ row: m }) => {
521
- var $;
567
+ control_plane: v(({ row: e }) => {
568
+ var s;
522
569
  return [
523
- ($ = m.x_meta) != null && $.cluster_id ? (S(), ue(I, {
570
+ (s = e.x_meta) != null && s.cluster_id ? (C(), Fe(O, {
524
571
  key: 0,
525
- tooltip: m.x_meta.cluster_id,
572
+ tooltip: e.x_meta.cluster_id,
526
573
  "truncation-tooltip": "",
527
- onClick: Se((le) => Ce(m.x_meta.cluster_id), ["stop"])
574
+ onClick: Ke((V) => Ce(e.x_meta.cluster_id), ["stop"])
528
575
  }, {
529
- default: f(() => [
530
- R(y(m.x_meta.cluster_id), 1)
576
+ default: v(() => [
577
+ z(P(e.x_meta.cluster_id), 1)
531
578
  ]),
532
579
  _: 2
533
- }, 1032, ["tooltip", "onClick"])) : (S(), U("b", Ct, "-"))
580
+ }, 1032, ["tooltip", "onClick"])) : (C(), F("b", Lt, "-"))
534
581
  ];
535
582
  }),
536
- enabled: f(({ row: m }) => [
537
- d(o(ie), {
538
- "auth-function": () => n.canEdit(m),
583
+ enabled: v(({ row: e }) => [
584
+ d(o(Ee), {
585
+ "auth-function": () => n.canEdit(e),
539
586
  "force-show": ""
540
587
  }, {
541
- default: f(({ isAllowed: $ }) => [
542
- k("div", {
543
- onClick: s[4] || (s[4] = Se(() => {
588
+ default: v(({ isAllowed: s }) => [
589
+ S("div", {
590
+ onClick: m[4] || (m[4] = Ke(() => {
544
591
  }, ["stop"]))
545
592
  }, [
546
- d(Z, {
547
- modelValue: m.enabled,
548
- "onUpdate:modelValue": (le) => m.enabled = le,
549
- "data-testid": `row-${m.id}-toggle-input`,
550
- disabled: !$,
551
- onClick: Se((le) => we(m), ["prevent"])
593
+ d(Q, {
594
+ modelValue: e.enabled,
595
+ "onUpdate:modelValue": (V) => e.enabled = V,
596
+ "data-testid": `row-${e.id}-toggle-input`,
597
+ disabled: !s,
598
+ onClick: Ke((V) => ce(e), ["prevent"])
552
599
  }, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
553
600
  ])
554
601
  ]),
555
602
  _: 2
556
603
  }, 1032, ["auth-function"])
557
604
  ]),
558
- tags: f(({ rowValue: m }) => [
559
- d(o(Xe), { tags: m }, null, 8, ["tags"])
605
+ tags: v(({ rowValue: e }) => [
606
+ d(o(vt), { tags: e }, null, 8, ["tags"])
560
607
  ]),
561
- created_at: f(({ rowValue: m }) => [
562
- R(y(o(x)(m)), 1)
608
+ created_at: v(({ rowValue: e }) => [
609
+ z(P(o(b)(e)), 1)
563
610
  ]),
564
- updated_at: f(({ row: m, rowValue: $ }) => [
565
- R(y(o(x)($ ?? m.created_at)), 1)
611
+ updated_at: v(({ row: e, rowValue: s }) => [
612
+ z(P(o(b)(s ?? e.created_at)), 1)
566
613
  ]),
567
- actions: f(({ row: m }) => [
568
- d(de, null, {
569
- default: f(({ copyToClipboard: $ }) => [
570
- d(A, {
614
+ actions: v(({ row: e }) => [
615
+ d(he, null, {
616
+ default: v(({ copyToClipboard: s }) => [
617
+ d(j, {
571
618
  "data-testid": "action-entity-copy-id",
572
- onClick: (le) => te(m, $)
619
+ onClick: (V) => me(e, s)
573
620
  }, {
574
- default: f(() => [
575
- R(y(o(r)("actions.copy_id")), 1)
621
+ default: v(() => [
622
+ z(P(o(a)("actions.copy_id")), 1)
576
623
  ]),
577
624
  _: 2
578
625
  }, 1032, ["onClick"])
579
626
  ]),
580
627
  _: 2
581
628
  }, 1024),
582
- d(de, null, {
583
- default: f(({ copyToClipboard: $ }) => [
584
- d(A, {
629
+ d(he, null, {
630
+ default: v(({ copyToClipboard: s }) => [
631
+ d(j, {
585
632
  "data-testid": "action-entity-copy-json",
586
- onClick: (le) => ne(m, $)
633
+ onClick: (V) => be(e, s)
587
634
  }, {
588
- default: f(() => [
589
- R(y(o(r)("actions.copy_json")), 1)
635
+ default: v(() => [
636
+ z(P(o(a)("actions.copy_json")), 1)
590
637
  ]),
591
638
  _: 2
592
639
  }, 1032, ["onClick"])
593
640
  ]),
594
641
  _: 2
595
642
  }, 1024),
596
- d(o(ie), {
597
- "auth-function": () => n.canRetrieve(m)
643
+ d(o(Ee), {
644
+ "auth-function": () => n.canRetrieve(e)
598
645
  }, {
599
- default: f(() => [
600
- d(A, {
646
+ default: v(() => [
647
+ d(j, {
601
648
  "data-testid": "action-entity-view",
602
649
  "has-divider": "",
603
- item: Ve(m.id)
650
+ item: de(e.id)
604
651
  }, null, 8, ["item"])
605
652
  ]),
606
653
  _: 2
607
654
  }, 1032, ["auth-function"]),
608
- d(o(ie), {
609
- "auth-function": () => n.canEdit(m)
655
+ d(o(Ee), {
656
+ "auth-function": () => n.canEdit(e)
610
657
  }, {
611
- default: f(() => [
612
- d(A, {
658
+ default: v(() => [
659
+ d(j, {
613
660
  "data-testid": "action-entity-edit",
614
- item: oe(m.id)
661
+ item: le(e.id)
615
662
  }, null, 8, ["item"])
616
663
  ]),
617
664
  _: 2
618
665
  }, 1032, ["auth-function"]),
619
- d(o(ie), {
620
- "auth-function": () => n.canDelete(m)
666
+ d(o(Ee), {
667
+ "auth-function": () => n.canDelete(e)
621
668
  }, {
622
- default: f(() => [
623
- d(A, {
669
+ default: v(() => [
670
+ d(j, {
624
671
  danger: "",
625
672
  "data-testid": "action-entity-delete",
626
673
  "has-divider": "",
627
- onClick: ($) => i(m)
674
+ onClick: (s) => f(e)
628
675
  }, {
629
- default: f(() => [
630
- R(y(o(r)("actions.delete.menu_label")), 1)
676
+ default: v(() => [
677
+ z(P(o(a)("actions.delete.menu_label")), 1)
631
678
  ]),
632
679
  _: 2
633
680
  }, 1032, ["onClick"])
@@ -637,22 +684,22 @@ const ve = {
637
684
  ]),
638
685
  _: 2
639
686
  }, [
640
- !o(a) && ge.value ? {
687
+ !o(r) && ie.value ? {
641
688
  name: "outside-actions",
642
- fn: f(() => [
643
- (S(), ue(Pe, {
689
+ fn: v(() => [
690
+ (C(), Fe(je, {
644
691
  disabled: !n.useActionOutside,
645
692
  to: "#kong-ui-app-page-header-action-button"
646
693
  }, [
647
- d(g, {
694
+ d(w, {
648
695
  appearance: "secondary",
649
696
  class: "open-learning-hub",
650
697
  "data-testid": "gateway-services-more-button",
651
698
  icon: "",
652
- onClick: s[2] || (s[2] = (m) => u.$emit("click:learn-more"))
699
+ onClick: m[2] || (m[2] = (e) => g.$emit("click:learn-more"))
653
700
  }, {
654
- default: f(() => [
655
- d(o(Re), { decorative: "" })
701
+ default: v(() => [
702
+ d(o(He), { decorative: "" })
656
703
  ]),
657
704
  _: 1
658
705
  })
@@ -662,34 +709,34 @@ const ve = {
662
709
  } : void 0,
663
710
  n.enableV2EmptyStates && n.config.app === "konnect" ? {
664
711
  name: "empty-state",
665
- fn: f(() => {
666
- var m;
712
+ fn: v(() => {
713
+ var e;
667
714
  return [
668
- d(o(Ze), {
669
- "action-button-text": o(r)("gateway_services.empty_state_v2.create"),
715
+ d(o(gt), {
716
+ "action-button-text": o(a)("gateway_services.empty_state_v2.create"),
670
717
  appearance: "secondary",
671
718
  "can-create": () => n.canCreate(),
672
719
  "data-testid": "gateway-services-entity-empty-state",
673
- description: o(r)("gateway_services.empty_state_v2.description"),
720
+ description: o(a)("gateway_services.empty_state_v2.description"),
674
721
  "learn-more": n.config.app === "konnect",
675
- title: o(r)("gateway_services.empty_state_v2.title"),
676
- "onClick:create": V,
677
- "onClick:learnMore": s[3] || (s[3] = ($) => u.$emit("click:learn-more"))
678
- }, Ee({
679
- image: f(() => [
680
- k("div", kt, [
681
- d(o(qe), {
682
- color: o(_t),
683
- size: o(bt)
722
+ title: o(a)("gateway_services.empty_state_v2.title"),
723
+ "onClick:create": L,
724
+ "onClick:learnMore": m[3] || (m[3] = (s) => g.$emit("click:learn-more"))
725
+ }, xe({
726
+ image: v(() => [
727
+ S("div", Bt, [
728
+ d(o(st), {
729
+ color: o(Rt),
730
+ size: o(xt)
684
731
  }, null, 8, ["color", "size"])
685
732
  ])
686
733
  ]),
687
734
  _: 2
688
735
  }, [
689
- (m = n.config) != null && m.isControlPlaneGroup ? {
736
+ (e = n.config) != null && e.isControlPlaneGroup ? {
690
737
  name: "message",
691
- fn: f(() => [
692
- R(y(o(r)("gateway_services.empty_state_v2.group")), 1)
738
+ fn: v(() => [
739
+ z(P(o(a)("gateway_services.empty_state_v2.group")), 1)
693
740
  ]),
694
741
  key: "0"
695
742
  } : void 0
@@ -699,58 +746,58 @@ const ve = {
699
746
  key: "1"
700
747
  } : void 0
701
748
  ]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
702
- d(o(Ye), {
703
- action: Q.value.action,
704
- "entity-id": Q.value.id,
705
- "entity-name": Q.value.name,
706
- "entity-type": o(r)("glossary.gateway_services"),
707
- "on-confirm": ke,
708
- visible: z.value,
709
- onCancel: ae,
710
- onProceed: ae
749
+ d(o(yt), {
750
+ action: pe.value.action,
751
+ "entity-id": pe.value.id,
752
+ "entity-name": pe.value.name,
753
+ "entity-type": o(a)("glossary.gateway_services"),
754
+ "on-confirm": Ve,
755
+ visible: ne.value,
756
+ onCancel: _e,
757
+ onProceed: _e
711
758
  }, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
712
- d(o(et), {
713
- "action-pending": j.value,
714
- description: o(r)("actions.delete.description"),
715
- "entity-name": B.value && (B.value.name || B.value.id),
716
- "entity-type": o(tt).GatewayService,
717
- error: X.value,
718
- title: o(r)("actions.delete.title"),
719
- visible: K.value,
720
- onCancel: v,
721
- onProceed: M
759
+ d(o(_t), {
760
+ "action-pending": oe.value,
761
+ description: o(a)("actions.delete.description"),
762
+ "entity-name": N.value && (N.value.name || N.value.id),
763
+ "entity-type": o(bt).GatewayService,
764
+ error: ve.value,
765
+ title: o(a)("actions.delete.title"),
766
+ visible: J.value,
767
+ onCancel: k,
768
+ onProceed: H
722
769
  }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
723
770
  ]);
724
771
  };
725
772
  }
726
- }), Be = (n, D) => {
727
- const p = n.__vccOpts || n;
728
- for (const [c, r] of D)
729
- p[c] = r;
730
- return p;
731
- }, zt = /* @__PURE__ */ Be(Vt, [["__scopeId", "data-v-ee4f8a6d"]]), St = { class: "kong-ui-entities-gateway-service-form" }, It = { key: 0 }, Tt = { class: "gateway-service-form-traffic-label" }, Et = { class: "gateway-service-form-margin-bottom" }, Pt = {
773
+ }), Ne = (n, M) => {
774
+ const y = n.__vccOpts || n;
775
+ for (const [p, a] of M)
776
+ y[p] = a;
777
+ return y;
778
+ }, $l = /* @__PURE__ */ Ne(Kt, [["__scopeId", "data-v-ee4f8a6d"]]), Wt = { class: "kong-ui-entities-gateway-service-form" }, Dt = { key: 0 }, qt = { class: "gateway-service-form-traffic-label" }, Ot = { class: "gateway-service-form-margin-bottom" }, Gt = {
732
779
  key: 0,
733
780
  class: "gateway-service-form-group-fields"
734
- }, Ut = {
781
+ }, Nt = {
735
782
  key: 1,
736
783
  class: "gateway-service-form-group-fields"
737
- }, Rt = { key: 0 }, Mt = { class: "gateway-service-form-margin-top" }, $t = { class: "gateway-service-form-margin-bottom" }, xt = { class: "gateway-service-form-margin-bottom" }, At = { class: "gateway-service-form-margin-bottom" }, Ft = { class: "gateway-service-form-margin-bottom" }, Bt = {
784
+ }, jt = { key: 0 }, zt = { class: "gateway-service-form-margin-top" }, Ht = { class: "gateway-service-form-margin-bottom" }, Zt = { class: "gateway-service-form-margin-bottom" }, Jt = { class: "gateway-service-form-margin-bottom" }, Qt = { class: "gateway-service-form-margin-bottom" }, Xt = {
738
785
  key: 0,
739
786
  class: "gateway-service-form-margin-bottom"
740
- }, Lt = {
787
+ }, Yt = {
741
788
  key: 1,
742
789
  class: "gateway-service-form-margin-bottom"
743
- }, Dt = {
790
+ }, el = {
744
791
  key: 2,
745
792
  class: "gateway-service-form-margin-bottom"
746
- }, Gt = {
793
+ }, tl = {
747
794
  key: 0,
748
795
  class: "checkbox-aligned-radio"
749
- }, Kt = {
796
+ }, ll = {
750
797
  key: 1,
751
798
  class: "checkbox-aligned-radio"
752
- }, qt = /* @__PURE__ */ Te({
753
- __name: "GatewayServiceForm",
799
+ }, ol = /* @__PURE__ */ Le({
800
+ __name: "LegacyGatewayServiceForm",
754
801
  props: {
755
802
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
756
803
  config: {
@@ -772,9 +819,9 @@ const ve = {
772
819
  }
773
820
  },
774
821
  emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated"],
775
- setup(n, { expose: D, emit: p }) {
776
- var X;
777
- const c = p, r = n, x = E(!0), N = xe(), { i18nT: q, i18n: { t: a } } = ve.useI18n(), { getMessageFromError: P } = ot(), { axiosInstance: C } = Ae((X = r.config) == null ? void 0 : X.axiosRequestConfig), ge = lt(), ye = b(() => se.form[r.config.app].edit), O = b(() => r.gatewayServiceId ? Me.Edit : Me.Create), _e = E(!1), H = b(() => !!r.gatewayServiceId), _ = E(H.value ? "protocol" : "url"), Y = ve.usePortFromProtocol(), G = E(""), be = b(() => !!G.value), e = Ue({
822
+ setup(n, { expose: M, emit: y }) {
823
+ var ve;
824
+ const p = y, a = n, b = W(!0), B = qe(), { i18nT: Z, i18n: { t: r } } = ge.useI18n(), { getMessageFromError: K } = Xe(), { axiosInstance: I } = Oe((ve = a.config) == null ? void 0 : ve.axiosRequestConfig), ie = Ye(), ue = h(() => ye.form[a.config.app].edit), X = h(() => a.gatewayServiceId ? Me.Edit : Me.Create), ke = W(!1), fe = h(() => !!a.gatewayServiceId), A = W(fe.value ? "protocol" : "url"), Y = ge.usePortFromProtocol(), ee = W(""), re = h(() => !!ee.value), l = Te({
778
825
  fields: {
779
826
  name: "",
780
827
  protocol: "http",
@@ -794,7 +841,7 @@ const ve = {
794
841
  },
795
842
  isReadonly: !1,
796
843
  errorMessage: ""
797
- }), w = Ue({
844
+ }), R = Te({
798
845
  name: "",
799
846
  protocol: "http",
800
847
  host: "",
@@ -810,543 +857,543 @@ const ve = {
810
857
  tls_verify_enabled: !1,
811
858
  tls_verify_value: !1,
812
859
  tags: ""
813
- }), ee = r.config.app === "konnect" || it({
814
- gatewayInfo: r.config.gatewayInfo,
860
+ }), se = a.config.app === "konnect" || et({
861
+ gatewayInfo: a.config.gatewayInfo,
815
862
  // 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
816
863
  supportedRange: {
817
864
  enterprise: ["3.0"]
818
865
  }
819
- }), he = [
866
+ }), Pe = [
820
867
  {
821
- label: a("gateway_services.form.fields.protocol.options.http"),
868
+ label: r("gateway_services.form.fields.protocol.options.http"),
822
869
  value: "http",
823
870
  group: "http"
824
871
  },
825
872
  {
826
- label: a("gateway_services.form.fields.protocol.options.https"),
873
+ label: r("gateway_services.form.fields.protocol.options.https"),
827
874
  value: "https",
828
875
  group: "http"
829
876
  },
830
877
  {
831
- label: a("gateway_services.form.fields.protocol.options.tcp"),
878
+ label: r("gateway_services.form.fields.protocol.options.tcp"),
832
879
  value: "tcp",
833
880
  group: "tcp"
834
881
  },
835
882
  {
836
- label: a("gateway_services.form.fields.protocol.options.tls"),
883
+ label: r("gateway_services.form.fields.protocol.options.tls"),
837
884
  value: "tls",
838
885
  group: "tcp"
839
886
  },
840
887
  {
841
- label: a("gateway_services.form.fields.protocol.options.tls_passthrough"),
888
+ label: r("gateway_services.form.fields.protocol.options.tls_passthrough"),
842
889
  value: "tls_passthrough",
843
890
  group: "tcp"
844
891
  },
845
892
  {
846
- label: a("gateway_services.form.fields.protocol.options.grpc"),
893
+ label: r("gateway_services.form.fields.protocol.options.grpc"),
847
894
  value: "grpc",
848
895
  group: "grpc"
849
896
  },
850
897
  {
851
- label: a("gateway_services.form.fields.protocol.options.grpcs"),
898
+ label: r("gateway_services.form.fields.protocol.options.grpcs"),
852
899
  value: "grpcs",
853
900
  group: "grpc"
854
901
  },
855
- ...ee ? [
902
+ ...se ? [
856
903
  {
857
- label: a("gateway_services.form.fields.protocol.options.ws"),
904
+ label: r("gateway_services.form.fields.protocol.options.ws"),
858
905
  value: "ws",
859
906
  group: "websocket"
860
907
  },
861
908
  {
862
- label: a("gateway_services.form.fields.protocol.options.wss"),
909
+ label: r("gateway_services.form.fields.protocol.options.wss"),
863
910
  value: "wss",
864
911
  group: "websocket"
865
912
  }
866
913
  ] : [],
867
914
  {
868
- label: a("gateway_services.form.fields.protocol.options.udp"),
915
+ label: r("gateway_services.form.fields.protocol.options.udp"),
869
916
  value: "udp",
870
917
  group: "udp"
871
918
  }
872
- ], re = { url: "url", protocol: "protocol" }, J = (t, i) => {
873
- i.value;
874
- }, W = (t) => t ? parseFloat(t) : 0, z = () => {
875
- x.value = !0, e.errorMessage = "", e.fields.host = w.host, e.fields.path = w.path, e.fields.port = w.port, e.fields.protocol = w.protocol, e.fields.url = w.url, e.fields.retries = w.retries, e.fields.connect_timeout = w.connect_timeout, e.fields.write_timeout = w.write_timeout, e.fields.read_timeout = w.read_timeout, e.fields.client_certificate = w.client_certificate, e.fields.ca_certificates = w.ca_certificates, e.fields.tls_verify_enabled = w.tls_verify_enabled, e.fields.tls_verify_value = w.tls_verify_value;
876
- }, T = () => {
877
- if (e.fields.url && _.value === "url")
919
+ ], t = { url: "url", protocol: "protocol" }, U = (i, f) => {
920
+ f.value;
921
+ }, ae = (i) => i ? parseFloat(i) : 0, ne = () => {
922
+ b.value = !0, l.errorMessage = "", l.fields.host = R.host, l.fields.path = R.path, l.fields.port = R.port, l.fields.protocol = R.protocol, l.fields.url = R.url, l.fields.retries = R.retries, l.fields.connect_timeout = R.connect_timeout, l.fields.write_timeout = R.write_timeout, l.fields.read_timeout = R.read_timeout, l.fields.client_certificate = R.client_certificate, l.fields.ca_certificates = R.ca_certificates, l.fields.tls_verify_enabled = R.tls_verify_enabled, l.fields.tls_verify_value = R.tls_verify_value;
923
+ }, q = () => {
924
+ if (l.fields.url && A.value === "url")
878
925
  try {
879
- const t = new URL(e.fields.url);
880
- e.errorMessage = "", e.fields.protocol = t.protocol.slice(0, -1), e.fields.host = t.hostname, e.fields.path = t.pathname;
881
- const i = Number(t.port);
882
- _e.value = !!i, e.fields.port = i || Y.getPortFromProtocol(e.fields.protocol), e.errorMessage = "", c("url-valid:success");
883
- } catch (t) {
884
- e.errorMessage = a("errors.urlErrorMessage"), c("url-valid:error", P(t));
926
+ const i = new URL(l.fields.url);
927
+ l.errorMessage = "", l.fields.protocol = i.protocol.slice(0, -1), l.fields.host = i.hostname, l.fields.path = i.pathname;
928
+ const f = Number(i.port);
929
+ ke.value = !!f, l.fields.port = f || Y.getPortFromProtocol(l.fields.protocol), l.errorMessage = "", p("url-valid:success");
930
+ } catch (i) {
931
+ l.errorMessage = r("errors.urlErrorMessage"), p("url-valid:error", K(i));
885
932
  }
886
933
  else
887
- c("url-valid:success"), e.errorMessage = "";
888
- }, Q = b(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), we = b(() => {
889
- if (_.value === "url")
934
+ p("url-valid:success"), l.errorMessage = "";
935
+ }, pe = h(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(l.fields.protocol)), ce = h(() => {
936
+ if (A.value === "url")
890
937
  return !0;
891
- const t = ["https", "wss", "tls"].includes(e.fields.protocol);
892
- return _.value === "protocol" && t;
893
- }), ae = b(() => {
894
- if (_.value === "url")
938
+ const i = ["https", "wss", "tls"].includes(l.fields.protocol);
939
+ return A.value === "protocol" && i;
940
+ }), _e = h(() => {
941
+ if (A.value === "url")
895
942
  return !0;
896
- const t = ["https", "tls"].includes(e.fields.protocol);
897
- return _.value === "protocol" && t;
898
- }), ke = b(() => {
899
- if (_.value === "url")
943
+ const i = ["https", "tls"].includes(l.fields.protocol);
944
+ return A.value === "protocol" && i;
945
+ }), Ve = h(() => {
946
+ if (A.value === "url")
900
947
  return !0;
901
- const t = ["https", "wss", "tls"].includes(e.fields.protocol);
902
- return _.value === "protocol" && t;
903
- }), Ce = (t) => {
904
- G.value = ge.utf8Name(t);
905
- }, te = b(() => H.value && JSON.stringify(e.fields) !== JSON.stringify(w) || _.value === "url" && !!e.fields.url || _.value === "protocol" && !!e.fields.host), ne = (t) => {
906
- var i, v, M;
907
- e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((i = t == null ? void 0 : t.tags) == null ? void 0 : i.join(", ")) || "", e.fields.protocol = (t == null ? void 0 : t.protocol) || "http", e.fields.path = (t == null ? void 0 : t.path) || "", e.fields.read_timeout = t != null && t.read_timeout || (t == null ? void 0 : t.read_timeout) === 0 ? t == null ? void 0 : t.read_timeout : 6e4, e.fields.retries = t != null && t.retries || (t == null ? void 0 : t.retries) === 0 ? t == null ? void 0 : t.retries : 5, e.fields.host = (t == null ? void 0 : t.host) || "", e.fields.connect_timeout = t != null && t.connect_timeout || (t == null ? void 0 : t.connect_timeout) === 0 ? t == null ? void 0 : t.connect_timeout : 6e4, e.fields.tls_verify_enabled = (t == null ? void 0 : t.tls_verify) !== "" && (t == null ? void 0 : t.tls_verify) !== null && (t == null ? void 0 : t.tls_verify) !== void 0, e.fields.tls_verify_value = t != null && t.tls_verify ? t == null ? void 0 : t.tls_verify : !1, e.fields.ca_certificates = ((v = t == null ? void 0 : t.ca_certificates) == null ? void 0 : v.join(",")) || "", e.fields.client_certificate = ((M = t == null ? void 0 : t.client_certificate) == null ? void 0 : M.id) || "", e.fields.write_timeout = t != null && t.write_timeout || (t == null ? void 0 : t.write_timeout) === 0 ? t == null ? void 0 : t.write_timeout : 6e4, e.fields.port = t != null && t.port || (t == null ? void 0 : t.port) === 0 ? t == null ? void 0 : t.port : 80, Object.assign(w, e.fields);
908
- }, ce = () => {
909
- N.push(r.config.cancelRoute);
910
- }, Ve = b(() => {
911
- var i, v;
912
- let t = `${r.config.apiBaseUrl}${se.form[r.config.app].validate}`;
913
- return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = r.config) == null ? void 0 : i.controlPlaneId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (v = r.config) != null && v.workspace ? `/${r.config.workspace}` : "")), t = t.replace(/{id}/gi, r.gatewayServiceId), t;
914
- }), oe = b(() => {
915
- var i, v;
916
- let t = `${r.config.apiBaseUrl}${se.form[r.config.app][O.value]}`;
917
- return r.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = r.config) == null ? void 0 : i.controlPlaneId) || "") : r.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (v = r.config) != null && v.workspace ? `/${r.config.workspace}` : "")), t = t.replace(/{id}/gi, r.gatewayServiceId), t;
918
- }), B = (t) => {
919
- let i = "";
920
- t.url && (i = new URL(t.url).protocol), (["https", "wss", "tls"].includes(t.protocol) || ["https", "wss", "tls"].includes(i)) && (t.tls_verify = t.tls_verify_enabled ? t.tls_verify_value : null), delete t.tls_verify_enabled, delete t.tls_verify_value;
921
- }, K = b(() => {
922
- var i, v, M, V;
923
- const t = {
924
- name: e.fields.name || null,
925
- tags: e.fields.tags ? (M = (v = (i = e.fields.tags) == null ? void 0 : i.split(",")) == null ? void 0 : v.map((h) => String(h || "").trim())) == null ? void 0 : M.filter((h) => h !== "") : null,
926
- protocol: e.fields.protocol,
927
- path: e.fields.path || null,
928
- read_timeout: e.fields.read_timeout,
929
- retries: e.fields.retries,
930
- host: e.fields.host,
931
- connect_timeout: e.fields.connect_timeout,
932
- tls_verify_value: e.fields.tls_verify_value,
933
- tls_verify_enabled: e.fields.tls_verify_enabled,
934
- ca_certificates: e.fields.ca_certificates ? (V = e.fields.ca_certificates) == null ? void 0 : V.split(",").filter((h) => h !== "") : null,
935
- client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
936
- write_timeout: e.fields.write_timeout,
937
- port: e.fields.port,
938
- url: e.fields.url
948
+ const i = ["https", "wss", "tls"].includes(l.fields.protocol);
949
+ return A.value === "protocol" && i;
950
+ }), Ce = (i) => {
951
+ ee.value = ie.utf8Name(i);
952
+ }, me = h(() => fe.value && JSON.stringify(l.fields) !== JSON.stringify(R) || A.value === "url" && !!l.fields.url || A.value === "protocol" && !!l.fields.host), be = (i) => {
953
+ var f, k, H;
954
+ l.fields.name = (i == null ? void 0 : i.name) || "", l.fields.tags = ((f = i == null ? void 0 : i.tags) == null ? void 0 : f.join(", ")) || "", l.fields.protocol = (i == null ? void 0 : i.protocol) || "http", l.fields.path = (i == null ? void 0 : i.path) || "", l.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, l.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, l.fields.host = (i == null ? void 0 : i.host) || "", l.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, l.fields.tls_verify_enabled = (i == null ? void 0 : i.tls_verify) !== "" && (i == null ? void 0 : i.tls_verify) !== null && (i == null ? void 0 : i.tls_verify) !== void 0, l.fields.tls_verify_value = i != null && i.tls_verify ? i == null ? void 0 : i.tls_verify : !1, l.fields.ca_certificates = ((k = i == null ? void 0 : i.ca_certificates) == null ? void 0 : k.join(",")) || "", l.fields.client_certificate = ((H = i == null ? void 0 : i.client_certificate) == null ? void 0 : H.id) || "", l.fields.write_timeout = i != null && i.write_timeout || (i == null ? void 0 : i.write_timeout) === 0 ? i == null ? void 0 : i.write_timeout : 6e4, l.fields.port = i != null && i.port || (i == null ? void 0 : i.port) === 0 ? i == null ? void 0 : i.port : 80, Object.assign(R, l.fields);
955
+ }, Se = () => {
956
+ B.push(a.config.cancelRoute);
957
+ }, de = h(() => {
958
+ var f, k;
959
+ let i = `${a.config.apiBaseUrl}${ye.form[a.config.app].validate}`;
960
+ return a.config.app === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((f = a.config) == null ? void 0 : f.controlPlaneId) || "") : a.config.app === "kongManager" && (i = i.replace(/\/{workspace}/gi, (k = a.config) != null && k.workspace ? `/${a.config.workspace}` : "")), i = i.replace(/{id}/gi, a.gatewayServiceId), i;
961
+ }), le = h(() => {
962
+ var f, k;
963
+ let i = `${a.config.apiBaseUrl}${ye.form[a.config.app][X.value]}`;
964
+ return a.config.app === "konnect" ? i = i.replace(/{controlPlaneId}/gi, ((f = a.config) == null ? void 0 : f.controlPlaneId) || "") : a.config.app === "kongManager" && (i = i.replace(/\/{workspace}/gi, (k = a.config) != null && k.workspace ? `/${a.config.workspace}` : "")), i = i.replace(/{id}/gi, a.gatewayServiceId), i;
965
+ }), N = (i) => {
966
+ let f = "";
967
+ i.url && (f = new URL(i.url).protocol), (["https", "wss", "tls"].includes(i.protocol) || ["https", "wss", "tls"].includes(f)) && (i.tls_verify = i.tls_verify_enabled ? i.tls_verify_value : null), delete i.tls_verify_enabled, delete i.tls_verify_value;
968
+ }, J = h(() => {
969
+ var f, k, H, L;
970
+ const i = {
971
+ name: l.fields.name || null,
972
+ tags: l.fields.tags ? (H = (k = (f = l.fields.tags) == null ? void 0 : f.split(",")) == null ? void 0 : k.map(($) => String($ || "").trim())) == null ? void 0 : H.filter(($) => $ !== "") : null,
973
+ protocol: l.fields.protocol,
974
+ path: l.fields.path || null,
975
+ read_timeout: l.fields.read_timeout,
976
+ retries: l.fields.retries,
977
+ host: l.fields.host,
978
+ connect_timeout: l.fields.connect_timeout,
979
+ tls_verify_value: l.fields.tls_verify_value,
980
+ tls_verify_enabled: l.fields.tls_verify_enabled,
981
+ ca_certificates: l.fields.ca_certificates ? (L = l.fields.ca_certificates) == null ? void 0 : L.split(",").filter(($) => $ !== "") : null,
982
+ client_certificate: l.fields.client_certificate ? { id: l.fields.client_certificate } : null,
983
+ write_timeout: l.fields.write_timeout,
984
+ port: l.fields.port,
985
+ url: l.fields.url
939
986
  };
940
- return e.fields.client_certificate && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.client_certificate = { id: e.fields.client_certificate }), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.tls_verify = e.fields.tls_verify_value), Q.value || (t.path = null), O.value === "create" ? _.value === "url" ? (delete t.protocol, delete t.host, delete t.path, r.config.app === "konnect" && delete t.port) : delete t.url : O.value === "edit" && delete t.url, t;
941
- }), j = async () => {
942
- var t, i, v, M;
987
+ return l.fields.client_certificate && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.client_certificate = { id: l.fields.client_certificate }), l.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(l.fields.protocol) && (i.tls_verify = l.fields.tls_verify_value), pe.value || (i.path = null), X.value === "create" ? A.value === "url" ? (delete i.protocol, delete i.host, delete i.path, a.config.app === "konnect" && delete i.port) : delete i.url : X.value === "edit" && delete i.url, i;
988
+ }), oe = async () => {
989
+ var i, f, k, H;
943
990
  try {
944
- e.isReadonly = !0, T();
945
- const V = K.value;
946
- B(V);
947
- let h;
948
- if (await C.post(Ve.value, V), O.value === "create" ? h = await C.post(oe.value, V) : O.value === "edit" && (h = ((t = r.config) == null ? void 0 : t.app) === "konnect" ? await C.put(oe.value, V) : await C.patch(oe.value, V)), h) {
949
- const { data: l } = h;
950
- e.fields.name = (l == null ? void 0 : l.name) || "", e.fields.port = l.port || Y.getPortFromProtocol(l.protocol), e.fields.protocol = (l == null ? void 0 : l.protocol) || "http", e.fields.host = (l == null ? void 0 : l.host) || "", e.fields.path = (l == null ? void 0 : l.path) || "", e.fields.url = (l == null ? void 0 : l.url) || "", e.fields.retries = l != null && l.retries || (l == null ? void 0 : l.retries) === 0 ? l == null ? void 0 : l.retries : 5, e.fields.connect_timeout = l != null && l.connect_timeout || (l == null ? void 0 : l.connect_timeout) === 0 ? l == null ? void 0 : l.connect_timeout : 6e4, e.fields.write_timeout = l != null && l.write_timeout || (l == null ? void 0 : l.write_timeout) === 0 ? l == null ? void 0 : l.write_timeout : 6e4, e.fields.read_timeout = l != null && l.read_timeout || (l == null ? void 0 : l.read_timeout) === 0 ? l == null ? void 0 : l.read_timeout : 6e4, e.fields.client_certificate = ((i = l == null ? void 0 : l.client_certificate) == null ? void 0 : i.id) || "", e.fields.ca_certificates = (v = l == null ? void 0 : l.ca_certificates) != null && v.length ? l == null ? void 0 : l.ca_certificates.join(",") : "", e.fields.tls_verify_enabled = (l == null ? void 0 : l.tls_verify) !== "" && (l == null ? void 0 : l.tls_verify) !== null && (l == null ? void 0 : l.tls_verify) !== void 0, e.fields.tls_verify_value = e.fields.tls_verify_enabled && (l == null ? void 0 : l.tls_verify), e.fields.tags = (M = l == null ? void 0 : l.tags) != null && M.length ? l.tags.join(", ") : "", Object.assign(w, e.fields), c("update", h == null ? void 0 : h.data);
991
+ l.isReadonly = !0, q();
992
+ const L = J.value;
993
+ N(L);
994
+ let $;
995
+ if (await I.post(de.value, L), X.value === "create" ? $ = await I.post(le.value, L) : X.value === "edit" && ($ = ((i = a.config) == null ? void 0 : i.app) === "konnect" ? await I.put(le.value, L) : await I.patch(le.value, L)), $) {
996
+ const { data: c } = $;
997
+ l.fields.name = (c == null ? void 0 : c.name) || "", l.fields.port = c.port || Y.getPortFromProtocol(c.protocol), l.fields.protocol = (c == null ? void 0 : c.protocol) || "http", l.fields.host = (c == null ? void 0 : c.host) || "", l.fields.path = (c == null ? void 0 : c.path) || "", l.fields.url = (c == null ? void 0 : c.url) || "", l.fields.retries = c != null && c.retries || (c == null ? void 0 : c.retries) === 0 ? c == null ? void 0 : c.retries : 5, l.fields.connect_timeout = c != null && c.connect_timeout || (c == null ? void 0 : c.connect_timeout) === 0 ? c == null ? void 0 : c.connect_timeout : 6e4, l.fields.write_timeout = c != null && c.write_timeout || (c == null ? void 0 : c.write_timeout) === 0 ? c == null ? void 0 : c.write_timeout : 6e4, l.fields.read_timeout = c != null && c.read_timeout || (c == null ? void 0 : c.read_timeout) === 0 ? c == null ? void 0 : c.read_timeout : 6e4, l.fields.client_certificate = ((f = c == null ? void 0 : c.client_certificate) == null ? void 0 : f.id) || "", l.fields.ca_certificates = (k = c == null ? void 0 : c.ca_certificates) != null && k.length ? c == null ? void 0 : c.ca_certificates.join(",") : "", l.fields.tls_verify_enabled = (c == null ? void 0 : c.tls_verify) !== "" && (c == null ? void 0 : c.tls_verify) !== null && (c == null ? void 0 : c.tls_verify) !== void 0, l.fields.tls_verify_value = l.fields.tls_verify_enabled && (c == null ? void 0 : c.tls_verify), l.fields.tags = (H = c == null ? void 0 : c.tags) != null && H.length ? c.tags.join(", ") : "", Object.assign(R, l.fields), p("update", $ == null ? void 0 : $.data);
951
998
  }
952
- return h;
953
- } catch (V) {
954
- e.errorMessage = P(V), c("error", V);
999
+ return $;
1000
+ } catch (L) {
1001
+ l.errorMessage = K(L), p("error", L);
955
1002
  } finally {
956
- e.isReadonly = !1;
1003
+ l.isReadonly = !1;
957
1004
  }
958
1005
  };
959
- return Ie(() => r.gatewayServiceId, () => {
960
- Object.assign(e.fields, w);
961
- }), Ie(e.fields, (t) => {
962
- e.fields.port = Y.getPortFromProtocol(t.protocol, String(t.port)), c("model-updated", K.value);
963
- }), De(() => {
964
- c("model-updated", K.value);
965
- }), D({
966
- validateUrl: T,
967
- getPayload: K,
968
- saveFormData: j,
969
- canSubmit: te,
970
- initForm: ne
971
- }), (t, i) => {
972
- const v = F("KInput"), M = F("KLabel"), V = F("KRadio"), h = F("KSelect"), l = F("KCheckbox"), u = F("KCollapse");
973
- return S(), U("div", St, [
974
- d(o(st), {
975
- "can-submit": te.value,
1006
+ return Ue(() => a.gatewayServiceId, () => {
1007
+ Object.assign(l.fields, R);
1008
+ }), Ue(l.fields, (i) => {
1009
+ l.fields.port = Y.getPortFromProtocol(i.protocol, String(i.port)), p("model-updated", J.value);
1010
+ }), Je(() => {
1011
+ p("model-updated", J.value);
1012
+ }), M({
1013
+ validateUrl: q,
1014
+ getPayload: J,
1015
+ saveFormData: oe,
1016
+ canSubmit: me,
1017
+ initForm: be
1018
+ }), (i, f) => {
1019
+ const k = D("KInput"), H = D("KLabel"), L = D("KRadio"), $ = D("KSelect"), c = D("KCheckbox"), g = D("KCollapse");
1020
+ return C(), F("div", Wt, [
1021
+ d(o(tt), {
1022
+ "can-submit": me.value,
976
1023
  config: n.config,
977
1024
  "edit-id": n.gatewayServiceId,
978
- "entity-type": o(Fe).GatewayService,
979
- "error-message": e.errorMessage,
980
- "fetch-url": ye.value,
981
- "form-fields": K.value,
982
- "is-readonly": e.isReadonly,
983
- onCancel: ce,
984
- "onFetch:error": i[25] || (i[25] = (s) => t.$emit("error", s)),
985
- "onFetch:success": ne,
986
- onLoading: i[26] || (i[26] = (s) => t.$emit("loading", s)),
987
- onSubmit: j
1025
+ "entity-type": o(Ge).GatewayService,
1026
+ "error-message": l.errorMessage,
1027
+ "fetch-url": ue.value,
1028
+ "form-fields": J.value,
1029
+ "is-readonly": l.isReadonly,
1030
+ onCancel: Se,
1031
+ "onFetch:error": f[25] || (f[25] = (m) => i.$emit("error", m)),
1032
+ "onFetch:success": be,
1033
+ onLoading: f[26] || (f[26] = (m) => i.$emit("loading", m)),
1034
+ onSubmit: oe
988
1035
  }, {
989
- "form-actions": f(() => [
990
- Ge(t.$slots, "form-actions", {
991
- canSubmit: te.value,
992
- cancel: ce,
993
- submit: j
1036
+ "form-actions": v(() => [
1037
+ Qe(i.$slots, "form-actions", {
1038
+ canSubmit: me.value,
1039
+ cancel: Se,
1040
+ submit: oe
994
1041
  }, void 0, !0)
995
1042
  ]),
996
- default: f(() => [
997
- d(o($e), {
998
- description: o(a)("gateway_services.form.sections.general.description"),
1043
+ default: v(() => [
1044
+ d(o(Be), {
1045
+ description: o(r)("gateway_services.form.sections.general.description"),
999
1046
  "hide-info-header": n.hideSectionsInfo,
1000
- title: o(a)("gateway_services.form.sections.general.title")
1047
+ title: o(r)("gateway_services.form.sections.general.title")
1001
1048
  }, {
1002
- default: f(() => [
1003
- d(v, {
1004
- modelValue: e.fields.name,
1005
- "onUpdate:modelValue": i[0] || (i[0] = (s) => e.fields.name = s),
1049
+ default: v(() => [
1050
+ d(k, {
1051
+ modelValue: l.fields.name,
1052
+ "onUpdate:modelValue": f[0] || (f[0] = (m) => l.fields.name = m),
1006
1053
  modelModifiers: { trim: !0 },
1007
1054
  autocomplete: "off",
1008
1055
  "data-testid": "gateway-service-name-input",
1009
- error: be.value,
1010
- "error-message": G.value,
1011
- label: o(a)("gateway_services.form.fields.name.label"),
1056
+ error: re.value,
1057
+ "error-message": ee.value,
1058
+ label: o(r)("gateway_services.form.fields.name.label"),
1012
1059
  "label-attributes": {
1013
- info: o(a)("gateway_services.form.fields.name.tooltip"),
1060
+ info: o(r)("gateway_services.form.fields.name.tooltip"),
1014
1061
  tooltipAttributes: { maxWidth: "400" }
1015
1062
  },
1016
1063
  name: "name",
1017
- placeholder: o(a)("gateway_services.form.fields.name.placeholder"),
1018
- readonly: e.isReadonly,
1064
+ placeholder: o(r)("gateway_services.form.fields.name.placeholder"),
1065
+ readonly: l.isReadonly,
1019
1066
  type: "text",
1020
1067
  onInput: Ce
1021
1068
  }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
1022
- d(v, {
1023
- modelValue: e.fields.tags,
1024
- "onUpdate:modelValue": i[1] || (i[1] = (s) => e.fields.tags = s),
1069
+ d(k, {
1070
+ modelValue: l.fields.tags,
1071
+ "onUpdate:modelValue": f[1] || (f[1] = (m) => l.fields.tags = m),
1025
1072
  modelModifiers: { trim: !0 },
1026
1073
  autocomplete: "off",
1027
1074
  "data-testid": "gateway-service-tags-input",
1028
- help: o(a)("gateway_services.form.fields.tags.help"),
1029
- label: o(a)("gateway_services.form.fields.tags.label"),
1075
+ help: o(r)("gateway_services.form.fields.tags.help"),
1076
+ label: o(r)("gateway_services.form.fields.tags.label"),
1030
1077
  "label-attributes": {
1031
- info: o(a)("gateway_services.form.fields.tags.tooltip"),
1078
+ info: o(r)("gateway_services.form.fields.tags.tooltip"),
1032
1079
  tooltipAttributes: { maxWidth: "400" }
1033
1080
  },
1034
1081
  name: "tags",
1035
- placeholder: o(a)("gateway_services.form.fields.tags.placeholder"),
1036
- readonly: e.isReadonly,
1082
+ placeholder: o(r)("gateway_services.form.fields.tags.placeholder"),
1083
+ readonly: l.isReadonly,
1037
1084
  type: "text"
1038
1085
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
1039
1086
  ]),
1040
1087
  _: 1
1041
1088
  }, 8, ["description", "hide-info-header", "title"]),
1042
- d(o($e), {
1043
- description: o(a)("gateway_services.form.sections.keys.description"),
1089
+ d(o(Be), {
1090
+ description: o(r)("gateway_services.form.sections.keys.description"),
1044
1091
  "hide-info-header": n.hideSectionsInfo,
1045
- title: o(a)("gateway_services.form.sections.keys.title")
1092
+ title: o(r)("gateway_services.form.sections.keys.title")
1046
1093
  }, {
1047
- default: f(() => [
1048
- H.value ? L("", !0) : (S(), U("div", It, [
1049
- k("div", Tt, [
1050
- d(M, { required: "" }, {
1051
- default: f(() => [
1052
- R(y(o(a)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
1094
+ default: v(() => [
1095
+ fe.value ? T("", !0) : (C(), F("div", Dt, [
1096
+ S("div", qt, [
1097
+ d(H, { required: "" }, {
1098
+ default: v(() => [
1099
+ z(P(o(r)("gateway_services.form.sections.keys.checkedGroupLabel")), 1)
1053
1100
  ]),
1054
1101
  _: 1
1055
1102
  })
1056
1103
  ]),
1057
- k("div", Et, [
1058
- d(V, {
1059
- modelValue: _.value,
1060
- "onUpdate:modelValue": i[2] || (i[2] = (s) => _.value = s),
1104
+ S("div", Ot, [
1105
+ d(L, {
1106
+ modelValue: A.value,
1107
+ "onUpdate:modelValue": f[2] || (f[2] = (m) => A.value = m),
1061
1108
  "data-testid": "gateway-service-url-radio",
1062
- "selected-value": re.url,
1063
- onChange: z
1109
+ "selected-value": t.url,
1110
+ onChange: ne
1064
1111
  }, {
1065
- default: f(() => [
1066
- R(y(o(a)("gateway_services.form.sections.keys.urlLabel")), 1)
1112
+ default: v(() => [
1113
+ z(P(o(r)("gateway_services.form.sections.keys.urlLabel")), 1)
1067
1114
  ]),
1068
1115
  _: 1
1069
1116
  }, 8, ["modelValue", "selected-value"])
1070
1117
  ]),
1071
- _.value === "url" ? (S(), U("div", Pt, [
1072
- d(v, {
1073
- modelValue: e.fields.url,
1074
- "onUpdate:modelValue": i[3] || (i[3] = (s) => e.fields.url = s),
1118
+ A.value === "url" ? (C(), F("div", Gt, [
1119
+ d(k, {
1120
+ modelValue: l.fields.url,
1121
+ "onUpdate:modelValue": f[3] || (f[3] = (m) => l.fields.url = m),
1075
1122
  modelModifiers: { trim: !0 },
1076
1123
  class: "gateway-service-url-input gateway-service-form-margin-bottom",
1077
1124
  "data-testid": "gateway-service-url-input",
1078
- label: o(a)("gateway_services.form.fields.upstream_url.label"),
1125
+ label: o(r)("gateway_services.form.fields.upstream_url.label"),
1079
1126
  "label-attributes": {
1080
- info: n.config.app === "konnect" ? o(a)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(a)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
1127
+ info: n.config.app === "konnect" ? o(r)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(r)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
1081
1128
  tooltipAttributes: { maxWidth: "400" }
1082
1129
  },
1083
1130
  name: "url",
1084
- placeholder: o(a)("gateway_services.form.fields.upstream_url.placeholder"),
1131
+ placeholder: o(r)("gateway_services.form.fields.upstream_url.placeholder"),
1085
1132
  required: ""
1086
1133
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
1087
- ])) : L("", !0),
1088
- d(V, {
1089
- modelValue: _.value,
1090
- "onUpdate:modelValue": i[4] || (i[4] = (s) => _.value = s),
1134
+ ])) : T("", !0),
1135
+ d(L, {
1136
+ modelValue: A.value,
1137
+ "onUpdate:modelValue": f[4] || (f[4] = (m) => A.value = m),
1091
1138
  "checked-group": "protocol",
1092
1139
  "data-testid": "gateway-service-protocol-radio",
1093
- "selected-value": re.protocol,
1094
- onChange: z
1140
+ "selected-value": t.protocol,
1141
+ onChange: ne
1095
1142
  }, {
1096
- default: f(() => [
1097
- R(y(o(a)("gateway_services.form.sections.keys.checkedGroupAltLabel")), 1)
1143
+ default: v(() => [
1144
+ z(P(o(r)("gateway_services.form.sections.keys.checkedGroupAltLabel")), 1)
1098
1145
  ]),
1099
1146
  _: 1
1100
1147
  }, 8, ["modelValue", "selected-value"])
1101
1148
  ])),
1102
- _.value === "protocol" || H.value ? (S(), U("div", Ut, [
1103
- d(h, {
1104
- modelValue: e.fields.protocol,
1105
- "onUpdate:modelValue": i[5] || (i[5] = (s) => e.fields.protocol = s),
1149
+ A.value === "protocol" || fe.value ? (C(), F("div", Nt, [
1150
+ d($, {
1151
+ modelValue: l.fields.protocol,
1152
+ "onUpdate:modelValue": f[5] || (f[5] = (m) => l.fields.protocol = m),
1106
1153
  "data-testid": "gateway-service-protocol-select",
1107
- items: he,
1108
- label: o(a)("gateway_services.form.fields.protocol.label"),
1154
+ items: Pe,
1155
+ label: o(r)("gateway_services.form.fields.protocol.label"),
1109
1156
  "label-attributes": {
1110
- info: o(a)("gateway_services.form.fields.protocol.tooltip"),
1157
+ info: o(r)("gateway_services.form.fields.protocol.tooltip"),
1111
1158
  tooltipAttributes: { maxWidth: "400" }
1112
1159
  },
1113
- readonly: e.isReadonly,
1160
+ readonly: l.isReadonly,
1114
1161
  required: "",
1115
1162
  width: "100%",
1116
- onSelected: i[6] || (i[6] = (s) => J(e.fields.protocol, s))
1163
+ onSelected: f[6] || (f[6] = (m) => U(l.fields.protocol, m))
1117
1164
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
1118
- d(v, {
1119
- modelValue: e.fields.host,
1120
- "onUpdate:modelValue": i[7] || (i[7] = (s) => e.fields.host = s),
1165
+ d(k, {
1166
+ modelValue: l.fields.host,
1167
+ "onUpdate:modelValue": f[7] || (f[7] = (m) => l.fields.host = m),
1121
1168
  modelModifiers: { trim: !0 },
1122
1169
  class: "gateway-service-form-margin-top",
1123
1170
  "data-testid": "gateway-service-host-input",
1124
- label: o(a)("gateway_services.form.fields.host.label"),
1171
+ label: o(r)("gateway_services.form.fields.host.label"),
1125
1172
  "label-attributes": {
1126
- info: o(a)("gateway_services.form.fields.host.tooltip"),
1173
+ info: o(r)("gateway_services.form.fields.host.tooltip"),
1127
1174
  tooltipAttributes: { maxWidth: "400" }
1128
1175
  },
1129
1176
  name: "host",
1130
- placeholder: o(a)("gateway_services.form.fields.host.placeholder"),
1177
+ placeholder: o(r)("gateway_services.form.fields.host.placeholder"),
1131
1178
  required: ""
1132
1179
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder"]),
1133
- Q.value ? (S(), U("div", Rt, [
1134
- d(v, {
1135
- modelValue: e.fields.path,
1136
- "onUpdate:modelValue": i[8] || (i[8] = (s) => e.fields.path = s),
1180
+ pe.value ? (C(), F("div", jt, [
1181
+ d(k, {
1182
+ modelValue: l.fields.path,
1183
+ "onUpdate:modelValue": f[8] || (f[8] = (m) => l.fields.path = m),
1137
1184
  modelModifiers: { trim: !0 },
1138
1185
  class: "gateway-service-form-margin-top",
1139
1186
  "data-testid": "gateway-service-path-input",
1140
- label: o(a)("gateway_services.form.fields.path.label"),
1187
+ label: o(r)("gateway_services.form.fields.path.label"),
1141
1188
  "label-attributes": {
1142
- info: o(a)("gateway_services.form.fields.path.tooltip"),
1189
+ info: o(r)("gateway_services.form.fields.path.tooltip"),
1143
1190
  tooltipAttributes: { maxWidth: "400" }
1144
1191
  },
1145
1192
  name: "path",
1146
- placeholder: o(a)("gateway_services.form.fields.path.placeholder")
1193
+ placeholder: o(r)("gateway_services.form.fields.path.placeholder")
1147
1194
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder"])
1148
- ])) : L("", !0),
1149
- d(v, {
1150
- modelValue: e.fields.port,
1195
+ ])) : T("", !0),
1196
+ d(k, {
1197
+ modelValue: l.fields.port,
1151
1198
  "onUpdate:modelValue": [
1152
- i[9] || (i[9] = (s) => e.fields.port = s),
1153
- i[10] || (i[10] = () => {
1154
- e.fields.port = W(e.fields.port + "");
1199
+ f[9] || (f[9] = (m) => l.fields.port = m),
1200
+ f[10] || (f[10] = () => {
1201
+ l.fields.port = ae(l.fields.port + "");
1155
1202
  })
1156
1203
  ],
1157
1204
  class: "gateway-service-form-margin-top",
1158
1205
  "data-testid": "gateway-service-port-input",
1159
- label: o(a)("gateway_services.form.fields.port.label"),
1206
+ label: o(r)("gateway_services.form.fields.port.label"),
1160
1207
  "label-attributes": {
1161
- info: o(a)("gateway_services.form.fields.port.tooltip"),
1208
+ info: o(r)("gateway_services.form.fields.port.tooltip"),
1162
1209
  tooltipAttributes: { maxWidth: "400" }
1163
1210
  },
1164
1211
  name: "port",
1165
1212
  type: "number"
1166
1213
  }, null, 8, ["modelValue", "label", "label-attributes"])
1167
- ])) : L("", !0),
1168
- d(u, {
1169
- modelValue: x.value,
1170
- "onUpdate:modelValue": i[24] || (i[24] = (s) => x.value = s),
1214
+ ])) : T("", !0),
1215
+ d(g, {
1216
+ modelValue: b.value,
1217
+ "onUpdate:modelValue": f[24] || (f[24] = (m) => b.value = m),
1171
1218
  "data-testid": "advanced-fields-collapse",
1172
1219
  "trigger-alignment": "leading",
1173
- "trigger-label": o(a)("gateway_services.form.sections.keys.viewAdvancedFields")
1220
+ "trigger-label": o(r)("gateway_services.form.sections.keys.viewAdvancedFields")
1174
1221
  }, {
1175
- default: f(() => [
1176
- k("div", Mt, [
1177
- k("div", $t, [
1178
- d(v, {
1179
- modelValue: e.fields.retries,
1222
+ default: v(() => [
1223
+ S("div", zt, [
1224
+ S("div", Ht, [
1225
+ d(k, {
1226
+ modelValue: l.fields.retries,
1180
1227
  "onUpdate:modelValue": [
1181
- i[11] || (i[11] = (s) => e.fields.retries = s),
1182
- i[12] || (i[12] = () => {
1183
- e.fields.retries = W(e.fields.retries + "");
1228
+ f[11] || (f[11] = (m) => l.fields.retries = m),
1229
+ f[12] || (f[12] = () => {
1230
+ l.fields.retries = ae(l.fields.retries + "");
1184
1231
  })
1185
1232
  ],
1186
1233
  autocomplete: "off",
1187
1234
  "data-testid": "gateway-service-retries-input",
1188
- label: o(a)("gateway_services.form.fields.retries.label"),
1235
+ label: o(r)("gateway_services.form.fields.retries.label"),
1189
1236
  "label-attributes": {
1190
- info: o(a)("gateway_services.form.fields.retries.tooltip"),
1237
+ info: o(r)("gateway_services.form.fields.retries.tooltip"),
1191
1238
  tooltipAttributes: { maxWidth: "400" }
1192
1239
  },
1193
1240
  name: "retries",
1194
- readonly: e.isReadonly,
1241
+ readonly: l.isReadonly,
1195
1242
  type: "number"
1196
1243
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1197
1244
  ]),
1198
- k("div", xt, [
1199
- d(v, {
1200
- modelValue: e.fields.connect_timeout,
1245
+ S("div", Zt, [
1246
+ d(k, {
1247
+ modelValue: l.fields.connect_timeout,
1201
1248
  "onUpdate:modelValue": [
1202
- i[13] || (i[13] = (s) => e.fields.connect_timeout = s),
1203
- i[14] || (i[14] = () => {
1204
- e.fields.connect_timeout = W(e.fields.connect_timeout + "");
1249
+ f[13] || (f[13] = (m) => l.fields.connect_timeout = m),
1250
+ f[14] || (f[14] = () => {
1251
+ l.fields.connect_timeout = ae(l.fields.connect_timeout + "");
1205
1252
  })
1206
1253
  ],
1207
1254
  autocomplete: "off",
1208
1255
  "data-testid": "gateway-service-connTimeout-input",
1209
- label: o(a)("gateway_services.form.fields.connect_timeout.label"),
1256
+ label: o(r)("gateway_services.form.fields.connect_timeout.label"),
1210
1257
  "label-attributes": {
1211
- info: o(a)("gateway_services.form.fields.connect_timeout.tooltip"),
1258
+ info: o(r)("gateway_services.form.fields.connect_timeout.tooltip"),
1212
1259
  tooltipAttributes: { maxWidth: "400" }
1213
1260
  },
1214
1261
  name: "connTimeout",
1215
- readonly: e.isReadonly,
1262
+ readonly: l.isReadonly,
1216
1263
  type: "number"
1217
1264
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1218
1265
  ]),
1219
- k("div", At, [
1220
- d(v, {
1221
- modelValue: e.fields.write_timeout,
1266
+ S("div", Jt, [
1267
+ d(k, {
1268
+ modelValue: l.fields.write_timeout,
1222
1269
  "onUpdate:modelValue": [
1223
- i[15] || (i[15] = (s) => e.fields.write_timeout = s),
1224
- i[16] || (i[16] = () => {
1225
- e.fields.write_timeout = W(e.fields.write_timeout + "");
1270
+ f[15] || (f[15] = (m) => l.fields.write_timeout = m),
1271
+ f[16] || (f[16] = () => {
1272
+ l.fields.write_timeout = ae(l.fields.write_timeout + "");
1226
1273
  })
1227
1274
  ],
1228
1275
  autocomplete: "off",
1229
1276
  "data-testid": "gateway-service-writeTimeout-input",
1230
- label: o(a)("gateway_services.form.fields.write_timeout.label"),
1277
+ label: o(r)("gateway_services.form.fields.write_timeout.label"),
1231
1278
  "label-attributes": {
1232
- info: o(a)("gateway_services.form.fields.write_timeout.tooltip"),
1279
+ info: o(r)("gateway_services.form.fields.write_timeout.tooltip"),
1233
1280
  tooltipAttributes: { maxWidth: "400" }
1234
1281
  },
1235
1282
  name: "writeTimeout",
1236
- readonly: e.isReadonly,
1283
+ readonly: l.isReadonly,
1237
1284
  type: "number"
1238
1285
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1239
1286
  ]),
1240
- k("div", Ft, [
1241
- d(v, {
1242
- modelValue: e.fields.read_timeout,
1287
+ S("div", Qt, [
1288
+ d(k, {
1289
+ modelValue: l.fields.read_timeout,
1243
1290
  "onUpdate:modelValue": [
1244
- i[17] || (i[17] = (s) => e.fields.read_timeout = s),
1245
- i[18] || (i[18] = () => {
1246
- e.fields.read_timeout = W(e.fields.read_timeout + "");
1291
+ f[17] || (f[17] = (m) => l.fields.read_timeout = m),
1292
+ f[18] || (f[18] = () => {
1293
+ l.fields.read_timeout = ae(l.fields.read_timeout + "");
1247
1294
  })
1248
1295
  ],
1249
1296
  autocomplete: "off",
1250
1297
  "data-testid": "gateway-service-readTimeout-input",
1251
- label: o(a)("gateway_services.form.fields.read_timeout.label"),
1298
+ label: o(r)("gateway_services.form.fields.read_timeout.label"),
1252
1299
  "label-attributes": {
1253
- info: o(a)("gateway_services.form.fields.read_timeout.tooltip"),
1300
+ info: o(r)("gateway_services.form.fields.read_timeout.tooltip"),
1254
1301
  tooltipAttributes: { maxWidth: "400" }
1255
1302
  },
1256
1303
  name: "readTimeout",
1257
- readonly: e.isReadonly,
1304
+ readonly: l.isReadonly,
1258
1305
  type: "number"
1259
1306
  }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1260
1307
  ]),
1261
- we.value ? (S(), U("div", Bt, [
1262
- d(v, {
1263
- modelValue: e.fields.client_certificate,
1264
- "onUpdate:modelValue": i[19] || (i[19] = (s) => e.fields.client_certificate = s),
1308
+ ce.value ? (C(), F("div", Xt, [
1309
+ d(k, {
1310
+ modelValue: l.fields.client_certificate,
1311
+ "onUpdate:modelValue": f[19] || (f[19] = (m) => l.fields.client_certificate = m),
1265
1312
  modelModifiers: { trim: !0 },
1266
1313
  autocomplete: "off",
1267
1314
  "data-testid": "gateway-service-clientCert-input",
1268
- label: o(a)("gateway_services.form.fields.client_certificate.label"),
1315
+ label: o(r)("gateway_services.form.fields.client_certificate.label"),
1269
1316
  "label-attributes": {
1270
- info: o(a)("gateway_services.form.fields.client_certificate.tooltip"),
1317
+ info: o(r)("gateway_services.form.fields.client_certificate.tooltip"),
1271
1318
  tooltipAttributes: { maxWidth: "400" }
1272
1319
  },
1273
1320
  name: "clientCert",
1274
- placeholder: o(a)("gateway_services.form.fields.client_certificate.placeholder"),
1275
- readonly: e.isReadonly,
1321
+ placeholder: o(r)("gateway_services.form.fields.client_certificate.placeholder"),
1322
+ readonly: l.isReadonly,
1276
1323
  type: "text"
1277
1324
  }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])
1278
- ])) : L("", !0),
1279
- ae.value ? (S(), U("div", Lt, [
1280
- d(v, {
1281
- modelValue: e.fields.ca_certificates,
1282
- "onUpdate:modelValue": i[20] || (i[20] = (s) => e.fields.ca_certificates = s),
1325
+ ])) : T("", !0),
1326
+ _e.value ? (C(), F("div", Yt, [
1327
+ d(k, {
1328
+ modelValue: l.fields.ca_certificates,
1329
+ "onUpdate:modelValue": f[20] || (f[20] = (m) => l.fields.ca_certificates = m),
1283
1330
  modelModifiers: { trim: !0 },
1284
1331
  autocomplete: "off",
1285
1332
  "data-testid": "gateway-service-ca-certs-input",
1286
- label: o(a)("gateway_services.form.fields.ca_certificates.label"),
1333
+ label: o(r)("gateway_services.form.fields.ca_certificates.label"),
1287
1334
  "label-attributes": { tooltipAttributes: { maxWidth: "400" } },
1288
- placeholder: o(a)("gateway_services.form.fields.ca_certificates.placeholder"),
1289
- readonly: e.isReadonly,
1335
+ placeholder: o(r)("gateway_services.form.fields.ca_certificates.placeholder"),
1336
+ readonly: l.isReadonly,
1290
1337
  type: "text"
1291
1338
  }, {
1292
- "label-tooltip": f(() => [
1293
- d(o(q), {
1339
+ "label-tooltip": v(() => [
1340
+ d(o(Z), {
1294
1341
  keypath: "gateway_services.form.fields.ca_certificates.tooltip",
1295
1342
  scope: "global"
1296
1343
  }, {
1297
- code1: f(() => [
1298
- k("code", null, y(o(a)("gateway_services.form.fields.ca_certificates.code1")), 1)
1344
+ code1: v(() => [
1345
+ S("code", null, P(o(r)("gateway_services.form.fields.ca_certificates.code1")), 1)
1299
1346
  ]),
1300
- code2: f(() => [
1301
- k("code", null, y(o(a)("gateway_services.form.fields.ca_certificates.code2")), 1)
1347
+ code2: v(() => [
1348
+ S("code", null, P(o(r)("gateway_services.form.fields.ca_certificates.code2")), 1)
1302
1349
  ]),
1303
1350
  _: 1
1304
1351
  })
1305
1352
  ]),
1306
1353
  _: 1
1307
1354
  }, 8, ["modelValue", "label", "placeholder", "readonly"])
1308
- ])) : L("", !0),
1309
- ke.value ? (S(), U("div", Dt, [
1310
- d(l, {
1311
- modelValue: e.fields.tls_verify_enabled,
1312
- "onUpdate:modelValue": i[21] || (i[21] = (s) => e.fields.tls_verify_enabled = s),
1355
+ ])) : T("", !0),
1356
+ Ve.value ? (C(), F("div", el, [
1357
+ d(c, {
1358
+ modelValue: l.fields.tls_verify_enabled,
1359
+ "onUpdate:modelValue": f[21] || (f[21] = (m) => l.fields.tls_verify_enabled = m),
1313
1360
  "data-testid": "gateway-service-tls-verify-checkbox",
1314
- description: o(a)("gateway_services.form.fields.tls_verify_enabled.help"),
1315
- label: o(a)("gateway_services.form.fields.tls_verify_enabled.label"),
1361
+ description: o(r)("gateway_services.form.fields.tls_verify_enabled.help"),
1362
+ label: o(r)("gateway_services.form.fields.tls_verify_enabled.label"),
1316
1363
  "label-attributes": { tooltipAttributes: { maxWidth: "400" } }
1317
1364
  }, {
1318
- tooltip: f(() => [
1319
- d(o(q), {
1365
+ tooltip: v(() => [
1366
+ d(o(Z), {
1320
1367
  keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
1321
1368
  scope: "global"
1322
1369
  }, {
1323
- code1: f(() => [
1324
- k("code", null, y(o(a)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1370
+ code1: v(() => [
1371
+ S("code", null, P(o(r)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1325
1372
  ]),
1326
1373
  _: 1
1327
1374
  })
1328
1375
  ]),
1329
1376
  _: 1
1330
1377
  }, 8, ["modelValue", "description", "label"]),
1331
- e.fields.tls_verify_enabled ? (S(), U("div", Gt, [
1332
- d(V, {
1333
- modelValue: e.fields.tls_verify_value,
1334
- "onUpdate:modelValue": i[22] || (i[22] = (s) => e.fields.tls_verify_value = s),
1378
+ l.fields.tls_verify_enabled ? (C(), F("div", tl, [
1379
+ d(L, {
1380
+ modelValue: l.fields.tls_verify_value,
1381
+ "onUpdate:modelValue": f[22] || (f[22] = (m) => l.fields.tls_verify_value = m),
1335
1382
  "data-testid": "gateway-service-tls-verify-true-option",
1336
- label: o(a)("gateway_services.form.fields.tls_verify_option.true.label"),
1383
+ label: o(r)("gateway_services.form.fields.tls_verify_option.true.label"),
1337
1384
  "selected-value": !0
1338
1385
  }, null, 8, ["modelValue", "label"])
1339
- ])) : L("", !0),
1340
- e.fields.tls_verify_enabled ? (S(), U("div", Kt, [
1341
- d(V, {
1342
- modelValue: e.fields.tls_verify_value,
1343
- "onUpdate:modelValue": i[23] || (i[23] = (s) => e.fields.tls_verify_value = s),
1386
+ ])) : T("", !0),
1387
+ l.fields.tls_verify_enabled ? (C(), F("div", ll, [
1388
+ d(L, {
1389
+ modelValue: l.fields.tls_verify_value,
1390
+ "onUpdate:modelValue": f[23] || (f[23] = (m) => l.fields.tls_verify_value = m),
1344
1391
  "data-testid": "gateway-service-tls-verify-false-option",
1345
- label: o(a)("gateway_services.form.fields.tls_verify_option.false.label"),
1392
+ label: o(r)("gateway_services.form.fields.tls_verify_option.false.label"),
1346
1393
  "selected-value": !1
1347
1394
  }, null, 8, ["modelValue", "label"])
1348
- ])) : L("", !0)
1349
- ])) : L("", !0)
1395
+ ])) : T("", !0)
1396
+ ])) : T("", !0)
1350
1397
  ])
1351
1398
  ]),
1352
1399
  _: 1
@@ -1360,7 +1407,7 @@ const ve = {
1360
1407
  ]);
1361
1408
  };
1362
1409
  }
1363
- }), Qt = /* @__PURE__ */ Be(qt, [["__scopeId", "data-v-35e0db56"]]), Ot = { class: "kong-ui-gateway-service-entity-config-card" }, Xt = /* @__PURE__ */ Te({
1410
+ }), Al = /* @__PURE__ */ Ne(ol, [["__scopeId", "data-v-c2c5e1f0"]]), il = { class: "kong-ui-gateway-service-entity-config-card" }, Rl = /* @__PURE__ */ Le({
1364
1411
  __name: "GatewayServiceConfigCard",
1365
1412
  props: {
1366
1413
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -1387,130 +1434,983 @@ const ve = {
1387
1434
  },
1388
1435
  emits: ["loading", "fetch:error", "fetch:success"],
1389
1436
  setup(n) {
1390
- const D = n, { i18n: { t: p }, i18nT: c } = ve.useI18n(), r = b(() => se.form[D.config.app].edit), { getPropValue: x } = rt(), N = (a, P) => x(a, P) === !0 ? p("gateway_services.form.fields.tls_verify_option.true.display") : p("gateway_services.form.fields.tls_verify_option.false.display"), q = E({
1437
+ const M = n, { i18n: { t: y }, i18nT: p } = ge.useI18n(), a = h(() => ye.form[M.config.app].edit), { getPropValue: b } = ht(), B = (r, K) => b(r, K) === !0 ? y("gateway_services.form.fields.tls_verify_option.true.display") : y("gateway_services.form.fields.tls_verify_option.false.display"), Z = W({
1391
1438
  id: {},
1392
1439
  name: {
1393
- tooltip: p("gateway_services.form.fields.name.tooltip")
1440
+ tooltip: y("gateway_services.form.fields.name.tooltip")
1394
1441
  },
1395
1442
  enabled: {},
1396
1443
  updated_at: {},
1397
1444
  created_at: {},
1398
1445
  protocol: {
1399
- section: fe.Basic,
1400
- tooltip: p("gateway_services.form.fields.protocol.tooltip")
1446
+ section: $e.Basic,
1447
+ tooltip: y("gateway_services.form.fields.protocol.tooltip")
1401
1448
  },
1402
1449
  host: {
1403
- section: fe.Basic,
1404
- tooltip: p("gateway_services.form.fields.host.tooltip")
1450
+ section: $e.Basic,
1451
+ tooltip: y("gateway_services.form.fields.host.tooltip")
1405
1452
  },
1406
1453
  path: {
1407
- section: fe.Basic,
1408
- tooltip: p("gateway_services.form.fields.path.tooltip")
1454
+ section: $e.Basic,
1455
+ tooltip: y("gateway_services.form.fields.path.tooltip")
1409
1456
  },
1410
1457
  port: {
1411
- section: fe.Basic,
1412
- tooltip: p("gateway_services.form.fields.port.tooltip")
1458
+ section: $e.Basic,
1459
+ tooltip: y("gateway_services.form.fields.port.tooltip")
1413
1460
  },
1414
1461
  tags: {
1415
- tooltip: p("gateway_services.form.fields.tags.tooltip")
1462
+ tooltip: y("gateway_services.form.fields.tags.tooltip")
1416
1463
  },
1417
1464
  // advanced fields
1418
1465
  retries: {
1419
1466
  order: 1,
1420
- tooltip: p("gateway_services.form.fields.retries.tooltip")
1467
+ tooltip: y("gateway_services.form.fields.retries.tooltip")
1421
1468
  },
1422
1469
  connect_timeout: {
1423
1470
  order: 2,
1424
- tooltip: p("gateway_services.form.fields.connect_timeout.tooltip")
1471
+ tooltip: y("gateway_services.form.fields.connect_timeout.tooltip")
1425
1472
  },
1426
1473
  write_timeout: {
1427
1474
  order: 3,
1428
- tooltip: p("gateway_services.form.fields.write_timeout.tooltip")
1475
+ tooltip: y("gateway_services.form.fields.write_timeout.tooltip")
1429
1476
  },
1430
1477
  read_timeout: {
1431
1478
  order: 4,
1432
- tooltip: p("gateway_services.form.fields.read_timeout.tooltip")
1479
+ tooltip: y("gateway_services.form.fields.read_timeout.tooltip")
1433
1480
  },
1434
1481
  client_certificate: {
1435
1482
  order: 5,
1436
- tooltip: p("gateway_services.form.fields.client_certificate.tooltip")
1483
+ tooltip: y("gateway_services.form.fields.client_certificate.tooltip")
1437
1484
  },
1438
1485
  ca_certificates: {
1439
- type: at.BadgeTag,
1440
- label: p("gateway_services.form.fields.ca_certificates.label"),
1486
+ type: wt.BadgeTag,
1487
+ label: y("gateway_services.form.fields.ca_certificates.label"),
1441
1488
  order: 6
1442
1489
  },
1443
1490
  tls_verify: {
1444
- label: p("gateway_services.form.fields.tls_verify_enabled.label")
1491
+ label: y("gateway_services.form.fields.tls_verify_enabled.label")
1445
1492
  },
1446
1493
  tls_verify_depth: {
1447
1494
  hidden: !0
1448
1495
  }
1449
1496
  });
1450
- return (a, P) => (S(), U("div", Ot, [
1451
- d(o(nt), {
1497
+ return (r, K) => (C(), F("div", il, [
1498
+ d(o(kt), {
1452
1499
  config: n.config,
1453
1500
  "config-card-doc": n.configCardDoc,
1454
- "config-schema": q.value,
1455
- "entity-type": o(Fe).GatewayService,
1456
- "fetch-url": r.value,
1501
+ "config-schema": Z.value,
1502
+ "entity-type": o(Ge).GatewayService,
1503
+ "fetch-url": a.value,
1457
1504
  "hide-title": n.hideTitle,
1458
- "onFetch:error": P[0] || (P[0] = (C) => a.$emit("fetch:error", C)),
1459
- "onFetch:success": P[1] || (P[1] = (C) => a.$emit("fetch:success", C)),
1460
- onLoading: P[2] || (P[2] = (C) => a.$emit("loading", C))
1505
+ "onFetch:error": K[0] || (K[0] = (I) => r.$emit("fetch:error", I)),
1506
+ "onFetch:success": K[1] || (K[1] = (I) => r.$emit("fetch:success", I)),
1507
+ onLoading: K[2] || (K[2] = (I) => r.$emit("loading", I))
1461
1508
  }, {
1462
- "enabled-label-tooltip": f(() => [
1463
- d(o(c), {
1509
+ "enabled-label-tooltip": v(() => [
1510
+ d(o(p), {
1464
1511
  keypath: "gateway_services.form.fields.enabled.tooltip",
1465
1512
  scope: "global"
1466
1513
  }, {
1467
- false: f(() => [
1468
- k("code", null, y(o(p)("gateway_services.form.fields.enabled.false")), 1)
1514
+ false: v(() => [
1515
+ S("code", null, P(o(y)("gateway_services.form.fields.enabled.false")), 1)
1469
1516
  ]),
1470
- true: f(() => [
1471
- k("code", null, y(o(p)("gateway_services.form.fields.enabled.true")), 1)
1517
+ true: v(() => [
1518
+ S("code", null, P(o(y)("gateway_services.form.fields.enabled.true")), 1)
1472
1519
  ]),
1473
1520
  _: 1
1474
1521
  })
1475
1522
  ]),
1476
- "ca_certificates-label-tooltip": f(() => [
1477
- d(o(c), {
1523
+ "ca_certificates-label-tooltip": v(() => [
1524
+ d(o(p), {
1478
1525
  keypath: "gateway_services.form.fields.ca_certificates.tooltip",
1479
1526
  scope: "global"
1480
1527
  }, {
1481
- code1: f(() => [
1482
- k("code", null, y(o(p)("gateway_services.form.fields.ca_certificates.code1")), 1)
1528
+ code1: v(() => [
1529
+ S("code", null, P(o(y)("gateway_services.form.fields.ca_certificates.code1")), 1)
1483
1530
  ]),
1484
- code2: f(() => [
1485
- k("code", null, y(o(p)("gateway_services.form.fields.ca_certificates.code2")), 1)
1531
+ code2: v(() => [
1532
+ S("code", null, P(o(y)("gateway_services.form.fields.ca_certificates.code2")), 1)
1486
1533
  ]),
1487
1534
  _: 1
1488
1535
  })
1489
1536
  ]),
1490
- "tls_verify-label-tooltip": f(() => [
1491
- d(o(c), {
1537
+ "tls_verify-label-tooltip": v(() => [
1538
+ d(o(p), {
1492
1539
  keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
1493
1540
  scope: "global"
1494
1541
  }, {
1495
- code1: f(() => [
1496
- k("code", null, y(o(p)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1542
+ code1: v(() => [
1543
+ S("code", null, P(o(y)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1497
1544
  ]),
1498
1545
  _: 1
1499
1546
  })
1500
1547
  ]),
1501
- tls_verify: f((C) => [
1502
- R(y(typeof o(x)("rowValue", C) == "boolean" ? N("rowValue", C) : o(p)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
1548
+ tls_verify: v((I) => [
1549
+ z(P(typeof o(b)("rowValue", I) == "boolean" ? B("rowValue", I) : o(y)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
1503
1550
  ]),
1504
- client_certificate: f((C) => [
1505
- R(y(o(x)("rowValue", C) ? o(x)("rowValue", C).id : "–"), 1)
1551
+ client_certificate: v((I) => [
1552
+ z(P(o(b)("rowValue", I) ? o(b)("rowValue", I).id : "–"), 1)
1506
1553
  ]),
1507
1554
  _: 1
1508
1555
  }, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
1509
1556
  ]));
1510
1557
  }
1511
1558
  });
1559
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1560
+ const Ze = () => {
1561
+ };
1562
+ function rl(n, M) {
1563
+ function y(...p) {
1564
+ return new Promise((a, b) => {
1565
+ Promise.resolve(n(() => M.apply(this, p), { fn: M, thisArg: this, args: p })).then(a).catch(b);
1566
+ });
1567
+ }
1568
+ return y;
1569
+ }
1570
+ function sl(n, M = {}) {
1571
+ let y, p, a = Ze;
1572
+ const b = (r) => {
1573
+ clearTimeout(r), a(), a = Ze;
1574
+ };
1575
+ let B;
1576
+ return (r) => {
1577
+ const K = ze(n), I = ze(M.maxWait);
1578
+ return y && b(y), K <= 0 || I !== void 0 && I <= 0 ? (p && (b(p), p = null), Promise.resolve(r())) : new Promise((ie, ue) => {
1579
+ a = M.rejectOnCancel ? ue : ie, B = r, I && !p && (p = setTimeout(() => {
1580
+ y && b(y), p = null, ie(B());
1581
+ }, I)), y = setTimeout(() => {
1582
+ p && b(p), p = null, ie(r());
1583
+ }, K);
1584
+ });
1585
+ };
1586
+ }
1587
+ function De(n, M = 200, y = {}) {
1588
+ return rl(
1589
+ sl(M, y),
1590
+ n
1591
+ );
1592
+ }
1593
+ const te = {
1594
+ name: "WeatherApi-quickstart-demo",
1595
+ tags: [],
1596
+ protocol: "https",
1597
+ path: "/flights",
1598
+ read_timeout: 6e4,
1599
+ retries: 5,
1600
+ host: "api.kong-air.com",
1601
+ connect_timeout: 6e4,
1602
+ ca_certificates: null,
1603
+ client_certificate: null,
1604
+ write_timeout: 6e4,
1605
+ port: 443
1606
+ }, al = { class: "kong-ui-entities-gateway-service-form" }, nl = {
1607
+ key: 0,
1608
+ class: "gateway-service-form-general-info"
1609
+ }, cl = { class: "gateway-service-form-group-selection-wrapper" }, dl = {
1610
+ key: 0,
1611
+ class: "gateway-service-form-group-fields"
1612
+ }, ul = {
1613
+ key: 0,
1614
+ class: "gateway-service-form-group-fields"
1615
+ }, fl = { key: 0 }, pl = {
1616
+ key: 0,
1617
+ class: "gateway-service-form-advanced-fields"
1618
+ }, ml = { class: "gateway-service-form-margin-bottom" }, vl = { class: "gateway-service-form-margin-bottom" }, gl = { class: "gateway-service-form-margin-bottom" }, yl = { class: "gateway-service-form-margin-bottom" }, _l = {
1619
+ key: 0,
1620
+ class: "gateway-service-form-margin-bottom"
1621
+ }, bl = {
1622
+ key: 1,
1623
+ class: "gateway-service-form-margin-bottom"
1624
+ }, hl = {
1625
+ key: 2,
1626
+ class: "gateway-service-form-margin-bottom"
1627
+ }, wl = {
1628
+ key: 0,
1629
+ class: "checkbox-aligned-radio"
1630
+ }, kl = {
1631
+ key: 1,
1632
+ class: "checkbox-aligned-radio"
1633
+ }, Vl = { class: "gateway-service-form-tags" }, Cl = { class: "form-error-list" }, Sl = /* @__PURE__ */ Le({
1634
+ __name: "GatewayServiceForm",
1635
+ props: {
1636
+ /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
1637
+ config: {
1638
+ type: Object,
1639
+ required: !0,
1640
+ validator: (n) => !(!n || !["konnect", "kongManager"].includes(n == null ? void 0 : n.app) || n.app === "konnect" && !n.controlPlaneId || n.app === "kongManager" && typeof n.workspace != "string" || !n.cancelRoute)
1641
+ },
1642
+ /** If a valid Gateway Service ID is provided, it will put the form in Edit mode instead of Create */
1643
+ gatewayServiceId: {
1644
+ type: String,
1645
+ required: !1,
1646
+ default: ""
1647
+ },
1648
+ /** Whether show or hide EntityFormSection info column */
1649
+ hideSectionsInfo: {
1650
+ type: Boolean,
1651
+ required: !1,
1652
+ default: !1
1653
+ },
1654
+ /** Whether show or hide Try sample API button */
1655
+ hideTrySampleApiButton: {
1656
+ type: Boolean,
1657
+ required: !1,
1658
+ default: !1
1659
+ },
1660
+ sampleApiList: {
1661
+ type: Array,
1662
+ required: !1,
1663
+ default: () => []
1664
+ }
1665
+ },
1666
+ emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
1667
+ setup(n, { expose: M, emit: y }) {
1668
+ var he;
1669
+ const p = y, a = n, b = W(!0), B = qe(), { i18nT: Z, i18n: { t: r } } = ge.useI18n(), { getErrorFieldsFromError: K } = Xe(), { axiosInstance: I } = Oe((he = a.config) == null ? void 0 : he.axiosRequestConfig), ie = Ye(), { validateHost: ue, validatePath: X, validatePort: ke, validateProtocol: fe } = ge.useUrlValidators(), A = h(() => ye.form[a.config.app].edit), Y = h(() => a.gatewayServiceId ? Me.Edit : Me.Create), ee = W(!1), re = h(() => !!a.gatewayServiceId), l = W(re.value ? "protocol" : "url"), R = ge.usePortFromProtocol(), se = W(""), Pe = h(() => !!se.value || !!de("name")), t = Te({
1670
+ fields: {
1671
+ name: "",
1672
+ protocol: "http",
1673
+ host: "",
1674
+ path: "",
1675
+ port: 80,
1676
+ url: "",
1677
+ retries: 5,
1678
+ connect_timeout: 6e4,
1679
+ write_timeout: 6e4,
1680
+ read_timeout: 6e4,
1681
+ client_certificate: "",
1682
+ ca_certificates: "",
1683
+ tls_verify_enabled: !1,
1684
+ tls_verify_value: !1,
1685
+ tags: ""
1686
+ },
1687
+ isReadonly: !1,
1688
+ errorMessages: [],
1689
+ formFieldErrors: {
1690
+ host: "",
1691
+ port: "",
1692
+ path: "",
1693
+ name: "",
1694
+ url: "",
1695
+ tags: "",
1696
+ retries: "",
1697
+ connect_timeout: "",
1698
+ write_timeout: "",
1699
+ read_timeout: "",
1700
+ client_certificate: "",
1701
+ ca_certificates: "",
1702
+ tls_verify_enabled: "",
1703
+ tls_verify_value: ""
1704
+ }
1705
+ }), U = Te({
1706
+ name: "",
1707
+ protocol: "http",
1708
+ host: "",
1709
+ path: "",
1710
+ port: 80,
1711
+ url: "",
1712
+ retries: 5,
1713
+ connect_timeout: 6e4,
1714
+ write_timeout: 6e4,
1715
+ read_timeout: 6e4,
1716
+ client_certificate: "",
1717
+ ca_certificates: "",
1718
+ tls_verify_enabled: !1,
1719
+ tls_verify_value: !1,
1720
+ tags: ""
1721
+ }), ae = a.config.app === "konnect" || et({
1722
+ gatewayInfo: a.config.gatewayInfo,
1723
+ // 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
1724
+ supportedRange: {
1725
+ enterprise: ["3.0"]
1726
+ }
1727
+ }), ne = [
1728
+ {
1729
+ label: r("gateway_services.form.fields.protocol.options.http"),
1730
+ value: "http",
1731
+ group: "http"
1732
+ },
1733
+ {
1734
+ label: r("gateway_services.form.fields.protocol.options.https"),
1735
+ value: "https",
1736
+ group: "http"
1737
+ },
1738
+ {
1739
+ label: r("gateway_services.form.fields.protocol.options.tcp"),
1740
+ value: "tcp",
1741
+ group: "tcp"
1742
+ },
1743
+ {
1744
+ label: r("gateway_services.form.fields.protocol.options.tls"),
1745
+ value: "tls",
1746
+ group: "tcp"
1747
+ },
1748
+ {
1749
+ label: r("gateway_services.form.fields.protocol.options.tls_passthrough"),
1750
+ value: "tls_passthrough",
1751
+ group: "tcp"
1752
+ },
1753
+ {
1754
+ label: r("gateway_services.form.fields.protocol.options.grpc"),
1755
+ value: "grpc",
1756
+ group: "grpc"
1757
+ },
1758
+ {
1759
+ label: r("gateway_services.form.fields.protocol.options.grpcs"),
1760
+ value: "grpcs",
1761
+ group: "grpc"
1762
+ },
1763
+ ...ae ? [
1764
+ {
1765
+ label: r("gateway_services.form.fields.protocol.options.ws"),
1766
+ value: "ws",
1767
+ group: "websocket"
1768
+ },
1769
+ {
1770
+ label: r("gateway_services.form.fields.protocol.options.wss"),
1771
+ value: "wss",
1772
+ group: "websocket"
1773
+ }
1774
+ ] : [],
1775
+ {
1776
+ label: r("gateway_services.form.fields.protocol.options.udp"),
1777
+ value: "udp",
1778
+ group: "udp"
1779
+ }
1780
+ ], q = { url: "url", protocol: "protocol" }, pe = (e, s) => {
1781
+ s.value;
1782
+ }, ce = (e) => e ? parseFloat(e) : 0, _e = () => {
1783
+ t.fields.host = U.host, t.fields.path = U.path, t.fields.port = U.port, t.fields.protocol = U.protocol, t.fields.url = U.url, t.fields.retries = U.retries, t.fields.connect_timeout = U.connect_timeout, t.fields.write_timeout = U.write_timeout, t.fields.read_timeout = U.read_timeout, t.fields.client_certificate = U.client_certificate, t.fields.ca_certificates = U.ca_certificates, t.fields.tls_verify_enabled = U.tls_verify_enabled, t.fields.tls_verify_value = U.tls_verify_value;
1784
+ }, Ve = () => {
1785
+ b.value = !0, N(), t.errorMessages = [], _e();
1786
+ }, Ce = () => {
1787
+ switch (_e(), t.fields.name = `${te.name} + ${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, l.value) {
1788
+ case "url":
1789
+ t.fields.url = `${te.protocol}://${te.host}${te.path}`;
1790
+ break;
1791
+ case "protocol":
1792
+ t.fields.host = te.host, t.fields.path = te.path, t.fields.protocol = te.protocol, t.fields.port = te.port;
1793
+ break;
1794
+ default:
1795
+ t.fields.url = `${te.protocol}://${te.host}${te.path}`;
1796
+ }
1797
+ }, me = De(() => {
1798
+ if (N(), t.fields.url.length)
1799
+ try {
1800
+ const e = new URL(t.fields.url), s = fe(e.protocol, ne);
1801
+ if (s) throw new Error(s);
1802
+ t.fields.protocol = e.protocol.slice(0, -1);
1803
+ const V = ue(e.hostname);
1804
+ if (V) throw new Error(V);
1805
+ t.fields.host = e.hostname;
1806
+ const G = X(e.pathname);
1807
+ if (G) throw new Error(G);
1808
+ t.fields.path = e.pathname;
1809
+ const E = ke(e.port);
1810
+ if (E) throw new Error(E);
1811
+ const x = Number(e.port);
1812
+ ee.value = !!x, t.fields.port = x || R.getPortFromProtocol(t.fields.protocol), p("url-valid:success");
1813
+ } catch (e) {
1814
+ p("url-valid:error", e.message || "URL validation failed"), t.formFieldErrors.url = e.message || "URL validation failed";
1815
+ }
1816
+ }, 300), be = De((e) => {
1817
+ N(e ?? void 0);
1818
+ }, 300), Se = h(() => !!t.formFieldErrors.url || !!t.formFieldErrors.host || !!t.formFieldErrors.port), de = (e) => {
1819
+ if (t.errorMessages.length) return "";
1820
+ const s = t.formFieldErrors;
1821
+ return s[e] ? s[e] : "";
1822
+ }, le = De((e) => {
1823
+ N(e ?? void 0);
1824
+ const s = ue(t.fields.host);
1825
+ s && (t.formFieldErrors.host = s);
1826
+ const V = X(t.fields.path);
1827
+ V && (t.formFieldErrors.path = V);
1828
+ const G = ke(t.fields.port);
1829
+ G && (t.formFieldErrors.port = G), J.value ? p("url-valid:success") : p("url-valid:error", t.errorMessages.join(",") || "URL validation failed");
1830
+ }, 300), N = (e) => {
1831
+ if (e)
1832
+ t.formFieldErrors[e] = "";
1833
+ else
1834
+ for (let s in t.formFieldErrors)
1835
+ t.formFieldErrors[s] = "";
1836
+ t.errorMessages = [];
1837
+ }, J = h(() => {
1838
+ let e = !0;
1839
+ for (let s in t.formFieldErrors)
1840
+ if (t.formFieldErrors[s].length) {
1841
+ e = !1;
1842
+ break;
1843
+ }
1844
+ return e;
1845
+ }), oe = () => {
1846
+ t.fields.url && l.value === "url" ? me() : le();
1847
+ }, ve = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, i = h(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(t.fields.protocol)), f = h(() => {
1848
+ if (l.value === "url")
1849
+ return !0;
1850
+ const e = ["https", "wss", "tls"].includes(t.fields.protocol);
1851
+ return l.value === "protocol" && e;
1852
+ }), k = h(() => {
1853
+ if (l.value === "url")
1854
+ return !0;
1855
+ const e = ["https", "tls"].includes(t.fields.protocol);
1856
+ return l.value === "protocol" && e;
1857
+ }), H = h(() => {
1858
+ if (l.value === "url")
1859
+ return !0;
1860
+ const e = ["https", "wss", "tls"].includes(t.fields.protocol);
1861
+ return l.value === "protocol" && e;
1862
+ }), L = (e) => {
1863
+ se.value = ie.utf8Name(e);
1864
+ }, $ = h(() => {
1865
+ if (re.value)
1866
+ return JSON.stringify(t.fields) !== JSON.stringify(U);
1867
+ const e = l.value === "url" && !!t.fields.url && J.value, s = l.value === "protocol" && !!t.fields.host && J.value;
1868
+ return e || s;
1869
+ }), c = (e) => {
1870
+ var s, V, G;
1871
+ t.fields.name = (e == null ? void 0 : e.name) || "", t.fields.tags = ((s = e == null ? void 0 : e.tags) == null ? void 0 : s.join(", ")) || "", t.fields.protocol = (e == null ? void 0 : e.protocol) || "http", t.fields.path = (e == null ? void 0 : e.path) || "", t.fields.read_timeout = e != null && e.read_timeout || (e == null ? void 0 : e.read_timeout) === 0 ? e == null ? void 0 : e.read_timeout : 6e4, t.fields.retries = e != null && e.retries || (e == null ? void 0 : e.retries) === 0 ? e == null ? void 0 : e.retries : 5, t.fields.host = (e == null ? void 0 : e.host) || "", t.fields.connect_timeout = e != null && e.connect_timeout || (e == null ? void 0 : e.connect_timeout) === 0 ? e == null ? void 0 : e.connect_timeout : 6e4, t.fields.tls_verify_enabled = (e == null ? void 0 : e.tls_verify) !== "" && (e == null ? void 0 : e.tls_verify) !== null && (e == null ? void 0 : e.tls_verify) !== void 0, t.fields.tls_verify_value = e != null && e.tls_verify ? e == null ? void 0 : e.tls_verify : !1, t.fields.ca_certificates = ((V = e == null ? void 0 : e.ca_certificates) == null ? void 0 : V.join(",")) || "", t.fields.client_certificate = ((G = e == null ? void 0 : e.client_certificate) == null ? void 0 : G.id) || "", t.fields.write_timeout = e != null && e.write_timeout || (e == null ? void 0 : e.write_timeout) === 0 ? e == null ? void 0 : e.write_timeout : 6e4, t.fields.port = e != null && e.port || (e == null ? void 0 : e.port) === 0 ? e == null ? void 0 : e.port : 80, Object.assign(U, t.fields);
1872
+ }, g = () => {
1873
+ B.push(a.config.cancelRoute);
1874
+ }, m = h(() => {
1875
+ var s, V;
1876
+ let e = `${a.config.apiBaseUrl}${ye.form[a.config.app].validate}`;
1877
+ return a.config.app === "konnect" ? e = e.replace(/{controlPlaneId}/gi, ((s = a.config) == null ? void 0 : s.controlPlaneId) || "") : a.config.app === "kongManager" && (e = e.replace(/\/{workspace}/gi, (V = a.config) != null && V.workspace ? `/${a.config.workspace}` : "")), e = e.replace(/{id}/gi, a.gatewayServiceId), e;
1878
+ }), w = h(() => {
1879
+ var s, V;
1880
+ let e = `${a.config.apiBaseUrl}${ye.form[a.config.app][Y.value]}`;
1881
+ return a.config.app === "konnect" ? e = e.replace(/{controlPlaneId}/gi, ((s = a.config) == null ? void 0 : s.controlPlaneId) || "") : a.config.app === "kongManager" && (e = e.replace(/\/{workspace}/gi, (V = a.config) != null && V.workspace ? `/${a.config.workspace}` : "")), e = e.replace(/{id}/gi, a.gatewayServiceId), e;
1882
+ }), O = (e) => {
1883
+ let s = "";
1884
+ e.url && (s = new URL(e.url).protocol), (["https", "wss", "tls"].includes(e.protocol) || ["https", "wss", "tls"].includes(s)) && (e.tls_verify = e.tls_verify_enabled ? e.tls_verify_value : null), delete e.tls_verify_enabled, delete e.tls_verify_value;
1885
+ }, Q = h(() => {
1886
+ var s, V, G, E;
1887
+ const e = {
1888
+ name: t.fields.name || null,
1889
+ tags: t.fields.tags ? (G = (V = (s = t.fields.tags) == null ? void 0 : s.split(",")) == null ? void 0 : V.map((x) => String(x || "").trim())) == null ? void 0 : G.filter((x) => x !== "") : null,
1890
+ protocol: t.fields.protocol,
1891
+ path: t.fields.path || null,
1892
+ read_timeout: t.fields.read_timeout,
1893
+ retries: t.fields.retries,
1894
+ host: t.fields.host,
1895
+ connect_timeout: t.fields.connect_timeout,
1896
+ tls_verify_value: t.fields.tls_verify_value,
1897
+ tls_verify_enabled: t.fields.tls_verify_enabled,
1898
+ ca_certificates: t.fields.ca_certificates ? (E = t.fields.ca_certificates) == null ? void 0 : E.split(",").filter((x) => x !== "") : null,
1899
+ client_certificate: t.fields.client_certificate ? { id: t.fields.client_certificate } : null,
1900
+ write_timeout: t.fields.write_timeout,
1901
+ port: t.fields.port,
1902
+ url: t.fields.url
1903
+ };
1904
+ return t.fields.client_certificate && ["https", "wss", "tls"].includes(t.fields.protocol) && (e.client_certificate = { id: t.fields.client_certificate }), t.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(t.fields.protocol) && (e.tls_verify = t.fields.tls_verify_value), i.value || (e.path = null), Y.value === "create" ? l.value === "url" ? (delete e.protocol, delete e.host, delete e.path, a.config.app === "konnect" && delete e.port) : delete e.url : Y.value === "edit" && delete e.url, e;
1905
+ }), j = async () => {
1906
+ var e, s, V, G;
1907
+ try {
1908
+ t.isReadonly = !0, oe();
1909
+ const E = Q.value;
1910
+ O(E);
1911
+ let x;
1912
+ if (await I.post(m.value, E), Y.value === "create" ? x = await I.post(w.value, E) : Y.value === "edit" && (x = ((e = a.config) == null ? void 0 : e.app) === "konnect" ? await I.put(w.value, E) : await I.patch(w.value, E)), x) {
1913
+ const { data: u } = x;
1914
+ t.fields.name = (u == null ? void 0 : u.name) || "", t.fields.port = u.port || R.getPortFromProtocol(u.protocol), t.fields.protocol = (u == null ? void 0 : u.protocol) || "http", t.fields.host = (u == null ? void 0 : u.host) || "", t.fields.path = (u == null ? void 0 : u.path) || "", t.fields.url = (u == null ? void 0 : u.url) || "", t.fields.retries = u != null && u.retries || (u == null ? void 0 : u.retries) === 0 ? u == null ? void 0 : u.retries : 5, t.fields.connect_timeout = u != null && u.connect_timeout || (u == null ? void 0 : u.connect_timeout) === 0 ? u == null ? void 0 : u.connect_timeout : 6e4, t.fields.write_timeout = u != null && u.write_timeout || (u == null ? void 0 : u.write_timeout) === 0 ? u == null ? void 0 : u.write_timeout : 6e4, t.fields.read_timeout = u != null && u.read_timeout || (u == null ? void 0 : u.read_timeout) === 0 ? u == null ? void 0 : u.read_timeout : 6e4, t.fields.client_certificate = ((s = u == null ? void 0 : u.client_certificate) == null ? void 0 : s.id) || "", t.fields.ca_certificates = (V = u == null ? void 0 : u.ca_certificates) != null && V.length ? u == null ? void 0 : u.ca_certificates.join(",") : "", t.fields.tls_verify_enabled = (u == null ? void 0 : u.tls_verify) !== "" && (u == null ? void 0 : u.tls_verify) !== null && (u == null ? void 0 : u.tls_verify) !== void 0, t.fields.tls_verify_value = t.fields.tls_verify_enabled && (u == null ? void 0 : u.tls_verify), t.fields.tags = (G = u == null ? void 0 : u.tags) != null && G.length ? u.tags.join(", ") : "", Object.assign(U, t.fields), p("update", x == null ? void 0 : x.data);
1915
+ }
1916
+ return x;
1917
+ } catch (E) {
1918
+ const { fields: x, messages: u } = K(E);
1919
+ t.errorMessages = u, x.length && x.forEach((we) => {
1920
+ const Ie = we.field;
1921
+ Ie === "client_certificate.id" ? t.formFieldErrors.client_certificate = we.message : Ie.startsWith("ca_certificates") ? t.formFieldErrors.ca_certificates = we.message : Object.keys(t.formFieldErrors).includes(Ie) && (t.formFieldErrors = {
1922
+ ...t.formFieldErrors,
1923
+ [Ie]: we.message
1924
+ });
1925
+ }), p("error", E);
1926
+ } finally {
1927
+ t.isReadonly = !1;
1928
+ }
1929
+ };
1930
+ return Ue(() => a.gatewayServiceId, () => {
1931
+ Object.assign(t.fields, U);
1932
+ }), Ue(t.fields, (e) => {
1933
+ t.fields.port = R.getPortFromProtocol(e.protocol, String(e.port)), p("model-updated", Q.value);
1934
+ }), Je(() => {
1935
+ p("model-updated", Q.value), re.value || (t.fields.name = ve());
1936
+ }), M({
1937
+ validateUrl: oe,
1938
+ getPayload: Q,
1939
+ saveFormData: j,
1940
+ canSubmit: $,
1941
+ initForm: c
1942
+ }), (e, s) => {
1943
+ const V = D("KRadio"), G = D("KButton"), E = D("KInput"), x = D("KSelect"), u = D("KCheckbox"), we = D("KCollapse"), Ie = D("KAlert");
1944
+ return C(), F("div", al, [
1945
+ d(o(tt), {
1946
+ "can-submit": $.value,
1947
+ config: n.config,
1948
+ "edit-id": n.gatewayServiceId,
1949
+ "entity-type": o(Ge).GatewayService,
1950
+ "fetch-url": A.value,
1951
+ "form-fields": Q.value,
1952
+ "is-readonly": t.isReadonly,
1953
+ onCancel: g,
1954
+ "onFetch:error": s[30] || (s[30] = (_) => e.$emit("error", _)),
1955
+ "onFetch:success": c,
1956
+ onLoading: s[31] || (s[31] = (_) => e.$emit("loading", _)),
1957
+ onSubmit: j
1958
+ }, {
1959
+ "form-actions": v(() => [
1960
+ Qe(e.$slots, "form-actions", {
1961
+ canSubmit: $.value,
1962
+ cancel: g,
1963
+ submit: j
1964
+ }, void 0, !0)
1965
+ ]),
1966
+ default: v(() => [
1967
+ d(o(Be), {
1968
+ description: o(r)("gateway_services.form.sections.keys.description"),
1969
+ "hide-info-header": n.hideSectionsInfo,
1970
+ title: o(r)("gateway_services.form.sections.keys.title")
1971
+ }, {
1972
+ default: v(() => [
1973
+ re.value ? T("", !0) : (C(), F("div", nl, [
1974
+ S("div", cl, [
1975
+ d(V, {
1976
+ modelValue: l.value,
1977
+ "onUpdate:modelValue": s[0] || (s[0] = (_) => l.value = _),
1978
+ card: "",
1979
+ "card-orientation": "horizontal",
1980
+ "data-testid": "gateway-service-url-radio",
1981
+ description: o(r)("gateway_services.form.sections.keys.url.description"),
1982
+ label: o(r)("gateway_services.form.sections.keys.url.label"),
1983
+ "selected-value": q.url,
1984
+ onChange: Ve
1985
+ }, null, 8, ["modelValue", "description", "label", "selected-value"]),
1986
+ d(V, {
1987
+ modelValue: l.value,
1988
+ "onUpdate:modelValue": s[1] || (s[1] = (_) => l.value = _),
1989
+ card: "",
1990
+ "card-orientation": "horizontal",
1991
+ "checked-group": "protocol",
1992
+ "data-testid": "gateway-service-protocol-radio",
1993
+ description: o(r)("gateway_services.form.sections.keys.protocol.description"),
1994
+ label: o(r)("gateway_services.form.sections.keys.protocol.label"),
1995
+ "selected-value": q.protocol,
1996
+ onChange: Ve
1997
+ }, null, 8, ["modelValue", "description", "label", "selected-value"])
1998
+ ]),
1999
+ d(We, { name: "slide-fade" }, {
2000
+ default: v(() => [
2001
+ l.value === "url" ? (C(), F("div", dl, [
2002
+ d(E, {
2003
+ modelValue: t.fields.url,
2004
+ "onUpdate:modelValue": s[2] || (s[2] = (_) => t.fields.url = _),
2005
+ modelModifiers: { trim: !0 },
2006
+ class: "gateway-service-url-input gateway-service-form-margin-bottom",
2007
+ "data-testid": "gateway-service-url-input",
2008
+ error: Se.value,
2009
+ "error-message": de("url"),
2010
+ label: o(r)("gateway_services.form.fields.upstream_url.label"),
2011
+ "label-attributes": {
2012
+ info: n.config.app === "konnect" ? o(r)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(r)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
2013
+ tooltipAttributes: { maxWidth: "400" }
2014
+ },
2015
+ name: "url",
2016
+ placeholder: o(r)("gateway_services.form.fields.upstream_url.placeholder"),
2017
+ required: "",
2018
+ onInput: o(me)
2019
+ }, xe({ _: 2 }, [
2020
+ n.hideTrySampleApiButton ? void 0 : {
2021
+ name: "after",
2022
+ fn: v(() => [
2023
+ d(G, {
2024
+ appearance: "tertiary",
2025
+ size: "small",
2026
+ onClick: Ce
2027
+ }, {
2028
+ default: v(() => [
2029
+ z(P(o(r)("gateway_services.form.buttons.try_sample")), 1)
2030
+ ]),
2031
+ _: 1
2032
+ })
2033
+ ]),
2034
+ key: "0"
2035
+ }
2036
+ ]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "onInput"])
2037
+ ])) : T("", !0)
2038
+ ]),
2039
+ _: 1
2040
+ })
2041
+ ])),
2042
+ d(We, { name: "slide-fade" }, {
2043
+ default: v(() => [
2044
+ l.value === "protocol" || re.value ? (C(), F("div", ul, [
2045
+ d(x, {
2046
+ modelValue: t.fields.protocol,
2047
+ "onUpdate:modelValue": s[3] || (s[3] = (_) => t.fields.protocol = _),
2048
+ "data-testid": "gateway-service-protocol-select",
2049
+ items: ne,
2050
+ label: o(r)("gateway_services.form.fields.protocol.label"),
2051
+ "label-attributes": {
2052
+ info: o(r)("gateway_services.form.fields.protocol.tooltip"),
2053
+ tooltipAttributes: { maxWidth: "400" }
2054
+ },
2055
+ readonly: t.isReadonly,
2056
+ required: "",
2057
+ width: "100%",
2058
+ onSelected: s[4] || (s[4] = (_) => pe(t.fields.protocol, _))
2059
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2060
+ d(E, {
2061
+ modelValue: t.fields.host,
2062
+ "onUpdate:modelValue": s[5] || (s[5] = (_) => t.fields.host = _),
2063
+ modelModifiers: { trim: !0 },
2064
+ class: "gateway-service-form-margin-top",
2065
+ "data-testid": "gateway-service-host-input",
2066
+ error: !!t.formFieldErrors.host,
2067
+ "error-message": de("host"),
2068
+ label: o(r)("gateway_services.form.fields.host.label"),
2069
+ "label-attributes": {
2070
+ info: o(r)("gateway_services.form.fields.host.tooltip"),
2071
+ tooltipAttributes: { maxWidth: "400" }
2072
+ },
2073
+ name: "host",
2074
+ placeholder: o(r)("gateway_services.form.fields.host.placeholder"),
2075
+ required: "",
2076
+ onInput: s[6] || (s[6] = (_) => o(le)("host"))
2077
+ }, xe({ _: 2 }, [
2078
+ n.hideTrySampleApiButton ? void 0 : {
2079
+ name: "after",
2080
+ fn: v(() => [
2081
+ d(G, {
2082
+ appearance: "tertiary",
2083
+ size: "small",
2084
+ onClick: Ce
2085
+ }, {
2086
+ default: v(() => [
2087
+ z(P(o(r)("gateway_services.form.buttons.try_sample")), 1)
2088
+ ]),
2089
+ _: 1
2090
+ })
2091
+ ]),
2092
+ key: "0"
2093
+ }
2094
+ ]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
2095
+ i.value ? (C(), F("div", fl, [
2096
+ d(E, {
2097
+ modelValue: t.fields.path,
2098
+ "onUpdate:modelValue": s[7] || (s[7] = (_) => t.fields.path = _),
2099
+ modelModifiers: { trim: !0 },
2100
+ class: "gateway-service-form-margin-top",
2101
+ "data-testid": "gateway-service-path-input",
2102
+ error: !!t.formFieldErrors.path,
2103
+ "error-message": de("path"),
2104
+ label: o(r)("gateway_services.form.fields.path.label"),
2105
+ "label-attributes": {
2106
+ info: o(r)("gateway_services.form.fields.path.tooltip"),
2107
+ tooltipAttributes: { maxWidth: "400" }
2108
+ },
2109
+ name: "path",
2110
+ placeholder: o(r)("gateway_services.form.fields.path.placeholder"),
2111
+ onInput: s[8] || (s[8] = (_) => o(le)("path"))
2112
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
2113
+ ])) : T("", !0),
2114
+ d(E, {
2115
+ modelValue: t.fields.port,
2116
+ "onUpdate:modelValue": [
2117
+ s[9] || (s[9] = (_) => t.fields.port = _),
2118
+ s[11] || (s[11] = () => {
2119
+ t.fields.port = ce(t.fields.port + "");
2120
+ })
2121
+ ],
2122
+ class: "gateway-service-form-margin-top",
2123
+ "data-testid": "gateway-service-port-input",
2124
+ error: !!t.formFieldErrors.port,
2125
+ "error-message": de("port"),
2126
+ label: o(r)("gateway_services.form.fields.port.label"),
2127
+ "label-attributes": {
2128
+ info: o(r)("gateway_services.form.fields.port.tooltip"),
2129
+ tooltipAttributes: { maxWidth: "400" }
2130
+ },
2131
+ name: "port",
2132
+ type: "number",
2133
+ onInput: s[10] || (s[10] = (_) => o(le)("port"))
2134
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
2135
+ ])) : T("", !0)
2136
+ ]),
2137
+ _: 1
2138
+ }),
2139
+ d(we, {
2140
+ modelValue: b.value,
2141
+ "onUpdate:modelValue": s[27] || (s[27] = (_) => b.value = _),
2142
+ "data-testid": "advanced-fields-collapse",
2143
+ "trigger-alignment": "leading",
2144
+ "trigger-label": o(r)("gateway_services.form.sections.keys.viewAdvancedFields")
2145
+ }, {
2146
+ default: v(() => [
2147
+ d(We, { name: "slide-fade" }, {
2148
+ default: v(() => [
2149
+ b.value ? T("", !0) : (C(), F("div", pl, [
2150
+ S("div", ml, [
2151
+ d(E, {
2152
+ modelValue: t.fields.retries,
2153
+ "onUpdate:modelValue": [
2154
+ s[12] || (s[12] = (_) => t.fields.retries = _),
2155
+ s[13] || (s[13] = () => {
2156
+ t.fields.retries = ce(t.fields.retries + "");
2157
+ })
2158
+ ],
2159
+ autocomplete: "off",
2160
+ "data-testid": "gateway-service-retries-input",
2161
+ label: o(r)("gateway_services.form.fields.retries.label"),
2162
+ "label-attributes": {
2163
+ info: o(r)("gateway_services.form.fields.retries.tooltip"),
2164
+ tooltipAttributes: { maxWidth: "400" }
2165
+ },
2166
+ name: "retries",
2167
+ readonly: t.isReadonly,
2168
+ type: "number"
2169
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2170
+ ]),
2171
+ S("div", vl, [
2172
+ d(E, {
2173
+ modelValue: t.fields.connect_timeout,
2174
+ "onUpdate:modelValue": [
2175
+ s[14] || (s[14] = (_) => t.fields.connect_timeout = _),
2176
+ s[15] || (s[15] = () => {
2177
+ t.fields.connect_timeout = ce(t.fields.connect_timeout + "");
2178
+ })
2179
+ ],
2180
+ autocomplete: "off",
2181
+ "data-testid": "gateway-service-connTimeout-input",
2182
+ label: o(r)("gateway_services.form.fields.connect_timeout.label"),
2183
+ "label-attributes": {
2184
+ info: o(r)("gateway_services.form.fields.connect_timeout.tooltip"),
2185
+ tooltipAttributes: { maxWidth: "400" }
2186
+ },
2187
+ name: "connTimeout",
2188
+ readonly: t.isReadonly,
2189
+ type: "number"
2190
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2191
+ ]),
2192
+ S("div", gl, [
2193
+ d(E, {
2194
+ modelValue: t.fields.write_timeout,
2195
+ "onUpdate:modelValue": [
2196
+ s[16] || (s[16] = (_) => t.fields.write_timeout = _),
2197
+ s[17] || (s[17] = () => {
2198
+ t.fields.write_timeout = ce(t.fields.write_timeout + "");
2199
+ })
2200
+ ],
2201
+ autocomplete: "off",
2202
+ "data-testid": "gateway-service-writeTimeout-input",
2203
+ label: o(r)("gateway_services.form.fields.write_timeout.label"),
2204
+ "label-attributes": {
2205
+ info: o(r)("gateway_services.form.fields.write_timeout.tooltip"),
2206
+ tooltipAttributes: { maxWidth: "400" }
2207
+ },
2208
+ name: "writeTimeout",
2209
+ readonly: t.isReadonly,
2210
+ type: "number"
2211
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2212
+ ]),
2213
+ S("div", yl, [
2214
+ d(E, {
2215
+ modelValue: t.fields.read_timeout,
2216
+ "onUpdate:modelValue": [
2217
+ s[18] || (s[18] = (_) => t.fields.read_timeout = _),
2218
+ s[19] || (s[19] = () => {
2219
+ t.fields.read_timeout = ce(t.fields.read_timeout + "");
2220
+ })
2221
+ ],
2222
+ autocomplete: "off",
2223
+ "data-testid": "gateway-service-readTimeout-input",
2224
+ label: o(r)("gateway_services.form.fields.read_timeout.label"),
2225
+ "label-attributes": {
2226
+ info: o(r)("gateway_services.form.fields.read_timeout.tooltip"),
2227
+ tooltipAttributes: { maxWidth: "400" }
2228
+ },
2229
+ name: "readTimeout",
2230
+ readonly: t.isReadonly,
2231
+ type: "number"
2232
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2233
+ ]),
2234
+ f.value ? (C(), F("div", _l, [
2235
+ d(E, {
2236
+ modelValue: t.fields.client_certificate,
2237
+ "onUpdate:modelValue": s[20] || (s[20] = (_) => t.fields.client_certificate = _),
2238
+ modelModifiers: { trim: !0 },
2239
+ autocomplete: "off",
2240
+ "data-testid": "gateway-service-clientCert-input",
2241
+ error: !!t.formFieldErrors.client_certificate,
2242
+ label: o(r)("gateway_services.form.fields.client_certificate.label"),
2243
+ "label-attributes": {
2244
+ info: o(r)("gateway_services.form.fields.client_certificate.tooltip"),
2245
+ tooltipAttributes: { maxWidth: "400" }
2246
+ },
2247
+ name: "clientCert",
2248
+ placeholder: o(r)("gateway_services.form.fields.client_certificate.placeholder"),
2249
+ readonly: t.isReadonly,
2250
+ type: "text",
2251
+ onInput: s[21] || (s[21] = (_) => o(be)("client_certificate"))
2252
+ }, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
2253
+ ])) : T("", !0),
2254
+ k.value ? (C(), F("div", bl, [
2255
+ d(E, {
2256
+ modelValue: t.fields.ca_certificates,
2257
+ "onUpdate:modelValue": s[22] || (s[22] = (_) => t.fields.ca_certificates = _),
2258
+ modelModifiers: { trim: !0 },
2259
+ autocomplete: "off",
2260
+ "data-testid": "gateway-service-ca-certs-input",
2261
+ error: !!t.formFieldErrors.ca_certificates,
2262
+ label: o(r)("gateway_services.form.fields.ca_certificates.label"),
2263
+ "label-attributes": { tooltipAttributes: { maxWidth: "400" } },
2264
+ placeholder: o(r)("gateway_services.form.fields.ca_certificates.placeholder"),
2265
+ readonly: t.isReadonly,
2266
+ type: "text",
2267
+ onInput: s[23] || (s[23] = (_) => o(be)("ca_certificates"))
2268
+ }, {
2269
+ "label-tooltip": v(() => [
2270
+ d(o(Z), {
2271
+ keypath: "gateway_services.form.fields.ca_certificates.tooltip",
2272
+ scope: "global"
2273
+ }, {
2274
+ code1: v(() => [
2275
+ S("code", null, P(o(r)("gateway_services.form.fields.ca_certificates.code1")), 1)
2276
+ ]),
2277
+ code2: v(() => [
2278
+ S("code", null, P(o(r)("gateway_services.form.fields.ca_certificates.code2")), 1)
2279
+ ]),
2280
+ _: 1
2281
+ })
2282
+ ]),
2283
+ _: 1
2284
+ }, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
2285
+ ])) : T("", !0),
2286
+ H.value ? (C(), F("div", hl, [
2287
+ d(u, {
2288
+ modelValue: t.fields.tls_verify_enabled,
2289
+ "onUpdate:modelValue": s[24] || (s[24] = (_) => t.fields.tls_verify_enabled = _),
2290
+ "data-testid": "gateway-service-tls-verify-checkbox",
2291
+ description: o(r)("gateway_services.form.fields.tls_verify_enabled.help"),
2292
+ label: o(r)("gateway_services.form.fields.tls_verify_enabled.label"),
2293
+ "label-attributes": { tooltipAttributes: { maxWidth: "400" } }
2294
+ }, {
2295
+ tooltip: v(() => [
2296
+ d(o(Z), {
2297
+ keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
2298
+ scope: "global"
2299
+ }, {
2300
+ code1: v(() => [
2301
+ S("code", null, P(o(r)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
2302
+ ]),
2303
+ _: 1
2304
+ })
2305
+ ]),
2306
+ _: 1
2307
+ }, 8, ["modelValue", "description", "label"]),
2308
+ t.fields.tls_verify_enabled ? (C(), F("div", wl, [
2309
+ d(V, {
2310
+ modelValue: t.fields.tls_verify_value,
2311
+ "onUpdate:modelValue": s[25] || (s[25] = (_) => t.fields.tls_verify_value = _),
2312
+ "data-testid": "gateway-service-tls-verify-true-option",
2313
+ label: o(r)("gateway_services.form.fields.tls_verify_option.true.label"),
2314
+ "selected-value": !0
2315
+ }, null, 8, ["modelValue", "label"])
2316
+ ])) : T("", !0),
2317
+ t.fields.tls_verify_enabled ? (C(), F("div", kl, [
2318
+ d(V, {
2319
+ modelValue: t.fields.tls_verify_value,
2320
+ "onUpdate:modelValue": s[26] || (s[26] = (_) => t.fields.tls_verify_value = _),
2321
+ "data-testid": "gateway-service-tls-verify-false-option",
2322
+ label: o(r)("gateway_services.form.fields.tls_verify_option.false.label"),
2323
+ "selected-value": !1
2324
+ }, null, 8, ["modelValue", "label"])
2325
+ ])) : T("", !0)
2326
+ ])) : T("", !0)
2327
+ ]))
2328
+ ]),
2329
+ _: 1
2330
+ })
2331
+ ]),
2332
+ _: 1
2333
+ }, 8, ["modelValue", "trigger-label"])
2334
+ ]),
2335
+ _: 1
2336
+ }, 8, ["description", "hide-info-header", "title"]),
2337
+ d(o(Be), {
2338
+ description: o(r)("gateway_services.form.sections.general.description"),
2339
+ "hide-info-header": n.hideSectionsInfo,
2340
+ title: o(r)("gateway_services.form.sections.general.title")
2341
+ }, {
2342
+ default: v(() => [
2343
+ d(E, {
2344
+ modelValue: t.fields.name,
2345
+ "onUpdate:modelValue": s[28] || (s[28] = (_) => t.fields.name = _),
2346
+ modelModifiers: { trim: !0 },
2347
+ autocomplete: "off",
2348
+ "data-testid": "gateway-service-name-input",
2349
+ error: Pe.value,
2350
+ "error-message": se.value,
2351
+ label: o(r)("gateway_services.form.fields.name.label"),
2352
+ "label-attributes": {
2353
+ info: o(r)("gateway_services.form.fields.name.tooltip"),
2354
+ tooltipAttributes: { maxWidth: "400" }
2355
+ },
2356
+ name: "name",
2357
+ placeholder: o(r)("gateway_services.form.fields.name.placeholder"),
2358
+ readonly: t.isReadonly,
2359
+ type: "text",
2360
+ onInput: L
2361
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
2362
+ d(we, {
2363
+ "data-testid": "tags-collapse",
2364
+ "trigger-alignment": "leading",
2365
+ "trigger-label": o(r)("gateway_services.form.fields.tags.collapse")
2366
+ }, {
2367
+ default: v(() => [
2368
+ S("div", Vl, [
2369
+ d(E, {
2370
+ modelValue: t.fields.tags,
2371
+ "onUpdate:modelValue": s[29] || (s[29] = (_) => t.fields.tags = _),
2372
+ modelModifiers: { trim: !0 },
2373
+ autocomplete: "off",
2374
+ "data-testid": "gateway-service-tags-input",
2375
+ help: o(r)("gateway_services.form.fields.tags.help"),
2376
+ label: o(r)("gateway_services.form.fields.tags.label"),
2377
+ "label-attributes": {
2378
+ info: o(r)("gateway_services.form.fields.tags.tooltip"),
2379
+ tooltipAttributes: { maxWidth: "400" }
2380
+ },
2381
+ name: "tags",
2382
+ placeholder: o(r)("gateway_services.form.fields.tags.placeholder"),
2383
+ readonly: t.isReadonly,
2384
+ type: "text"
2385
+ }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
2386
+ ])
2387
+ ]),
2388
+ _: 1
2389
+ }, 8, ["trigger-label"])
2390
+ ]),
2391
+ _: 1
2392
+ }, 8, ["description", "hide-info-header", "title"]),
2393
+ t.errorMessages.length ? (C(), Fe(Ie, {
2394
+ key: 0,
2395
+ appearance: "danger"
2396
+ }, {
2397
+ default: v(() => [
2398
+ S("ul", Cl, [
2399
+ (C(!0), F(ot, null, it(t.errorMessages, (_) => (C(), F("li", { key: _ }, P(_), 1))), 128))
2400
+ ])
2401
+ ]),
2402
+ _: 1
2403
+ })) : T("", !0)
2404
+ ]),
2405
+ _: 3
2406
+ }, 8, ["can-submit", "config", "edit-id", "entity-type", "fetch-url", "form-fields", "is-readonly"])
2407
+ ]);
2408
+ };
2409
+ }
2410
+ }), xl = /* @__PURE__ */ Ne(Sl, [["__scopeId", "data-v-291510a6"]]);
1512
2411
  export {
1513
- Xt as GatewayServiceConfigCard,
1514
- Qt as GatewayServiceForm,
1515
- zt as GatewayServiceList
2412
+ Rl as GatewayServiceConfigCard,
2413
+ xl as GatewayServiceForm,
2414
+ $l as GatewayServiceList,
2415
+ Al as LegacyGatewayServiceForm
1516
2416
  };