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