@kong-ui-public/entities-gateway-services 3.11.12 → 3.11.14-pr.2086.20c50855e.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.
- package/dist/entities-gateway-services.es.js +76 -71
- package/dist/entities-gateway-services.umd.js +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/gateway-service-form.d.ts +6 -0
- package/dist/types/types/gateway-service-form.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/urlValidator.d.ts +4 -0
- package/dist/types/utils/urlValidator.d.ts.map +1 -0
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Le, computed as k, ref as q, watch as
|
|
1
|
+
import { defineComponent as Le, computed as k, ref as q, watch as $e, onBeforeMount as it, resolveComponent as G, openBlock as S, createElementBlock as $, createVNode as d, unref as l, createSlots as Re, withCtx as v, createBlock as Ue, Teleport as ze, createElementVNode as I, createCommentVNode as B, createTextVNode as J, toDisplayString as E, withModifiers as We, reactive as Me, onMounted as Qe, renderSlot as Xe, toValue as He, Transition as De, Fragment as rt, renderList as st } from "vue";
|
|
2
2
|
import { useRouter as Ge } from "vue-router";
|
|
3
3
|
import { BookIcon as Ze, AddIcon as at, ServicesIcon as nt } from "@kong/icons";
|
|
4
4
|
import { createI18n as ct, i18nTComponent as dt } from "@kong-ui-public/i18n";
|
|
@@ -213,7 +213,7 @@ const Ct = {
|
|
|
213
213
|
success_brief: "Successfully copied to clipboard"
|
|
214
214
|
}, Ft = {
|
|
215
215
|
gateway_services: "gateway services"
|
|
216
|
-
},
|
|
216
|
+
}, Ut = {
|
|
217
217
|
actions: Ct,
|
|
218
218
|
search: St,
|
|
219
219
|
gateway_services: It,
|
|
@@ -221,8 +221,8 @@ const Ct = {
|
|
|
221
221
|
copy: Et,
|
|
222
222
|
glossary: Ft
|
|
223
223
|
};
|
|
224
|
-
function
|
|
225
|
-
const n = ct("en-us",
|
|
224
|
+
function $t() {
|
|
225
|
+
const n = ct("en-us", Ut);
|
|
226
226
|
return {
|
|
227
227
|
i18n: n,
|
|
228
228
|
i18nT: dt(n)
|
|
@@ -272,7 +272,7 @@ function xt() {
|
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
const ne = {
|
|
275
|
-
useI18n:
|
|
275
|
+
useI18n: $t,
|
|
276
276
|
usePortFromProtocol: At,
|
|
277
277
|
useUrlValidators: xt
|
|
278
278
|
}, xe = "/v2/control-planes/{controlPlaneId}/core-entities", Te = "/{workspace}", ve = {
|
|
@@ -486,7 +486,7 @@ const ne = {
|
|
|
486
486
|
}, L = () => {
|
|
487
487
|
M.push(p.config.createRoute);
|
|
488
488
|
};
|
|
489
|
-
|
|
489
|
+
$e(w, (g) => {
|
|
490
490
|
var m, C, W;
|
|
491
491
|
if (g.status === mt.Error) {
|
|
492
492
|
e.value = {
|
|
@@ -501,7 +501,7 @@ const ne = {
|
|
|
501
501
|
T.value = await p.canCreate();
|
|
502
502
|
}), (g, m) => {
|
|
503
503
|
const C = G("KButton"), W = G("KBadge"), pe = G("KInputSwitch"), N = G("KDropdownItem"), me = G("KClipboardProvider");
|
|
504
|
-
return S(),
|
|
504
|
+
return S(), $("div", Mt, [
|
|
505
505
|
d(l(vt), {
|
|
506
506
|
"cache-identifier": n.cacheIdentifier,
|
|
507
507
|
"default-table-preferences": we,
|
|
@@ -528,12 +528,12 @@ const ne = {
|
|
|
528
528
|
}, null, 8, ["modelValue", "config"])
|
|
529
529
|
]),
|
|
530
530
|
"toolbar-button": v(() => [
|
|
531
|
-
(S(),
|
|
531
|
+
(S(), Ue(ze, {
|
|
532
532
|
disabled: !n.useActionOutside,
|
|
533
533
|
to: "#kong-ui-app-page-header-action-button"
|
|
534
534
|
}, [
|
|
535
535
|
I("div", Bt, [
|
|
536
|
-
P.value ? (S(),
|
|
536
|
+
P.value ? (S(), Ue(C, {
|
|
537
537
|
key: 0,
|
|
538
538
|
appearance: "secondary",
|
|
539
539
|
class: "open-learning-hub",
|
|
@@ -574,7 +574,7 @@ const ne = {
|
|
|
574
574
|
control_plane: v(({ row: h }) => {
|
|
575
575
|
var t;
|
|
576
576
|
return [
|
|
577
|
-
(t = h.x_meta) != null && t.cluster_id ? (S(),
|
|
577
|
+
(t = h.x_meta) != null && t.cluster_id ? (S(), Ue(W, {
|
|
578
578
|
key: 0,
|
|
579
579
|
tooltip: h.x_meta.cluster_id,
|
|
580
580
|
"truncation-tooltip": "",
|
|
@@ -584,7 +584,7 @@ const ne = {
|
|
|
584
584
|
J(E(h.x_meta.cluster_id), 1)
|
|
585
585
|
]),
|
|
586
586
|
_: 2
|
|
587
|
-
}, 1032, ["tooltip", "onClick"])) : (S(),
|
|
587
|
+
}, 1032, ["tooltip", "onClick"])) : (S(), $("b", Lt, "-"))
|
|
588
588
|
];
|
|
589
589
|
}),
|
|
590
590
|
enabled: v(({ row: h }) => [
|
|
@@ -694,7 +694,7 @@ const ne = {
|
|
|
694
694
|
!l(r) && ie.value ? {
|
|
695
695
|
name: "outside-actions",
|
|
696
696
|
fn: v(() => [
|
|
697
|
-
(S(),
|
|
697
|
+
(S(), Ue(ze, {
|
|
698
698
|
disabled: !n.useActionOutside,
|
|
699
699
|
to: "#kong-ui-app-page-header-action-button"
|
|
700
700
|
}, [
|
|
@@ -782,7 +782,7 @@ const ne = {
|
|
|
782
782
|
for (const [p, s] of K)
|
|
783
783
|
y[p] = s;
|
|
784
784
|
return y;
|
|
785
|
-
},
|
|
785
|
+
}, Ml = /* @__PURE__ */ je(Wt, [["__scopeId", "data-v-4adf4f7a"]]), Dt = { class: "kong-ui-entities-gateway-service-form" }, qt = { key: 0 }, Gt = { class: "gateway-service-form-traffic-label" }, Ot = { class: "gateway-service-form-margin-bottom" }, Nt = {
|
|
786
786
|
key: 0,
|
|
787
787
|
class: "gateway-service-form-group-fields"
|
|
788
788
|
}, jt = {
|
|
@@ -1010,9 +1010,9 @@ const ne = {
|
|
|
1010
1010
|
o.isReadonly = !1;
|
|
1011
1011
|
}
|
|
1012
1012
|
};
|
|
1013
|
-
return
|
|
1013
|
+
return $e(() => s.gatewayServiceId, () => {
|
|
1014
1014
|
Object.assign(o.fields, w);
|
|
1015
|
-
}),
|
|
1015
|
+
}), $e(o.fields, (i) => {
|
|
1016
1016
|
o.fields.port = ge.getPortFromProtocol(i.protocol, String(i.port)), p("model-updated", Z.value);
|
|
1017
1017
|
}), Qe(() => {
|
|
1018
1018
|
p("model-updated", Z.value);
|
|
@@ -1024,7 +1024,7 @@ const ne = {
|
|
|
1024
1024
|
initForm: _e
|
|
1025
1025
|
}), (i, u) => {
|
|
1026
1026
|
const V = G("KInput"), X = G("KLabel"), L = G("KRadio"), T = G("KSelect"), c = G("KCheckbox"), g = G("KCollapse");
|
|
1027
|
-
return S(),
|
|
1027
|
+
return S(), $("div", Dt, [
|
|
1028
1028
|
d(l(lt), {
|
|
1029
1029
|
"can-submit": fe.value,
|
|
1030
1030
|
config: n.config,
|
|
@@ -1099,7 +1099,7 @@ const ne = {
|
|
|
1099
1099
|
title: l(r)("gateway_services.form.sections.keys.title")
|
|
1100
1100
|
}, {
|
|
1101
1101
|
default: v(() => [
|
|
1102
|
-
de.value ? B("", !0) : (S(),
|
|
1102
|
+
de.value ? B("", !0) : (S(), $("div", qt, [
|
|
1103
1103
|
I("div", Gt, [
|
|
1104
1104
|
d(X, { required: "" }, {
|
|
1105
1105
|
default: v(() => [
|
|
@@ -1122,7 +1122,7 @@ const ne = {
|
|
|
1122
1122
|
_: 1
|
|
1123
1123
|
}, 8, ["modelValue", "selected-value"])
|
|
1124
1124
|
]),
|
|
1125
|
-
x.value === "url" ? (S(),
|
|
1125
|
+
x.value === "url" ? (S(), $("div", Nt, [
|
|
1126
1126
|
d(V, {
|
|
1127
1127
|
modelValue: o.fields.url,
|
|
1128
1128
|
"onUpdate:modelValue": u[3] || (u[3] = (m) => o.fields.url = m),
|
|
@@ -1153,7 +1153,7 @@ const ne = {
|
|
|
1153
1153
|
_: 1
|
|
1154
1154
|
}, 8, ["modelValue", "selected-value"])
|
|
1155
1155
|
])),
|
|
1156
|
-
x.value === "protocol" || de.value ? (S(),
|
|
1156
|
+
x.value === "protocol" || de.value ? (S(), $("div", jt, [
|
|
1157
1157
|
d(T, {
|
|
1158
1158
|
modelValue: o.fields.protocol,
|
|
1159
1159
|
"onUpdate:modelValue": u[5] || (u[5] = (m) => o.fields.protocol = m),
|
|
@@ -1184,7 +1184,7 @@ const ne = {
|
|
|
1184
1184
|
placeholder: l(r)("gateway_services.form.fields.host.placeholder"),
|
|
1185
1185
|
required: ""
|
|
1186
1186
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder"]),
|
|
1187
|
-
se.value ? (S(),
|
|
1187
|
+
se.value ? (S(), $("div", zt, [
|
|
1188
1188
|
d(V, {
|
|
1189
1189
|
modelValue: o.fields.path,
|
|
1190
1190
|
"onUpdate:modelValue": u[8] || (u[8] = (m) => o.fields.path = m),
|
|
@@ -1312,7 +1312,7 @@ const ne = {
|
|
|
1312
1312
|
type: "number"
|
|
1313
1313
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
1314
1314
|
]),
|
|
1315
|
-
Pe.value ? (S(),
|
|
1315
|
+
Pe.value ? (S(), $("div", Yt, [
|
|
1316
1316
|
d(V, {
|
|
1317
1317
|
modelValue: o.fields.client_certificate,
|
|
1318
1318
|
"onUpdate:modelValue": u[19] || (u[19] = (m) => o.fields.client_certificate = m),
|
|
@@ -1330,7 +1330,7 @@ const ne = {
|
|
|
1330
1330
|
type: "text"
|
|
1331
1331
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])
|
|
1332
1332
|
])) : B("", !0),
|
|
1333
|
-
oe.value ? (S(),
|
|
1333
|
+
oe.value ? (S(), $("div", el, [
|
|
1334
1334
|
d(V, {
|
|
1335
1335
|
modelValue: o.fields.ca_certificates,
|
|
1336
1336
|
"onUpdate:modelValue": u[20] || (u[20] = (m) => o.fields.ca_certificates = m),
|
|
@@ -1360,7 +1360,7 @@ const ne = {
|
|
|
1360
1360
|
_: 1
|
|
1361
1361
|
}, 8, ["modelValue", "label", "placeholder", "readonly"])
|
|
1362
1362
|
])) : B("", !0),
|
|
1363
|
-
Ve.value ? (S(),
|
|
1363
|
+
Ve.value ? (S(), $("div", tl, [
|
|
1364
1364
|
d(c, {
|
|
1365
1365
|
modelValue: o.fields.tls_verify_enabled,
|
|
1366
1366
|
"onUpdate:modelValue": u[21] || (u[21] = (m) => o.fields.tls_verify_enabled = m),
|
|
@@ -1382,7 +1382,7 @@ const ne = {
|
|
|
1382
1382
|
]),
|
|
1383
1383
|
_: 1
|
|
1384
1384
|
}, 8, ["modelValue", "description", "label"]),
|
|
1385
|
-
o.fields.tls_verify_enabled ? (S(),
|
|
1385
|
+
o.fields.tls_verify_enabled ? (S(), $("div", ll, [
|
|
1386
1386
|
d(L, {
|
|
1387
1387
|
modelValue: o.fields.tls_verify_value,
|
|
1388
1388
|
"onUpdate:modelValue": u[22] || (u[22] = (m) => o.fields.tls_verify_value = m),
|
|
@@ -1391,7 +1391,7 @@ const ne = {
|
|
|
1391
1391
|
"selected-value": !0
|
|
1392
1392
|
}, null, 8, ["modelValue", "label"])
|
|
1393
1393
|
])) : B("", !0),
|
|
1394
|
-
o.fields.tls_verify_enabled ? (S(),
|
|
1394
|
+
o.fields.tls_verify_enabled ? (S(), $("div", ol, [
|
|
1395
1395
|
d(L, {
|
|
1396
1396
|
modelValue: o.fields.tls_verify_value,
|
|
1397
1397
|
"onUpdate:modelValue": u[23] || (u[23] = (m) => o.fields.tls_verify_value = m),
|
|
@@ -1414,7 +1414,7 @@ const ne = {
|
|
|
1414
1414
|
]);
|
|
1415
1415
|
};
|
|
1416
1416
|
}
|
|
1417
|
-
}),
|
|
1417
|
+
}), Bl = /* @__PURE__ */ je(il, [["__scopeId", "data-v-c2c5e1f0"]]), rl = { class: "kong-ui-gateway-service-entity-config-card" }, Kl = /* @__PURE__ */ Le({
|
|
1418
1418
|
__name: "GatewayServiceConfigCard",
|
|
1419
1419
|
props: {
|
|
1420
1420
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1501,7 +1501,7 @@ const ne = {
|
|
|
1501
1501
|
hidden: !0
|
|
1502
1502
|
}
|
|
1503
1503
|
});
|
|
1504
|
-
return (r, D) => (S(),
|
|
1504
|
+
return (r, D) => (S(), $("div", rl, [
|
|
1505
1505
|
d(l(Vt), {
|
|
1506
1506
|
config: n.config,
|
|
1507
1507
|
"config-card-doc": n.configCardDoc,
|
|
@@ -1808,8 +1808,8 @@ const le = {
|
|
|
1808
1808
|
const j = Y(t.pathname);
|
|
1809
1809
|
if (j) throw new Error(j);
|
|
1810
1810
|
e.fields.path = t.pathname;
|
|
1811
|
-
const
|
|
1812
|
-
if (
|
|
1811
|
+
const U = we(t.port);
|
|
1812
|
+
if (U) throw new Error(U);
|
|
1813
1813
|
const R = Number(t.port);
|
|
1814
1814
|
Ie.value = !!R, e.fields.port = R || re.getPortFromProtocol(e.fields.protocol), p("url-valid:success");
|
|
1815
1815
|
} catch {
|
|
@@ -1880,7 +1880,7 @@ const le = {
|
|
|
1880
1880
|
let a = "";
|
|
1881
1881
|
t.url && (a = new URL(t.url).protocol), (["https", "wss", "tls"].includes(t.protocol) || ["https", "wss", "tls"].includes(a)) && (t.tls_verify = t.tls_verify_enabled ? t.tls_verify_value : null), delete t.tls_verify_enabled, delete t.tls_verify_value;
|
|
1882
1882
|
}, N = k(() => {
|
|
1883
|
-
var a, F, j,
|
|
1883
|
+
var a, F, j, U;
|
|
1884
1884
|
const t = {
|
|
1885
1885
|
name: e.fields.name || null,
|
|
1886
1886
|
tags: e.fields.tags ? (j = (F = (a = e.fields.tags) == null ? void 0 : a.split(",")) == null ? void 0 : F.map((R) => String(R || "").trim())) == null ? void 0 : j.filter((R) => R !== "") : null,
|
|
@@ -1892,7 +1892,7 @@ const le = {
|
|
|
1892
1892
|
connect_timeout: e.fields.connect_timeout,
|
|
1893
1893
|
tls_verify_value: e.fields.tls_verify_value,
|
|
1894
1894
|
tls_verify_enabled: e.fields.tls_verify_enabled,
|
|
1895
|
-
ca_certificates: e.fields.ca_certificates ? (
|
|
1895
|
+
ca_certificates: e.fields.ca_certificates ? (U = e.fields.ca_certificates) == null ? void 0 : U.split(",").filter((R) => R !== "") : null,
|
|
1896
1896
|
client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
|
|
1897
1897
|
write_timeout: e.fields.write_timeout,
|
|
1898
1898
|
port: e.fields.port,
|
|
@@ -1903,30 +1903,30 @@ const le = {
|
|
|
1903
1903
|
var t, a, F, j;
|
|
1904
1904
|
try {
|
|
1905
1905
|
e.isReadonly = !0, ae();
|
|
1906
|
-
const
|
|
1907
|
-
pe(
|
|
1906
|
+
const U = N.value;
|
|
1907
|
+
pe(U);
|
|
1908
1908
|
let R;
|
|
1909
|
-
if (await P.post(C.value,
|
|
1909
|
+
if (await P.post(C.value, U), z.value === "create" ? R = await P.post(W.value, U) : z.value === "edit" && (R = ((t = s.config) == null ? void 0 : t.app) === "konnect" ? await P.put(W.value, U) : await P.patch(W.value, U)), R) {
|
|
1910
1910
|
const { data: f } = R;
|
|
1911
1911
|
e.fields.name = (f == null ? void 0 : f.name) || "", e.fields.port = f.port || re.getPortFromProtocol(f.protocol), e.fields.protocol = (f == null ? void 0 : f.protocol) || "http", e.fields.host = (f == null ? void 0 : f.host) || "", e.fields.path = (f == null ? void 0 : f.path) || "", e.fields.url = (f == null ? void 0 : f.url) || "", e.fields.retries = f != null && f.retries || (f == null ? void 0 : f.retries) === 0 ? f == null ? void 0 : f.retries : 5, e.fields.connect_timeout = f != null && f.connect_timeout || (f == null ? void 0 : f.connect_timeout) === 0 ? f == null ? void 0 : f.connect_timeout : 6e4, e.fields.write_timeout = f != null && f.write_timeout || (f == null ? void 0 : f.write_timeout) === 0 ? f == null ? void 0 : f.write_timeout : 6e4, e.fields.read_timeout = f != null && f.read_timeout || (f == null ? void 0 : f.read_timeout) === 0 ? f == null ? void 0 : f.read_timeout : 6e4, e.fields.client_certificate = ((a = f == null ? void 0 : f.client_certificate) == null ? void 0 : a.id) || "", e.fields.ca_certificates = (F = f == null ? void 0 : f.ca_certificates) != null && F.length ? f == null ? void 0 : f.ca_certificates.join(",") : "", e.fields.tls_verify_enabled = (f == null ? void 0 : f.tls_verify) !== "" && (f == null ? void 0 : f.tls_verify) !== null && (f == null ? void 0 : f.tls_verify) !== void 0, e.fields.tls_verify_value = e.fields.tls_verify_enabled && (f == null ? void 0 : f.tls_verify), e.fields.tags = (j = f == null ? void 0 : f.tags) != null && j.length ? f.tags.join(", ") : "", Object.assign(A, e.fields), p("update", R == null ? void 0 : R.data);
|
|
1912
1912
|
}
|
|
1913
1913
|
return R;
|
|
1914
|
-
} catch (
|
|
1915
|
-
const { fields: R, messages: f } = D(
|
|
1914
|
+
} catch (U) {
|
|
1915
|
+
const { fields: R, messages: f } = D(U);
|
|
1916
1916
|
e.errorMessages = f, R.length && R.forEach((he) => {
|
|
1917
1917
|
const Se = he.field;
|
|
1918
1918
|
Se === "client_certificate.id" ? e.formFieldErrors.client_certificate = he.message : Se.startsWith("ca_certificates") ? e.formFieldErrors.ca_certificates = he.message : Object.keys(e.formFieldErrors).includes(Se) && (e.formFieldErrors = {
|
|
1919
1919
|
...e.formFieldErrors,
|
|
1920
1920
|
[Se]: he.message
|
|
1921
1921
|
});
|
|
1922
|
-
}), p("error",
|
|
1922
|
+
}), p("error", U);
|
|
1923
1923
|
} finally {
|
|
1924
1924
|
e.isReadonly = !1;
|
|
1925
1925
|
}
|
|
1926
1926
|
};
|
|
1927
|
-
return
|
|
1927
|
+
return $e(() => s.gatewayServiceId, () => {
|
|
1928
1928
|
Object.assign(e.fields, A);
|
|
1929
|
-
}),
|
|
1929
|
+
}), $e(e.fields, (t) => {
|
|
1930
1930
|
e.fields.port = re.getPortFromProtocol(t.protocol, String(t.port)), p("model-updated", N.value);
|
|
1931
1931
|
}), Qe(() => {
|
|
1932
1932
|
p("model-updated", N.value), o.value || (e.fields.name = i());
|
|
@@ -1937,8 +1937,8 @@ const le = {
|
|
|
1937
1937
|
canSubmit: c,
|
|
1938
1938
|
initForm: g
|
|
1939
1939
|
}), (t, a) => {
|
|
1940
|
-
const F = G("KRadio"), j = G("KButton"),
|
|
1941
|
-
return S(),
|
|
1940
|
+
const F = G("KRadio"), j = G("KButton"), U = G("KInput"), R = G("KSelect"), f = G("KCheckbox"), he = G("KCollapse"), Se = G("KAlert");
|
|
1941
|
+
return S(), $("div", nl, [
|
|
1942
1942
|
d(l(lt), {
|
|
1943
1943
|
"can-submit": c.value,
|
|
1944
1944
|
config: n.config,
|
|
@@ -1967,7 +1967,7 @@ const le = {
|
|
|
1967
1967
|
title: l(r)("gateway_services.form.sections.keys.title")
|
|
1968
1968
|
}, {
|
|
1969
1969
|
default: v(() => [
|
|
1970
|
-
o.value ? B("", !0) : (S(),
|
|
1970
|
+
o.value ? B("", !0) : (S(), $("div", cl, [
|
|
1971
1971
|
I("div", dl, [
|
|
1972
1972
|
d(F, {
|
|
1973
1973
|
modelValue: w.value,
|
|
@@ -1995,8 +1995,8 @@ const le = {
|
|
|
1995
1995
|
]),
|
|
1996
1996
|
d(De, { name: "slide-fade" }, {
|
|
1997
1997
|
default: v(() => [
|
|
1998
|
-
w.value === "url" ? (S(),
|
|
1999
|
-
d(
|
|
1998
|
+
w.value === "url" ? (S(), $("div", ul, [
|
|
1999
|
+
d(U, {
|
|
2000
2000
|
modelValue: e.fields.url,
|
|
2001
2001
|
"onUpdate:modelValue": a[2] || (a[2] = (_) => e.fields.url = _),
|
|
2002
2002
|
modelModifiers: { trim: !0 },
|
|
@@ -2039,7 +2039,7 @@ const le = {
|
|
|
2039
2039
|
])),
|
|
2040
2040
|
d(De, { name: "slide-fade" }, {
|
|
2041
2041
|
default: v(() => [
|
|
2042
|
-
w.value === "protocol" || o.value ? (S(),
|
|
2042
|
+
w.value === "protocol" || o.value ? (S(), $("div", fl, [
|
|
2043
2043
|
d(R, {
|
|
2044
2044
|
modelValue: e.fields.protocol,
|
|
2045
2045
|
"onUpdate:modelValue": a[3] || (a[3] = (_) => e.fields.protocol = _),
|
|
@@ -2055,7 +2055,7 @@ const le = {
|
|
|
2055
2055
|
width: "100%",
|
|
2056
2056
|
onSelected: a[4] || (a[4] = (_) => Pe(e.fields.protocol, _))
|
|
2057
2057
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
|
|
2058
|
-
d(
|
|
2058
|
+
d(U, {
|
|
2059
2059
|
modelValue: e.fields.host,
|
|
2060
2060
|
"onUpdate:modelValue": a[5] || (a[5] = (_) => e.fields.host = _),
|
|
2061
2061
|
modelModifiers: { trim: !0 },
|
|
@@ -2090,8 +2090,8 @@ const le = {
|
|
|
2090
2090
|
key: "0"
|
|
2091
2091
|
}
|
|
2092
2092
|
]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
|
|
2093
|
-
u.value ? (S(),
|
|
2094
|
-
d(
|
|
2093
|
+
u.value ? (S(), $("div", pl, [
|
|
2094
|
+
d(U, {
|
|
2095
2095
|
modelValue: e.fields.path,
|
|
2096
2096
|
"onUpdate:modelValue": a[7] || (a[7] = (_) => e.fields.path = _),
|
|
2097
2097
|
modelModifiers: { trim: !0 },
|
|
@@ -2109,7 +2109,7 @@ const le = {
|
|
|
2109
2109
|
onInput: a[8] || (a[8] = (_) => l(H)("path"))
|
|
2110
2110
|
}, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
|
|
2111
2111
|
])) : B("", !0),
|
|
2112
|
-
d(
|
|
2112
|
+
d(U, {
|
|
2113
2113
|
modelValue: e.fields.port,
|
|
2114
2114
|
"onUpdate:modelValue": [
|
|
2115
2115
|
a[9] || (a[9] = (_) => e.fields.port = _),
|
|
@@ -2144,9 +2144,9 @@ const le = {
|
|
|
2144
2144
|
default: v(() => [
|
|
2145
2145
|
d(De, { name: "slide-fade" }, {
|
|
2146
2146
|
default: v(() => [
|
|
2147
|
-
b.value ? B("", !0) : (S(),
|
|
2147
|
+
b.value ? B("", !0) : (S(), $("div", ml, [
|
|
2148
2148
|
I("div", vl, [
|
|
2149
|
-
d(
|
|
2149
|
+
d(U, {
|
|
2150
2150
|
modelValue: e.fields.retries,
|
|
2151
2151
|
"onUpdate:modelValue": [
|
|
2152
2152
|
a[12] || (a[12] = (_) => e.fields.retries = _),
|
|
@@ -2167,7 +2167,7 @@ const le = {
|
|
|
2167
2167
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
2168
2168
|
]),
|
|
2169
2169
|
I("div", gl, [
|
|
2170
|
-
d(
|
|
2170
|
+
d(U, {
|
|
2171
2171
|
modelValue: e.fields.connect_timeout,
|
|
2172
2172
|
"onUpdate:modelValue": [
|
|
2173
2173
|
a[14] || (a[14] = (_) => e.fields.connect_timeout = _),
|
|
@@ -2188,7 +2188,7 @@ const le = {
|
|
|
2188
2188
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
2189
2189
|
]),
|
|
2190
2190
|
I("div", yl, [
|
|
2191
|
-
d(
|
|
2191
|
+
d(U, {
|
|
2192
2192
|
modelValue: e.fields.write_timeout,
|
|
2193
2193
|
"onUpdate:modelValue": [
|
|
2194
2194
|
a[16] || (a[16] = (_) => e.fields.write_timeout = _),
|
|
@@ -2209,7 +2209,7 @@ const le = {
|
|
|
2209
2209
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
2210
2210
|
]),
|
|
2211
2211
|
I("div", _l, [
|
|
2212
|
-
d(
|
|
2212
|
+
d(U, {
|
|
2213
2213
|
modelValue: e.fields.read_timeout,
|
|
2214
2214
|
"onUpdate:modelValue": [
|
|
2215
2215
|
a[18] || (a[18] = (_) => e.fields.read_timeout = _),
|
|
@@ -2229,8 +2229,8 @@ const le = {
|
|
|
2229
2229
|
type: "number"
|
|
2230
2230
|
}, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
|
|
2231
2231
|
]),
|
|
2232
|
-
V.value ? (S(),
|
|
2233
|
-
d(
|
|
2232
|
+
V.value ? (S(), $("div", bl, [
|
|
2233
|
+
d(U, {
|
|
2234
2234
|
modelValue: e.fields.client_certificate,
|
|
2235
2235
|
"onUpdate:modelValue": a[20] || (a[20] = (_) => e.fields.client_certificate = _),
|
|
2236
2236
|
modelModifiers: { trim: !0 },
|
|
@@ -2249,8 +2249,8 @@ const le = {
|
|
|
2249
2249
|
onInput: a[21] || (a[21] = (_) => l(be)("client_certificate"))
|
|
2250
2250
|
}, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
|
|
2251
2251
|
])) : B("", !0),
|
|
2252
|
-
X.value ? (S(),
|
|
2253
|
-
d(
|
|
2252
|
+
X.value ? (S(), $("div", hl, [
|
|
2253
|
+
d(U, {
|
|
2254
2254
|
modelValue: e.fields.ca_certificates,
|
|
2255
2255
|
"onUpdate:modelValue": a[22] || (a[22] = (_) => e.fields.ca_certificates = _),
|
|
2256
2256
|
modelModifiers: { trim: !0 },
|
|
@@ -2281,7 +2281,7 @@ const le = {
|
|
|
2281
2281
|
_: 1
|
|
2282
2282
|
}, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
|
|
2283
2283
|
])) : B("", !0),
|
|
2284
|
-
L.value ? (S(),
|
|
2284
|
+
L.value ? (S(), $("div", wl, [
|
|
2285
2285
|
d(f, {
|
|
2286
2286
|
modelValue: e.fields.tls_verify_enabled,
|
|
2287
2287
|
"onUpdate:modelValue": a[24] || (a[24] = (_) => e.fields.tls_verify_enabled = _),
|
|
@@ -2303,7 +2303,7 @@ const le = {
|
|
|
2303
2303
|
]),
|
|
2304
2304
|
_: 1
|
|
2305
2305
|
}, 8, ["modelValue", "description", "label"]),
|
|
2306
|
-
e.fields.tls_verify_enabled ? (S(),
|
|
2306
|
+
e.fields.tls_verify_enabled ? (S(), $("div", kl, [
|
|
2307
2307
|
d(F, {
|
|
2308
2308
|
modelValue: e.fields.tls_verify_value,
|
|
2309
2309
|
"onUpdate:modelValue": a[25] || (a[25] = (_) => e.fields.tls_verify_value = _),
|
|
@@ -2312,7 +2312,7 @@ const le = {
|
|
|
2312
2312
|
"selected-value": !0
|
|
2313
2313
|
}, null, 8, ["modelValue", "label"])
|
|
2314
2314
|
])) : B("", !0),
|
|
2315
|
-
e.fields.tls_verify_enabled ? (S(),
|
|
2315
|
+
e.fields.tls_verify_enabled ? (S(), $("div", Vl, [
|
|
2316
2316
|
d(F, {
|
|
2317
2317
|
modelValue: e.fields.tls_verify_value,
|
|
2318
2318
|
"onUpdate:modelValue": a[26] || (a[26] = (_) => e.fields.tls_verify_value = _),
|
|
@@ -2338,7 +2338,7 @@ const le = {
|
|
|
2338
2338
|
title: l(r)("gateway_services.form.sections.general.title")
|
|
2339
2339
|
}, {
|
|
2340
2340
|
default: v(() => [
|
|
2341
|
-
d(
|
|
2341
|
+
d(U, {
|
|
2342
2342
|
modelValue: e.fields.name,
|
|
2343
2343
|
"onUpdate:modelValue": a[28] || (a[28] = (_) => e.fields.name = _),
|
|
2344
2344
|
modelModifiers: { trim: !0 },
|
|
@@ -2364,7 +2364,7 @@ const le = {
|
|
|
2364
2364
|
}, {
|
|
2365
2365
|
default: v(() => [
|
|
2366
2366
|
I("div", Cl, [
|
|
2367
|
-
d(
|
|
2367
|
+
d(U, {
|
|
2368
2368
|
modelValue: e.fields.tags,
|
|
2369
2369
|
"onUpdate:modelValue": a[29] || (a[29] = (_) => e.fields.tags = _),
|
|
2370
2370
|
modelModifiers: { trim: !0 },
|
|
@@ -2388,13 +2388,13 @@ const le = {
|
|
|
2388
2388
|
]),
|
|
2389
2389
|
_: 1
|
|
2390
2390
|
}, 8, ["description", "hide-info-header", "title"]),
|
|
2391
|
-
e.errorMessages.length ? (S(),
|
|
2391
|
+
e.errorMessages.length ? (S(), Ue(Se, {
|
|
2392
2392
|
key: 0,
|
|
2393
2393
|
appearance: "danger"
|
|
2394
2394
|
}, {
|
|
2395
2395
|
default: v(() => [
|
|
2396
2396
|
I("ul", Sl, [
|
|
2397
|
-
(S(!0),
|
|
2397
|
+
(S(!0), $(rt, null, st(e.errorMessages, (_) => (S(), $("li", { key: _ }, E(_), 1))), 128))
|
|
2398
2398
|
])
|
|
2399
2399
|
]),
|
|
2400
2400
|
_: 1
|
|
@@ -2405,11 +2405,16 @@ const le = {
|
|
|
2405
2405
|
]);
|
|
2406
2406
|
};
|
|
2407
2407
|
}
|
|
2408
|
-
}),
|
|
2408
|
+
}), Ll = /* @__PURE__ */ je(Il, [["__scopeId", "data-v-0200f215"]]), { validateHost: Pl, validatePort: El, validateProtocol: Fl, validatePath: Ul } = ne.useUrlValidators(), Wl = () => ({
|
|
2409
|
+
validateHost: Pl,
|
|
2410
|
+
validatePort: El,
|
|
2411
|
+
validateProtocol: Fl,
|
|
2412
|
+
validatePath: Ul
|
|
2413
|
+
});
|
|
2409
2414
|
export {
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
+
Kl as GatewayServiceConfigCard,
|
|
2416
|
+
Ll as GatewayServiceForm,
|
|
2417
|
+
Ml as GatewayServiceList,
|
|
2418
|
+
Bl as LegacyGatewayServiceForm,
|
|
2419
|
+
Wl as useUrlValidator
|
|
2415
2420
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(D,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(D=typeof globalThis<"u"?globalThis:D||self,e(D["kong-ui-public-entities-gateway-services"]={},D.Vue,D.VueRouter,D.KongIcons,D["kong-ui-public-i18n"],D["kong-ui-public-entities-shared"]))})(this,function(D,e,ke,he,Ee,_){"use strict";const Se={actions:{create:"New gateway service",serverless_create:"Add a Service",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",clear:"Clear",view:"View Details",delete:{title:"Delete a Gateway Service",description:"Deleting this Gateway Service will also remove any associated plugins. This action cannot be reversed.",menu_label:"Delete"}},search:{placeholder:{konnect:"Filter by name",kongManager:"Filter by exact name or ID"}},gateway_services:{title:"Gateway Services",list:{toolbar_actions:{new_gateway_service:"New gateway service"},table_headers:{name:"Name",control_plane:"Control Plane",protocol:"Protocol",host:"Host",port:"Port",path:"Path",enabled:"Enabled",tags:"Tags",id:"ID",created_at:"Created At",updated_at:"Last Modified"},empty_state:{title:"Configure a New Gateway Service",description:"Gateway services are used to proxy traffic.",serverless_title:"Configure your first Gateway Service"}},empty_state_v2:{create:"New gateway service",title:"Configure your first gateway service",group:"Services created in gateways within this group will automatically appear here.",description:"Gateway services represent backend APIs or microservices that receive traffic routed through the gateway."},form:{buttons:{try_sample:"Try sample API"},errors:{host:{empty:"Host cannot be empty",invalid:"Invalid host"},port:{type:"Port must be a number",invalid:"Port must be between 0 and 65535"},path:{prefix:"Path must begin with /",invalid:"Path should not include characters outside of the reserved list of RFC 3986"},protocol:{empty:"Protocol cannot be empty",invalid:"Protocol - value must be one of http, https, grpc, grpcs, tcp, udp, tls, tls_passthrough, ws, wss"},url:{invalid:"The URL must follow a valid format. Example: https://api.kong-air.com/flights"}},sections:{general:{title:"General Information",description:"Provide a name and tags to help identify and manage this service."},keys:{title:"Service endpoint",description:"Define where this service should send requests.",checkedGroupLabel:"Choose how and where to send traffic",urlLabel:"Full URL",checkedGroupAltLabel:"Protocol, host, port and path",url:{label:"Full URL",description:"Define the service using a single, complete API URL for simple setup."},protocol:{label:"Protocol, host, port, and path",description:"Manually specify each component of the API’s URL for advanced configurations."},viewAdvancedFields:"View advanced fields"}},fields:{upstream_url:{label:"Full URL",placeholder:"e.g. https://api.kong-air.com/flights",tooltip_for_konnect:"This is the URL of the API you will manage in Konnect.",tooltip_for_km:"This is the URL of the API you will manage in Kong Gateway."},name:{label:"Name",placeholder:"Enter a unique name",tooltip:"The Service name."},protocol:{label:"Protocol",tooltip:"The protocol used to communicate with the upstream.",options:{http:"http",https:"https",tcp:"tcp",tls:"tls",tls_passthrough:"tls_passthrough",grpc:"grpc",grpcs:"grpcs",ws:"ws",wss:"wss",udp:"udp"}},host:{label:"Host",placeholder:"e.g. api.kong-air.com",tooltip:"The host of the upstream server. Note that the host value is case sensitive."},path:{label:"Path",placeholder:"e.g. /sample",tooltip:"The path to be used in request to the upstream server."},port:{label:"Port",tooltip:"The upstream server port."},retries:{label:"Retries",tooltip:"The number of retries to execute upon failure to proxy."},connect_timeout:{label:"Connection timeout",tooltip:"The timeout in milliseconds for establishing a connection to the upstream server."},write_timeout:{label:"Write timeout",tooltip:"The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server."},read_timeout:{label:"Read timeout",tooltip:"The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server."},client_certificate:{label:"Client certificate",placeholder:"Enter a Certificate ID",tooltip:"Certificate to be used as client certificate while TLS handshaking to the upstream server."},ca_certificates:{label:"CA certificates",placeholder:"Enter a comma separated list of CA Certificate IDs",tooltip:"Array of {code1} object UUIDs that are used to build the trust store while verifying upstream server's TLS certificate. If set to {code2} when Nginx default is respected. If default CA list in Nginx are not specified and TLS verification is enabled, then handshake with upstream server will always fail (because no CA are trusted).",code1:"CA Certificate",code2:"null"},tls_verify_enabled:{label:"TLS verify",help:"If unchecked, use default system setting",tooltip:"Whether to enable verification of upstream server TLS certificate. If set to {code1}, then the Nginx default is respected.",code1:"null"},tls_verify_option:{unset:{display:"Use default system setting"},true:{label:"True",display:"On"},false:{label:"False",display:"Off"}},tags:{label:"Tags",tooltip:"An optional set of strings associated with the Service for grouping and filtering.",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",collapse:"Add tags"},enabled:{label:"Enabled",tooltip:"Whether the Service is active. If set to {false}, the proxy behavior will be as if any routes attached to it do not exist (404). Default: {true}.",false:"false",true:"true"}}}},errors:{general:"Gateway Services could not be retrieved",delete:"The gateway service could not be deleted at this time.",copy:"Failed to copy to clipboard",urlErrorMessage:"Error: invalid URL"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},glossary:{gateway_services:"gateway services"}};function Ie(){const n=Ee.createI18n("en-us",Se);return{i18n:n,i18nT:Ee.i18nTComponent(n)}}function Pe(){return{getPortFromProtocol:(B,g)=>{const p=[80,443],s=Number(g);if((s||s===0)&&!p.includes(s))return s;switch(B){case"grpcs":case"tls":case"https":case"wss":return 443;case"grpc":case"tcp":case"http":case"ws":default:return 80}}}}function Be(){const{i18n:{t:n}}=Z.useI18n();return{validateHost:b=>{if(!b||b.trim()==="")return n("gateway_services.form.errors.host.empty");const P=/^(?!:\/\/)([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*)(\.[a-zA-Z]{1,63})?$/;return/^((25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])$/.test(b)||P.test(b)?"":n("gateway_services.form.errors.host.invalid")},validateProtocol:(b,P)=>!b||b.trim()===""?n("gateway_services.form.errors.protocol.empty"):(b=b.slice(0,-1),P.find(i=>{if(i.value===b)return i})===void 0?n("gateway_services.form.errors.protocol.invalid"):""),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"),validatePort:b=>{if(b==null||b==="")return"";const P=typeof b=="string"?parseInt(b,10):b;return isNaN(P)?n("gateway_services.form.errors.port.type"):P<0||P>65535?n("gateway_services.form.errors.port.invalid"):""}}}const Z={useI18n:Ie,usePortFromProtocol:Pe,useUrlValidators:Be},ve="/v2/control-planes/{controlPlaneId}/core-entities",Ve="/{workspace}",ee={list:{konnect:{all:`${ve}/services`},kongManager:{all:`${Ve}/services`}},form:{konnect:{create:`${ve}/services`,validate:`${ve}/v1/schemas/json/service/validate`,edit:`${ve}/services/{id}`},kongManager:{create:`${Ve}/services`,validate:`${Ve}/schemas/services/validate`,edit:`${Ve}/services/{id}`}}},Te="#00abd2",Fe="24px",$e={class:"kong-ui-entities-gateway-services-list"},Ue={class:"button-row"},Ae={class:"empty-state-icon-gateway"},Re={key:1},Me=e.defineComponent({__name:"GatewayServiceList",props:{config:{type:Object,required:!0,validator:n=>!(!n||!["konnect","kongManager"].includes(n==null?void 0:n.app)||!n.createRoute||!n.getViewRoute||!n.getEditRoute||n.app==="kongManager"&&!n.isExactMatch&&!n.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1},isServerless:{type:Boolean,default:!1},enableV2EmptyStates:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success","toggle:success"],setup(n,{emit:B}){var c;const g=B,p=n,{i18n:{t:s,formatUnixTimeStamp:b}}=Z.useI18n(),P=ke.useRouter(),{axiosInstance:L}=_.useAxios((c=p.config)==null?void 0:c.axiosRequestConfig),{hasRecords:i,handleStateChange:$}=_.useTableState(()=>M.value),k=e.computed(()=>i.value&&p.config.app==="konnect"),J=e.computed(()=>!p.enableV2EmptyStates&&p.config.app==="konnect"),te=e.computed(()=>p.config.app!=="kongManager"||!!p.config.disableSorting),O={name:{label:s("gateway_services.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},...p.config.showControlPlaneColumn?{control_plane:{label:s("gateway_services.list.table_headers.control_plane")}}:{},protocol:{label:s("gateway_services.list.table_headers.protocol"),searchable:!0,sortable:!0},host:{label:s("gateway_services.list.table_headers.host"),searchable:!0,sortable:!0},port:{label:s("gateway_services.list.table_headers.port"),searchable:!0,sortable:!0},path:{label:s("gateway_services.list.table_headers.path"),searchable:!0,sortable:!0},enabled:{label:s("gateway_services.list.table_headers.enabled"),searchable:!0,sortable:!0},tags:{label:s("gateway_services.list.table_headers.tags"),sortable:!1},updated_at:{label:s("gateway_services.list.table_headers.updated_at"),sortable:!0},created_at:{label:s("gateway_services.list.table_headers.created_at"),sortable:!0}},pe={columnVisibility:{created_at:!1}},oe=O,x=e.computed(()=>{var m,V;let u=`${p.config.apiBaseUrl}${ee.list[p.config.app].all}`;return p.config.app==="konnect"?u=u.replace(/{controlPlaneId}/gi,((m=p.config)==null?void 0:m.controlPlaneId)||""):p.config.app==="kongManager"&&(u=u.replace(/\/{workspace}/gi,(V=p.config)!=null&&V.workspace?`/${p.config.workspace}`:"")),u}),ae=e.computed(()=>p.config.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${x.value}`):new URL(x.value)),M=e.ref(""),_e=e.computed(()=>{const u=p.config.app==="konnect"||p.config.isExactMatch;if(u)return{isExactMatch:u,placeholder:s(`search.placeholder.${p.config.app}`)};const{name:m,enabled:V,protocol:F,host:ie,port:A,path:se}=O;return{isExactMatch:u,fields:{name:m,enabled:V,protocol:F,host:ie,port:A,path:se},schema:p.config.filterSchema}}),{fetcher:r,fetcherState:h,fetcherCacheKey:Q}=_.useFetcher({...p.config,cacheIdentifier:p.cacheIdentifier},x.value),ne=()=>{M.value=""},me=()=>{Q.value++},t=e.ref(null),E=e.computed(()=>({ctaPath:p.config.createRoute,ctaText:S.value?p.isServerless?s("actions.serverless_create"):s("actions.create"):void 0,message:`${s("gateway_services.list.empty_state.description")}${p.config.additionMessageForEmptyState?` ${p.config.additionMessageForEmptyState}`:""}`,title:S.value?p.isServerless?s("gateway_services.list.empty_state.serverless_title"):s("gateway_services.list.empty_state.title"):s("gateway_services.title")})),re=e.ref(!1),U=e.ref(null),X=e.computed(()=>{const u={action:"disable",id:"",name:""};if(U.value){const{enabled:m,id:V,name:F}=U.value;u.action=m?"disable":"enable",u.id=V,u.name=F||V}return u}),be=u=>{re.value=!0,U.value=u},H=()=>{re.value=!1,U.value=null},ue=async()=>{var F,ie;if(!await((F=p.canEdit)==null?void 0:F.call(p,U.value))||!U.value)return;const m=`${ae.value.href}/${U.value.id}`,V=!U.value.enabled;try{const{data:A}=((ie=p.config)==null?void 0:ie.app)==="konnect"?await L.put(m,{...U.value,enabled:V}):await L.patch(m,{...U.value,enabled:V});g("toggle:success",A),U.value.enabled=V}catch(A){g("error",A)}},ge=u=>{p.config.getControlPlaneRoute&&P.push(p.config.getControlPlaneRoute(u))},le=async(u,m)=>{const V=u.id;if(!await m(V)){g("copy:error",{entity:u,field:"id",message:s("errors.copy")});return}g("copy:success",{entity:u,field:"id",message:s("copy.success",{val:V})})},ce=async(u,m)=>{const V=JSON.stringify(u);if(!await m(V)){g("copy:error",{entity:u,message:s("errors.copy")});return}g("copy:success",{entity:u,message:s("copy.success_brief")})},de=async u=>{var V;await((V=p.canRetrieve)==null?void 0:V.call(p,u))&&P.push(p.config.getViewRoute(u.id))},we=u=>({label:s("actions.view"),to:p.config.getViewRoute(u)}),j=u=>({label:s("actions.edit"),to:p.config.getEditRoute(u)}),K=e.ref(void 0),W=e.ref(!1),z=e.ref(!1),Y=e.ref(""),l=_.useDeleteUrlBuilder(p.config,x.value),d=u=>{K.value=u,W.value=!0,Y.value=""},v=()=>{W.value=!1,K.value=void 0},q=async()=>{var u,m,V;if((u=K.value)!=null&&u.id){z.value=!0;try{await L.delete(l(K.value.id)),g("delete:success",K.value),v(),Q.value++}catch(F){Y.value=((V=(m=F.response)==null?void 0:m.data)==null?void 0:V.message)||F.message||s("errors.delete"),g("error",F)}finally{z.value=!1}}},T=()=>{P.push(p.config.createRoute)};e.watch(h,u=>{var m,V,F;if(u.status===_.FetcherStatus.Error){t.value={title:s("errors.general")},(F=(V=(m=u.error)==null?void 0:m.response)==null?void 0:V.data)!=null&&F.message&&(t.value.message=u.error.response.data.message),g("error",u.error);return}t.value=null});const S=e.ref(!1);return e.onBeforeMount(async()=>{S.value=await p.canCreate()}),(u,m)=>{const V=e.resolveComponent("KButton"),F=e.resolveComponent("KBadge"),ie=e.resolveComponent("KInputSwitch"),A=e.resolveComponent("KDropdownItem"),se=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(_.EntityBaseTable),{"cache-identifier":n.cacheIdentifier,"default-table-preferences":pe,"disable-sorting":te.value,"empty-state-options":E.value,"enable-entity-actions":"","error-message":t.value,fetcher:e.unref(r),"fetcher-cache-key":e.unref(Q),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-gateway-services-list",query:M.value,"table-headers":e.unref(oe),onClearSearchInput:ne,"onClick:row":m[5]||(m[5]=w=>de(w)),onSort:me,onState:e.unref($)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(_.EntityFilter),{modelValue:M.value,"onUpdate:modelValue":m[0]||(m[0]=w=>M.value=w),config:_e.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!n.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",Ue,[k.value?(e.openBlock(),e.createBlock(V,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"gateway-services-learn-more-button",icon:"",onClick:m[1]||(m[1]=w=>u.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(he.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canCreate()},{default:e.withCtx(()=>[e.createVNode(V,{appearance:"primary","data-testid":"toolbar-add-gateway-service",size:n.useActionOutside?"medium":"large",to:n.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(he.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(s)("gateway_services.list.toolbar_actions.new_gateway_service")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),name:e.withCtx(({rowValue:w})=>[e.createElementVNode("b",null,e.toDisplayString(w??"-"),1)]),control_plane:e.withCtx(({row:w})=>{var o;return[(o=w.x_meta)!=null&&o.cluster_id?(e.openBlock(),e.createBlock(F,{key:0,tooltip:w.x_meta.cluster_id,"truncation-tooltip":"",onClick:e.withModifiers(a=>ge(w.x_meta.cluster_id),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.x_meta.cluster_id),1)]),_:2},1032,["tooltip","onClick"])):(e.openBlock(),e.createElementBlock("b",Re,"-"))]}),enabled:e.withCtx(({row:w})=>[e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canEdit(w),"force-show":""},{default:e.withCtx(({isAllowed:o})=>[e.createElementVNode("div",{onClick:m[4]||(m[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ie,{modelValue:w.enabled,"onUpdate:modelValue":a=>w.enabled=a,"data-testid":`row-${w.id}-toggle-input`,disabled:!o,onClick:e.withModifiers(a=>be(w),["prevent"])},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","onClick"])])]),_:2},1032,["auth-function"])]),tags:e.withCtx(({rowValue:w})=>[e.createVNode(e.unref(_.TableTags),{tags:w},null,8,["tags"])]),created_at:e.withCtx(({rowValue:w})=>[e.createTextVNode(e.toDisplayString(e.unref(b)(w)),1)]),updated_at:e.withCtx(({row:w,rowValue:o})=>[e.createTextVNode(e.toDisplayString(e.unref(b)(o??w.created_at)),1)]),actions:e.withCtx(({row:w})=>[e.createVNode(se,null,{default:e.withCtx(({copyToClipboard:o})=>[e.createVNode(A,{"data-testid":"action-entity-copy-id",onClick:a=>le(w,o)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(se,null,{default:e.withCtx(({copyToClipboard:o})=>[e.createVNode(A,{"data-testid":"action-entity-copy-json",onClick:a=>ce(w,o)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canRetrieve(w)},{default:e.withCtx(()=>[e.createVNode(A,{"data-testid":"action-entity-view","has-divider":"",item:we(w.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canEdit(w)},{default:e.withCtx(()=>[e.createVNode(A,{"data-testid":"action-entity-edit",item:j(w.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canDelete(w)},{default:e.withCtx(()=>[e.createVNode(A,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:o=>d(w)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("actions.delete.menu_label")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!e.unref(i)&&J.value?{name:"outside-actions",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!n.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(V,{appearance:"secondary",class:"open-learning-hub","data-testid":"gateway-services-more-button",icon:"",onClick:m[2]||(m[2]=w=>u.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(he.BookIcon),{decorative:""})]),_:1})],8,["disabled"]))]),key:"0"}:void 0,!M.value&&n.enableV2EmptyStates&&n.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var w;return[e.createVNode(e.unref(_.EntityEmptyState),{"action-button-text":e.unref(s)("gateway_services.empty_state_v2.create"),appearance:"secondary","can-create":()=>n.canCreate(),"data-testid":"gateway-services-entity-empty-state",description:e.unref(s)("gateway_services.empty_state_v2.description"),"learn-more":n.config.app==="konnect",title:e.unref(s)("gateway_services.empty_state_v2.title"),"onClick:create":T,"onClick:learnMore":m[3]||(m[3]=o=>u.$emit("click:learn-more"))},e.createSlots({image:e.withCtx(()=>[e.createElementVNode("div",Ae,[e.createVNode(e.unref(he.ServicesIcon),{color:e.unref(Te),size:e.unref(Fe)},null,8,["color","size"])])]),_:2},[(w=n.config)!=null&&w.isControlPlaneGroup?{name:"message",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("gateway_services.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["action-button-text","can-create","description","learn-more","title"])]}),key:"1"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),e.createVNode(e.unref(_.EntityToggleModal),{action:X.value.action,"entity-id":X.value.id,"entity-name":X.value.name,"entity-type":e.unref(s)("glossary.gateway_services"),"on-confirm":ue,visible:re.value,onCancel:H,onProceed:H},null,8,["action","entity-id","entity-name","entity-type","visible"]),e.createVNode(e.unref(_.EntityDeleteModal),{"action-pending":z.value,description:e.unref(s)("actions.delete.description"),"entity-name":K.value&&(K.value.name||K.value.id),"entity-type":e.unref(_.EntityTypes).GatewayService,error:Y.value,title:e.unref(s)("actions.delete.title"),visible:W.value,onCancel:v,onProceed:q},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),Ce=(n,B)=>{const g=n.__vccOpts||n;for(const[p,s]of B)g[p]=s;return g},De=Ce(Me,[["__scopeId","data-v-4adf4f7a"]]),Ke={class:"kong-ui-entities-gateway-service-form"},We={key:0},Le={class:"gateway-service-form-traffic-label"},qe={class:"gateway-service-form-margin-bottom"},Ge={key:0,class:"gateway-service-form-group-fields"},Oe={key:1,class:"gateway-service-form-group-fields"},je={key:0},ze={class:"gateway-service-form-margin-top"},He={class:"gateway-service-form-margin-bottom"},Ze={class:"gateway-service-form-margin-bottom"},Je={class:"gateway-service-form-margin-bottom"},Qe={class:"gateway-service-form-margin-bottom"},Xe={key:0,class:"gateway-service-form-margin-bottom"},Ye={key:1,class:"gateway-service-form-margin-bottom"},et={key:2,class:"gateway-service-form-margin-bottom"},tt={key:0,class:"checkbox-aligned-radio"},ot={key:1,class:"checkbox-aligned-radio"},rt=Ce(e.defineComponent({__name:"LegacyGatewayServiceForm",props:{config:{type:Object,required:!0,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)},gatewayServiceId:{type:String,required:!1,default:""},hideSectionsInfo:{type:Boolean,required:!1,default:!1}},emits:["update","error","url-valid:success","url-valid:error","loading","model-updated"],setup(n,{expose:B,emit:g}){var Y;const p=g,s=n,b=e.ref(!0),P=ke.useRouter(),{i18nT:L,i18n:{t:i}}=Z.useI18n(),{getMessageFromError:$}=_.useErrors(),{axiosInstance:k}=_.useAxios((Y=s.config)==null?void 0:Y.axiosRequestConfig),J=_.useValidators(),te=e.computed(()=>ee.form[s.config.app].edit),O=e.computed(()=>s.gatewayServiceId?_.EntityBaseFormType.Edit:_.EntityBaseFormType.Create),pe=e.ref(!1),oe=e.computed(()=>!!s.gatewayServiceId),x=e.ref(oe.value?"protocol":"url"),ae=Z.usePortFromProtocol(),M=e.ref(""),_e=e.computed(()=>!!M.value),r=e.reactive({fields:{name:"",protocol:"http",host:"",path:"",port:80,url:"",retries:5,connect_timeout:6e4,write_timeout:6e4,read_timeout:6e4,client_certificate:"",ca_certificates:"",tls_verify_enabled:!1,tls_verify_value:!1,tags:""},isReadonly:!1,errorMessage:""}),h=e.reactive({name:"",protocol:"http",host:"",path:"",port:80,url:"",retries:5,connect_timeout:6e4,write_timeout:6e4,read_timeout:6e4,client_certificate:"",ca_certificates:"",tls_verify_enabled:!1,tls_verify_value:!1,tags:""}),Q=s.config.app==="konnect"||_.useGatewayFeatureSupported({gatewayInfo:s.config.gatewayInfo,supportedRange:{enterprise:["3.0"]}}),ne=[{label:i("gateway_services.form.fields.protocol.options.http"),value:"http",group:"http"},{label:i("gateway_services.form.fields.protocol.options.https"),value:"https",group:"http"},{label:i("gateway_services.form.fields.protocol.options.tcp"),value:"tcp",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.tls"),value:"tls",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.tls_passthrough"),value:"tls_passthrough",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.grpc"),value:"grpc",group:"grpc"},{label:i("gateway_services.form.fields.protocol.options.grpcs"),value:"grpcs",group:"grpc"},...Q?[{label:i("gateway_services.form.fields.protocol.options.ws"),value:"ws",group:"websocket"},{label:i("gateway_services.form.fields.protocol.options.wss"),value:"wss",group:"websocket"}]:[],{label:i("gateway_services.form.fields.protocol.options.udp"),value:"udp",group:"udp"}],me={url:"url",protocol:"protocol"},t=(l,d)=>{d.value},E=l=>l?parseFloat(l):0,re=()=>{b.value=!0,r.errorMessage="",r.fields.host=h.host,r.fields.path=h.path,r.fields.port=h.port,r.fields.protocol=h.protocol,r.fields.url=h.url,r.fields.retries=h.retries,r.fields.connect_timeout=h.connect_timeout,r.fields.write_timeout=h.write_timeout,r.fields.read_timeout=h.read_timeout,r.fields.client_certificate=h.client_certificate,r.fields.ca_certificates=h.ca_certificates,r.fields.tls_verify_enabled=h.tls_verify_enabled,r.fields.tls_verify_value=h.tls_verify_value},U=()=>{if(r.fields.url&&x.value==="url")try{const l=new URL(r.fields.url);r.errorMessage="",r.fields.protocol=l.protocol.slice(0,-1),r.fields.host=l.hostname,r.fields.path=l.pathname;const d=Number(l.port);pe.value=!!d,r.fields.port=d||ae.getPortFromProtocol(r.fields.protocol),r.errorMessage="",p("url-valid:success")}catch(l){r.errorMessage=i("errors.urlErrorMessage"),p("url-valid:error",$(l))}else p("url-valid:success"),r.errorMessage=""},X=e.computed(()=>!["tcp","tls","tls_passthrough","grpc","grpcs","udp"].includes(r.fields.protocol)),be=e.computed(()=>{if(x.value==="url")return!0;const l=["https","wss","tls"].includes(r.fields.protocol);return x.value==="protocol"&&l}),H=e.computed(()=>{if(x.value==="url")return!0;const l=["https","tls"].includes(r.fields.protocol);return x.value==="protocol"&&l}),ue=e.computed(()=>{if(x.value==="url")return!0;const l=["https","wss","tls"].includes(r.fields.protocol);return x.value==="protocol"&&l}),ge=l=>{M.value=J.utf8Name(l)},le=e.computed(()=>oe.value&&JSON.stringify(r.fields)!==JSON.stringify(h)||x.value==="url"&&!!r.fields.url||x.value==="protocol"&&!!r.fields.host),ce=l=>{var d,v,q;r.fields.name=(l==null?void 0:l.name)||"",r.fields.tags=((d=l==null?void 0:l.tags)==null?void 0:d.join(", "))||"",r.fields.protocol=(l==null?void 0:l.protocol)||"http",r.fields.path=(l==null?void 0:l.path)||"",r.fields.read_timeout=l!=null&&l.read_timeout||(l==null?void 0:l.read_timeout)===0?l==null?void 0:l.read_timeout:6e4,r.fields.retries=l!=null&&l.retries||(l==null?void 0:l.retries)===0?l==null?void 0:l.retries:5,r.fields.host=(l==null?void 0:l.host)||"",r.fields.connect_timeout=l!=null&&l.connect_timeout||(l==null?void 0:l.connect_timeout)===0?l==null?void 0:l.connect_timeout:6e4,r.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,r.fields.tls_verify_value=l!=null&&l.tls_verify?l==null?void 0:l.tls_verify:!1,r.fields.ca_certificates=((v=l==null?void 0:l.ca_certificates)==null?void 0:v.join(","))||"",r.fields.client_certificate=((q=l==null?void 0:l.client_certificate)==null?void 0:q.id)||"",r.fields.write_timeout=l!=null&&l.write_timeout||(l==null?void 0:l.write_timeout)===0?l==null?void 0:l.write_timeout:6e4,r.fields.port=l!=null&&l.port||(l==null?void 0:l.port)===0?l==null?void 0:l.port:80,Object.assign(h,r.fields)},de=()=>{P.push(s.config.cancelRoute)},we=e.computed(()=>{var d,v;let l=`${s.config.apiBaseUrl}${ee.form[s.config.app].validate}`;return s.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((d=s.config)==null?void 0:d.controlPlaneId)||""):s.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(v=s.config)!=null&&v.workspace?`/${s.config.workspace}`:"")),l=l.replace(/{id}/gi,s.gatewayServiceId),l}),j=e.computed(()=>{var d,v;let l=`${s.config.apiBaseUrl}${ee.form[s.config.app][O.value]}`;return s.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((d=s.config)==null?void 0:d.controlPlaneId)||""):s.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(v=s.config)!=null&&v.workspace?`/${s.config.workspace}`:"")),l=l.replace(/{id}/gi,s.gatewayServiceId),l}),K=l=>{let d="";l.url&&(d=new URL(l.url).protocol),(["https","wss","tls"].includes(l.protocol)||["https","wss","tls"].includes(d))&&(l.tls_verify=l.tls_verify_enabled?l.tls_verify_value:null),delete l.tls_verify_enabled,delete l.tls_verify_value},W=e.computed(()=>{var d,v,q,T;const l={name:r.fields.name||null,tags:r.fields.tags?(q=(v=(d=r.fields.tags)==null?void 0:d.split(","))==null?void 0:v.map(S=>String(S||"").trim()))==null?void 0:q.filter(S=>S!==""):null,protocol:r.fields.protocol,path:r.fields.path||null,read_timeout:r.fields.read_timeout,retries:r.fields.retries,host:r.fields.host,connect_timeout:r.fields.connect_timeout,tls_verify_value:r.fields.tls_verify_value,tls_verify_enabled:r.fields.tls_verify_enabled,ca_certificates:r.fields.ca_certificates?(T=r.fields.ca_certificates)==null?void 0:T.split(",").filter(S=>S!==""):null,client_certificate:r.fields.client_certificate?{id:r.fields.client_certificate}:null,write_timeout:r.fields.write_timeout,port:r.fields.port,url:r.fields.url};return r.fields.client_certificate&&["https","wss","tls"].includes(r.fields.protocol)&&(l.client_certificate={id:r.fields.client_certificate}),r.fields.tls_verify_enabled&&["https","wss","tls"].includes(r.fields.protocol)&&(l.tls_verify=r.fields.tls_verify_value),X.value||(l.path=null),O.value==="create"?x.value==="url"?(delete l.protocol,delete l.host,delete l.path,s.config.app==="konnect"&&delete l.port):delete l.url:O.value==="edit"&&delete l.url,l}),z=async()=>{var l,d,v,q;try{r.isReadonly=!0,U();const T=W.value;K(T);let S;if(await k.post(we.value,T),O.value==="create"?S=await k.post(j.value,T):O.value==="edit"&&(S=((l=s.config)==null?void 0:l.app)==="konnect"?await k.put(j.value,T):await k.patch(j.value,T)),S){const{data:c}=S;r.fields.name=(c==null?void 0:c.name)||"",r.fields.port=c.port||ae.getPortFromProtocol(c.protocol),r.fields.protocol=(c==null?void 0:c.protocol)||"http",r.fields.host=(c==null?void 0:c.host)||"",r.fields.path=(c==null?void 0:c.path)||"",r.fields.url=(c==null?void 0:c.url)||"",r.fields.retries=c!=null&&c.retries||(c==null?void 0:c.retries)===0?c==null?void 0:c.retries:5,r.fields.connect_timeout=c!=null&&c.connect_timeout||(c==null?void 0:c.connect_timeout)===0?c==null?void 0:c.connect_timeout:6e4,r.fields.write_timeout=c!=null&&c.write_timeout||(c==null?void 0:c.write_timeout)===0?c==null?void 0:c.write_timeout:6e4,r.fields.read_timeout=c!=null&&c.read_timeout||(c==null?void 0:c.read_timeout)===0?c==null?void 0:c.read_timeout:6e4,r.fields.client_certificate=((d=c==null?void 0:c.client_certificate)==null?void 0:d.id)||"",r.fields.ca_certificates=(v=c==null?void 0:c.ca_certificates)!=null&&v.length?c==null?void 0:c.ca_certificates.join(","):"",r.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,r.fields.tls_verify_value=r.fields.tls_verify_enabled&&(c==null?void 0:c.tls_verify),r.fields.tags=(q=c==null?void 0:c.tags)!=null&&q.length?c.tags.join(", "):"",Object.assign(h,r.fields),p("update",S==null?void 0:S.data)}return S}catch(T){r.errorMessage=$(T),p("error",T)}finally{r.isReadonly=!1}};return e.watch(()=>s.gatewayServiceId,()=>{Object.assign(r.fields,h)}),e.watch(r.fields,l=>{r.fields.port=ae.getPortFromProtocol(l.protocol,String(l.port)),p("model-updated",W.value)}),e.onMounted(()=>{p("model-updated",W.value)}),B({validateUrl:U,getPayload:W,saveFormData:z,canSubmit:le,initForm:ce}),(l,d)=>{const v=e.resolveComponent("KInput"),q=e.resolveComponent("KLabel"),T=e.resolveComponent("KRadio"),S=e.resolveComponent("KSelect"),c=e.resolveComponent("KCheckbox"),u=e.resolveComponent("KCollapse");return e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(e.unref(_.EntityBaseForm),{"can-submit":le.value,config:n.config,"edit-id":n.gatewayServiceId,"entity-type":e.unref(_.SupportedEntityType).GatewayService,"error-message":r.errorMessage,"fetch-url":te.value,"form-fields":W.value,"is-readonly":r.isReadonly,onCancel:de,"onFetch:error":d[25]||(d[25]=m=>l.$emit("error",m)),"onFetch:success":ce,onLoading:d[26]||(d[26]=m=>l.$emit("loading",m)),onSubmit:z},{"form-actions":e.withCtx(()=>[e.renderSlot(l.$slots,"form-actions",{canSubmit:le.value,cancel:de,submit:z},void 0,!0)]),default:e.withCtx(()=>[e.createVNode(e.unref(_.EntityFormSection),{description:e.unref(i)("gateway_services.form.sections.general.description"),"hide-info-header":n.hideSectionsInfo,title:e.unref(i)("gateway_services.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(v,{modelValue:r.fields.name,"onUpdate:modelValue":d[0]||(d[0]=m=>r.fields.name=m),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-name-input",error:_e.value,"error-message":M.value,label:e.unref(i)("gateway_services.form.fields.name.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.name.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"name",placeholder:e.unref(i)("gateway_services.form.fields.name.placeholder"),readonly:r.isReadonly,type:"text",onInput:ge},null,8,["modelValue","error","error-message","label","label-attributes","placeholder","readonly"]),e.createVNode(v,{modelValue:r.fields.tags,"onUpdate:modelValue":d[1]||(d[1]=m=>r.fields.tags=m),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-tags-input",help:e.unref(i)("gateway_services.form.fields.tags.help"),label:e.unref(i)("gateway_services.form.fields.tags.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"tags",placeholder:e.unref(i)("gateway_services.form.fields.tags.placeholder"),readonly:r.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","hide-info-header","title"]),e.createVNode(e.unref(_.EntityFormSection),{description:e.unref(i)("gateway_services.form.sections.keys.description"),"hide-info-header":n.hideSectionsInfo,title:e.unref(i)("gateway_services.form.sections.keys.title")},{default:e.withCtx(()=>[oe.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",Le,[e.createVNode(q,{required:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.sections.keys.checkedGroupLabel")),1)]),_:1})]),e.createElementVNode("div",qe,[e.createVNode(T,{modelValue:x.value,"onUpdate:modelValue":d[2]||(d[2]=m=>x.value=m),"data-testid":"gateway-service-url-radio","selected-value":me.url,onChange:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.sections.keys.urlLabel")),1)]),_:1},8,["modelValue","selected-value"])]),x.value==="url"?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(v,{modelValue:r.fields.url,"onUpdate:modelValue":d[3]||(d[3]=m=>r.fields.url=m),modelModifiers:{trim:!0},class:"gateway-service-url-input gateway-service-form-margin-bottom","data-testid":"gateway-service-url-input",label:e.unref(i)("gateway_services.form.fields.upstream_url.label"),"label-attributes":{info:n.config.app==="konnect"?e.unref(i)("gateway_services.form.fields.upstream_url.tooltip_for_konnect"):e.unref(i)("gateway_services.form.fields.upstream_url.tooltip_for_km"),tooltipAttributes:{maxWidth:"400"}},name:"url",placeholder:e.unref(i)("gateway_services.form.fields.upstream_url.placeholder"),required:""},null,8,["modelValue","label","label-attributes","placeholder"])])):e.createCommentVNode("",!0),e.createVNode(T,{modelValue:x.value,"onUpdate:modelValue":d[4]||(d[4]=m=>x.value=m),"checked-group":"protocol","data-testid":"gateway-service-protocol-radio","selected-value":me.protocol,onChange:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.sections.keys.checkedGroupAltLabel")),1)]),_:1},8,["modelValue","selected-value"])])),x.value==="protocol"||oe.value?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(S,{modelValue:r.fields.protocol,"onUpdate:modelValue":d[5]||(d[5]=m=>r.fields.protocol=m),"data-testid":"gateway-service-protocol-select",items:ne,label:e.unref(i)("gateway_services.form.fields.protocol.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.protocol.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:r.isReadonly,required:"",width:"100%",onSelected:d[6]||(d[6]=m=>t(r.fields.protocol,m))},null,8,["modelValue","label","label-attributes","readonly"]),e.createVNode(v,{modelValue:r.fields.host,"onUpdate:modelValue":d[7]||(d[7]=m=>r.fields.host=m),modelModifiers:{trim:!0},class:"gateway-service-form-margin-top","data-testid":"gateway-service-host-input",label:e.unref(i)("gateway_services.form.fields.host.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.host.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"host",placeholder:e.unref(i)("gateway_services.form.fields.host.placeholder"),required:""},null,8,["modelValue","label","label-attributes","placeholder"]),X.value?(e.openBlock(),e.createElementBlock("div",je,[e.createVNode(v,{modelValue:r.fields.path,"onUpdate:modelValue":d[8]||(d[8]=m=>r.fields.path=m),modelModifiers:{trim:!0},class:"gateway-service-form-margin-top","data-testid":"gateway-service-path-input",label:e.unref(i)("gateway_services.form.fields.path.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.path.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"path",placeholder:e.unref(i)("gateway_services.form.fields.path.placeholder")},null,8,["modelValue","label","label-attributes","placeholder"])])):e.createCommentVNode("",!0),e.createVNode(v,{modelValue:r.fields.port,"onUpdate:modelValue":[d[9]||(d[9]=m=>r.fields.port=m),d[10]||(d[10]=()=>{r.fields.port=E(r.fields.port+"")})],class:"gateway-service-form-margin-top","data-testid":"gateway-service-port-input",label:e.unref(i)("gateway_services.form.fields.port.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.port.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"port",type:"number"},null,8,["modelValue","label","label-attributes"])])):e.createCommentVNode("",!0),e.createVNode(u,{modelValue:b.value,"onUpdate:modelValue":d[24]||(d[24]=m=>b.value=m),"data-testid":"advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(i)("gateway_services.form.sections.keys.viewAdvancedFields")},{default:e.withCtx(()=>[e.createElementVNode("div",ze,[e.createElementVNode("div",He,[e.createVNode(v,{modelValue:r.fields.retries,"onUpdate:modelValue":[d[11]||(d[11]=m=>r.fields.retries=m),d[12]||(d[12]=()=>{r.fields.retries=E(r.fields.retries+"")})],autocomplete:"off","data-testid":"gateway-service-retries-input",label:e.unref(i)("gateway_services.form.fields.retries.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.retries.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"retries",readonly:r.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",Ze,[e.createVNode(v,{modelValue:r.fields.connect_timeout,"onUpdate:modelValue":[d[13]||(d[13]=m=>r.fields.connect_timeout=m),d[14]||(d[14]=()=>{r.fields.connect_timeout=E(r.fields.connect_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-connTimeout-input",label:e.unref(i)("gateway_services.form.fields.connect_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.connect_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"connTimeout",readonly:r.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",Je,[e.createVNode(v,{modelValue:r.fields.write_timeout,"onUpdate:modelValue":[d[15]||(d[15]=m=>r.fields.write_timeout=m),d[16]||(d[16]=()=>{r.fields.write_timeout=E(r.fields.write_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-writeTimeout-input",label:e.unref(i)("gateway_services.form.fields.write_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.write_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"writeTimeout",readonly:r.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",Qe,[e.createVNode(v,{modelValue:r.fields.read_timeout,"onUpdate:modelValue":[d[17]||(d[17]=m=>r.fields.read_timeout=m),d[18]||(d[18]=()=>{r.fields.read_timeout=E(r.fields.read_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-readTimeout-input",label:e.unref(i)("gateway_services.form.fields.read_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.read_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"readTimeout",readonly:r.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),be.value?(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(v,{modelValue:r.fields.client_certificate,"onUpdate:modelValue":d[19]||(d[19]=m=>r.fields.client_certificate=m),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-clientCert-input",label:e.unref(i)("gateway_services.form.fields.client_certificate.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"clientCert",placeholder:e.unref(i)("gateway_services.form.fields.client_certificate.placeholder"),readonly:r.isReadonly,type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"])])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",Ye,[e.createVNode(v,{modelValue:r.fields.ca_certificates,"onUpdate:modelValue":d[20]||(d[20]=m=>r.fields.ca_certificates=m),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-ca-certs-input",label:e.unref(i)("gateway_services.form.fields.ca_certificates.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(i)("gateway_services.form.fields.ca_certificates.placeholder"),readonly:r.isReadonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(L),{keypath:"gateway_services.form.fields.ca_certificates.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.ca_certificates.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.ca_certificates.code2")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])])):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",et,[e.createVNode(c,{modelValue:r.fields.tls_verify_enabled,"onUpdate:modelValue":d[21]||(d[21]=m=>r.fields.tls_verify_enabled=m),"data-testid":"gateway-service-tls-verify-checkbox",description:e.unref(i)("gateway_services.form.fields.tls_verify_enabled.help"),label:e.unref(i)("gateway_services.form.fields.tls_verify_enabled.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}}},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(L),{keypath:"gateway_services.form.fields.tls_verify_enabled.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.tls_verify_enabled.code1")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),r.fields.tls_verify_enabled?(e.openBlock(),e.createElementBlock("div",tt,[e.createVNode(T,{modelValue:r.fields.tls_verify_value,"onUpdate:modelValue":d[22]||(d[22]=m=>r.fields.tls_verify_value=m),"data-testid":"gateway-service-tls-verify-true-option",label:e.unref(i)("gateway_services.form.fields.tls_verify_option.true.label"),"selected-value":!0},null,8,["modelValue","label"])])):e.createCommentVNode("",!0),r.fields.tls_verify_enabled?(e.openBlock(),e.createElementBlock("div",ot,[e.createVNode(T,{modelValue:r.fields.tls_verify_value,"onUpdate:modelValue":d[23]||(d[23]=m=>r.fields.tls_verify_value=m),"data-testid":"gateway-service-tls-verify-false-option",label:e.unref(i)("gateway_services.form.fields.tls_verify_option.false.label"),"selected-value":!1},null,8,["modelValue","label"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","trigger-label"])]),_:1},8,["description","hide-info-header","title"])]),_:3},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-c2c5e1f0"]]),lt={class:"kong-ui-gateway-service-entity-config-card"},it=e.defineComponent({__name:"GatewayServiceConfigCard",props:{config:{type:Object,required:!0,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.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(n){const B=n,{i18n:{t:g},i18nT:p}=Z.useI18n(),s=e.computed(()=>ee.form[B.config.app].edit),{getPropValue:b}=_.useHelpers(),P=(i,$)=>b(i,$)===!0?g("gateway_services.form.fields.tls_verify_option.true.display"):g("gateway_services.form.fields.tls_verify_option.false.display"),L=e.ref({id:{},name:{tooltip:g("gateway_services.form.fields.name.tooltip")},enabled:{},updated_at:{},created_at:{},protocol:{section:_.ConfigurationSchemaSection.Basic,tooltip:g("gateway_services.form.fields.protocol.tooltip")},host:{section:_.ConfigurationSchemaSection.Basic,tooltip:g("gateway_services.form.fields.host.tooltip")},path:{section:_.ConfigurationSchemaSection.Basic,tooltip:g("gateway_services.form.fields.path.tooltip")},port:{section:_.ConfigurationSchemaSection.Basic,tooltip:g("gateway_services.form.fields.port.tooltip")},tags:{tooltip:g("gateway_services.form.fields.tags.tooltip")},retries:{order:1,tooltip:g("gateway_services.form.fields.retries.tooltip")},connect_timeout:{order:2,tooltip:g("gateway_services.form.fields.connect_timeout.tooltip")},write_timeout:{order:3,tooltip:g("gateway_services.form.fields.write_timeout.tooltip")},read_timeout:{order:4,tooltip:g("gateway_services.form.fields.read_timeout.tooltip")},client_certificate:{order:5,tooltip:g("gateway_services.form.fields.client_certificate.tooltip")},ca_certificates:{type:_.ConfigurationSchemaType.BadgeTag,label:g("gateway_services.form.fields.ca_certificates.label"),order:6},tls_verify:{label:g("gateway_services.form.fields.tls_verify_enabled.label")},tls_verify_depth:{hidden:!0}});return(i,$)=>(e.openBlock(),e.createElementBlock("div",lt,[e.createVNode(e.unref(_.EntityBaseConfigCard),{config:n.config,"config-card-doc":n.configCardDoc,"config-schema":L.value,"entity-type":e.unref(_.SupportedEntityType).GatewayService,"fetch-url":s.value,"hide-title":n.hideTitle,"onFetch:error":$[0]||($[0]=k=>i.$emit("fetch:error",k)),"onFetch:success":$[1]||($[1]=k=>i.$emit("fetch:success",k)),onLoading:$[2]||($[2]=k=>i.$emit("loading",k))},{"enabled-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"gateway_services.form.fields.enabled.tooltip",scope:"global"},{false:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.enabled.false")),1)]),true:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.enabled.true")),1)]),_:1})]),"ca_certificates-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"gateway_services.form.fields.ca_certificates.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.ca_certificates.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.ca_certificates.code2")),1)]),_:1})]),"tls_verify-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"gateway_services.form.fields.tls_verify_enabled.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.tls_verify_enabled.code1")),1)]),_:1})]),tls_verify:e.withCtx(k=>[e.createTextVNode(e.toDisplayString(typeof e.unref(b)("rowValue",k)=="boolean"?P("rowValue",k):e.unref(g)("gateway_services.form.fields.tls_verify_option.unset.display")),1)]),client_certificate:e.withCtx(k=>[e.createTextVNode(e.toDisplayString(e.unref(b)("rowValue",k)?e.unref(b)("rowValue",k).id:"–"),1)]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const xe=()=>{};function st(n,B){function g(...p){return new Promise((s,b)=>{Promise.resolve(n(()=>B.apply(this,p),{fn:B,thisArg:this,args:p})).then(s).catch(b)})}return g}function at(n,B={}){let g,p,s=xe;const b=i=>{clearTimeout(i),s(),s=xe};let P;return i=>{const $=e.toValue(n),k=e.toValue(B.maxWait);return g&&b(g),$<=0||k!==void 0&&k<=0?(p&&(b(p),p=null),Promise.resolve(i())):new Promise((J,te)=>{s=B.rejectOnCancel?te:J,P=i,k&&!p&&(p=setTimeout(()=>{g&&b(g),p=null,J(P())},k)),g=setTimeout(()=>{p&&b(p),p=null,J(i())},$)})}}function Ne(n,B=200,g={}){return st(at(B,g),n)}const G={name:"Kong-Air-Flights-API",tags:[],protocol:"https",path:"/flights",read_timeout:6e4,retries:5,host:"api.kong-air.com",connect_timeout:6e4,ca_certificates:null,client_certificate:null,write_timeout:6e4,port:443},nt={class:"kong-ui-entities-gateway-service-form"},ct={key:0,class:"gateway-service-form-general-info"},dt={class:"gateway-service-form-group-selection-wrapper"},ft={key:0,class:"gateway-service-form-group-fields"},pt={key:0,class:"gateway-service-form-group-fields"},mt={key:0},ut={key:0,class:"gateway-service-form-advanced-fields"},gt={class:"gateway-service-form-margin-bottom"},yt={class:"gateway-service-form-margin-bottom"},_t={class:"gateway-service-form-margin-bottom"},bt={class:"gateway-service-form-margin-bottom"},wt={key:0,class:"gateway-service-form-margin-bottom"},ht={key:1,class:"gateway-service-form-margin-bottom"},vt={key:2,class:"gateway-service-form-margin-bottom"},Vt={key:0,class:"checkbox-aligned-radio"},kt={key:1,class:"checkbox-aligned-radio"},Ct={class:"gateway-service-form-tags"},Nt={class:"form-error-list"},Et=Ce(e.defineComponent({__name:"GatewayServiceForm",props:{config:{type:Object,required:!0,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)},gatewayServiceId:{type:String,required:!1,default:""},hideSectionsInfo:{type:Boolean,required:!1,default:!1},hideTrySampleApiButton:{type:Boolean,required:!1,default:!1}},emits:["update","error","url-valid:success","url-valid:error","loading","model-updated","try-sample-api"],setup(n,{expose:B,emit:g}){var w;const p=g,s=n,b=e.ref(!0),P=ke.useRouter(),{i18nT:L,i18n:{t:i}}=Z.useI18n(),{getErrorFieldsFromError:$}=_.useErrors(),{axiosInstance:k}=_.useAxios((w=s.config)==null?void 0:w.axiosRequestConfig),J=_.useValidators(),{validateHost:te,validatePath:O,validatePort:pe,validateProtocol:oe}=Z.useUrlValidators(),{objectsAreEqual:x}=_.useHelpers(),ae=e.computed(()=>ee.form[s.config.app].edit),M=e.computed(()=>s.gatewayServiceId?_.EntityBaseFormType.Edit:_.EntityBaseFormType.Create),_e=e.ref(!1),r=e.computed(()=>!!s.gatewayServiceId),h=e.ref(r.value?"protocol":"url"),Q=Z.usePortFromProtocol(),ne=e.ref(""),me=e.computed(()=>!!ne.value||!!j("name")),t=e.reactive({fields:{name:"",protocol:"http",host:"",path:"",port:80,url:"",retries:5,connect_timeout:6e4,write_timeout:6e4,read_timeout:6e4,client_certificate:"",ca_certificates:"",tls_verify_enabled:!1,tls_verify_value:!1,tags:""},isReadonly:!1,errorMessages:[],formFieldErrors:{host:"",port:"",path:"",name:"",url:"",tags:"",retries:"",connect_timeout:"",write_timeout:"",read_timeout:"",client_certificate:"",ca_certificates:"",tls_verify_enabled:"",tls_verify_value:""}}),E=e.reactive({name:"",protocol:"http",host:"",path:"",port:80,url:"",retries:5,connect_timeout:6e4,write_timeout:6e4,read_timeout:6e4,client_certificate:"",ca_certificates:"",tls_verify_enabled:!1,tls_verify_value:!1,tags:""}),re=s.config.app==="konnect"||_.useGatewayFeatureSupported({gatewayInfo:s.config.gatewayInfo,supportedRange:{enterprise:["3.0"]}}),U=[{label:i("gateway_services.form.fields.protocol.options.http"),value:"http",group:"http"},{label:i("gateway_services.form.fields.protocol.options.https"),value:"https",group:"http"},{label:i("gateway_services.form.fields.protocol.options.tcp"),value:"tcp",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.tls"),value:"tls",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.tls_passthrough"),value:"tls_passthrough",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.grpc"),value:"grpc",group:"grpc"},{label:i("gateway_services.form.fields.protocol.options.grpcs"),value:"grpcs",group:"grpc"},...re?[{label:i("gateway_services.form.fields.protocol.options.ws"),value:"ws",group:"websocket"},{label:i("gateway_services.form.fields.protocol.options.wss"),value:"wss",group:"websocket"}]:[],{label:i("gateway_services.form.fields.protocol.options.udp"),value:"udp",group:"udp"}],X={url:"url",protocol:"protocol"},be=(o,a)=>{a.value},H=o=>o?parseFloat(o):0,ue=()=>{t.fields.host=E.host,t.fields.path=E.path,t.fields.port=E.port,t.fields.protocol=E.protocol,t.fields.url=E.url,t.fields.retries=E.retries,t.fields.connect_timeout=E.connect_timeout,t.fields.write_timeout=E.write_timeout,t.fields.read_timeout=E.read_timeout,t.fields.client_certificate=E.client_certificate,t.fields.ca_certificates=E.ca_certificates,t.fields.tls_verify_enabled=E.tls_verify_enabled,t.fields.tls_verify_value=E.tls_verify_value},ge=()=>{b.value=!0,W(),t.errorMessages=[],ue()},le=()=>{switch(ue(),t.fields.name=`${G.name}-${new Date().toISOString().replace(/\D/g,"").slice(0,17)}`,h.value){case"url":t.fields.url=`${G.protocol}://${G.host}${G.path}`;break;case"protocol":t.fields.host=G.host,t.fields.path=G.path,t.fields.protocol=G.protocol,t.fields.port=G.port;break;default:t.fields.url=`${G.protocol}://${G.host}${G.path}`}},ce=Ne(()=>{if(W(),t.fields.url.length)try{const o=new URL(t.fields.url),a=oe(o.protocol,U);if(a)throw new Error(a);t.fields.protocol=o.protocol.slice(0,-1);const C=te(o.hostname);if(C)throw new Error(C);t.fields.host=o.hostname;const R=O(o.pathname);if(R)throw new Error(R);t.fields.path=o.pathname;const N=pe(o.port);if(N)throw new Error(N);const I=Number(o.port);_e.value=!!I,t.fields.port=I||Q.getPortFromProtocol(t.fields.protocol),p("url-valid:success")}catch{p("url-valid:error",i("gateway_services.form.errors.url.invalid")),t.formFieldErrors.url=i("gateway_services.form.errors.url.invalid")}},300),de=Ne(o=>{W(o)},300),we=e.computed(()=>!!t.formFieldErrors.url||!!t.formFieldErrors.host||!!t.formFieldErrors.port),j=o=>{if(t.errorMessages.length)return"";const a=t.formFieldErrors;return a[o]?a[o]:""},K=Ne(o=>{W(o??void 0);const a=te(t.fields.host);a&&(t.formFieldErrors.host=a);const C=O(t.fields.path);C&&(t.formFieldErrors.path=C);const R=pe(t.fields.port);R&&(t.formFieldErrors.port=R),z.value?p("url-valid:success"):p("url-valid:error",t.errorMessages.join(",")||i("gateway_services.form.errors.url.invalid"))},300),W=o=>{if(o)t.formFieldErrors[o]="";else for(let a in t.formFieldErrors)t.formFieldErrors[a]="";t.errorMessages=[]},z=e.computed(()=>{for(let o in t.formFieldErrors)if(t.formFieldErrors[o].length)return!1;return!0}),Y=()=>{t.fields.url&&h.value==="url"?ce():K()},l=()=>`new-service-${new Date().toISOString().replace(/\D/g,"").slice(0,17)}`,d=e.computed(()=>!["tcp","tls","tls_passthrough","grpc","grpcs","udp"].includes(t.fields.protocol)),v=e.computed(()=>{if(h.value==="url")return!0;const o=["https","wss","tls"].includes(t.fields.protocol);return h.value==="protocol"&&o}),q=e.computed(()=>{if(h.value==="url")return!0;const o=["https","tls"].includes(t.fields.protocol);return h.value==="protocol"&&o}),T=e.computed(()=>{if(h.value==="url")return!0;const o=["https","wss","tls"].includes(t.fields.protocol);return h.value==="protocol"&&o}),S=o=>{W("name"),ne.value=J.utf8Name(o)},c=e.computed(()=>{const o=!r.value||!x(t.fields,E),a=h.value==="url"&&!!t.fields.url&&z.value,C=h.value==="protocol"&&!!t.fields.host&&z.value;return o&&(a||C)}),u=o=>{var a,C,R;t.fields.name=(o==null?void 0:o.name)||"",t.fields.tags=((a=o==null?void 0:o.tags)==null?void 0:a.join(", "))||"",t.fields.protocol=(o==null?void 0:o.protocol)||"http",t.fields.path=(o==null?void 0:o.path)||"",t.fields.read_timeout=o!=null&&o.read_timeout||(o==null?void 0:o.read_timeout)===0?o==null?void 0:o.read_timeout:6e4,t.fields.retries=o!=null&&o.retries||(o==null?void 0:o.retries)===0?o==null?void 0:o.retries:5,t.fields.host=(o==null?void 0:o.host)||"",t.fields.connect_timeout=o!=null&&o.connect_timeout||(o==null?void 0:o.connect_timeout)===0?o==null?void 0:o.connect_timeout:6e4,t.fields.tls_verify_enabled=(o==null?void 0:o.tls_verify)!==""&&(o==null?void 0:o.tls_verify)!==null&&(o==null?void 0:o.tls_verify)!==void 0,t.fields.tls_verify_value=o!=null&&o.tls_verify?o==null?void 0:o.tls_verify:!1,t.fields.ca_certificates=((C=o==null?void 0:o.ca_certificates)==null?void 0:C.join(","))||"",t.fields.client_certificate=((R=o==null?void 0:o.client_certificate)==null?void 0:R.id)||"",t.fields.write_timeout=o!=null&&o.write_timeout||(o==null?void 0:o.write_timeout)===0?o==null?void 0:o.write_timeout:6e4,t.fields.port=o!=null&&o.port||(o==null?void 0:o.port)===0?o==null?void 0:o.port:80,Object.assign(E,t.fields)},m=()=>{P.push(s.config.cancelRoute)},V=e.computed(()=>{var a,C;let o=`${s.config.apiBaseUrl}${ee.form[s.config.app].validate}`;return s.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((a=s.config)==null?void 0:a.controlPlaneId)||""):s.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(C=s.config)!=null&&C.workspace?`/${s.config.workspace}`:"")),o=o.replace(/{id}/gi,s.gatewayServiceId),o}),F=e.computed(()=>{var a,C;let o=`${s.config.apiBaseUrl}${ee.form[s.config.app][M.value]}`;return s.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((a=s.config)==null?void 0:a.controlPlaneId)||""):s.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(C=s.config)!=null&&C.workspace?`/${s.config.workspace}`:"")),o=o.replace(/{id}/gi,s.gatewayServiceId),o}),ie=o=>{let a="";o.url&&(a=new URL(o.url).protocol),(["https","wss","tls"].includes(o.protocol)||["https","wss","tls"].includes(a))&&(o.tls_verify=o.tls_verify_enabled?o.tls_verify_value:null),delete o.tls_verify_enabled,delete o.tls_verify_value},A=e.computed(()=>{var a,C,R,N;const o={name:t.fields.name||null,tags:t.fields.tags?(R=(C=(a=t.fields.tags)==null?void 0:a.split(","))==null?void 0:C.map(I=>String(I||"").trim()))==null?void 0:R.filter(I=>I!==""):null,protocol:t.fields.protocol,path:t.fields.path||null,read_timeout:t.fields.read_timeout,retries:t.fields.retries,host:t.fields.host,connect_timeout:t.fields.connect_timeout,tls_verify_value:t.fields.tls_verify_value,tls_verify_enabled:t.fields.tls_verify_enabled,ca_certificates:t.fields.ca_certificates?(N=t.fields.ca_certificates)==null?void 0:N.split(",").filter(I=>I!==""):null,client_certificate:t.fields.client_certificate?{id:t.fields.client_certificate}:null,write_timeout:t.fields.write_timeout,port:t.fields.port,url:t.fields.url};return t.fields.client_certificate&&["https","wss","tls"].includes(t.fields.protocol)&&(o.client_certificate={id:t.fields.client_certificate}),t.fields.tls_verify_enabled&&["https","wss","tls"].includes(t.fields.protocol)&&(o.tls_verify=t.fields.tls_verify_value),d.value||(o.path=null),M.value==="create"?h.value==="url"?(delete o.protocol,delete o.host,delete o.path,s.config.app==="konnect"&&delete o.port):delete o.url:M.value==="edit"&&delete o.url,o}),se=async()=>{var o,a,C,R;try{t.isReadonly=!0,Y();const N=A.value;ie(N);let I;if(await k.post(V.value,N),M.value==="create"?I=await k.post(F.value,N):M.value==="edit"&&(I=((o=s.config)==null?void 0:o.app)==="konnect"?await k.put(F.value,N):await k.patch(F.value,N)),I){const{data:f}=I;t.fields.name=(f==null?void 0:f.name)||"",t.fields.port=f.port||Q.getPortFromProtocol(f.protocol),t.fields.protocol=(f==null?void 0:f.protocol)||"http",t.fields.host=(f==null?void 0:f.host)||"",t.fields.path=(f==null?void 0:f.path)||"",t.fields.url=(f==null?void 0:f.url)||"",t.fields.retries=f!=null&&f.retries||(f==null?void 0:f.retries)===0?f==null?void 0:f.retries:5,t.fields.connect_timeout=f!=null&&f.connect_timeout||(f==null?void 0:f.connect_timeout)===0?f==null?void 0:f.connect_timeout:6e4,t.fields.write_timeout=f!=null&&f.write_timeout||(f==null?void 0:f.write_timeout)===0?f==null?void 0:f.write_timeout:6e4,t.fields.read_timeout=f!=null&&f.read_timeout||(f==null?void 0:f.read_timeout)===0?f==null?void 0:f.read_timeout:6e4,t.fields.client_certificate=((a=f==null?void 0:f.client_certificate)==null?void 0:a.id)||"",t.fields.ca_certificates=(C=f==null?void 0:f.ca_certificates)!=null&&C.length?f==null?void 0:f.ca_certificates.join(","):"",t.fields.tls_verify_enabled=(f==null?void 0:f.tls_verify)!==""&&(f==null?void 0:f.tls_verify)!==null&&(f==null?void 0:f.tls_verify)!==void 0,t.fields.tls_verify_value=t.fields.tls_verify_enabled&&(f==null?void 0:f.tls_verify),t.fields.tags=(R=f==null?void 0:f.tags)!=null&&R.length?f.tags.join(", "):"",Object.assign(E,t.fields),p("update",I==null?void 0:I.data)}return I}catch(N){const{fields:I,messages:f}=$(N);t.errorMessages=f,I.length&&I.forEach(fe=>{const ye=fe.field;ye==="client_certificate.id"?t.formFieldErrors.client_certificate=fe.message:ye.startsWith("ca_certificates")?t.formFieldErrors.ca_certificates=fe.message:Object.keys(t.formFieldErrors).includes(ye)&&(t.formFieldErrors={...t.formFieldErrors,[ye]:fe.message})}),p("error",N)}finally{t.isReadonly=!1}};return e.watch(()=>s.gatewayServiceId,()=>{Object.assign(t.fields,E)}),e.watch(t.fields,o=>{t.fields.port=Q.getPortFromProtocol(o.protocol,String(o.port)),p("model-updated",A.value)}),e.onMounted(()=>{p("model-updated",A.value),r.value||(t.fields.name=l())}),B({validateUrl:Y,getPayload:A,saveFormData:se,canSubmit:c,initForm:u}),(o,a)=>{const C=e.resolveComponent("KRadio"),R=e.resolveComponent("KButton"),N=e.resolveComponent("KInput"),I=e.resolveComponent("KSelect"),f=e.resolveComponent("KCheckbox"),fe=e.resolveComponent("KCollapse"),ye=e.resolveComponent("KAlert");return e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(e.unref(_.EntityBaseForm),{"can-submit":c.value,config:n.config,"edit-id":n.gatewayServiceId,"entity-type":e.unref(_.SupportedEntityType).GatewayService,"fetch-url":ae.value,"form-fields":A.value,"is-readonly":t.isReadonly,onCancel:m,"onFetch:error":a[30]||(a[30]=y=>o.$emit("error",y)),"onFetch:success":u,onLoading:a[31]||(a[31]=y=>o.$emit("loading",y)),onSubmit:se},{"form-actions":e.withCtx(()=>[e.renderSlot(o.$slots,"form-actions",{canSubmit:c.value,cancel:m,submit:se},void 0,!0)]),default:e.withCtx(()=>[e.createVNode(e.unref(_.EntityFormSection),{description:e.unref(i)("gateway_services.form.sections.keys.description"),"hide-info-header":n.hideSectionsInfo,title:e.unref(i)("gateway_services.form.sections.keys.title")},{default:e.withCtx(()=>[r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ct,[e.createElementVNode("div",dt,[e.createVNode(C,{modelValue:h.value,"onUpdate:modelValue":a[0]||(a[0]=y=>h.value=y),card:"","card-orientation":"horizontal","data-testid":"gateway-service-url-radio",description:e.unref(i)("gateway_services.form.sections.keys.url.description"),label:e.unref(i)("gateway_services.form.sections.keys.url.label"),"selected-value":X.url,onChange:ge},null,8,["modelValue","description","label","selected-value"]),e.createVNode(C,{modelValue:h.value,"onUpdate:modelValue":a[1]||(a[1]=y=>h.value=y),card:"","card-orientation":"horizontal","checked-group":"protocol","data-testid":"gateway-service-protocol-radio",description:e.unref(i)("gateway_services.form.sections.keys.protocol.description"),label:e.unref(i)("gateway_services.form.sections.keys.protocol.label"),"selected-value":X.protocol,onChange:ge},null,8,["modelValue","description","label","selected-value"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[h.value==="url"?(e.openBlock(),e.createElementBlock("div",ft,[e.createVNode(N,{modelValue:t.fields.url,"onUpdate:modelValue":a[2]||(a[2]=y=>t.fields.url=y),modelModifiers:{trim:!0},class:"gateway-service-url-input gateway-service-form-margin-bottom","data-testid":"gateway-service-url-input",error:we.value,"error-message":j("url"),label:e.unref(i)("gateway_services.form.fields.upstream_url.label"),"label-attributes":{info:n.config.app==="konnect"?e.unref(i)("gateway_services.form.fields.upstream_url.tooltip_for_konnect"):e.unref(i)("gateway_services.form.fields.upstream_url.tooltip_for_km"),tooltipAttributes:{maxWidth:"400"}},name:"url",placeholder:e.unref(i)("gateway_services.form.fields.upstream_url.placeholder"),required:"",onInput:e.unref(ce)},e.createSlots({_:2},[n.hideTrySampleApiButton?void 0:{name:"after",fn:e.withCtx(()=>[e.createVNode(R,{appearance:"tertiary","data-testid":"try-sample-api",size:"small",onClick:le},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.buttons.try_sample")),1)]),_:1})]),key:"0"}]),1032,["modelValue","error","error-message","label","label-attributes","placeholder","onInput"])])):e.createCommentVNode("",!0)]),_:1})])),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[h.value==="protocol"||r.value?(e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(I,{modelValue:t.fields.protocol,"onUpdate:modelValue":a[3]||(a[3]=y=>t.fields.protocol=y),"data-testid":"gateway-service-protocol-select",items:U,label:e.unref(i)("gateway_services.form.fields.protocol.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.protocol.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:t.isReadonly,required:"",width:"100%",onSelected:a[4]||(a[4]=y=>be(t.fields.protocol,y))},null,8,["modelValue","label","label-attributes","readonly"]),e.createVNode(N,{modelValue:t.fields.host,"onUpdate:modelValue":a[5]||(a[5]=y=>t.fields.host=y),modelModifiers:{trim:!0},class:"gateway-service-form-margin-top","data-testid":"gateway-service-host-input",error:!!t.formFieldErrors.host,"error-message":j("host"),label:e.unref(i)("gateway_services.form.fields.host.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.host.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"host",placeholder:e.unref(i)("gateway_services.form.fields.host.placeholder"),required:"",onInput:a[6]||(a[6]=y=>e.unref(K)("host"))},e.createSlots({_:2},[n.hideTrySampleApiButton?void 0:{name:"after",fn:e.withCtx(()=>[e.createVNode(R,{appearance:"tertiary",size:"small",onClick:le},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.buttons.try_sample")),1)]),_:1})]),key:"0"}]),1032,["modelValue","error","error-message","label","label-attributes","placeholder"]),d.value?(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(N,{modelValue:t.fields.path,"onUpdate:modelValue":a[7]||(a[7]=y=>t.fields.path=y),modelModifiers:{trim:!0},class:"gateway-service-form-margin-top","data-testid":"gateway-service-path-input",error:!!t.formFieldErrors.path,"error-message":j("path"),label:e.unref(i)("gateway_services.form.fields.path.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.path.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"path",placeholder:e.unref(i)("gateway_services.form.fields.path.placeholder"),onInput:a[8]||(a[8]=y=>e.unref(K)("path"))},null,8,["modelValue","error","error-message","label","label-attributes","placeholder"])])):e.createCommentVNode("",!0),e.createVNode(N,{modelValue:t.fields.port,"onUpdate:modelValue":[a[9]||(a[9]=y=>t.fields.port=y),a[11]||(a[11]=()=>{t.fields.port=H(t.fields.port+"")})],class:"gateway-service-form-margin-top","data-testid":"gateway-service-port-input",error:!!t.formFieldErrors.port,"error-message":j("port"),label:e.unref(i)("gateway_services.form.fields.port.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.port.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"port",type:"number",onInput:a[10]||(a[10]=y=>e.unref(K)("port"))},null,8,["modelValue","error","error-message","label","label-attributes"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(fe,{modelValue:b.value,"onUpdate:modelValue":a[27]||(a[27]=y=>b.value=y),"data-testid":"advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(i)("gateway_services.form.sections.keys.viewAdvancedFields")},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ut,[e.createElementVNode("div",gt,[e.createVNode(N,{modelValue:t.fields.retries,"onUpdate:modelValue":[a[12]||(a[12]=y=>t.fields.retries=y),a[13]||(a[13]=()=>{t.fields.retries=H(t.fields.retries+"")})],autocomplete:"off","data-testid":"gateway-service-retries-input",label:e.unref(i)("gateway_services.form.fields.retries.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.retries.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"retries",readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",yt,[e.createVNode(N,{modelValue:t.fields.connect_timeout,"onUpdate:modelValue":[a[14]||(a[14]=y=>t.fields.connect_timeout=y),a[15]||(a[15]=()=>{t.fields.connect_timeout=H(t.fields.connect_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-connTimeout-input",label:e.unref(i)("gateway_services.form.fields.connect_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.connect_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"connTimeout",readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",_t,[e.createVNode(N,{modelValue:t.fields.write_timeout,"onUpdate:modelValue":[a[16]||(a[16]=y=>t.fields.write_timeout=y),a[17]||(a[17]=()=>{t.fields.write_timeout=H(t.fields.write_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-writeTimeout-input",label:e.unref(i)("gateway_services.form.fields.write_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.write_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"writeTimeout",readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",bt,[e.createVNode(N,{modelValue:t.fields.read_timeout,"onUpdate:modelValue":[a[18]||(a[18]=y=>t.fields.read_timeout=y),a[19]||(a[19]=()=>{t.fields.read_timeout=H(t.fields.read_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-readTimeout-input",label:e.unref(i)("gateway_services.form.fields.read_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.read_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"readTimeout",readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),v.value?(e.openBlock(),e.createElementBlock("div",wt,[e.createVNode(N,{modelValue:t.fields.client_certificate,"onUpdate:modelValue":a[20]||(a[20]=y=>t.fields.client_certificate=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-clientCert-input",error:!!t.formFieldErrors.client_certificate,label:e.unref(i)("gateway_services.form.fields.client_certificate.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"clientCert",placeholder:e.unref(i)("gateway_services.form.fields.client_certificate.placeholder"),readonly:t.isReadonly,type:"text",onInput:a[21]||(a[21]=y=>e.unref(de)("client_certificate"))},null,8,["modelValue","error","label","label-attributes","placeholder","readonly"])])):e.createCommentVNode("",!0),q.value?(e.openBlock(),e.createElementBlock("div",ht,[e.createVNode(N,{modelValue:t.fields.ca_certificates,"onUpdate:modelValue":a[22]||(a[22]=y=>t.fields.ca_certificates=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-ca-certs-input",error:!!t.formFieldErrors.ca_certificates,label:e.unref(i)("gateway_services.form.fields.ca_certificates.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(i)("gateway_services.form.fields.ca_certificates.placeholder"),readonly:t.isReadonly,type:"text",onInput:a[23]||(a[23]=y=>e.unref(de)("ca_certificates"))},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(L),{keypath:"gateway_services.form.fields.ca_certificates.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.ca_certificates.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.ca_certificates.code2")),1)]),_:1})]),_:1},8,["modelValue","error","label","placeholder","readonly"])])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("div",vt,[e.createVNode(f,{modelValue:t.fields.tls_verify_enabled,"onUpdate:modelValue":a[24]||(a[24]=y=>t.fields.tls_verify_enabled=y),"data-testid":"gateway-service-tls-verify-checkbox",description:e.unref(i)("gateway_services.form.fields.tls_verify_enabled.help"),label:e.unref(i)("gateway_services.form.fields.tls_verify_enabled.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}}},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(L),{keypath:"gateway_services.form.fields.tls_verify_enabled.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.tls_verify_enabled.code1")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),t.fields.tls_verify_enabled?(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(C,{modelValue:t.fields.tls_verify_value,"onUpdate:modelValue":a[25]||(a[25]=y=>t.fields.tls_verify_value=y),"data-testid":"gateway-service-tls-verify-true-option",label:e.unref(i)("gateway_services.form.fields.tls_verify_option.true.label"),"selected-value":!0},null,8,["modelValue","label"])])):e.createCommentVNode("",!0),t.fields.tls_verify_enabled?(e.openBlock(),e.createElementBlock("div",kt,[e.createVNode(C,{modelValue:t.fields.tls_verify_value,"onUpdate:modelValue":a[26]||(a[26]=y=>t.fields.tls_verify_value=y),"data-testid":"gateway-service-tls-verify-false-option",label:e.unref(i)("gateway_services.form.fields.tls_verify_option.false.label"),"selected-value":!1},null,8,["modelValue","label"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))]),_:1})]),_:1},8,["modelValue","trigger-label"])]),_:1},8,["description","hide-info-header","title"]),e.createVNode(e.unref(_.EntityFormSection),{description:e.unref(i)("gateway_services.form.sections.general.description"),"hide-info-header":n.hideSectionsInfo,title:e.unref(i)("gateway_services.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(N,{modelValue:t.fields.name,"onUpdate:modelValue":a[28]||(a[28]=y=>t.fields.name=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-name-input",error:me.value,"error-message":ne.value,label:e.unref(i)("gateway_services.form.fields.name.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.name.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"name",placeholder:e.unref(i)("gateway_services.form.fields.name.placeholder"),readonly:t.isReadonly,type:"text",onInput:S},null,8,["modelValue","error","error-message","label","label-attributes","placeholder","readonly"]),e.createVNode(fe,{"data-testid":"tags-collapse","trigger-alignment":"leading","trigger-label":e.unref(i)("gateway_services.form.fields.tags.collapse")},{default:e.withCtx(()=>[e.createElementVNode("div",Ct,[e.createVNode(N,{modelValue:t.fields.tags,"onUpdate:modelValue":a[29]||(a[29]=y=>t.fields.tags=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-tags-input",help:e.unref(i)("gateway_services.form.fields.tags.help"),label:e.unref(i)("gateway_services.form.fields.tags.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"tags",placeholder:e.unref(i)("gateway_services.form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])])]),_:1},8,["trigger-label"])]),_:1},8,["description","hide-info-header","title"]),t.errorMessages.length?(e.openBlock(),e.createBlock(ye,{key:0,appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("ul",Nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.errorMessages,y=>(e.openBlock(),e.createElementBlock("li",{key:y},e.toDisplayString(y),1))),128))])]),_:1})):e.createCommentVNode("",!0)]),_:3},8,["can-submit","config","edit-id","entity-type","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-0200f215"]]),{useUrlValidators:xt}=Z;D.GatewayServiceConfigCard=it,D.GatewayServiceForm=Et,D.GatewayServiceList=De,D.LegacyGatewayServiceForm=rt,D.useUrlValidators=xt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(D,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(D=typeof globalThis<"u"?globalThis:D||self,e(D["kong-ui-public-entities-gateway-services"]={},D.Vue,D.VueRouter,D.KongIcons,D["kong-ui-public-i18n"],D["kong-ui-public-entities-shared"]))})(this,function(D,e,ke,he,Ee,_){"use strict";const Se={actions:{create:"New gateway service",serverless_create:"Add a Service",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",clear:"Clear",view:"View Details",delete:{title:"Delete a Gateway Service",description:"Deleting this Gateway Service will also remove any associated plugins. This action cannot be reversed.",menu_label:"Delete"}},search:{placeholder:{konnect:"Filter by name",kongManager:"Filter by exact name or ID"}},gateway_services:{title:"Gateway Services",list:{toolbar_actions:{new_gateway_service:"New gateway service"},table_headers:{name:"Name",control_plane:"Control Plane",protocol:"Protocol",host:"Host",port:"Port",path:"Path",enabled:"Enabled",tags:"Tags",id:"ID",created_at:"Created At",updated_at:"Last Modified"},empty_state:{title:"Configure a New Gateway Service",description:"Gateway services are used to proxy traffic.",serverless_title:"Configure your first Gateway Service"}},empty_state_v2:{create:"New gateway service",title:"Configure your first gateway service",group:"Services created in gateways within this group will automatically appear here.",description:"Gateway services represent backend APIs or microservices that receive traffic routed through the gateway."},form:{buttons:{try_sample:"Try sample API"},errors:{host:{empty:"Host cannot be empty",invalid:"Invalid host"},port:{type:"Port must be a number",invalid:"Port must be between 0 and 65535"},path:{prefix:"Path must begin with /",invalid:"Path should not include characters outside of the reserved list of RFC 3986"},protocol:{empty:"Protocol cannot be empty",invalid:"Protocol - value must be one of http, https, grpc, grpcs, tcp, udp, tls, tls_passthrough, ws, wss"},url:{invalid:"The URL must follow a valid format. Example: https://api.kong-air.com/flights"}},sections:{general:{title:"General Information",description:"Provide a name and tags to help identify and manage this service."},keys:{title:"Service endpoint",description:"Define where this service should send requests.",checkedGroupLabel:"Choose how and where to send traffic",urlLabel:"Full URL",checkedGroupAltLabel:"Protocol, host, port and path",url:{label:"Full URL",description:"Define the service using a single, complete API URL for simple setup."},protocol:{label:"Protocol, host, port, and path",description:"Manually specify each component of the API’s URL for advanced configurations."},viewAdvancedFields:"View advanced fields"}},fields:{upstream_url:{label:"Full URL",placeholder:"e.g. https://api.kong-air.com/flights",tooltip_for_konnect:"This is the URL of the API you will manage in Konnect.",tooltip_for_km:"This is the URL of the API you will manage in Kong Gateway."},name:{label:"Name",placeholder:"Enter a unique name",tooltip:"The Service name."},protocol:{label:"Protocol",tooltip:"The protocol used to communicate with the upstream.",options:{http:"http",https:"https",tcp:"tcp",tls:"tls",tls_passthrough:"tls_passthrough",grpc:"grpc",grpcs:"grpcs",ws:"ws",wss:"wss",udp:"udp"}},host:{label:"Host",placeholder:"e.g. api.kong-air.com",tooltip:"The host of the upstream server. Note that the host value is case sensitive."},path:{label:"Path",placeholder:"e.g. /sample",tooltip:"The path to be used in request to the upstream server."},port:{label:"Port",tooltip:"The upstream server port."},retries:{label:"Retries",tooltip:"The number of retries to execute upon failure to proxy."},connect_timeout:{label:"Connection timeout",tooltip:"The timeout in milliseconds for establishing a connection to the upstream server."},write_timeout:{label:"Write timeout",tooltip:"The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server."},read_timeout:{label:"Read timeout",tooltip:"The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server."},client_certificate:{label:"Client certificate",placeholder:"Enter a Certificate ID",tooltip:"Certificate to be used as client certificate while TLS handshaking to the upstream server."},ca_certificates:{label:"CA certificates",placeholder:"Enter a comma separated list of CA Certificate IDs",tooltip:"Array of {code1} object UUIDs that are used to build the trust store while verifying upstream server's TLS certificate. If set to {code2} when Nginx default is respected. If default CA list in Nginx are not specified and TLS verification is enabled, then handshake with upstream server will always fail (because no CA are trusted).",code1:"CA Certificate",code2:"null"},tls_verify_enabled:{label:"TLS verify",help:"If unchecked, use default system setting",tooltip:"Whether to enable verification of upstream server TLS certificate. If set to {code1}, then the Nginx default is respected.",code1:"null"},tls_verify_option:{unset:{display:"Use default system setting"},true:{label:"True",display:"On"},false:{label:"False",display:"Off"}},tags:{label:"Tags",tooltip:"An optional set of strings associated with the Service for grouping and filtering.",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",collapse:"Add tags"},enabled:{label:"Enabled",tooltip:"Whether the Service is active. If set to {false}, the proxy behavior will be as if any routes attached to it do not exist (404). Default: {true}.",false:"false",true:"true"}}}},errors:{general:"Gateway Services could not be retrieved",delete:"The gateway service could not be deleted at this time.",copy:"Failed to copy to clipboard",urlErrorMessage:"Error: invalid URL"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},glossary:{gateway_services:"gateway services"}};function Ie(){const n=Ee.createI18n("en-us",Se);return{i18n:n,i18nT:Ee.i18nTComponent(n)}}function Pe(){return{getPortFromProtocol:(B,g)=>{const p=[80,443],s=Number(g);if((s||s===0)&&!p.includes(s))return s;switch(B){case"grpcs":case"tls":case"https":case"wss":return 443;case"grpc":case"tcp":case"http":case"ws":default:return 80}}}}function Be(){const{i18n:{t:n}}=Z.useI18n();return{validateHost:b=>{if(!b||b.trim()==="")return n("gateway_services.form.errors.host.empty");const P=/^(?!:\/\/)([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*)(\.[a-zA-Z]{1,63})?$/;return/^((25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])$/.test(b)||P.test(b)?"":n("gateway_services.form.errors.host.invalid")},validateProtocol:(b,P)=>!b||b.trim()===""?n("gateway_services.form.errors.protocol.empty"):(b=b.slice(0,-1),P.find(i=>{if(i.value===b)return i})===void 0?n("gateway_services.form.errors.protocol.invalid"):""),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"),validatePort:b=>{if(b==null||b==="")return"";const P=typeof b=="string"?parseInt(b,10):b;return isNaN(P)?n("gateway_services.form.errors.port.type"):P<0||P>65535?n("gateway_services.form.errors.port.invalid"):""}}}const Z={useI18n:Ie,usePortFromProtocol:Pe,useUrlValidators:Be},ve="/v2/control-planes/{controlPlaneId}/core-entities",Ve="/{workspace}",ee={list:{konnect:{all:`${ve}/services`},kongManager:{all:`${Ve}/services`}},form:{konnect:{create:`${ve}/services`,validate:`${ve}/v1/schemas/json/service/validate`,edit:`${ve}/services/{id}`},kongManager:{create:`${Ve}/services`,validate:`${Ve}/schemas/services/validate`,edit:`${Ve}/services/{id}`}}},Te="#00abd2",Fe="24px",$e={class:"kong-ui-entities-gateway-services-list"},Ue={class:"button-row"},Ae={class:"empty-state-icon-gateway"},Re={key:1},Me=e.defineComponent({__name:"GatewayServiceList",props:{config:{type:Object,required:!0,validator:n=>!(!n||!["konnect","kongManager"].includes(n==null?void 0:n.app)||!n.createRoute||!n.getViewRoute||!n.getEditRoute||n.app==="kongManager"&&!n.isExactMatch&&!n.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1},isServerless:{type:Boolean,default:!1},enableV2EmptyStates:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success","toggle:success"],setup(n,{emit:B}){var c;const g=B,p=n,{i18n:{t:s,formatUnixTimeStamp:b}}=Z.useI18n(),P=ke.useRouter(),{axiosInstance:L}=_.useAxios((c=p.config)==null?void 0:c.axiosRequestConfig),{hasRecords:i,handleStateChange:$}=_.useTableState(()=>M.value),k=e.computed(()=>i.value&&p.config.app==="konnect"),J=e.computed(()=>!p.enableV2EmptyStates&&p.config.app==="konnect"),te=e.computed(()=>p.config.app!=="kongManager"||!!p.config.disableSorting),O={name:{label:s("gateway_services.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},...p.config.showControlPlaneColumn?{control_plane:{label:s("gateway_services.list.table_headers.control_plane")}}:{},protocol:{label:s("gateway_services.list.table_headers.protocol"),searchable:!0,sortable:!0},host:{label:s("gateway_services.list.table_headers.host"),searchable:!0,sortable:!0},port:{label:s("gateway_services.list.table_headers.port"),searchable:!0,sortable:!0},path:{label:s("gateway_services.list.table_headers.path"),searchable:!0,sortable:!0},enabled:{label:s("gateway_services.list.table_headers.enabled"),searchable:!0,sortable:!0},tags:{label:s("gateway_services.list.table_headers.tags"),sortable:!1},updated_at:{label:s("gateway_services.list.table_headers.updated_at"),sortable:!0},created_at:{label:s("gateway_services.list.table_headers.created_at"),sortable:!0}},pe={columnVisibility:{created_at:!1}},oe=O,x=e.computed(()=>{var m,V;let u=`${p.config.apiBaseUrl}${ee.list[p.config.app].all}`;return p.config.app==="konnect"?u=u.replace(/{controlPlaneId}/gi,((m=p.config)==null?void 0:m.controlPlaneId)||""):p.config.app==="kongManager"&&(u=u.replace(/\/{workspace}/gi,(V=p.config)!=null&&V.workspace?`/${p.config.workspace}`:"")),u}),ae=e.computed(()=>p.config.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${x.value}`):new URL(x.value)),M=e.ref(""),_e=e.computed(()=>{const u=p.config.app==="konnect"||p.config.isExactMatch;if(u)return{isExactMatch:u,placeholder:s(`search.placeholder.${p.config.app}`)};const{name:m,enabled:V,protocol:F,host:ie,port:A,path:se}=O;return{isExactMatch:u,fields:{name:m,enabled:V,protocol:F,host:ie,port:A,path:se},schema:p.config.filterSchema}}),{fetcher:r,fetcherState:h,fetcherCacheKey:Q}=_.useFetcher({...p.config,cacheIdentifier:p.cacheIdentifier},x.value),ne=()=>{M.value=""},me=()=>{Q.value++},t=e.ref(null),E=e.computed(()=>({ctaPath:p.config.createRoute,ctaText:S.value?p.isServerless?s("actions.serverless_create"):s("actions.create"):void 0,message:`${s("gateway_services.list.empty_state.description")}${p.config.additionMessageForEmptyState?` ${p.config.additionMessageForEmptyState}`:""}`,title:S.value?p.isServerless?s("gateway_services.list.empty_state.serverless_title"):s("gateway_services.list.empty_state.title"):s("gateway_services.title")})),re=e.ref(!1),U=e.ref(null),X=e.computed(()=>{const u={action:"disable",id:"",name:""};if(U.value){const{enabled:m,id:V,name:F}=U.value;u.action=m?"disable":"enable",u.id=V,u.name=F||V}return u}),be=u=>{re.value=!0,U.value=u},H=()=>{re.value=!1,U.value=null},ue=async()=>{var F,ie;if(!await((F=p.canEdit)==null?void 0:F.call(p,U.value))||!U.value)return;const m=`${ae.value.href}/${U.value.id}`,V=!U.value.enabled;try{const{data:A}=((ie=p.config)==null?void 0:ie.app)==="konnect"?await L.put(m,{...U.value,enabled:V}):await L.patch(m,{...U.value,enabled:V});g("toggle:success",A),U.value.enabled=V}catch(A){g("error",A)}},ge=u=>{p.config.getControlPlaneRoute&&P.push(p.config.getControlPlaneRoute(u))},le=async(u,m)=>{const V=u.id;if(!await m(V)){g("copy:error",{entity:u,field:"id",message:s("errors.copy")});return}g("copy:success",{entity:u,field:"id",message:s("copy.success",{val:V})})},ce=async(u,m)=>{const V=JSON.stringify(u);if(!await m(V)){g("copy:error",{entity:u,message:s("errors.copy")});return}g("copy:success",{entity:u,message:s("copy.success_brief")})},de=async u=>{var V;await((V=p.canRetrieve)==null?void 0:V.call(p,u))&&P.push(p.config.getViewRoute(u.id))},we=u=>({label:s("actions.view"),to:p.config.getViewRoute(u)}),j=u=>({label:s("actions.edit"),to:p.config.getEditRoute(u)}),K=e.ref(void 0),W=e.ref(!1),z=e.ref(!1),Y=e.ref(""),l=_.useDeleteUrlBuilder(p.config,x.value),d=u=>{K.value=u,W.value=!0,Y.value=""},v=()=>{W.value=!1,K.value=void 0},q=async()=>{var u,m,V;if((u=K.value)!=null&&u.id){z.value=!0;try{await L.delete(l(K.value.id)),g("delete:success",K.value),v(),Q.value++}catch(F){Y.value=((V=(m=F.response)==null?void 0:m.data)==null?void 0:V.message)||F.message||s("errors.delete"),g("error",F)}finally{z.value=!1}}},T=()=>{P.push(p.config.createRoute)};e.watch(h,u=>{var m,V,F;if(u.status===_.FetcherStatus.Error){t.value={title:s("errors.general")},(F=(V=(m=u.error)==null?void 0:m.response)==null?void 0:V.data)!=null&&F.message&&(t.value.message=u.error.response.data.message),g("error",u.error);return}t.value=null});const S=e.ref(!1);return e.onBeforeMount(async()=>{S.value=await p.canCreate()}),(u,m)=>{const V=e.resolveComponent("KButton"),F=e.resolveComponent("KBadge"),ie=e.resolveComponent("KInputSwitch"),A=e.resolveComponent("KDropdownItem"),se=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(e.unref(_.EntityBaseTable),{"cache-identifier":n.cacheIdentifier,"default-table-preferences":pe,"disable-sorting":te.value,"empty-state-options":E.value,"enable-entity-actions":"","error-message":t.value,fetcher:e.unref(r),"fetcher-cache-key":e.unref(Q),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-gateway-services-list",query:M.value,"table-headers":e.unref(oe),onClearSearchInput:ne,"onClick:row":m[5]||(m[5]=w=>de(w)),onSort:me,onState:e.unref($)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(_.EntityFilter),{modelValue:M.value,"onUpdate:modelValue":m[0]||(m[0]=w=>M.value=w),config:_e.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!n.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",Ue,[k.value?(e.openBlock(),e.createBlock(V,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"gateway-services-learn-more-button",icon:"",onClick:m[1]||(m[1]=w=>u.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(he.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canCreate()},{default:e.withCtx(()=>[e.createVNode(V,{appearance:"primary","data-testid":"toolbar-add-gateway-service",size:n.useActionOutside?"medium":"large",to:n.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(he.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(s)("gateway_services.list.toolbar_actions.new_gateway_service")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),name:e.withCtx(({rowValue:w})=>[e.createElementVNode("b",null,e.toDisplayString(w??"-"),1)]),control_plane:e.withCtx(({row:w})=>{var o;return[(o=w.x_meta)!=null&&o.cluster_id?(e.openBlock(),e.createBlock(F,{key:0,tooltip:w.x_meta.cluster_id,"truncation-tooltip":"",onClick:e.withModifiers(a=>ge(w.x_meta.cluster_id),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.x_meta.cluster_id),1)]),_:2},1032,["tooltip","onClick"])):(e.openBlock(),e.createElementBlock("b",Re,"-"))]}),enabled:e.withCtx(({row:w})=>[e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canEdit(w),"force-show":""},{default:e.withCtx(({isAllowed:o})=>[e.createElementVNode("div",{onClick:m[4]||(m[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ie,{modelValue:w.enabled,"onUpdate:modelValue":a=>w.enabled=a,"data-testid":`row-${w.id}-toggle-input`,disabled:!o,onClick:e.withModifiers(a=>be(w),["prevent"])},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","onClick"])])]),_:2},1032,["auth-function"])]),tags:e.withCtx(({rowValue:w})=>[e.createVNode(e.unref(_.TableTags),{tags:w},null,8,["tags"])]),created_at:e.withCtx(({rowValue:w})=>[e.createTextVNode(e.toDisplayString(e.unref(b)(w)),1)]),updated_at:e.withCtx(({row:w,rowValue:o})=>[e.createTextVNode(e.toDisplayString(e.unref(b)(o??w.created_at)),1)]),actions:e.withCtx(({row:w})=>[e.createVNode(se,null,{default:e.withCtx(({copyToClipboard:o})=>[e.createVNode(A,{"data-testid":"action-entity-copy-id",onClick:a=>le(w,o)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(se,null,{default:e.withCtx(({copyToClipboard:o})=>[e.createVNode(A,{"data-testid":"action-entity-copy-json",onClick:a=>ce(w,o)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canRetrieve(w)},{default:e.withCtx(()=>[e.createVNode(A,{"data-testid":"action-entity-view","has-divider":"",item:we(w.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canEdit(w)},{default:e.withCtx(()=>[e.createVNode(A,{"data-testid":"action-entity-edit",item:j(w.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(_.PermissionsWrapper),{"auth-function":()=>n.canDelete(w)},{default:e.withCtx(()=>[e.createVNode(A,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:o=>d(w)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("actions.delete.menu_label")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!e.unref(i)&&J.value?{name:"outside-actions",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!n.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(V,{appearance:"secondary",class:"open-learning-hub","data-testid":"gateway-services-more-button",icon:"",onClick:m[2]||(m[2]=w=>u.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(he.BookIcon),{decorative:""})]),_:1})],8,["disabled"]))]),key:"0"}:void 0,!M.value&&n.enableV2EmptyStates&&n.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var w;return[e.createVNode(e.unref(_.EntityEmptyState),{"action-button-text":e.unref(s)("gateway_services.empty_state_v2.create"),appearance:"secondary","can-create":()=>n.canCreate(),"data-testid":"gateway-services-entity-empty-state",description:e.unref(s)("gateway_services.empty_state_v2.description"),"learn-more":n.config.app==="konnect",title:e.unref(s)("gateway_services.empty_state_v2.title"),"onClick:create":T,"onClick:learnMore":m[3]||(m[3]=o=>u.$emit("click:learn-more"))},e.createSlots({image:e.withCtx(()=>[e.createElementVNode("div",Ae,[e.createVNode(e.unref(he.ServicesIcon),{color:e.unref(Te),size:e.unref(Fe)},null,8,["color","size"])])]),_:2},[(w=n.config)!=null&&w.isControlPlaneGroup?{name:"message",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("gateway_services.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["action-button-text","can-create","description","learn-more","title"])]}),key:"1"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),e.createVNode(e.unref(_.EntityToggleModal),{action:X.value.action,"entity-id":X.value.id,"entity-name":X.value.name,"entity-type":e.unref(s)("glossary.gateway_services"),"on-confirm":ue,visible:re.value,onCancel:H,onProceed:H},null,8,["action","entity-id","entity-name","entity-type","visible"]),e.createVNode(e.unref(_.EntityDeleteModal),{"action-pending":z.value,description:e.unref(s)("actions.delete.description"),"entity-name":K.value&&(K.value.name||K.value.id),"entity-type":e.unref(_.EntityTypes).GatewayService,error:Y.value,title:e.unref(s)("actions.delete.title"),visible:W.value,onCancel:v,onProceed:q},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),Ce=(n,B)=>{const g=n.__vccOpts||n;for(const[p,s]of B)g[p]=s;return g},De=Ce(Me,[["__scopeId","data-v-4adf4f7a"]]),Ke={class:"kong-ui-entities-gateway-service-form"},We={key:0},Le={class:"gateway-service-form-traffic-label"},qe={class:"gateway-service-form-margin-bottom"},Ge={key:0,class:"gateway-service-form-group-fields"},Oe={key:1,class:"gateway-service-form-group-fields"},je={key:0},ze={class:"gateway-service-form-margin-top"},He={class:"gateway-service-form-margin-bottom"},Ze={class:"gateway-service-form-margin-bottom"},Je={class:"gateway-service-form-margin-bottom"},Qe={class:"gateway-service-form-margin-bottom"},Xe={key:0,class:"gateway-service-form-margin-bottom"},Ye={key:1,class:"gateway-service-form-margin-bottom"},et={key:2,class:"gateway-service-form-margin-bottom"},tt={key:0,class:"checkbox-aligned-radio"},ot={key:1,class:"checkbox-aligned-radio"},rt=Ce(e.defineComponent({__name:"LegacyGatewayServiceForm",props:{config:{type:Object,required:!0,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)},gatewayServiceId:{type:String,required:!1,default:""},hideSectionsInfo:{type:Boolean,required:!1,default:!1}},emits:["update","error","url-valid:success","url-valid:error","loading","model-updated"],setup(n,{expose:B,emit:g}){var Y;const p=g,s=n,b=e.ref(!0),P=ke.useRouter(),{i18nT:L,i18n:{t:i}}=Z.useI18n(),{getMessageFromError:$}=_.useErrors(),{axiosInstance:k}=_.useAxios((Y=s.config)==null?void 0:Y.axiosRequestConfig),J=_.useValidators(),te=e.computed(()=>ee.form[s.config.app].edit),O=e.computed(()=>s.gatewayServiceId?_.EntityBaseFormType.Edit:_.EntityBaseFormType.Create),pe=e.ref(!1),oe=e.computed(()=>!!s.gatewayServiceId),x=e.ref(oe.value?"protocol":"url"),ae=Z.usePortFromProtocol(),M=e.ref(""),_e=e.computed(()=>!!M.value),r=e.reactive({fields:{name:"",protocol:"http",host:"",path:"",port:80,url:"",retries:5,connect_timeout:6e4,write_timeout:6e4,read_timeout:6e4,client_certificate:"",ca_certificates:"",tls_verify_enabled:!1,tls_verify_value:!1,tags:""},isReadonly:!1,errorMessage:""}),h=e.reactive({name:"",protocol:"http",host:"",path:"",port:80,url:"",retries:5,connect_timeout:6e4,write_timeout:6e4,read_timeout:6e4,client_certificate:"",ca_certificates:"",tls_verify_enabled:!1,tls_verify_value:!1,tags:""}),Q=s.config.app==="konnect"||_.useGatewayFeatureSupported({gatewayInfo:s.config.gatewayInfo,supportedRange:{enterprise:["3.0"]}}),ne=[{label:i("gateway_services.form.fields.protocol.options.http"),value:"http",group:"http"},{label:i("gateway_services.form.fields.protocol.options.https"),value:"https",group:"http"},{label:i("gateway_services.form.fields.protocol.options.tcp"),value:"tcp",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.tls"),value:"tls",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.tls_passthrough"),value:"tls_passthrough",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.grpc"),value:"grpc",group:"grpc"},{label:i("gateway_services.form.fields.protocol.options.grpcs"),value:"grpcs",group:"grpc"},...Q?[{label:i("gateway_services.form.fields.protocol.options.ws"),value:"ws",group:"websocket"},{label:i("gateway_services.form.fields.protocol.options.wss"),value:"wss",group:"websocket"}]:[],{label:i("gateway_services.form.fields.protocol.options.udp"),value:"udp",group:"udp"}],me={url:"url",protocol:"protocol"},t=(l,d)=>{d.value},E=l=>l?parseFloat(l):0,re=()=>{b.value=!0,r.errorMessage="",r.fields.host=h.host,r.fields.path=h.path,r.fields.port=h.port,r.fields.protocol=h.protocol,r.fields.url=h.url,r.fields.retries=h.retries,r.fields.connect_timeout=h.connect_timeout,r.fields.write_timeout=h.write_timeout,r.fields.read_timeout=h.read_timeout,r.fields.client_certificate=h.client_certificate,r.fields.ca_certificates=h.ca_certificates,r.fields.tls_verify_enabled=h.tls_verify_enabled,r.fields.tls_verify_value=h.tls_verify_value},U=()=>{if(r.fields.url&&x.value==="url")try{const l=new URL(r.fields.url);r.errorMessage="",r.fields.protocol=l.protocol.slice(0,-1),r.fields.host=l.hostname,r.fields.path=l.pathname;const d=Number(l.port);pe.value=!!d,r.fields.port=d||ae.getPortFromProtocol(r.fields.protocol),r.errorMessage="",p("url-valid:success")}catch(l){r.errorMessage=i("errors.urlErrorMessage"),p("url-valid:error",$(l))}else p("url-valid:success"),r.errorMessage=""},X=e.computed(()=>!["tcp","tls","tls_passthrough","grpc","grpcs","udp"].includes(r.fields.protocol)),be=e.computed(()=>{if(x.value==="url")return!0;const l=["https","wss","tls"].includes(r.fields.protocol);return x.value==="protocol"&&l}),H=e.computed(()=>{if(x.value==="url")return!0;const l=["https","tls"].includes(r.fields.protocol);return x.value==="protocol"&&l}),ue=e.computed(()=>{if(x.value==="url")return!0;const l=["https","wss","tls"].includes(r.fields.protocol);return x.value==="protocol"&&l}),ge=l=>{M.value=J.utf8Name(l)},le=e.computed(()=>oe.value&&JSON.stringify(r.fields)!==JSON.stringify(h)||x.value==="url"&&!!r.fields.url||x.value==="protocol"&&!!r.fields.host),ce=l=>{var d,v,q;r.fields.name=(l==null?void 0:l.name)||"",r.fields.tags=((d=l==null?void 0:l.tags)==null?void 0:d.join(", "))||"",r.fields.protocol=(l==null?void 0:l.protocol)||"http",r.fields.path=(l==null?void 0:l.path)||"",r.fields.read_timeout=l!=null&&l.read_timeout||(l==null?void 0:l.read_timeout)===0?l==null?void 0:l.read_timeout:6e4,r.fields.retries=l!=null&&l.retries||(l==null?void 0:l.retries)===0?l==null?void 0:l.retries:5,r.fields.host=(l==null?void 0:l.host)||"",r.fields.connect_timeout=l!=null&&l.connect_timeout||(l==null?void 0:l.connect_timeout)===0?l==null?void 0:l.connect_timeout:6e4,r.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,r.fields.tls_verify_value=l!=null&&l.tls_verify?l==null?void 0:l.tls_verify:!1,r.fields.ca_certificates=((v=l==null?void 0:l.ca_certificates)==null?void 0:v.join(","))||"",r.fields.client_certificate=((q=l==null?void 0:l.client_certificate)==null?void 0:q.id)||"",r.fields.write_timeout=l!=null&&l.write_timeout||(l==null?void 0:l.write_timeout)===0?l==null?void 0:l.write_timeout:6e4,r.fields.port=l!=null&&l.port||(l==null?void 0:l.port)===0?l==null?void 0:l.port:80,Object.assign(h,r.fields)},de=()=>{P.push(s.config.cancelRoute)},we=e.computed(()=>{var d,v;let l=`${s.config.apiBaseUrl}${ee.form[s.config.app].validate}`;return s.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((d=s.config)==null?void 0:d.controlPlaneId)||""):s.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(v=s.config)!=null&&v.workspace?`/${s.config.workspace}`:"")),l=l.replace(/{id}/gi,s.gatewayServiceId),l}),j=e.computed(()=>{var d,v;let l=`${s.config.apiBaseUrl}${ee.form[s.config.app][O.value]}`;return s.config.app==="konnect"?l=l.replace(/{controlPlaneId}/gi,((d=s.config)==null?void 0:d.controlPlaneId)||""):s.config.app==="kongManager"&&(l=l.replace(/\/{workspace}/gi,(v=s.config)!=null&&v.workspace?`/${s.config.workspace}`:"")),l=l.replace(/{id}/gi,s.gatewayServiceId),l}),K=l=>{let d="";l.url&&(d=new URL(l.url).protocol),(["https","wss","tls"].includes(l.protocol)||["https","wss","tls"].includes(d))&&(l.tls_verify=l.tls_verify_enabled?l.tls_verify_value:null),delete l.tls_verify_enabled,delete l.tls_verify_value},W=e.computed(()=>{var d,v,q,T;const l={name:r.fields.name||null,tags:r.fields.tags?(q=(v=(d=r.fields.tags)==null?void 0:d.split(","))==null?void 0:v.map(S=>String(S||"").trim()))==null?void 0:q.filter(S=>S!==""):null,protocol:r.fields.protocol,path:r.fields.path||null,read_timeout:r.fields.read_timeout,retries:r.fields.retries,host:r.fields.host,connect_timeout:r.fields.connect_timeout,tls_verify_value:r.fields.tls_verify_value,tls_verify_enabled:r.fields.tls_verify_enabled,ca_certificates:r.fields.ca_certificates?(T=r.fields.ca_certificates)==null?void 0:T.split(",").filter(S=>S!==""):null,client_certificate:r.fields.client_certificate?{id:r.fields.client_certificate}:null,write_timeout:r.fields.write_timeout,port:r.fields.port,url:r.fields.url};return r.fields.client_certificate&&["https","wss","tls"].includes(r.fields.protocol)&&(l.client_certificate={id:r.fields.client_certificate}),r.fields.tls_verify_enabled&&["https","wss","tls"].includes(r.fields.protocol)&&(l.tls_verify=r.fields.tls_verify_value),X.value||(l.path=null),O.value==="create"?x.value==="url"?(delete l.protocol,delete l.host,delete l.path,s.config.app==="konnect"&&delete l.port):delete l.url:O.value==="edit"&&delete l.url,l}),z=async()=>{var l,d,v,q;try{r.isReadonly=!0,U();const T=W.value;K(T);let S;if(await k.post(we.value,T),O.value==="create"?S=await k.post(j.value,T):O.value==="edit"&&(S=((l=s.config)==null?void 0:l.app)==="konnect"?await k.put(j.value,T):await k.patch(j.value,T)),S){const{data:c}=S;r.fields.name=(c==null?void 0:c.name)||"",r.fields.port=c.port||ae.getPortFromProtocol(c.protocol),r.fields.protocol=(c==null?void 0:c.protocol)||"http",r.fields.host=(c==null?void 0:c.host)||"",r.fields.path=(c==null?void 0:c.path)||"",r.fields.url=(c==null?void 0:c.url)||"",r.fields.retries=c!=null&&c.retries||(c==null?void 0:c.retries)===0?c==null?void 0:c.retries:5,r.fields.connect_timeout=c!=null&&c.connect_timeout||(c==null?void 0:c.connect_timeout)===0?c==null?void 0:c.connect_timeout:6e4,r.fields.write_timeout=c!=null&&c.write_timeout||(c==null?void 0:c.write_timeout)===0?c==null?void 0:c.write_timeout:6e4,r.fields.read_timeout=c!=null&&c.read_timeout||(c==null?void 0:c.read_timeout)===0?c==null?void 0:c.read_timeout:6e4,r.fields.client_certificate=((d=c==null?void 0:c.client_certificate)==null?void 0:d.id)||"",r.fields.ca_certificates=(v=c==null?void 0:c.ca_certificates)!=null&&v.length?c==null?void 0:c.ca_certificates.join(","):"",r.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,r.fields.tls_verify_value=r.fields.tls_verify_enabled&&(c==null?void 0:c.tls_verify),r.fields.tags=(q=c==null?void 0:c.tags)!=null&&q.length?c.tags.join(", "):"",Object.assign(h,r.fields),p("update",S==null?void 0:S.data)}return S}catch(T){r.errorMessage=$(T),p("error",T)}finally{r.isReadonly=!1}};return e.watch(()=>s.gatewayServiceId,()=>{Object.assign(r.fields,h)}),e.watch(r.fields,l=>{r.fields.port=ae.getPortFromProtocol(l.protocol,String(l.port)),p("model-updated",W.value)}),e.onMounted(()=>{p("model-updated",W.value)}),B({validateUrl:U,getPayload:W,saveFormData:z,canSubmit:le,initForm:ce}),(l,d)=>{const v=e.resolveComponent("KInput"),q=e.resolveComponent("KLabel"),T=e.resolveComponent("KRadio"),S=e.resolveComponent("KSelect"),c=e.resolveComponent("KCheckbox"),u=e.resolveComponent("KCollapse");return e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(e.unref(_.EntityBaseForm),{"can-submit":le.value,config:n.config,"edit-id":n.gatewayServiceId,"entity-type":e.unref(_.SupportedEntityType).GatewayService,"error-message":r.errorMessage,"fetch-url":te.value,"form-fields":W.value,"is-readonly":r.isReadonly,onCancel:de,"onFetch:error":d[25]||(d[25]=m=>l.$emit("error",m)),"onFetch:success":ce,onLoading:d[26]||(d[26]=m=>l.$emit("loading",m)),onSubmit:z},{"form-actions":e.withCtx(()=>[e.renderSlot(l.$slots,"form-actions",{canSubmit:le.value,cancel:de,submit:z},void 0,!0)]),default:e.withCtx(()=>[e.createVNode(e.unref(_.EntityFormSection),{description:e.unref(i)("gateway_services.form.sections.general.description"),"hide-info-header":n.hideSectionsInfo,title:e.unref(i)("gateway_services.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(v,{modelValue:r.fields.name,"onUpdate:modelValue":d[0]||(d[0]=m=>r.fields.name=m),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-name-input",error:_e.value,"error-message":M.value,label:e.unref(i)("gateway_services.form.fields.name.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.name.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"name",placeholder:e.unref(i)("gateway_services.form.fields.name.placeholder"),readonly:r.isReadonly,type:"text",onInput:ge},null,8,["modelValue","error","error-message","label","label-attributes","placeholder","readonly"]),e.createVNode(v,{modelValue:r.fields.tags,"onUpdate:modelValue":d[1]||(d[1]=m=>r.fields.tags=m),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-tags-input",help:e.unref(i)("gateway_services.form.fields.tags.help"),label:e.unref(i)("gateway_services.form.fields.tags.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"tags",placeholder:e.unref(i)("gateway_services.form.fields.tags.placeholder"),readonly:r.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","hide-info-header","title"]),e.createVNode(e.unref(_.EntityFormSection),{description:e.unref(i)("gateway_services.form.sections.keys.description"),"hide-info-header":n.hideSectionsInfo,title:e.unref(i)("gateway_services.form.sections.keys.title")},{default:e.withCtx(()=>[oe.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",Le,[e.createVNode(q,{required:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.sections.keys.checkedGroupLabel")),1)]),_:1})]),e.createElementVNode("div",qe,[e.createVNode(T,{modelValue:x.value,"onUpdate:modelValue":d[2]||(d[2]=m=>x.value=m),"data-testid":"gateway-service-url-radio","selected-value":me.url,onChange:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.sections.keys.urlLabel")),1)]),_:1},8,["modelValue","selected-value"])]),x.value==="url"?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(v,{modelValue:r.fields.url,"onUpdate:modelValue":d[3]||(d[3]=m=>r.fields.url=m),modelModifiers:{trim:!0},class:"gateway-service-url-input gateway-service-form-margin-bottom","data-testid":"gateway-service-url-input",label:e.unref(i)("gateway_services.form.fields.upstream_url.label"),"label-attributes":{info:n.config.app==="konnect"?e.unref(i)("gateway_services.form.fields.upstream_url.tooltip_for_konnect"):e.unref(i)("gateway_services.form.fields.upstream_url.tooltip_for_km"),tooltipAttributes:{maxWidth:"400"}},name:"url",placeholder:e.unref(i)("gateway_services.form.fields.upstream_url.placeholder"),required:""},null,8,["modelValue","label","label-attributes","placeholder"])])):e.createCommentVNode("",!0),e.createVNode(T,{modelValue:x.value,"onUpdate:modelValue":d[4]||(d[4]=m=>x.value=m),"checked-group":"protocol","data-testid":"gateway-service-protocol-radio","selected-value":me.protocol,onChange:re},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.sections.keys.checkedGroupAltLabel")),1)]),_:1},8,["modelValue","selected-value"])])),x.value==="protocol"||oe.value?(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(S,{modelValue:r.fields.protocol,"onUpdate:modelValue":d[5]||(d[5]=m=>r.fields.protocol=m),"data-testid":"gateway-service-protocol-select",items:ne,label:e.unref(i)("gateway_services.form.fields.protocol.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.protocol.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:r.isReadonly,required:"",width:"100%",onSelected:d[6]||(d[6]=m=>t(r.fields.protocol,m))},null,8,["modelValue","label","label-attributes","readonly"]),e.createVNode(v,{modelValue:r.fields.host,"onUpdate:modelValue":d[7]||(d[7]=m=>r.fields.host=m),modelModifiers:{trim:!0},class:"gateway-service-form-margin-top","data-testid":"gateway-service-host-input",label:e.unref(i)("gateway_services.form.fields.host.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.host.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"host",placeholder:e.unref(i)("gateway_services.form.fields.host.placeholder"),required:""},null,8,["modelValue","label","label-attributes","placeholder"]),X.value?(e.openBlock(),e.createElementBlock("div",je,[e.createVNode(v,{modelValue:r.fields.path,"onUpdate:modelValue":d[8]||(d[8]=m=>r.fields.path=m),modelModifiers:{trim:!0},class:"gateway-service-form-margin-top","data-testid":"gateway-service-path-input",label:e.unref(i)("gateway_services.form.fields.path.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.path.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"path",placeholder:e.unref(i)("gateway_services.form.fields.path.placeholder")},null,8,["modelValue","label","label-attributes","placeholder"])])):e.createCommentVNode("",!0),e.createVNode(v,{modelValue:r.fields.port,"onUpdate:modelValue":[d[9]||(d[9]=m=>r.fields.port=m),d[10]||(d[10]=()=>{r.fields.port=E(r.fields.port+"")})],class:"gateway-service-form-margin-top","data-testid":"gateway-service-port-input",label:e.unref(i)("gateway_services.form.fields.port.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.port.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"port",type:"number"},null,8,["modelValue","label","label-attributes"])])):e.createCommentVNode("",!0),e.createVNode(u,{modelValue:b.value,"onUpdate:modelValue":d[24]||(d[24]=m=>b.value=m),"data-testid":"advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(i)("gateway_services.form.sections.keys.viewAdvancedFields")},{default:e.withCtx(()=>[e.createElementVNode("div",ze,[e.createElementVNode("div",He,[e.createVNode(v,{modelValue:r.fields.retries,"onUpdate:modelValue":[d[11]||(d[11]=m=>r.fields.retries=m),d[12]||(d[12]=()=>{r.fields.retries=E(r.fields.retries+"")})],autocomplete:"off","data-testid":"gateway-service-retries-input",label:e.unref(i)("gateway_services.form.fields.retries.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.retries.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"retries",readonly:r.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",Ze,[e.createVNode(v,{modelValue:r.fields.connect_timeout,"onUpdate:modelValue":[d[13]||(d[13]=m=>r.fields.connect_timeout=m),d[14]||(d[14]=()=>{r.fields.connect_timeout=E(r.fields.connect_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-connTimeout-input",label:e.unref(i)("gateway_services.form.fields.connect_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.connect_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"connTimeout",readonly:r.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",Je,[e.createVNode(v,{modelValue:r.fields.write_timeout,"onUpdate:modelValue":[d[15]||(d[15]=m=>r.fields.write_timeout=m),d[16]||(d[16]=()=>{r.fields.write_timeout=E(r.fields.write_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-writeTimeout-input",label:e.unref(i)("gateway_services.form.fields.write_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.write_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"writeTimeout",readonly:r.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",Qe,[e.createVNode(v,{modelValue:r.fields.read_timeout,"onUpdate:modelValue":[d[17]||(d[17]=m=>r.fields.read_timeout=m),d[18]||(d[18]=()=>{r.fields.read_timeout=E(r.fields.read_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-readTimeout-input",label:e.unref(i)("gateway_services.form.fields.read_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.read_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"readTimeout",readonly:r.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),be.value?(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(v,{modelValue:r.fields.client_certificate,"onUpdate:modelValue":d[19]||(d[19]=m=>r.fields.client_certificate=m),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-clientCert-input",label:e.unref(i)("gateway_services.form.fields.client_certificate.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"clientCert",placeholder:e.unref(i)("gateway_services.form.fields.client_certificate.placeholder"),readonly:r.isReadonly,type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"])])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",Ye,[e.createVNode(v,{modelValue:r.fields.ca_certificates,"onUpdate:modelValue":d[20]||(d[20]=m=>r.fields.ca_certificates=m),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-ca-certs-input",label:e.unref(i)("gateway_services.form.fields.ca_certificates.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(i)("gateway_services.form.fields.ca_certificates.placeholder"),readonly:r.isReadonly,type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(L),{keypath:"gateway_services.form.fields.ca_certificates.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.ca_certificates.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.ca_certificates.code2")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])])):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",et,[e.createVNode(c,{modelValue:r.fields.tls_verify_enabled,"onUpdate:modelValue":d[21]||(d[21]=m=>r.fields.tls_verify_enabled=m),"data-testid":"gateway-service-tls-verify-checkbox",description:e.unref(i)("gateway_services.form.fields.tls_verify_enabled.help"),label:e.unref(i)("gateway_services.form.fields.tls_verify_enabled.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}}},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(L),{keypath:"gateway_services.form.fields.tls_verify_enabled.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.tls_verify_enabled.code1")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),r.fields.tls_verify_enabled?(e.openBlock(),e.createElementBlock("div",tt,[e.createVNode(T,{modelValue:r.fields.tls_verify_value,"onUpdate:modelValue":d[22]||(d[22]=m=>r.fields.tls_verify_value=m),"data-testid":"gateway-service-tls-verify-true-option",label:e.unref(i)("gateway_services.form.fields.tls_verify_option.true.label"),"selected-value":!0},null,8,["modelValue","label"])])):e.createCommentVNode("",!0),r.fields.tls_verify_enabled?(e.openBlock(),e.createElementBlock("div",ot,[e.createVNode(T,{modelValue:r.fields.tls_verify_value,"onUpdate:modelValue":d[23]||(d[23]=m=>r.fields.tls_verify_value=m),"data-testid":"gateway-service-tls-verify-false-option",label:e.unref(i)("gateway_services.form.fields.tls_verify_option.false.label"),"selected-value":!1},null,8,["modelValue","label"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","trigger-label"])]),_:1},8,["description","hide-info-header","title"])]),_:3},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-c2c5e1f0"]]),lt={class:"kong-ui-gateway-service-entity-config-card"},it=e.defineComponent({__name:"GatewayServiceConfigCard",props:{config:{type:Object,required:!0,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.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(n){const B=n,{i18n:{t:g},i18nT:p}=Z.useI18n(),s=e.computed(()=>ee.form[B.config.app].edit),{getPropValue:b}=_.useHelpers(),P=(i,$)=>b(i,$)===!0?g("gateway_services.form.fields.tls_verify_option.true.display"):g("gateway_services.form.fields.tls_verify_option.false.display"),L=e.ref({id:{},name:{tooltip:g("gateway_services.form.fields.name.tooltip")},enabled:{},updated_at:{},created_at:{},protocol:{section:_.ConfigurationSchemaSection.Basic,tooltip:g("gateway_services.form.fields.protocol.tooltip")},host:{section:_.ConfigurationSchemaSection.Basic,tooltip:g("gateway_services.form.fields.host.tooltip")},path:{section:_.ConfigurationSchemaSection.Basic,tooltip:g("gateway_services.form.fields.path.tooltip")},port:{section:_.ConfigurationSchemaSection.Basic,tooltip:g("gateway_services.form.fields.port.tooltip")},tags:{tooltip:g("gateway_services.form.fields.tags.tooltip")},retries:{order:1,tooltip:g("gateway_services.form.fields.retries.tooltip")},connect_timeout:{order:2,tooltip:g("gateway_services.form.fields.connect_timeout.tooltip")},write_timeout:{order:3,tooltip:g("gateway_services.form.fields.write_timeout.tooltip")},read_timeout:{order:4,tooltip:g("gateway_services.form.fields.read_timeout.tooltip")},client_certificate:{order:5,tooltip:g("gateway_services.form.fields.client_certificate.tooltip")},ca_certificates:{type:_.ConfigurationSchemaType.BadgeTag,label:g("gateway_services.form.fields.ca_certificates.label"),order:6},tls_verify:{label:g("gateway_services.form.fields.tls_verify_enabled.label")},tls_verify_depth:{hidden:!0}});return(i,$)=>(e.openBlock(),e.createElementBlock("div",lt,[e.createVNode(e.unref(_.EntityBaseConfigCard),{config:n.config,"config-card-doc":n.configCardDoc,"config-schema":L.value,"entity-type":e.unref(_.SupportedEntityType).GatewayService,"fetch-url":s.value,"hide-title":n.hideTitle,"onFetch:error":$[0]||($[0]=k=>i.$emit("fetch:error",k)),"onFetch:success":$[1]||($[1]=k=>i.$emit("fetch:success",k)),onLoading:$[2]||($[2]=k=>i.$emit("loading",k))},{"enabled-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"gateway_services.form.fields.enabled.tooltip",scope:"global"},{false:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.enabled.false")),1)]),true:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.enabled.true")),1)]),_:1})]),"ca_certificates-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"gateway_services.form.fields.ca_certificates.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.ca_certificates.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.ca_certificates.code2")),1)]),_:1})]),"tls_verify-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(p),{keypath:"gateway_services.form.fields.tls_verify_enabled.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(g)("gateway_services.form.fields.tls_verify_enabled.code1")),1)]),_:1})]),tls_verify:e.withCtx(k=>[e.createTextVNode(e.toDisplayString(typeof e.unref(b)("rowValue",k)=="boolean"?P("rowValue",k):e.unref(g)("gateway_services.form.fields.tls_verify_option.unset.display")),1)]),client_certificate:e.withCtx(k=>[e.createTextVNode(e.toDisplayString(e.unref(b)("rowValue",k)?e.unref(b)("rowValue",k).id:"–"),1)]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const xe=()=>{};function st(n,B){function g(...p){return new Promise((s,b)=>{Promise.resolve(n(()=>B.apply(this,p),{fn:B,thisArg:this,args:p})).then(s).catch(b)})}return g}function at(n,B={}){let g,p,s=xe;const b=i=>{clearTimeout(i),s(),s=xe};let P;return i=>{const $=e.toValue(n),k=e.toValue(B.maxWait);return g&&b(g),$<=0||k!==void 0&&k<=0?(p&&(b(p),p=null),Promise.resolve(i())):new Promise((J,te)=>{s=B.rejectOnCancel?te:J,P=i,k&&!p&&(p=setTimeout(()=>{g&&b(g),p=null,J(P())},k)),g=setTimeout(()=>{p&&b(p),p=null,J(i())},$)})}}function Ne(n,B=200,g={}){return st(at(B,g),n)}const G={name:"Kong-Air-Flights-API",tags:[],protocol:"https",path:"/flights",read_timeout:6e4,retries:5,host:"api.kong-air.com",connect_timeout:6e4,ca_certificates:null,client_certificate:null,write_timeout:6e4,port:443},nt={class:"kong-ui-entities-gateway-service-form"},ct={key:0,class:"gateway-service-form-general-info"},dt={class:"gateway-service-form-group-selection-wrapper"},ft={key:0,class:"gateway-service-form-group-fields"},pt={key:0,class:"gateway-service-form-group-fields"},mt={key:0},ut={key:0,class:"gateway-service-form-advanced-fields"},gt={class:"gateway-service-form-margin-bottom"},yt={class:"gateway-service-form-margin-bottom"},_t={class:"gateway-service-form-margin-bottom"},bt={class:"gateway-service-form-margin-bottom"},wt={key:0,class:"gateway-service-form-margin-bottom"},ht={key:1,class:"gateway-service-form-margin-bottom"},vt={key:2,class:"gateway-service-form-margin-bottom"},Vt={key:0,class:"checkbox-aligned-radio"},kt={key:1,class:"checkbox-aligned-radio"},Ct={class:"gateway-service-form-tags"},Nt={class:"form-error-list"},Et=Ce(e.defineComponent({__name:"GatewayServiceForm",props:{config:{type:Object,required:!0,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)},gatewayServiceId:{type:String,required:!1,default:""},hideSectionsInfo:{type:Boolean,required:!1,default:!1},hideTrySampleApiButton:{type:Boolean,required:!1,default:!1}},emits:["update","error","url-valid:success","url-valid:error","loading","model-updated","try-sample-api"],setup(n,{expose:B,emit:g}){var w;const p=g,s=n,b=e.ref(!0),P=ke.useRouter(),{i18nT:L,i18n:{t:i}}=Z.useI18n(),{getErrorFieldsFromError:$}=_.useErrors(),{axiosInstance:k}=_.useAxios((w=s.config)==null?void 0:w.axiosRequestConfig),J=_.useValidators(),{validateHost:te,validatePath:O,validatePort:pe,validateProtocol:oe}=Z.useUrlValidators(),{objectsAreEqual:x}=_.useHelpers(),ae=e.computed(()=>ee.form[s.config.app].edit),M=e.computed(()=>s.gatewayServiceId?_.EntityBaseFormType.Edit:_.EntityBaseFormType.Create),_e=e.ref(!1),r=e.computed(()=>!!s.gatewayServiceId),h=e.ref(r.value?"protocol":"url"),Q=Z.usePortFromProtocol(),ne=e.ref(""),me=e.computed(()=>!!ne.value||!!j("name")),t=e.reactive({fields:{name:"",protocol:"http",host:"",path:"",port:80,url:"",retries:5,connect_timeout:6e4,write_timeout:6e4,read_timeout:6e4,client_certificate:"",ca_certificates:"",tls_verify_enabled:!1,tls_verify_value:!1,tags:""},isReadonly:!1,errorMessages:[],formFieldErrors:{host:"",port:"",path:"",name:"",url:"",tags:"",retries:"",connect_timeout:"",write_timeout:"",read_timeout:"",client_certificate:"",ca_certificates:"",tls_verify_enabled:"",tls_verify_value:""}}),E=e.reactive({name:"",protocol:"http",host:"",path:"",port:80,url:"",retries:5,connect_timeout:6e4,write_timeout:6e4,read_timeout:6e4,client_certificate:"",ca_certificates:"",tls_verify_enabled:!1,tls_verify_value:!1,tags:""}),re=s.config.app==="konnect"||_.useGatewayFeatureSupported({gatewayInfo:s.config.gatewayInfo,supportedRange:{enterprise:["3.0"]}}),U=[{label:i("gateway_services.form.fields.protocol.options.http"),value:"http",group:"http"},{label:i("gateway_services.form.fields.protocol.options.https"),value:"https",group:"http"},{label:i("gateway_services.form.fields.protocol.options.tcp"),value:"tcp",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.tls"),value:"tls",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.tls_passthrough"),value:"tls_passthrough",group:"tcp"},{label:i("gateway_services.form.fields.protocol.options.grpc"),value:"grpc",group:"grpc"},{label:i("gateway_services.form.fields.protocol.options.grpcs"),value:"grpcs",group:"grpc"},...re?[{label:i("gateway_services.form.fields.protocol.options.ws"),value:"ws",group:"websocket"},{label:i("gateway_services.form.fields.protocol.options.wss"),value:"wss",group:"websocket"}]:[],{label:i("gateway_services.form.fields.protocol.options.udp"),value:"udp",group:"udp"}],X={url:"url",protocol:"protocol"},be=(o,a)=>{a.value},H=o=>o?parseFloat(o):0,ue=()=>{t.fields.host=E.host,t.fields.path=E.path,t.fields.port=E.port,t.fields.protocol=E.protocol,t.fields.url=E.url,t.fields.retries=E.retries,t.fields.connect_timeout=E.connect_timeout,t.fields.write_timeout=E.write_timeout,t.fields.read_timeout=E.read_timeout,t.fields.client_certificate=E.client_certificate,t.fields.ca_certificates=E.ca_certificates,t.fields.tls_verify_enabled=E.tls_verify_enabled,t.fields.tls_verify_value=E.tls_verify_value},ge=()=>{b.value=!0,W(),t.errorMessages=[],ue()},le=()=>{switch(ue(),t.fields.name=`${G.name}-${new Date().toISOString().replace(/\D/g,"").slice(0,17)}`,h.value){case"url":t.fields.url=`${G.protocol}://${G.host}${G.path}`;break;case"protocol":t.fields.host=G.host,t.fields.path=G.path,t.fields.protocol=G.protocol,t.fields.port=G.port;break;default:t.fields.url=`${G.protocol}://${G.host}${G.path}`}},ce=Ne(()=>{if(W(),t.fields.url.length)try{const o=new URL(t.fields.url),a=oe(o.protocol,U);if(a)throw new Error(a);t.fields.protocol=o.protocol.slice(0,-1);const C=te(o.hostname);if(C)throw new Error(C);t.fields.host=o.hostname;const R=O(o.pathname);if(R)throw new Error(R);t.fields.path=o.pathname;const N=pe(o.port);if(N)throw new Error(N);const I=Number(o.port);_e.value=!!I,t.fields.port=I||Q.getPortFromProtocol(t.fields.protocol),p("url-valid:success")}catch{p("url-valid:error",i("gateway_services.form.errors.url.invalid")),t.formFieldErrors.url=i("gateway_services.form.errors.url.invalid")}},300),de=Ne(o=>{W(o)},300),we=e.computed(()=>!!t.formFieldErrors.url||!!t.formFieldErrors.host||!!t.formFieldErrors.port),j=o=>{if(t.errorMessages.length)return"";const a=t.formFieldErrors;return a[o]?a[o]:""},K=Ne(o=>{W(o??void 0);const a=te(t.fields.host);a&&(t.formFieldErrors.host=a);const C=O(t.fields.path);C&&(t.formFieldErrors.path=C);const R=pe(t.fields.port);R&&(t.formFieldErrors.port=R),z.value?p("url-valid:success"):p("url-valid:error",t.errorMessages.join(",")||i("gateway_services.form.errors.url.invalid"))},300),W=o=>{if(o)t.formFieldErrors[o]="";else for(let a in t.formFieldErrors)t.formFieldErrors[a]="";t.errorMessages=[]},z=e.computed(()=>{for(let o in t.formFieldErrors)if(t.formFieldErrors[o].length)return!1;return!0}),Y=()=>{t.fields.url&&h.value==="url"?ce():K()},l=()=>`new-service-${new Date().toISOString().replace(/\D/g,"").slice(0,17)}`,d=e.computed(()=>!["tcp","tls","tls_passthrough","grpc","grpcs","udp"].includes(t.fields.protocol)),v=e.computed(()=>{if(h.value==="url")return!0;const o=["https","wss","tls"].includes(t.fields.protocol);return h.value==="protocol"&&o}),q=e.computed(()=>{if(h.value==="url")return!0;const o=["https","tls"].includes(t.fields.protocol);return h.value==="protocol"&&o}),T=e.computed(()=>{if(h.value==="url")return!0;const o=["https","wss","tls"].includes(t.fields.protocol);return h.value==="protocol"&&o}),S=o=>{W("name"),ne.value=J.utf8Name(o)},c=e.computed(()=>{const o=!r.value||!x(t.fields,E),a=h.value==="url"&&!!t.fields.url&&z.value,C=h.value==="protocol"&&!!t.fields.host&&z.value;return o&&(a||C)}),u=o=>{var a,C,R;t.fields.name=(o==null?void 0:o.name)||"",t.fields.tags=((a=o==null?void 0:o.tags)==null?void 0:a.join(", "))||"",t.fields.protocol=(o==null?void 0:o.protocol)||"http",t.fields.path=(o==null?void 0:o.path)||"",t.fields.read_timeout=o!=null&&o.read_timeout||(o==null?void 0:o.read_timeout)===0?o==null?void 0:o.read_timeout:6e4,t.fields.retries=o!=null&&o.retries||(o==null?void 0:o.retries)===0?o==null?void 0:o.retries:5,t.fields.host=(o==null?void 0:o.host)||"",t.fields.connect_timeout=o!=null&&o.connect_timeout||(o==null?void 0:o.connect_timeout)===0?o==null?void 0:o.connect_timeout:6e4,t.fields.tls_verify_enabled=(o==null?void 0:o.tls_verify)!==""&&(o==null?void 0:o.tls_verify)!==null&&(o==null?void 0:o.tls_verify)!==void 0,t.fields.tls_verify_value=o!=null&&o.tls_verify?o==null?void 0:o.tls_verify:!1,t.fields.ca_certificates=((C=o==null?void 0:o.ca_certificates)==null?void 0:C.join(","))||"",t.fields.client_certificate=((R=o==null?void 0:o.client_certificate)==null?void 0:R.id)||"",t.fields.write_timeout=o!=null&&o.write_timeout||(o==null?void 0:o.write_timeout)===0?o==null?void 0:o.write_timeout:6e4,t.fields.port=o!=null&&o.port||(o==null?void 0:o.port)===0?o==null?void 0:o.port:80,Object.assign(E,t.fields)},m=()=>{P.push(s.config.cancelRoute)},V=e.computed(()=>{var a,C;let o=`${s.config.apiBaseUrl}${ee.form[s.config.app].validate}`;return s.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((a=s.config)==null?void 0:a.controlPlaneId)||""):s.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(C=s.config)!=null&&C.workspace?`/${s.config.workspace}`:"")),o=o.replace(/{id}/gi,s.gatewayServiceId),o}),F=e.computed(()=>{var a,C;let o=`${s.config.apiBaseUrl}${ee.form[s.config.app][M.value]}`;return s.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((a=s.config)==null?void 0:a.controlPlaneId)||""):s.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(C=s.config)!=null&&C.workspace?`/${s.config.workspace}`:"")),o=o.replace(/{id}/gi,s.gatewayServiceId),o}),ie=o=>{let a="";o.url&&(a=new URL(o.url).protocol),(["https","wss","tls"].includes(o.protocol)||["https","wss","tls"].includes(a))&&(o.tls_verify=o.tls_verify_enabled?o.tls_verify_value:null),delete o.tls_verify_enabled,delete o.tls_verify_value},A=e.computed(()=>{var a,C,R,N;const o={name:t.fields.name||null,tags:t.fields.tags?(R=(C=(a=t.fields.tags)==null?void 0:a.split(","))==null?void 0:C.map(I=>String(I||"").trim()))==null?void 0:R.filter(I=>I!==""):null,protocol:t.fields.protocol,path:t.fields.path||null,read_timeout:t.fields.read_timeout,retries:t.fields.retries,host:t.fields.host,connect_timeout:t.fields.connect_timeout,tls_verify_value:t.fields.tls_verify_value,tls_verify_enabled:t.fields.tls_verify_enabled,ca_certificates:t.fields.ca_certificates?(N=t.fields.ca_certificates)==null?void 0:N.split(",").filter(I=>I!==""):null,client_certificate:t.fields.client_certificate?{id:t.fields.client_certificate}:null,write_timeout:t.fields.write_timeout,port:t.fields.port,url:t.fields.url};return t.fields.client_certificate&&["https","wss","tls"].includes(t.fields.protocol)&&(o.client_certificate={id:t.fields.client_certificate}),t.fields.tls_verify_enabled&&["https","wss","tls"].includes(t.fields.protocol)&&(o.tls_verify=t.fields.tls_verify_value),d.value||(o.path=null),M.value==="create"?h.value==="url"?(delete o.protocol,delete o.host,delete o.path,s.config.app==="konnect"&&delete o.port):delete o.url:M.value==="edit"&&delete o.url,o}),se=async()=>{var o,a,C,R;try{t.isReadonly=!0,Y();const N=A.value;ie(N);let I;if(await k.post(V.value,N),M.value==="create"?I=await k.post(F.value,N):M.value==="edit"&&(I=((o=s.config)==null?void 0:o.app)==="konnect"?await k.put(F.value,N):await k.patch(F.value,N)),I){const{data:f}=I;t.fields.name=(f==null?void 0:f.name)||"",t.fields.port=f.port||Q.getPortFromProtocol(f.protocol),t.fields.protocol=(f==null?void 0:f.protocol)||"http",t.fields.host=(f==null?void 0:f.host)||"",t.fields.path=(f==null?void 0:f.path)||"",t.fields.url=(f==null?void 0:f.url)||"",t.fields.retries=f!=null&&f.retries||(f==null?void 0:f.retries)===0?f==null?void 0:f.retries:5,t.fields.connect_timeout=f!=null&&f.connect_timeout||(f==null?void 0:f.connect_timeout)===0?f==null?void 0:f.connect_timeout:6e4,t.fields.write_timeout=f!=null&&f.write_timeout||(f==null?void 0:f.write_timeout)===0?f==null?void 0:f.write_timeout:6e4,t.fields.read_timeout=f!=null&&f.read_timeout||(f==null?void 0:f.read_timeout)===0?f==null?void 0:f.read_timeout:6e4,t.fields.client_certificate=((a=f==null?void 0:f.client_certificate)==null?void 0:a.id)||"",t.fields.ca_certificates=(C=f==null?void 0:f.ca_certificates)!=null&&C.length?f==null?void 0:f.ca_certificates.join(","):"",t.fields.tls_verify_enabled=(f==null?void 0:f.tls_verify)!==""&&(f==null?void 0:f.tls_verify)!==null&&(f==null?void 0:f.tls_verify)!==void 0,t.fields.tls_verify_value=t.fields.tls_verify_enabled&&(f==null?void 0:f.tls_verify),t.fields.tags=(R=f==null?void 0:f.tags)!=null&&R.length?f.tags.join(", "):"",Object.assign(E,t.fields),p("update",I==null?void 0:I.data)}return I}catch(N){const{fields:I,messages:f}=$(N);t.errorMessages=f,I.length&&I.forEach(fe=>{const ye=fe.field;ye==="client_certificate.id"?t.formFieldErrors.client_certificate=fe.message:ye.startsWith("ca_certificates")?t.formFieldErrors.ca_certificates=fe.message:Object.keys(t.formFieldErrors).includes(ye)&&(t.formFieldErrors={...t.formFieldErrors,[ye]:fe.message})}),p("error",N)}finally{t.isReadonly=!1}};return e.watch(()=>s.gatewayServiceId,()=>{Object.assign(t.fields,E)}),e.watch(t.fields,o=>{t.fields.port=Q.getPortFromProtocol(o.protocol,String(o.port)),p("model-updated",A.value)}),e.onMounted(()=>{p("model-updated",A.value),r.value||(t.fields.name=l())}),B({validateUrl:Y,getPayload:A,saveFormData:se,canSubmit:c,initForm:u}),(o,a)=>{const C=e.resolveComponent("KRadio"),R=e.resolveComponent("KButton"),N=e.resolveComponent("KInput"),I=e.resolveComponent("KSelect"),f=e.resolveComponent("KCheckbox"),fe=e.resolveComponent("KCollapse"),ye=e.resolveComponent("KAlert");return e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(e.unref(_.EntityBaseForm),{"can-submit":c.value,config:n.config,"edit-id":n.gatewayServiceId,"entity-type":e.unref(_.SupportedEntityType).GatewayService,"fetch-url":ae.value,"form-fields":A.value,"is-readonly":t.isReadonly,onCancel:m,"onFetch:error":a[30]||(a[30]=y=>o.$emit("error",y)),"onFetch:success":u,onLoading:a[31]||(a[31]=y=>o.$emit("loading",y)),onSubmit:se},{"form-actions":e.withCtx(()=>[e.renderSlot(o.$slots,"form-actions",{canSubmit:c.value,cancel:m,submit:se},void 0,!0)]),default:e.withCtx(()=>[e.createVNode(e.unref(_.EntityFormSection),{description:e.unref(i)("gateway_services.form.sections.keys.description"),"hide-info-header":n.hideSectionsInfo,title:e.unref(i)("gateway_services.form.sections.keys.title")},{default:e.withCtx(()=>[r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ct,[e.createElementVNode("div",dt,[e.createVNode(C,{modelValue:h.value,"onUpdate:modelValue":a[0]||(a[0]=y=>h.value=y),card:"","card-orientation":"horizontal","data-testid":"gateway-service-url-radio",description:e.unref(i)("gateway_services.form.sections.keys.url.description"),label:e.unref(i)("gateway_services.form.sections.keys.url.label"),"selected-value":X.url,onChange:ge},null,8,["modelValue","description","label","selected-value"]),e.createVNode(C,{modelValue:h.value,"onUpdate:modelValue":a[1]||(a[1]=y=>h.value=y),card:"","card-orientation":"horizontal","checked-group":"protocol","data-testid":"gateway-service-protocol-radio",description:e.unref(i)("gateway_services.form.sections.keys.protocol.description"),label:e.unref(i)("gateway_services.form.sections.keys.protocol.label"),"selected-value":X.protocol,onChange:ge},null,8,["modelValue","description","label","selected-value"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[h.value==="url"?(e.openBlock(),e.createElementBlock("div",ft,[e.createVNode(N,{modelValue:t.fields.url,"onUpdate:modelValue":a[2]||(a[2]=y=>t.fields.url=y),modelModifiers:{trim:!0},class:"gateway-service-url-input gateway-service-form-margin-bottom","data-testid":"gateway-service-url-input",error:we.value,"error-message":j("url"),label:e.unref(i)("gateway_services.form.fields.upstream_url.label"),"label-attributes":{info:n.config.app==="konnect"?e.unref(i)("gateway_services.form.fields.upstream_url.tooltip_for_konnect"):e.unref(i)("gateway_services.form.fields.upstream_url.tooltip_for_km"),tooltipAttributes:{maxWidth:"400"}},name:"url",placeholder:e.unref(i)("gateway_services.form.fields.upstream_url.placeholder"),required:"",onInput:e.unref(ce)},e.createSlots({_:2},[n.hideTrySampleApiButton?void 0:{name:"after",fn:e.withCtx(()=>[e.createVNode(R,{appearance:"tertiary","data-testid":"try-sample-api",size:"small",onClick:le},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.buttons.try_sample")),1)]),_:1})]),key:"0"}]),1032,["modelValue","error","error-message","label","label-attributes","placeholder","onInput"])])):e.createCommentVNode("",!0)]),_:1})])),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[h.value==="protocol"||r.value?(e.openBlock(),e.createElementBlock("div",pt,[e.createVNode(I,{modelValue:t.fields.protocol,"onUpdate:modelValue":a[3]||(a[3]=y=>t.fields.protocol=y),"data-testid":"gateway-service-protocol-select",items:U,label:e.unref(i)("gateway_services.form.fields.protocol.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.protocol.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:t.isReadonly,required:"",width:"100%",onSelected:a[4]||(a[4]=y=>be(t.fields.protocol,y))},null,8,["modelValue","label","label-attributes","readonly"]),e.createVNode(N,{modelValue:t.fields.host,"onUpdate:modelValue":a[5]||(a[5]=y=>t.fields.host=y),modelModifiers:{trim:!0},class:"gateway-service-form-margin-top","data-testid":"gateway-service-host-input",error:!!t.formFieldErrors.host,"error-message":j("host"),label:e.unref(i)("gateway_services.form.fields.host.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.host.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"host",placeholder:e.unref(i)("gateway_services.form.fields.host.placeholder"),required:"",onInput:a[6]||(a[6]=y=>e.unref(K)("host"))},e.createSlots({_:2},[n.hideTrySampleApiButton?void 0:{name:"after",fn:e.withCtx(()=>[e.createVNode(R,{appearance:"tertiary",size:"small",onClick:le},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("gateway_services.form.buttons.try_sample")),1)]),_:1})]),key:"0"}]),1032,["modelValue","error","error-message","label","label-attributes","placeholder"]),d.value?(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(N,{modelValue:t.fields.path,"onUpdate:modelValue":a[7]||(a[7]=y=>t.fields.path=y),modelModifiers:{trim:!0},class:"gateway-service-form-margin-top","data-testid":"gateway-service-path-input",error:!!t.formFieldErrors.path,"error-message":j("path"),label:e.unref(i)("gateway_services.form.fields.path.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.path.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"path",placeholder:e.unref(i)("gateway_services.form.fields.path.placeholder"),onInput:a[8]||(a[8]=y=>e.unref(K)("path"))},null,8,["modelValue","error","error-message","label","label-attributes","placeholder"])])):e.createCommentVNode("",!0),e.createVNode(N,{modelValue:t.fields.port,"onUpdate:modelValue":[a[9]||(a[9]=y=>t.fields.port=y),a[11]||(a[11]=()=>{t.fields.port=H(t.fields.port+"")})],class:"gateway-service-form-margin-top","data-testid":"gateway-service-port-input",error:!!t.formFieldErrors.port,"error-message":j("port"),label:e.unref(i)("gateway_services.form.fields.port.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.port.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"port",type:"number",onInput:a[10]||(a[10]=y=>e.unref(K)("port"))},null,8,["modelValue","error","error-message","label","label-attributes"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(fe,{modelValue:b.value,"onUpdate:modelValue":a[27]||(a[27]=y=>b.value=y),"data-testid":"advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(i)("gateway_services.form.sections.keys.viewAdvancedFields")},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ut,[e.createElementVNode("div",gt,[e.createVNode(N,{modelValue:t.fields.retries,"onUpdate:modelValue":[a[12]||(a[12]=y=>t.fields.retries=y),a[13]||(a[13]=()=>{t.fields.retries=H(t.fields.retries+"")})],autocomplete:"off","data-testid":"gateway-service-retries-input",label:e.unref(i)("gateway_services.form.fields.retries.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.retries.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"retries",readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",yt,[e.createVNode(N,{modelValue:t.fields.connect_timeout,"onUpdate:modelValue":[a[14]||(a[14]=y=>t.fields.connect_timeout=y),a[15]||(a[15]=()=>{t.fields.connect_timeout=H(t.fields.connect_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-connTimeout-input",label:e.unref(i)("gateway_services.form.fields.connect_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.connect_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"connTimeout",readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",_t,[e.createVNode(N,{modelValue:t.fields.write_timeout,"onUpdate:modelValue":[a[16]||(a[16]=y=>t.fields.write_timeout=y),a[17]||(a[17]=()=>{t.fields.write_timeout=H(t.fields.write_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-writeTimeout-input",label:e.unref(i)("gateway_services.form.fields.write_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.write_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"writeTimeout",readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),e.createElementVNode("div",bt,[e.createVNode(N,{modelValue:t.fields.read_timeout,"onUpdate:modelValue":[a[18]||(a[18]=y=>t.fields.read_timeout=y),a[19]||(a[19]=()=>{t.fields.read_timeout=H(t.fields.read_timeout+"")})],autocomplete:"off","data-testid":"gateway-service-readTimeout-input",label:e.unref(i)("gateway_services.form.fields.read_timeout.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.read_timeout.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"readTimeout",readonly:t.isReadonly,type:"number"},null,8,["modelValue","label","label-attributes","readonly"])]),v.value?(e.openBlock(),e.createElementBlock("div",wt,[e.createVNode(N,{modelValue:t.fields.client_certificate,"onUpdate:modelValue":a[20]||(a[20]=y=>t.fields.client_certificate=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-clientCert-input",error:!!t.formFieldErrors.client_certificate,label:e.unref(i)("gateway_services.form.fields.client_certificate.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"clientCert",placeholder:e.unref(i)("gateway_services.form.fields.client_certificate.placeholder"),readonly:t.isReadonly,type:"text",onInput:a[21]||(a[21]=y=>e.unref(de)("client_certificate"))},null,8,["modelValue","error","label","label-attributes","placeholder","readonly"])])):e.createCommentVNode("",!0),q.value?(e.openBlock(),e.createElementBlock("div",ht,[e.createVNode(N,{modelValue:t.fields.ca_certificates,"onUpdate:modelValue":a[22]||(a[22]=y=>t.fields.ca_certificates=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-ca-certs-input",error:!!t.formFieldErrors.ca_certificates,label:e.unref(i)("gateway_services.form.fields.ca_certificates.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(i)("gateway_services.form.fields.ca_certificates.placeholder"),readonly:t.isReadonly,type:"text",onInput:a[23]||(a[23]=y=>e.unref(de)("ca_certificates"))},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(L),{keypath:"gateway_services.form.fields.ca_certificates.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.ca_certificates.code1")),1)]),code2:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.ca_certificates.code2")),1)]),_:1})]),_:1},8,["modelValue","error","label","placeholder","readonly"])])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("div",vt,[e.createVNode(f,{modelValue:t.fields.tls_verify_enabled,"onUpdate:modelValue":a[24]||(a[24]=y=>t.fields.tls_verify_enabled=y),"data-testid":"gateway-service-tls-verify-checkbox",description:e.unref(i)("gateway_services.form.fields.tls_verify_enabled.help"),label:e.unref(i)("gateway_services.form.fields.tls_verify_enabled.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}}},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(L),{keypath:"gateway_services.form.fields.tls_verify_enabled.tooltip",scope:"global"},{code1:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(i)("gateway_services.form.fields.tls_verify_enabled.code1")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),t.fields.tls_verify_enabled?(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(C,{modelValue:t.fields.tls_verify_value,"onUpdate:modelValue":a[25]||(a[25]=y=>t.fields.tls_verify_value=y),"data-testid":"gateway-service-tls-verify-true-option",label:e.unref(i)("gateway_services.form.fields.tls_verify_option.true.label"),"selected-value":!0},null,8,["modelValue","label"])])):e.createCommentVNode("",!0),t.fields.tls_verify_enabled?(e.openBlock(),e.createElementBlock("div",kt,[e.createVNode(C,{modelValue:t.fields.tls_verify_value,"onUpdate:modelValue":a[26]||(a[26]=y=>t.fields.tls_verify_value=y),"data-testid":"gateway-service-tls-verify-false-option",label:e.unref(i)("gateway_services.form.fields.tls_verify_option.false.label"),"selected-value":!1},null,8,["modelValue","label"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))]),_:1})]),_:1},8,["modelValue","trigger-label"])]),_:1},8,["description","hide-info-header","title"]),e.createVNode(e.unref(_.EntityFormSection),{description:e.unref(i)("gateway_services.form.sections.general.description"),"hide-info-header":n.hideSectionsInfo,title:e.unref(i)("gateway_services.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(N,{modelValue:t.fields.name,"onUpdate:modelValue":a[28]||(a[28]=y=>t.fields.name=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-name-input",error:me.value,"error-message":ne.value,label:e.unref(i)("gateway_services.form.fields.name.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.name.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"name",placeholder:e.unref(i)("gateway_services.form.fields.name.placeholder"),readonly:t.isReadonly,type:"text",onInput:S},null,8,["modelValue","error","error-message","label","label-attributes","placeholder","readonly"]),e.createVNode(fe,{"data-testid":"tags-collapse","trigger-alignment":"leading","trigger-label":e.unref(i)("gateway_services.form.fields.tags.collapse")},{default:e.withCtx(()=>[e.createElementVNode("div",Ct,[e.createVNode(N,{modelValue:t.fields.tags,"onUpdate:modelValue":a[29]||(a[29]=y=>t.fields.tags=y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"gateway-service-tags-input",help:e.unref(i)("gateway_services.form.fields.tags.help"),label:e.unref(i)("gateway_services.form.fields.tags.label"),"label-attributes":{info:e.unref(i)("gateway_services.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},name:"tags",placeholder:e.unref(i)("gateway_services.form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])])]),_:1},8,["trigger-label"])]),_:1},8,["description","hide-info-header","title"]),t.errorMessages.length?(e.openBlock(),e.createBlock(ye,{key:0,appearance:"danger"},{default:e.withCtx(()=>[e.createElementVNode("ul",Nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.errorMessages,y=>(e.openBlock(),e.createElementBlock("li",{key:y},e.toDisplayString(y),1))),128))])]),_:1})):e.createCommentVNode("",!0)]),_:3},8,["can-submit","config","edit-id","entity-type","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-0200f215"]]),{validateHost:xt,validatePort:St,validateProtocol:It,validatePath:Pt}=Z.useUrlValidators(),Bt=()=>({validateHost:xt,validatePort:St,validateProtocol:It,validatePath:Pt});D.GatewayServiceConfigCard=it,D.GatewayServiceForm=Et,D.GatewayServiceList=De,D.LegacyGatewayServiceForm=rt,D.useUrlValidator=Bt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,8 +2,7 @@ import GatewayServiceList from './components/GatewayServiceList.vue';
|
|
|
2
2
|
import LegacyGatewayServiceForm from './components/LegacyGatewayServiceForm.vue';
|
|
3
3
|
import GatewayServiceConfigCard from './components/GatewayServiceConfigCard.vue';
|
|
4
4
|
import GatewayServiceForm from './components/GatewayServiceForm.vue';
|
|
5
|
-
declare const useUrlValidators: typeof import("./composables/useUrlValidators.js").default;
|
|
6
5
|
export { GatewayServiceList, GatewayServiceForm, GatewayServiceConfigCard, LegacyGatewayServiceForm };
|
|
7
|
-
export
|
|
6
|
+
export * from './utils';
|
|
8
7
|
export * from './types';
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AACpE,OAAO,wBAAwB,MAAM,2CAA2C,CAAA;AAChF,OAAO,wBAAwB,MAAM,2CAA2C,CAAA;AAChF,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AACpE,OAAO,wBAAwB,MAAM,2CAA2C,CAAA;AAChF,OAAO,wBAAwB,MAAM,2CAA2C,CAAA;AAChF,OAAO,kBAAkB,MAAM,qCAAqC,CAAA;AAGpE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,CAAA;AAGrG,cAAc,SAAS,CAAA;AAGvB,cAAc,SAAS,CAAA"}
|
|
@@ -66,4 +66,10 @@ export interface SelectItem {
|
|
|
66
66
|
value: string | number;
|
|
67
67
|
selected?: boolean;
|
|
68
68
|
}
|
|
69
|
+
export interface useUrlValidators {
|
|
70
|
+
validateHost: (host: string) => string;
|
|
71
|
+
validatePort: (port: number) => string;
|
|
72
|
+
validateProtocol: (protocol: string) => string;
|
|
73
|
+
validatePath: (path: string) => string;
|
|
74
|
+
}
|
|
69
75
|
//# sourceMappingURL=gateway-service-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-service-form.d.ts","sourceRoot":"","sources":["../../../src/types/gateway-service-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAEvG,yCAAyC;AACzC,MAAM,WAAW,+BAAgC,SAAQ,qBAAqB;IAC5E,mEAAmE;IACnE,WAAW,EAAE,gBAAgB,CAAA;CAC9B;AAED,8CAA8C;AAC9C,MAAM,WAAW,mCAAoC,SAAQ,yBAAyB;IACpF,mEAAmE;IACnE,WAAW,EAAE,gBAAgB,CAAA;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,gBAAgB,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;CACb;AACD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gBAAgB,EAAE,MAAM,CAAA;IACxB,IAAI,EAAC,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,6BAA6B;IAC5C,kBAAkB;IAClB,MAAM,EAAE,wBAAwB,CAAA;IAChC,iEAAiE;IACjE,UAAU,EAAE,OAAO,CAAA;IACnB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,kBAAkB;IAClB,MAAM,EAAE,wBAAwB,CAAA;IAChC,iEAAiE;IACjE,UAAU,EAAE,OAAO,CAAA;IACnB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,2DAA2D;IAC3D,eAAe,EAAE,eAAe,CAAA;CACjC;AAGD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB"}
|
|
1
|
+
{"version":3,"file":"gateway-service-form.d.ts","sourceRoot":"","sources":["../../../src/types/gateway-service-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAEvG,yCAAyC;AACzC,MAAM,WAAW,+BAAgC,SAAQ,qBAAqB;IAC5E,mEAAmE;IACnE,WAAW,EAAE,gBAAgB,CAAA;CAC9B;AAED,8CAA8C;AAC9C,MAAM,WAAW,mCAAoC,SAAQ,yBAAyB;IACpF,mEAAmE;IACnE,WAAW,EAAE,gBAAgB,CAAA;CAC9B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,gBAAgB,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;CACb;AACD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gBAAgB,EAAE,MAAM,CAAA;IACxB,IAAI,EAAC,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,6BAA6B;IAC5C,kBAAkB;IAClB,MAAM,EAAE,wBAAwB,CAAA;IAChC,iEAAiE;IACjE,UAAU,EAAE,OAAO,CAAA;IACnB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,kBAAkB;IAClB,MAAM,EAAE,wBAAwB,CAAA;IAChC,iEAAiE;IACjE,UAAU,EAAE,OAAO,CAAA;IACnB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,2DAA2D;IAC3D,eAAe,EAAE,eAAe,CAAA;CACjC;AAGD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9C,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlValidator.d.ts","sourceRoot":"","sources":["../../../src/utils/urlValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAOjD,QAAA,MAAM,eAAe,QAAM,gBAKzB,CAAA;AAEF,OAAO,EACL,eAAe,GAChB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-gateway-services",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.14-pr.2086.20c50855e.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-gateway-services.umd.js",
|
|
6
6
|
"module": "./dist/entities-gateway-services.es.js",
|
|
@@ -21,22 +21,22 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@kong/icons": "^1.
|
|
25
|
-
"@kong/kongponents": "^9.
|
|
24
|
+
"@kong/icons": "^1.25.1",
|
|
25
|
+
"@kong/kongponents": "^9.29.3",
|
|
26
26
|
"axios": "^1.7.7",
|
|
27
27
|
"vue": ">= 3.3.13 < 4",
|
|
28
28
|
"vue-router": "^4.4.5",
|
|
29
|
-
"@kong-ui-public/
|
|
30
|
-
"@kong-ui-public/
|
|
29
|
+
"@kong-ui-public/entities-shared": "^3.22.2-pr.2086.20c50855e.0",
|
|
30
|
+
"@kong-ui-public/i18n": "^2.3.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@kong/design-tokens": "1.17.3",
|
|
34
|
-
"@kong/icons": "^1.
|
|
35
|
-
"@kong/kongponents": "9.
|
|
34
|
+
"@kong/icons": "^1.25.1",
|
|
35
|
+
"@kong/kongponents": "9.29.3",
|
|
36
36
|
"axios": "^1.7.7",
|
|
37
37
|
"vue": "^3.5.13",
|
|
38
38
|
"vue-router": "^4.4.5",
|
|
39
|
-
"@kong-ui-public/entities-shared": "^3.22.0",
|
|
39
|
+
"@kong-ui-public/entities-shared": "^3.22.2-pr.2086.20c50855e.0",
|
|
40
40
|
"@kong-ui-public/i18n": "^2.3.0"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|