@kong-ui-public/entities-consumer-groups 3.5.42 → 3.5.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import { defineComponent as _e, ref as _, computed as I, watch as $e, resolveComponent as F, openBlock as $, createBlock as oe, unref as r, withCtx as f, createElementVNode as O, toDisplayString as G, createVNode as y, createElementBlock as j, Fragment as Ke, renderList as Fe, createCommentVNode as ue, onBeforeMount as De, Teleport as Oe, withDirectives as je, createTextVNode as ae, vShow as Le, withModifiers as Qe, createSlots as Je, reactive as Se } from "vue";
2
- import { useRouter as Be } from "vue-router";
3
- import { AddIcon as He } from "@kong/icons";
4
- import { createI18n as ze, i18nTComponent as We } from "@kong-ui-public/i18n";
5
- import { useAxios as we, useDebouncedFilter as Ue, useFetcher as Xe, useDeleteUrlBuilder as Ye, FetcherStatus as Te, EntityBaseTable as Ze, EntityFilter as eo, PermissionsWrapper as he, EntityDeleteModal as oo, EntityTypes as so, useErrors as to, useValidators as ro, EntityBaseFormType as Ie, EntityBaseForm as no, SupportedEntityType as Ve, EntityFormSection as Pe, EntityBaseConfigCard as ao } from "@kong-ui-public/entities-shared";
6
- const uo = {
1
+ import { defineComponent as ye, ref as _, computed as I, watch as Ie, resolveComponent as Q, openBlock as T, createBlock as me, unref as t, withCtx as v, createElementVNode as N, toDisplayString as G, createVNode as f, createElementBlock as W, Fragment as Re, renderList as Be, createCommentVNode as te, onBeforeMount as Te, Teleport as qe, withDirectives as Ne, createTextVNode as de, vShow as Oe, createSlots as je, reactive as Ge } from "vue";
2
+ import { useRouter as Pe } from "vue-router";
3
+ import { AddIcon as Le } from "@kong/icons";
4
+ import { createI18n as Qe, i18nTComponent as Je } from "@kong-ui-public/i18n";
5
+ import { useAxios as we, useDebouncedFilter as Ve, useFetcher as He, useDeleteUrlBuilder as ze, FetcherStatus as Ae, EntityBaseTable as We, EntityFilter as Xe, PermissionsWrapper as ve, TableTags as Ye, EntityDeleteModal as Ze, EntityTypes as eo, useErrors as oo, useValidators as so, EntityBaseFormType as ke, EntityBaseForm as ro, SupportedEntityType as Fe, EntityFormSection as Se, EntityBaseConfigCard as to } from "@kong-ui-public/entities-shared";
6
+ const no = {
7
7
  list: {
8
8
  table_headers: {
9
9
  name: "Name",
@@ -92,57 +92,57 @@ const uo = {
92
92
  }
93
93
  }
94
94
  }
95
- }, io = {
96
- consumer_groups: uo
95
+ }, ao = {
96
+ consumer_groups: no
97
97
  };
98
- function lo() {
99
- const e = ze("en-us", io);
98
+ function uo() {
99
+ const e = Qe("en-us", ao);
100
100
  return {
101
101
  i18n: e,
102
- i18nT: We(e)
102
+ i18nT: Je(e)
103
103
  // Translation component <i18n-t>
104
104
  };
105
105
  }
106
- const be = {
107
- useI18n: lo
108
- }, q = "/v2/control-planes/{controlPlaneId}/core-entities", N = "/{workspace}", X = {
106
+ const he = {
107
+ useI18n: uo
108
+ }, B = "/v2/control-planes/{controlPlaneId}/core-entities", q = "/{workspace}", X = {
109
109
  list: {
110
110
  konnect: {
111
- all: `${q}/consumer_groups`,
112
- forModal: `${q}/consumer_groups`,
113
- forConsumer: `${q}/consumers/{consumerId}/consumer_groups`,
114
- oneForConsumer: `${q}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
111
+ all: `${B}/consumer_groups`,
112
+ forModal: `${B}/consumer_groups`,
113
+ forConsumer: `${B}/consumers/{consumerId}/consumer_groups`,
114
+ oneForConsumer: `${B}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
115
115
  },
116
116
  kongManager: {
117
- all: `${N}/consumer_groups?counter=true`,
117
+ all: `${q}/consumer_groups?counter=true`,
118
118
  // we need counter=true to get consumers_count in consumer group list
119
- forModal: `${N}/consumer_groups`,
120
- forConsumer: `${N}/consumers/{consumerId}/consumer_groups`,
121
- oneForConsumer: `${N}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
119
+ forModal: `${q}/consumer_groups`,
120
+ forConsumer: `${q}/consumers/{consumerId}/consumer_groups`,
121
+ oneForConsumer: `${q}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
122
122
  }
123
123
  },
124
124
  form: {
125
125
  konnect: {
126
+ consumersList: `${B}/consumers`,
127
+ create: `${B}/consumer_groups`,
128
+ edit: `${B}/consumer_groups/{id}`,
129
+ addConsumer: `${B}/consumer_groups/{id}/consumers`,
130
+ removeConsumer: `${B}/consumer_groups/{id}/consumers/{consumerId}`,
131
+ getConsumers: `${B}/consumer_groups/{id}/consumers`
132
+ },
133
+ kongManager: {
126
134
  consumersList: `${q}/consumers`,
127
135
  create: `${q}/consumer_groups`,
128
136
  edit: `${q}/consumer_groups/{id}`,
129
137
  addConsumer: `${q}/consumer_groups/{id}/consumers`,
130
138
  removeConsumer: `${q}/consumer_groups/{id}/consumers/{consumerId}`,
131
139
  getConsumers: `${q}/consumer_groups/{id}/consumers`
132
- },
133
- kongManager: {
134
- consumersList: `${N}/consumers`,
135
- create: `${N}/consumer_groups`,
136
- edit: `${N}/consumer_groups/{id}`,
137
- addConsumer: `${N}/consumer_groups/{id}/consumers`,
138
- removeConsumer: `${N}/consumer_groups/{id}/consumers/{consumerId}`,
139
- getConsumers: `${N}/consumer_groups/{id}/consumers`
140
140
  }
141
141
  }
142
- }, co = { class: "add-to-group-form-container" }, mo = { class: "add-to-group-cta-text" }, po = {
142
+ }, lo = { class: "add-to-group-form-container" }, io = { class: "add-to-group-cta-text" }, co = {
143
143
  key: 0,
144
144
  class: "kong-ui-entity-add-to-groups-error"
145
- }, go = { key: 0 }, fo = /* @__PURE__ */ _e({
145
+ }, mo = { key: 0 }, po = /* @__PURE__ */ ye({
146
146
  __name: "AddToGroupModal",
147
147
  props: {
148
148
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -158,16 +158,16 @@ const be = {
158
158
  }
159
159
  },
160
160
  emits: ["cancel", "add:success", "add:partial-success", "error"],
161
- setup(e, { emit: L }) {
162
- var J;
163
- const { i18n: { t: u } } = be.useI18n(), s = e, g = L, { axiosInstance: l } = we((J = s.config) == null ? void 0 : J.axiosRequestConfig), n = _([]), {
164
- debouncedQueryChange: w,
165
- loading: Q,
161
+ setup(e, { emit: O }) {
162
+ var L;
163
+ const { i18n: { t: u } } = he.useI18n(), s = e, g = O, { axiosInstance: i } = we((L = s.config) == null ? void 0 : L.axiosRequestConfig), n = _([]), {
164
+ debouncedQueryChange: $,
165
+ loading: j,
166
166
  allRecords: A,
167
- error: ie,
168
- loadItems: le,
167
+ error: ne,
168
+ loadItems: ae,
169
169
  results: D
170
- } = Ue(
170
+ } = Ve(
171
171
  s.config,
172
172
  X.list[s.config.app].forModal,
173
173
  "",
@@ -175,113 +175,113 @@ const be = {
175
175
  fetchedItemsKey: "data",
176
176
  searchKeys: ["name", "id"]
177
177
  }
178
- ), K = I(() => ie.value ? u("consumer_groups.errors.general") : ""), ce = _(0), Y = I(() => A.value === void 0), B = I(() => D.value.map((p) => ({
179
- label: p.name,
180
- value: p.id,
181
- selected: n.value.includes(p.id),
182
- data: p
178
+ ), V = I(() => ne.value ? u("consumer_groups.errors.general") : ""), ue = _(0), Y = I(() => A.value === void 0), K = I(() => D.value.map((m) => ({
179
+ label: m.name,
180
+ value: m.id,
181
+ selected: n.value.includes(m.id),
182
+ data: m
183
183
  // we need this to determine whether or not to show the description text
184
- }))), se = (p) => {
184
+ }))), oe = (m) => {
185
185
  var d;
186
- const k = Y.value ? D.value.find((h) => h.id === p) : (d = A.value) == null ? void 0 : d.find((h) => h.id === p);
187
- return k ? k.name : p;
188
- }, de = () => {
186
+ const k = Y.value ? D.value.find((y) => y.id === m) : (d = A.value) == null ? void 0 : d.find((y) => y.id === m);
187
+ return k ? k.name : m;
188
+ }, le = () => {
189
189
  E.value = "", U.value = [], P.value = [], g("cancel");
190
- }, U = _([]), H = _(!1), E = _(""), me = async () => {
190
+ }, U = _([]), J = _(!1), E = _(""), ie = async () => {
191
191
  if (!n.value.length) {
192
192
  E.value = "", P.value = [], g("cancel");
193
193
  return;
194
194
  }
195
- H.value = !0, E.value = "", U.value = [], P.value = [];
195
+ J.value = !0, E.value = "", U.value = [], P.value = [];
196
196
  try {
197
- const p = n.value.map((h) => Z(h)), k = await Promise.allSettled(p);
197
+ const m = n.value.map((y) => Z(y)), k = await Promise.allSettled(m);
198
198
  let d = !0;
199
- k.forEach((h) => {
200
- h.status !== "fulfilled" && (d = !1);
201
- }), d ? (U.value = [], P.value = [], g("add:success", n.value), n.value = []) : (U.value.length && g("add:partial-success", U.value), n.value = [], te(k));
199
+ k.forEach((y) => {
200
+ y.status !== "fulfilled" && (d = !1);
201
+ }), d ? (U.value = [], P.value = [], g("add:success", n.value), n.value = []) : (U.value.length && g("add:partial-success", U.value), n.value = [], se(k));
202
202
  } catch {
203
203
  E.value = u("consumer_groups.errors.add"), g("error", E.value);
204
204
  } finally {
205
- H.value = !1;
205
+ J.value = !1;
206
206
  }
207
- }, z = I(() => {
208
- var k, d, h, T;
209
- let p = `${s.config.apiBaseUrl}${X.list[s.config.app].forConsumer}`;
210
- return s.config.app === "konnect" ? p = p.replace(/{controlPlaneId}/gi, ((k = s.config) == null ? void 0 : k.controlPlaneId) || "").replace(/{consumerId}/gi, ((d = s.config) == null ? void 0 : d.consumerId) || "") : s.config.app === "kongManager" && (p = p.replace(/\/{workspace}/gi, (h = s.config) != null && h.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((T = s.config) == null ? void 0 : T.consumerId) || "")), p;
211
- }), Z = async (p) => {
207
+ }, H = I(() => {
208
+ var k, d, y, S;
209
+ let m = `${s.config.apiBaseUrl}${X.list[s.config.app].forConsumer}`;
210
+ return s.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((k = s.config) == null ? void 0 : k.controlPlaneId) || "").replace(/{consumerId}/gi, ((d = s.config) == null ? void 0 : d.consumerId) || "") : s.config.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, (y = s.config) != null && y.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((S = s.config) == null ? void 0 : S.consumerId) || "")), m;
211
+ }), Z = async (m) => {
212
212
  const k = {
213
- group: p
213
+ group: m
214
214
  };
215
215
  try {
216
- const d = await l.post(z.value, k);
217
- return U.value.push(p), d;
216
+ const d = await i.post(H.value, k);
217
+ return U.value.push(m), d;
218
218
  } catch (d) {
219
- let h = `${se(p)} - ${d.message}`;
220
- return d.response.status === 409 && (h = `${se(p)} - ${u("consumer_groups.errors.already_added")}`), Promise.reject(Error(h));
219
+ let y = `${oe(m)} - ${d.message}`;
220
+ return d.response.status === 409 && (y = `${oe(m)} - ${u("consumer_groups.errors.already_added")}`), Promise.reject(Error(y));
221
221
  }
222
- }, P = _([]), te = (p) => {
223
- P.value = p.map((k) => {
222
+ }, P = _([]), se = (m) => {
223
+ P.value = m.map((k) => {
224
224
  var d;
225
225
  return (d = k.reason) == null ? void 0 : d.message;
226
226
  }).filter(Boolean);
227
227
  };
228
- return $e(B, () => {
229
- ce.value++;
230
- }, { immediate: !0, deep: !0 }), $e(() => s.visible, () => {
231
- s.visible && le();
232
- }, { immediate: !0 }), (p, k) => {
233
- const d = F("KMultiselect"), h = F("KAlert"), T = F("KPrompt");
234
- return $(), oe(T, {
235
- "action-button-disabled": H.value,
228
+ return Ie(K, () => {
229
+ ue.value++;
230
+ }, { immediate: !0, deep: !0 }), Ie(() => s.visible, () => {
231
+ s.visible && ae();
232
+ }, { immediate: !0 }), (m, k) => {
233
+ const d = Q("KMultiselect"), y = Q("KAlert"), S = Q("KPrompt");
234
+ return T(), me(S, {
235
+ "action-button-disabled": J.value,
236
236
  class: "kong-ui-entities-add-to-groups-modal",
237
237
  "data-testid": "add-to-group-modal",
238
- title: r(u)("consumer_groups.consumers.add.title"),
238
+ title: t(u)("consumer_groups.consumers.add.title"),
239
239
  visible: e.visible,
240
- onCancel: de,
241
- onProceed: me
240
+ onCancel: le,
241
+ onProceed: ie
242
242
  }, {
243
- default: f(() => [
244
- O("div", co, [
245
- O("p", mo, G(r(u)("consumer_groups.consumers.add.ctaText")), 1),
246
- y(d, {
243
+ default: v(() => [
244
+ N("div", lo, [
245
+ N("p", io, G(t(u)("consumer_groups.consumers.add.ctaText")), 1),
246
+ f(d, {
247
247
  modelValue: n.value,
248
- "onUpdate:modelValue": k[0] || (k[0] = (W) => n.value = W),
248
+ "onUpdate:modelValue": k[0] || (k[0] = (z) => n.value = z),
249
249
  autosuggest: "",
250
250
  "data-testid": "add-to-groups-multiselect",
251
- "dropdown-footer-text": Y.value ? r(u)("consumer_groups.consumers.add.footer") : void 0,
252
- items: B.value,
253
- label: r(u)("consumer_groups.consumers.add.consumer_groups_label"),
254
- loading: r(Q),
255
- placeholder: r(u)("consumer_groups.consumers.add.consumer_group_placeholder"),
256
- readonly: H.value,
251
+ "dropdown-footer-text": Y.value ? t(u)("consumer_groups.consumers.add.footer") : void 0,
252
+ items: K.value,
253
+ label: t(u)("consumer_groups.consumers.add.consumer_groups_label"),
254
+ loading: t(j),
255
+ placeholder: t(u)("consumer_groups.consumers.add.consumer_group_placeholder"),
256
+ readonly: J.value,
257
257
  required: "",
258
258
  width: "100%",
259
- onQueryChange: r(w)
259
+ onQueryChange: t($)
260
260
  }, null, 8, ["modelValue", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"]),
261
- E.value || K.value || P.value.length ? ($(), j("div", po, [
262
- y(h, { appearance: "danger" }, {
263
- default: f(() => [
264
- O("p", null, G(r(u)("consumer_groups.errors.add")), 1),
265
- P.value.length ? ($(), j("ul", go, [
266
- ($(!0), j(Ke, null, Fe(P.value, (W, pe) => ($(), j("li", { key: pe }, G(W), 1))), 128))
267
- ])) : ue("", !0),
268
- O("div", null, G(E.value || K.value), 1)
261
+ E.value || V.value || P.value.length ? (T(), W("div", co, [
262
+ f(y, { appearance: "danger" }, {
263
+ default: v(() => [
264
+ N("p", null, G(t(u)("consumer_groups.errors.add")), 1),
265
+ P.value.length ? (T(), W("ul", mo, [
266
+ (T(!0), W(Re, null, Be(P.value, (z, ce) => (T(), W("li", { key: ce }, G(z), 1))), 128))
267
+ ])) : te("", !0),
268
+ N("div", null, G(E.value || V.value), 1)
269
269
  ]),
270
270
  _: 1
271
271
  })
272
- ])) : ue("", !0)
272
+ ])) : te("", !0)
273
273
  ])
274
274
  ]),
275
275
  _: 1
276
276
  }, 8, ["action-button-disabled", "title", "visible"]);
277
277
  };
278
278
  }
279
- }), Ee = (e, L) => {
279
+ }), $e = (e, O) => {
280
280
  const u = e.__vccOpts || e;
281
- for (const [s, g] of L)
281
+ for (const [s, g] of O)
282
282
  u[s] = g;
283
283
  return u;
284
- }, vo = /* @__PURE__ */ Ee(fo, [["__scopeId", "data-v-4260ce03"]]), yo = { class: "kong-ui-entities-consumer-groups-list" }, ho = { key: 1 }, _o = /* @__PURE__ */ _e({
284
+ }, go = /* @__PURE__ */ $e(po, [["__scopeId", "data-v-4260ce03"]]), fo = { class: "kong-ui-entities-consumer-groups-list" }, vo = /* @__PURE__ */ ye({
285
285
  __name: "ConsumerGroupList",
286
286
  props: {
287
287
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -326,288 +326,274 @@ const be = {
326
326
  }
327
327
  },
328
328
  emits: ["error", "copy:success", "copy:error", "delete:success", "add:success", "remove:success"],
329
- setup(e, { emit: L }) {
330
- var Ge;
331
- const u = L, s = e, { i18nT: g, i18n: { t: l } } = be.useI18n(), n = Be(), { axiosInstance: w } = we((Ge = s.config) == null ? void 0 : Ge.axiosRequestConfig), Q = _(1), A = I(() => !!s.config.consumerId), ie = I(
329
+ setup(e, { emit: O }) {
330
+ var Me;
331
+ const u = O, s = e, { i18nT: g, i18n: { t: i } } = he.useI18n(), n = Pe(), { axiosInstance: $ } = we((Me = s.config) == null ? void 0 : Me.axiosRequestConfig), j = _(1), A = I(() => !!s.config.consumerId), ne = I(
332
332
  () => A.value ? "kong-ui-entities-consumer-groups-list-in-consumer-page" : "kong-ui-entities-consumer-groups-list"
333
- ), le = I(() => s.config.app !== "kongManager" || !!s.config.disableSorting), D = {
333
+ ), ae = I(() => s.config.app !== "kongManager" || !!s.config.disableSorting), D = {
334
334
  // the Name column is non-hidable
335
- name: { label: l("consumer_groups.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 }
335
+ name: { label: i("consumer_groups.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 }
336
336
  };
337
- s.config.app === "kongManager" && (D.consumers_count = { label: l("consumer_groups.list.table_headers.consumers_count"), searchable: !1, sortable: !1 }), D.tags = { label: l("consumer_groups.list.table_headers.tags"), sortable: !1 };
338
- const K = D, ce = (t) => ({
339
- "data-testid": t.username ?? t.custom_id ?? t.id
337
+ s.config.app === "kongManager" && (D.consumers_count = { label: i("consumer_groups.list.table_headers.consumers_count"), searchable: !1, sortable: !1 }), D.tags = { label: i("consumer_groups.list.table_headers.tags"), sortable: !1 };
338
+ const V = D, ue = (r) => ({
339
+ "data-testid": r.username ?? r.custom_id ?? r.id
340
340
  }), Y = I(() => {
341
- var m, C, S, R;
342
- let t = `${s.config.apiBaseUrl}${X.list[s.config.app][A.value ? "forConsumer" : "all"]}`;
343
- return s.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((m = s.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((C = s.config) == null ? void 0 : C.consumerId) || "") : s.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (S = s.config) != null && S.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((R = s.config) == null ? void 0 : R.consumerId) || "")), t;
344
- }), B = _(""), se = I(() => {
345
- const t = s.config.app === "konnect" || s.config.isExactMatch;
346
- return t ? {
347
- isExactMatch: t,
341
+ var p, C, w, F;
342
+ let r = `${s.config.apiBaseUrl}${X.list[s.config.app][A.value ? "forConsumer" : "all"]}`;
343
+ return s.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((p = s.config) == null ? void 0 : p.controlPlaneId) || "").replace(/{consumerId}/gi, ((C = s.config) == null ? void 0 : C.consumerId) || "") : s.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, (w = s.config) != null && w.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((F = s.config) == null ? void 0 : F.consumerId) || "")), r;
344
+ }), K = _(""), oe = I(() => {
345
+ const r = s.config.app === "konnect" || s.config.isExactMatch;
346
+ return r ? {
347
+ isExactMatch: r,
348
348
  fields: {
349
349
  username: D.name,
350
- id: { label: l("consumer_groups.list.table_headers.id") }
350
+ id: { label: i("consumer_groups.list.table_headers.id") }
351
351
  },
352
- placeholder: l("consumer_groups.search.placeholder")
352
+ placeholder: i("consumer_groups.search.placeholder")
353
353
  } : {
354
- isExactMatch: t,
354
+ isExactMatch: r,
355
355
  fields: {
356
356
  name: D.name
357
357
  },
358
358
  schema: s.config.filterSchema
359
359
  };
360
- }), de = I(() => s.config.app === "konnect" && B.value ? "consumer_group" : A.value && !s.config.paginatedEndpoint ? "consumer_groups" : void 0), { fetcher: U, fetcherState: H } = Xe(s.config, Y.value, de), E = () => {
361
- B.value = "";
362
- }, me = () => {
363
- Q.value++;
364
- }, z = _(null), Z = _(!1), P = (t, m) => {
365
- const C = t.id;
366
- if (!m(C)) {
360
+ }), le = I(() => s.config.app === "konnect" && K.value ? "consumer_group" : A.value && !s.config.paginatedEndpoint ? "consumer_groups" : void 0), { fetcher: U, fetcherState: J } = He(s.config, Y.value, le), E = () => {
361
+ K.value = "";
362
+ }, ie = () => {
363
+ j.value++;
364
+ }, H = _(null), Z = _(!1), P = (r, p) => {
365
+ const C = r.id;
366
+ if (!p(C)) {
367
367
  u("copy:error", {
368
- entity: t,
368
+ entity: r,
369
369
  field: "id",
370
- message: l("consumer_groups.errors.copy")
370
+ message: i("consumer_groups.errors.copy")
371
371
  });
372
372
  return;
373
373
  }
374
374
  u("copy:success", {
375
- entity: t,
375
+ entity: r,
376
376
  field: "id",
377
- message: l("consumer_groups.copy.success", { val: C })
377
+ message: i("consumer_groups.copy.success", { val: C })
378
378
  });
379
- }, te = (t, m) => {
380
- const C = JSON.stringify(t);
381
- if (!m(C)) {
379
+ }, se = (r, p) => {
380
+ const C = JSON.stringify(r);
381
+ if (!p(C)) {
382
382
  u("copy:error", {
383
- entity: t,
384
- message: l("consumer_groups.errors.copy")
383
+ entity: r,
384
+ message: i("consumer_groups.errors.copy")
385
385
  });
386
386
  return;
387
387
  }
388
388
  u("copy:success", {
389
- entity: t,
390
- message: l("consumer_groups.copy.success_brief")
389
+ entity: r,
390
+ message: i("consumer_groups.copy.success_brief")
391
391
  });
392
- }, J = async (t) => {
392
+ }, L = async (r) => {
393
393
  var C;
394
- await ((C = s.canRetrieve) == null ? void 0 : C.call(s, t)) && n.push(s.config.getViewRoute(t.id));
395
- }, p = (t) => ({
396
- label: l("consumer_groups.actions.view"),
397
- to: s.config.getViewRoute(t)
398
- }), k = (t) => ({
399
- label: l("consumer_groups.actions.edit"),
400
- to: s.config.getEditRoute(t)
401
- }), d = _(void 0), h = _(!1), T = _(!1), W = _(""), pe = Ye(s.config, Y.value), Ce = (t) => {
402
- d.value = t, h.value = !0;
403
- }, fe = () => {
404
- h.value = !1;
405
- }, ve = async () => {
406
- var t, m, C;
407
- if ((t = d.value) != null && t.id) {
408
- T.value = !0;
394
+ await ((C = s.canRetrieve) == null ? void 0 : C.call(s, r)) && n.push(s.config.getViewRoute(r.id));
395
+ }, m = (r) => ({
396
+ label: i("consumer_groups.actions.view"),
397
+ to: s.config.getViewRoute(r)
398
+ }), k = (r) => ({
399
+ label: i("consumer_groups.actions.edit"),
400
+ to: s.config.getEditRoute(r)
401
+ }), d = _(void 0), y = _(!1), S = _(!1), z = _(""), ce = ze(s.config, Y.value), _e = (r) => {
402
+ d.value = r, y.value = !0;
403
+ }, pe = () => {
404
+ y.value = !1;
405
+ }, ge = async () => {
406
+ var r, p, C;
407
+ if ((r = d.value) != null && r.id) {
408
+ S.value = !0;
409
409
  try {
410
- await w.delete(pe(d.value.id)), T.value = !1, h.value = !1, Q.value++, u("delete:success", d.value);
411
- } catch (S) {
412
- W.value = ((C = (m = S.response) == null ? void 0 : m.data) == null ? void 0 : C.message) || S.message || l("consumer_groups.errors.delete"), u("error", S);
410
+ await $.delete(ce(d.value.id)), S.value = !1, y.value = !1, j.value++, u("delete:success", d.value);
411
+ } catch (w) {
412
+ z.value = ((C = (p = w.response) == null ? void 0 : p.data) == null ? void 0 : C.message) || w.message || i("consumer_groups.errors.delete"), u("error", w);
413
413
  } finally {
414
- T.value = !1;
414
+ S.value = !1;
415
415
  }
416
416
  }
417
417
  }, re = _(!1), o = () => {
418
418
  re.value = !0;
419
419
  }, a = () => {
420
420
  re.value = !1;
421
- }, b = (t, m) => {
422
- m || a(), Q.value++, u("add:success", t);
421
+ }, b = (r, p) => {
422
+ p || a(), j.value++, u("add:success", r);
423
423
  }, c = () => {
424
424
  A.value && o();
425
- }, i = _(void 0), x = _(!1), V = _(""), M = (t) => {
426
- i.value = t, x.value = !0;
425
+ }, l = _(void 0), x = _(!1), R = _(""), M = (r) => {
426
+ l.value = r, x.value = !0;
427
427
  }, ee = () => {
428
- x.value = !1, i.value = void 0;
429
- }, ye = I(() => {
430
- var m, C, S, R;
431
- let t = `${s.config.apiBaseUrl}${X.list[s.config.app].oneForConsumer}`;
432
- return s.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((m = s.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((C = s.config) == null ? void 0 : C.consumerId) || "") : s.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (S = s.config) != null && S.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((R = s.config) == null ? void 0 : R.consumerId) || "")), t;
433
- }), xe = _(!1), Re = async () => {
434
- if (i.value) {
435
- xe.value = !0;
428
+ x.value = !1, l.value = void 0;
429
+ }, fe = I(() => {
430
+ var p, C, w, F;
431
+ let r = `${s.config.apiBaseUrl}${X.list[s.config.app].oneForConsumer}`;
432
+ return s.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((p = s.config) == null ? void 0 : p.controlPlaneId) || "").replace(/{consumerId}/gi, ((C = s.config) == null ? void 0 : C.consumerId) || "") : s.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, (w = s.config) != null && w.workspace ? `/${s.config.workspace}` : "").replace(/{consumerId}/gi, ((F = s.config) == null ? void 0 : F.consumerId) || "")), r;
433
+ }), Ee = _(!1), De = async () => {
434
+ if (l.value) {
435
+ Ee.value = !0;
436
436
  try {
437
- const t = ye.value.replace(/{consumerGroupId}/gi, i.value.id);
438
- await w.delete(t), u("remove:success", i.value), ee(), Q.value++;
439
- } catch (t) {
440
- V.value = t.message || l("consumer_groups.errors.delete"), u("error", t);
437
+ const r = fe.value.replace(/{consumerGroupId}/gi, l.value.id);
438
+ await $.delete(r), u("remove:success", l.value), ee(), j.value++;
439
+ } catch (r) {
440
+ R.value = r.message || i("consumer_groups.errors.delete"), u("error", r);
441
441
  } finally {
442
- xe.value = !1;
442
+ Ee.value = !1;
443
443
  }
444
444
  }
445
- }, Me = _(!1);
446
- $e(H, (t) => {
447
- var m, C, S, R;
448
- if (Array.isArray((m = t == null ? void 0 : t.response) == null ? void 0 : m.data) && (Me.value = t.response.data.length > 0), t.status === Te.NoRecords ? Z.value = !0 : Z.value = !1, t.status === Te.Error) {
449
- z.value = {
450
- title: l("consumer_groups.errors.general")
451
- }, (R = (S = (C = t.error) == null ? void 0 : C.response) == null ? void 0 : S.data) != null && R.message && (z.value.message = t.error.response.data.message), u("error", t.error);
445
+ }, xe = _(!1);
446
+ Ie(J, (r) => {
447
+ var p, C, w, F;
448
+ if (Array.isArray((p = r == null ? void 0 : r.response) == null ? void 0 : p.data) && (xe.value = r.response.data.length > 0), r.status === Ae.NoRecords ? Z.value = !0 : Z.value = !1, r.status === Ae.Error) {
449
+ H.value = {
450
+ title: i("consumer_groups.errors.general")
451
+ }, (F = (w = (C = r.error) == null ? void 0 : C.response) == null ? void 0 : w.data) != null && F.message && (H.value.message = r.error.response.data.message), u("error", r.error);
452
452
  return;
453
453
  }
454
- z.value = null;
454
+ H.value = null;
455
455
  });
456
- const ke = _({
456
+ const be = _({
457
457
  ctaPath: A.value ? void 0 : s.config.createRoute,
458
458
  ctaText: void 0,
459
- message: `${l("consumer_groups.list.empty_state.description")}${s.config.additionMessageForEmptyState ? ` ${s.config.additionMessageForEmptyState}` : ""}`,
460
- title: l("consumer_groups.title")
459
+ message: `${i("consumer_groups.list.empty_state.description")}${s.config.additionMessageForEmptyState ? ` ${s.config.additionMessageForEmptyState}` : ""}`,
460
+ title: i("consumer_groups.title")
461
461
  });
462
- return De(async () => {
463
- await s.canCreate() && (ke.value.title = A.value ? l("consumer_groups.list.empty_state.title_for_consumer") : l("consumer_groups.list.empty_state.title"), ke.value.ctaText = A.value ? l("consumer_groups.actions.add_to_group") : l("consumer_groups.actions.create"));
464
- }), (t, m) => {
465
- const C = F("KButton"), S = F("KBadge"), R = F("KTruncate"), ge = F("KDropdownItem"), Ae = F("KClipboardProvider"), qe = F("KPrompt");
466
- return $(), j("div", yo, [
467
- y(r(Ze), {
462
+ return Te(async () => {
463
+ await s.canCreate() && (be.value.title = A.value ? i("consumer_groups.list.empty_state.title_for_consumer") : i("consumer_groups.list.empty_state.title"), be.value.ctaText = A.value ? i("consumer_groups.actions.add_to_group") : i("consumer_groups.actions.create"));
464
+ }), (r, p) => {
465
+ const C = Q("KButton"), w = Q("KDropdownItem"), F = Q("KClipboardProvider"), Ke = Q("KPrompt");
466
+ return T(), W("div", fo, [
467
+ f(t(We), {
468
468
  "cache-identifier": e.cacheIdentifier,
469
469
  "disable-pagination": A.value && !e.config.paginatedEndpoint,
470
- "disable-sorting": le.value,
471
- "empty-state-options": ke.value,
470
+ "disable-sorting": ae.value,
471
+ "empty-state-options": be.value,
472
472
  "enable-entity-actions": "",
473
- "error-message": z.value,
474
- fetcher: r(U),
475
- "fetcher-cache-key": Q.value,
473
+ "error-message": H.value,
474
+ fetcher: t(U),
475
+ "fetcher-cache-key": j.value,
476
476
  "hide-toolbar": Z.value,
477
477
  "pagination-type": "offset",
478
- "preferences-storage-key": ie.value,
479
- query: B.value,
480
- "row-attributes": ce,
481
- "table-headers": r(K),
478
+ "preferences-storage-key": ne.value,
479
+ query: K.value,
480
+ "row-attributes": ue,
481
+ "table-headers": t(V),
482
482
  onClearSearchInput: E,
483
- "onClick:row": m[3] || (m[3] = (v) => J(v)),
483
+ "onClick:row": p[2] || (p[2] = (h) => L(h)),
484
484
  onEmptyStateCtaClicked: c,
485
- onSort: me
485
+ onSort: ie
486
486
  }, {
487
- "toolbar-filter": f(() => [
488
- A.value ? ue("", !0) : ($(), oe(r(eo), {
487
+ "toolbar-filter": v(() => [
488
+ A.value ? te("", !0) : (T(), me(t(Xe), {
489
489
  key: 0,
490
- modelValue: B.value,
491
- "onUpdate:modelValue": m[0] || (m[0] = (v) => B.value = v),
492
- config: se.value
490
+ modelValue: K.value,
491
+ "onUpdate:modelValue": p[0] || (p[0] = (h) => K.value = h),
492
+ config: oe.value
493
493
  }, null, 8, ["modelValue", "config"]))
494
494
  ]),
495
- "toolbar-button": f(() => [
496
- ($(), oe(Oe, {
495
+ "toolbar-button": v(() => [
496
+ (T(), me(qe, {
497
497
  disabled: !e.useActionOutside,
498
498
  to: "#kong-ui-app-page-header-action-button"
499
499
  }, [
500
- y(r(he), {
500
+ f(t(ve), {
501
501
  "auth-function": () => e.canCreate()
502
502
  }, {
503
- default: f(() => [
504
- je(y(C, {
503
+ default: v(() => [
504
+ Ne(f(C, {
505
505
  appearance: "primary",
506
506
  "data-testid": "toolbar-add-consumer-group",
507
507
  size: e.useActionOutside ? "medium" : "large",
508
508
  to: e.config.consumerId ? void 0 : e.config.createRoute,
509
- onClick: m[1] || (m[1] = () => e.config.consumerId ? o() : void 0)
509
+ onClick: p[1] || (p[1] = () => e.config.consumerId ? o() : void 0)
510
510
  }, {
511
- default: f(() => [
512
- y(r(He)),
513
- ae(" " + G(e.config.consumerId ? r(l)("consumer_groups.actions.add_to_group") : r(l)("consumer_groups.list.toolbar_actions.new_consumer_group")), 1)
511
+ default: v(() => [
512
+ f(t(Le)),
513
+ de(" " + G(e.config.consumerId ? t(i)("consumer_groups.actions.add_to_group") : t(i)("consumer_groups.list.toolbar_actions.new_consumer_group")), 1)
514
514
  ]),
515
515
  _: 1
516
516
  }, 8, ["size", "to"]), [
517
- [Le, Me.value]
517
+ [Oe, xe.value]
518
518
  ])
519
519
  ]),
520
520
  _: 1
521
521
  }, 8, ["auth-function"])
522
522
  ], 8, ["disabled"]))
523
523
  ]),
524
- name: f(({ rowValue: v }) => [
525
- O("b", null, G(v ?? "-"), 1)
524
+ name: v(({ rowValue: h }) => [
525
+ N("b", null, G(h ?? "-"), 1)
526
526
  ]),
527
- consumers_count: f(({ rowValue: v }) => [
528
- ae(G(v ?? "-"), 1)
527
+ consumers_count: v(({ rowValue: h }) => [
528
+ de(G(h ?? "-"), 1)
529
529
  ]),
530
- tags: f(({ rowValue: v }) => [
531
- (v == null ? void 0 : v.length) > 0 ? ($(), oe(R, { key: 0 }, {
532
- default: f(() => [
533
- ($(!0), j(Ke, null, Fe(v, (ne) => ($(), oe(S, {
534
- key: ne,
535
- onClick: m[2] || (m[2] = Qe(() => {
536
- }, ["stop"]))
537
- }, {
538
- default: f(() => [
539
- ae(G(ne), 1)
540
- ]),
541
- _: 2
542
- }, 1024))), 128))
543
- ]),
544
- _: 2
545
- }, 1024)) : ($(), j("span", ho, "-"))
530
+ tags: v(({ rowValue: h }) => [
531
+ f(t(Ye), { tags: h }, null, 8, ["tags"])
546
532
  ]),
547
- actions: f(({ row: v }) => [
548
- y(Ae, null, {
549
- default: f(({ copyToClipboard: ne }) => [
550
- y(ge, {
533
+ actions: v(({ row: h }) => [
534
+ f(F, null, {
535
+ default: v(({ copyToClipboard: Ce }) => [
536
+ f(w, {
551
537
  "data-testid": "action-entity-copy-id",
552
- onClick: (Ne) => P(v, ne)
538
+ onClick: (Ue) => P(h, Ce)
553
539
  }, {
554
- default: f(() => [
555
- ae(G(r(l)("consumer_groups.actions.copy_id")), 1)
540
+ default: v(() => [
541
+ de(G(t(i)("consumer_groups.actions.copy_id")), 1)
556
542
  ]),
557
543
  _: 2
558
544
  }, 1032, ["onClick"])
559
545
  ]),
560
546
  _: 2
561
547
  }, 1024),
562
- y(Ae, null, {
563
- default: f(({ copyToClipboard: ne }) => [
564
- y(ge, {
548
+ f(F, null, {
549
+ default: v(({ copyToClipboard: Ce }) => [
550
+ f(w, {
565
551
  "data-testid": "action-entity-copy-json",
566
- onClick: (Ne) => te(v, ne)
552
+ onClick: (Ue) => se(h, Ce)
567
553
  }, {
568
- default: f(() => [
569
- ae(G(r(l)("consumer_groups.actions.copy_json")), 1)
554
+ default: v(() => [
555
+ de(G(t(i)("consumer_groups.actions.copy_json")), 1)
570
556
  ]),
571
557
  _: 2
572
558
  }, 1032, ["onClick"])
573
559
  ]),
574
560
  _: 2
575
561
  }, 1024),
576
- y(r(he), {
577
- "auth-function": () => e.canRetrieve(v)
562
+ f(t(ve), {
563
+ "auth-function": () => e.canRetrieve(h)
578
564
  }, {
579
- default: f(() => [
580
- y(ge, {
565
+ default: v(() => [
566
+ f(w, {
581
567
  "data-testid": "action-entity-view",
582
568
  "has-divider": "",
583
- item: p(v.id)
569
+ item: m(h.id)
584
570
  }, null, 8, ["item"])
585
571
  ]),
586
572
  _: 2
587
573
  }, 1032, ["auth-function"]),
588
- y(r(he), {
589
- "auth-function": () => e.canEdit(v)
574
+ f(t(ve), {
575
+ "auth-function": () => e.canEdit(h)
590
576
  }, {
591
- default: f(() => [
592
- y(ge, {
577
+ default: v(() => [
578
+ f(w, {
593
579
  "data-testid": "action-entity-edit",
594
- item: k(v.id)
580
+ item: k(h.id)
595
581
  }, null, 8, ["item"])
596
582
  ]),
597
583
  _: 2
598
584
  }, 1032, ["auth-function"]),
599
- y(r(he), {
600
- "auth-function": () => e.canDelete(v)
585
+ f(t(ve), {
586
+ "auth-function": () => e.canDelete(h)
601
587
  }, {
602
- default: f(() => [
603
- y(ge, {
588
+ default: v(() => [
589
+ f(w, {
604
590
  danger: "",
605
591
  "data-testid": "action-entity-delete",
606
592
  "has-divider": "",
607
- onClick: () => e.config.consumerId ? M(v) : Ce(v)
593
+ onClick: () => e.config.consumerId ? M(h) : _e(h)
608
594
  }, {
609
- default: f(() => [
610
- ae(G(e.config.consumerId ? r(l)("consumer_groups.actions.exit") : r(l)("consumer_groups.actions.delete")), 1)
595
+ default: v(() => [
596
+ de(G(e.config.consumerId ? t(i)("consumer_groups.actions.exit") : t(i)("consumer_groups.actions.delete")), 1)
611
597
  ]),
612
598
  _: 2
613
599
  }, 1032, ["onClick"])
@@ -617,66 +603,66 @@ const be = {
617
603
  ]),
618
604
  _: 1
619
605
  }, 8, ["cache-identifier", "disable-pagination", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "hide-toolbar", "preferences-storage-key", "query", "table-headers"]),
620
- y(r(oo), {
621
- "action-pending": T.value,
606
+ f(t(Ze), {
607
+ "action-pending": S.value,
622
608
  "data-testid": "delete-consumer-group-modal",
623
- description: r(l)("consumer_groups.delete.description"),
609
+ description: t(i)("consumer_groups.delete.description"),
624
610
  "entity-name": d.value && (d.value.name || d.value.id),
625
- "entity-type": r(so).ConsumerGroup,
626
- error: W.value,
627
- title: r(l)("consumer_groups.delete.title"),
628
- visible: h.value,
629
- onCancel: fe,
630
- onProceed: ve
611
+ "entity-type": t(eo).ConsumerGroup,
612
+ error: z.value,
613
+ title: t(i)("consumer_groups.delete.title"),
614
+ visible: y.value,
615
+ onCancel: pe,
616
+ onProceed: ge
631
617
  }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"]),
632
- e.config.consumerId ? ($(), oe(vo, {
618
+ e.config.consumerId ? (T(), me(go, {
633
619
  key: 0,
634
620
  config: e.config,
635
621
  "data-testid": "add-to-group-modal",
636
622
  visible: re.value,
637
- "onAdd:partialSuccess": m[4] || (m[4] = (v) => b(v, !0)),
638
- "onAdd:success": m[5] || (m[5] = (v) => b(v)),
623
+ "onAdd:partialSuccess": p[3] || (p[3] = (h) => b(h, !0)),
624
+ "onAdd:success": p[4] || (p[4] = (h) => b(h)),
639
625
  onCancel: a
640
- }, null, 8, ["config", "visible"])) : ue("", !0),
641
- e.config.consumerId && i.value ? ($(), oe(qe, {
626
+ }, null, 8, ["config", "visible"])) : te("", !0),
627
+ e.config.consumerId && l.value ? (T(), me(Ke, {
642
628
  key: 1,
643
629
  "action-button-appearance": "danger",
644
630
  "data-testid": "exit-group-modal",
645
- title: r(l)("consumer_groups.consumers.exit.title"),
631
+ title: t(i)("consumer_groups.consumers.exit.title"),
646
632
  visible: x.value,
647
633
  onCancel: ee,
648
- onProceed: Re
634
+ onProceed: De
649
635
  }, {
650
- default: f(() => [
651
- y(r(g), {
636
+ default: v(() => [
637
+ f(t(g), {
652
638
  class: "exit-modal-message",
653
639
  keypath: e.config.consumerUsername ? "consumer_groups.consumers.exit.confirmation" : "consumer_groups.consumers.exit.confirmationNoUsername",
654
640
  tag: "p"
655
- }, Je({
656
- consumerGroup: f(() => [
657
- O("strong", null, G(i.value.name || i.value.id), 1)
641
+ }, je({
642
+ consumerGroup: v(() => [
643
+ N("strong", null, G(l.value.name || l.value.id), 1)
658
644
  ]),
659
645
  _: 2
660
646
  }, [
661
647
  e.config.consumerUsername ? {
662
648
  name: "consumer",
663
- fn: f(() => [
664
- O("strong", null, G(e.config.consumerUsername), 1)
649
+ fn: v(() => [
650
+ N("strong", null, G(e.config.consumerUsername), 1)
665
651
  ]),
666
652
  key: "0"
667
653
  } : void 0
668
654
  ]), 1032, ["keypath"]),
669
- O("p", null, G(r(l)("consumer_groups.consumers.exit.description")), 1)
655
+ N("p", null, G(t(i)("consumer_groups.consumers.exit.description")), 1)
670
656
  ]),
671
657
  _: 1
672
- }, 8, ["title", "visible"])) : ue("", !0)
658
+ }, 8, ["title", "visible"])) : te("", !0)
673
659
  ]);
674
660
  };
675
661
  }
676
- }), So = /* @__PURE__ */ Ee(_o, [["__scopeId", "data-v-8bb72c5a"]]), bo = { class: "kong-ui-entities-consumer-group-form" }, Co = { class: "select-item-container" }, ko = { class: "select-item-label" }, Io = {
662
+ }), Mo = /* @__PURE__ */ $e(vo, [["__scopeId", "data-v-3c823a87"]]), yo = { class: "kong-ui-entities-consumer-group-form" }, ho = { class: "select-item-container" }, _o = { class: "select-item-label" }, bo = {
677
663
  key: 0,
678
664
  class: "select-item-description"
679
- }, $o = /* @__PURE__ */ _e({
665
+ }, Co = /* @__PURE__ */ ye({
680
666
  __name: "ConsumerGroupForm",
681
667
  props: {
682
668
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -693,9 +679,9 @@ const be = {
693
679
  }
694
680
  },
695
681
  emits: ["update", "error", "loading"],
696
- setup(e, { emit: L }) {
697
- var fe, ve, re;
698
- const u = e, s = L, { i18n: { t: g } } = be.useI18n(), l = Be(), n = Se({
682
+ setup(e, { emit: O }) {
683
+ var pe, ge, re;
684
+ const u = e, s = O, { i18n: { t: g } } = he.useI18n(), i = Pe(), n = Ge({
699
685
  fields: {
700
686
  name: "",
701
687
  tags: "",
@@ -703,197 +689,197 @@ const be = {
703
689
  },
704
690
  errorMessage: "",
705
691
  readonly: !1
706
- }), w = Se({
692
+ }), $ = Ge({
707
693
  name: "",
708
694
  tags: "",
709
695
  consumers: []
710
696
  }), {
711
- debouncedQueryChange: Q,
697
+ debouncedQueryChange: j,
712
698
  loading: A,
713
- error: ie,
714
- loadItems: le,
699
+ error: ne,
700
+ loadItems: ae,
715
701
  results: D
716
- } = Ue(u.config, (ve = X.form[(fe = u.config) == null ? void 0 : fe.app]) == null ? void 0 : ve.consumersList, "", {
702
+ } = Ve(u.config, (ge = X.form[(pe = u.config) == null ? void 0 : pe.app]) == null ? void 0 : ge.consumersList, "", {
717
703
  fetchedItemsKey: "data",
718
704
  searchKeys: ["username", "custom_id", "id"]
719
- }), { axiosInstance: K } = we((re = u.config) == null ? void 0 : re.axiosRequestConfig), { getMessageFromError: ce } = to(), Y = ro(), B = I(() => D.value.map((o) => ({
705
+ }), { axiosInstance: V } = we((re = u.config) == null ? void 0 : re.axiosRequestConfig), { getMessageFromError: ue } = oo(), Y = so(), K = I(() => D.value.map((o) => ({
720
706
  label: o.username || o.custom_id,
721
707
  value: o.id,
722
708
  selected: n.fields.consumers.includes(o.id),
723
709
  data: o
724
710
  // we need this to determine whether or not to show the description text
725
- }))), se = I(() => {
711
+ }))), oe = I(() => {
726
712
  var o, a;
727
713
  return (a = X.form[(o = u.config) == null ? void 0 : o.app]) == null ? void 0 : a.edit;
728
- }), de = I(() => u.consumerGroupId ? Ie.Edit : Ie.Create), U = I(() => !!n.fields.name && !te.value), H = I(() => JSON.stringify(n.fields) !== JSON.stringify(w)), E = (o, a = "", b = "") => {
729
- var i, x, V, M, ee, ye;
730
- let c = `${(i = u.config) == null ? void 0 : i.apiBaseUrl}${X.form[(x = u.config) == null ? void 0 : x.app][o]}`;
731
- return ((V = u.config) == null ? void 0 : V.app) === "konnect" ? c = c.replace(/{controlPlaneId}/gi, ((M = u.config) == null ? void 0 : M.controlPlaneId) || "") : ((ee = u.config) == null ? void 0 : ee.app) === "kongManager" && (c = c.replace(/\/{workspace}/gi, (ye = u.config) != null && ye.workspace ? `/${u.config.workspace}` : "")), c = c.replace(/{id}/gi, a || u.consumerGroupId), (o === "addConsumer" || o === "removeConsumer") && (c = c.replace(/{consumerId}/gi, b)), c;
732
- }, me = () => {
714
+ }), le = I(() => u.consumerGroupId ? ke.Edit : ke.Create), U = I(() => !!n.fields.name && !se.value), J = I(() => JSON.stringify(n.fields) !== JSON.stringify($)), E = (o, a = "", b = "") => {
715
+ var l, x, R, M, ee, fe;
716
+ let c = `${(l = u.config) == null ? void 0 : l.apiBaseUrl}${X.form[(x = u.config) == null ? void 0 : x.app][o]}`;
717
+ return ((R = u.config) == null ? void 0 : R.app) === "konnect" ? c = c.replace(/{controlPlaneId}/gi, ((M = u.config) == null ? void 0 : M.controlPlaneId) || "") : ((ee = u.config) == null ? void 0 : ee.app) === "kongManager" && (c = c.replace(/\/{workspace}/gi, (fe = u.config) != null && fe.workspace ? `/${u.config.workspace}` : "")), c = c.replace(/{id}/gi, a || u.consumerGroupId), (o === "addConsumer" || o === "removeConsumer") && (c = c.replace(/{consumerId}/gi, b)), c;
718
+ }, ie = () => {
733
719
  var o;
734
- l.push(((o = u.config) == null ? void 0 : o.cancelRoute) || { name: "consumer-group-list" });
735
- }, z = (o) => {
720
+ i.push(((o = u.config) == null ? void 0 : o.cancelRoute) || { name: "consumer-group-list" });
721
+ }, H = (o) => {
736
722
  s("error", o);
737
723
  }, Z = (o) => {
738
724
  s("loading", o);
739
725
  }, P = async (o) => {
740
- var b, c, i, x, V;
726
+ var b, c, l, x, R;
741
727
  n.fields.name = ((b = o == null ? void 0 : o.item) == null ? void 0 : b.name) || ((c = o == null ? void 0 : o.consumer_group) == null ? void 0 : c.name) || (o == null ? void 0 : o.name) || "";
742
- const a = ((i = o == null ? void 0 : o.item) == null ? void 0 : i.tags) || (o == null ? void 0 : o.consumer_group.tags) || (o == null ? void 0 : o.tags) || [];
728
+ const a = ((l = o == null ? void 0 : o.item) == null ? void 0 : l.tags) || (o == null ? void 0 : o.consumer_group.tags) || (o == null ? void 0 : o.tags) || [];
743
729
  if (n.fields.tags = (a == null ? void 0 : a.join(", ")) || "", "consumers" in o)
744
730
  n.fields.consumers = ((x = o == null ? void 0 : o.consumers) == null ? void 0 : x.map((M) => M.id)) || [];
745
731
  else
746
732
  try {
747
- const { data: M } = await K.get(E("getConsumers"));
748
- n.fields.consumers = "consumers" in M ? (V = M == null ? void 0 : M.consumers) == null ? void 0 : V.map((ee) => ee.id) : [];
733
+ const { data: M } = await V.get(E("getConsumers"));
734
+ n.fields.consumers = "consumers" in M ? (R = M == null ? void 0 : M.consumers) == null ? void 0 : R.map((ee) => ee.id) : [];
749
735
  } catch (M) {
750
736
  d(M);
751
737
  }
752
- Object.assign(w, n.fields);
753
- }, te = I(() => Y.utf8Name(n.fields.name)), J = I(() => {
738
+ Object.assign($, n.fields);
739
+ }, se = I(() => Y.utf8Name(n.fields.name)), L = I(() => {
754
740
  var o, a;
755
741
  return {
756
742
  name: n.fields.name,
757
743
  tags: (a = (o = n.fields.tags.split(",")) == null ? void 0 : o.map((b) => String(b || "").trim())) == null ? void 0 : a.filter((b) => b !== "")
758
744
  };
759
- }), p = async (o, a = "") => await K.post(E("addConsumer", a, o), { consumer: o }), k = async (o, a = "") => await K.delete(E("removeConsumer", a, o)), d = (o) => {
760
- n.errorMessage = ce(o), s("error", o);
761
- }, h = (o = u.consumerGroupId) => {
762
- Object.assign(w, n.fields), s("update", { ...n.fields, id: o });
763
- }, T = (o, a, b = u.consumerGroupId) => {
764
- const c = o == null ? void 0 : o.find((i) => i.status !== "fulfilled");
745
+ }), m = async (o, a = "") => await V.post(E("addConsumer", a, o), { consumer: o }), k = async (o, a = "") => await V.delete(E("removeConsumer", a, o)), d = (o) => {
746
+ n.errorMessage = ue(o), s("error", o);
747
+ }, y = (o = u.consumerGroupId) => {
748
+ Object.assign($, n.fields), s("update", { ...n.fields, id: o });
749
+ }, S = (o, a, b = u.consumerGroupId) => {
750
+ const c = o == null ? void 0 : o.find((l) => l.status !== "fulfilled");
765
751
  c ? d({
766
752
  code: c.status,
767
753
  message: a
768
- }) : h(b);
769
- }, W = async () => {
754
+ }) : y(b);
755
+ }, z = async () => {
770
756
  let o = "";
771
757
  try {
772
- const { data: a } = await K.post(E("create"), J.value);
758
+ const { data: a } = await V.post(E("create"), L.value);
773
759
  o = "item" in a ? a.item.id : a.id;
774
760
  } catch (a) {
775
761
  d(a);
776
762
  }
777
763
  if (n.fields.consumers.length > 0 && o)
778
764
  try {
779
- const a = n.fields.consumers.map((c) => p(c, o)), b = await Promise.allSettled(a);
780
- T(b, g("consumer_groups.errors.add_consumer"), o);
765
+ const a = n.fields.consumers.map((c) => m(c, o)), b = await Promise.allSettled(a);
766
+ S(b, g("consumer_groups.errors.add_consumer"), o);
781
767
  } catch (a) {
782
768
  d(a);
783
769
  }
784
- else n.fields.consumers.length === 0 && o && h(o);
785
- }, pe = async () => {
770
+ else n.fields.consumers.length === 0 && o && y(o);
771
+ }, ce = async () => {
786
772
  var b;
787
773
  try {
788
- ((b = u.config) == null ? void 0 : b.app) === "konnect" ? await K.put(E("edit"), J.value) : await K.patch(E("edit"), J.value);
774
+ ((b = u.config) == null ? void 0 : b.app) === "konnect" ? await V.put(E("edit"), L.value) : await V.patch(E("edit"), L.value);
789
775
  } catch (c) {
790
776
  d(c);
791
777
  }
792
- const o = n.fields.consumers.filter((c) => !w.consumers.includes(c)), a = w.consumers.filter((c) => !n.fields.consumers.includes(c));
778
+ const o = n.fields.consumers.filter((c) => !$.consumers.includes(c)), a = $.consumers.filter((c) => !n.fields.consumers.includes(c));
793
779
  if (a.length === 0 && o.length === 0)
794
- h();
780
+ y();
795
781
  else {
796
782
  if (a.length > 0)
797
783
  try {
798
- const c = a.map((x) => k(x)), i = await Promise.allSettled(c);
799
- T(i, g("consumer_groups.errors.remove_consumer"));
784
+ const c = a.map((x) => k(x)), l = await Promise.allSettled(c);
785
+ S(l, g("consumer_groups.errors.remove_consumer"));
800
786
  } catch (c) {
801
787
  d(c);
802
788
  }
803
789
  if (o.length > 0)
804
790
  try {
805
- const c = o.map((x) => p(x)), i = await Promise.allSettled(c);
806
- T(i, g("consumer_groups.errors.add_consumer"));
791
+ const c = o.map((x) => m(x)), l = await Promise.allSettled(c);
792
+ S(l, g("consumer_groups.errors.add_consumer"));
807
793
  } catch (c) {
808
794
  d(c);
809
795
  }
810
796
  }
811
- }, Ce = async () => {
797
+ }, _e = async () => {
812
798
  try {
813
- n.readonly = !0, de.value === Ie.Create ? await W() : await pe();
799
+ n.readonly = !0, le.value === ke.Create ? await z() : await ce();
814
800
  } finally {
815
801
  n.readonly = !1;
816
802
  }
817
803
  };
818
- return De(async () => {
819
- await le();
804
+ return Te(async () => {
805
+ await ae();
820
806
  }), (o, a) => {
821
- const b = F("KInput"), c = F("KMultiselect");
822
- return $(), j("div", bo, [
823
- y(r(no), {
824
- "can-submit": U.value && H.value,
807
+ const b = Q("KInput"), c = Q("KMultiselect");
808
+ return T(), W("div", yo, [
809
+ f(t(ro), {
810
+ "can-submit": U.value && J.value,
825
811
  config: e.config,
826
812
  "edit-id": e.consumerGroupId,
827
- "entity-type": r(Ve).ConsumerGroup,
828
- "error-message": n.errorMessage || r(ie) || te.value,
829
- "fetch-url": se.value,
830
- "form-fields": J.value,
813
+ "entity-type": t(Fe).ConsumerGroup,
814
+ "error-message": n.errorMessage || t(ne) || se.value,
815
+ "fetch-url": oe.value,
816
+ "form-fields": L.value,
831
817
  "is-readonly": n.readonly,
832
- onCancel: me,
833
- "onFetch:error": a[3] || (a[3] = (i) => z(i)),
818
+ onCancel: ie,
819
+ "onFetch:error": a[3] || (a[3] = (l) => H(l)),
834
820
  "onFetch:success": P,
835
- onLoading: a[4] || (a[4] = (i) => Z(i)),
836
- onSubmit: Ce
821
+ onLoading: a[4] || (a[4] = (l) => Z(l)),
822
+ onSubmit: _e
837
823
  }, {
838
- default: f(() => [
839
- y(r(Pe), {
840
- description: r(g)("consumer_groups.form.general_info.description"),
841
- title: r(g)("consumer_groups.form.general_info.title")
824
+ default: v(() => [
825
+ f(t(Se), {
826
+ description: t(g)("consumer_groups.form.general_info.description"),
827
+ title: t(g)("consumer_groups.form.general_info.title")
842
828
  }, {
843
- default: f(() => [
844
- y(b, {
829
+ default: v(() => [
830
+ f(b, {
845
831
  modelValue: n.fields.name,
846
- "onUpdate:modelValue": a[0] || (a[0] = (i) => n.fields.name = i),
832
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => n.fields.name = l),
847
833
  modelModifiers: { trim: !0 },
848
834
  autocomplete: "off",
849
835
  "data-testid": "consumer-group-form-name",
850
- label: r(g)("consumer_groups.form.fields.name.label"),
851
- placeholder: r(g)("consumer_groups.form.fields.name.placeholder"),
836
+ label: t(g)("consumer_groups.form.fields.name.label"),
837
+ placeholder: t(g)("consumer_groups.form.fields.name.placeholder"),
852
838
  required: "",
853
839
  type: "text"
854
840
  }, null, 8, ["modelValue", "label", "placeholder"]),
855
- y(b, {
841
+ f(b, {
856
842
  modelValue: n.fields.tags,
857
- "onUpdate:modelValue": a[1] || (a[1] = (i) => n.fields.tags = i),
843
+ "onUpdate:modelValue": a[1] || (a[1] = (l) => n.fields.tags = l),
858
844
  modelModifiers: { trim: !0 },
859
845
  autocomplete: "off",
860
846
  "data-testid": "consumer-group-form-tags",
861
- help: r(g)("consumer_groups.form.fields.tags.help"),
862
- label: r(g)("consumer_groups.form.fields.tags.label"),
847
+ help: t(g)("consumer_groups.form.fields.tags.help"),
848
+ label: t(g)("consumer_groups.form.fields.tags.label"),
863
849
  "label-attributes": {
864
- info: r(g)("consumer_groups.form.fields.tags.tooltip"),
850
+ info: t(g)("consumer_groups.form.fields.tags.tooltip"),
865
851
  tooltipAttributes: { maxWidth: "400" }
866
852
  },
867
- placeholder: r(g)("consumer_groups.form.fields.tags.placeholder"),
853
+ placeholder: t(g)("consumer_groups.form.fields.tags.placeholder"),
868
854
  type: "text"
869
855
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder"])
870
856
  ]),
871
857
  _: 1
872
858
  }, 8, ["description", "title"]),
873
- y(r(Pe), {
874
- description: r(g)("consumer_groups.form.consumers.description"),
859
+ f(t(Se), {
860
+ description: t(g)("consumer_groups.form.consumers.description"),
875
861
  "has-divider": "",
876
- title: r(g)("consumer_groups.form.consumers.title")
862
+ title: t(g)("consumer_groups.form.consumers.title")
877
863
  }, {
878
- default: f(() => [
879
- y(c, {
864
+ default: v(() => [
865
+ f(c, {
880
866
  modelValue: n.fields.consumers,
881
- "onUpdate:modelValue": a[2] || (a[2] = (i) => n.fields.consumers = i),
867
+ "onUpdate:modelValue": a[2] || (a[2] = (l) => n.fields.consumers = l),
882
868
  appearance: "select",
883
869
  autosuggest: "",
884
- items: B.value,
885
- label: r(g)("consumer_groups.form.fields.consumers.label"),
886
- loading: r(A),
887
- placeholder: r(g)("consumer_groups.form.fields.consumers.placeholder"),
870
+ items: K.value,
871
+ label: t(g)("consumer_groups.form.fields.consumers.label"),
872
+ loading: t(A),
873
+ placeholder: t(g)("consumer_groups.form.fields.consumers.placeholder"),
888
874
  width: "auto",
889
- onQueryChange: r(Q)
875
+ onQueryChange: t(j)
890
876
  }, {
891
- "item-template": f(({ item: i }) => {
892
- var x, V, M;
877
+ "item-template": v(({ item: l }) => {
878
+ var x, R, M;
893
879
  return [
894
- O("div", Co, [
895
- O("div", ko, G(i.label), 1),
896
- (x = i == null ? void 0 : i.data) != null && x.username && ((V = i == null ? void 0 : i.data) != null && V.custom_id) ? ($(), j("div", Io, G((M = i == null ? void 0 : i.data) == null ? void 0 : M.custom_id), 1)) : ue("", !0)
880
+ N("div", ho, [
881
+ N("div", _o, G(l.label), 1),
882
+ (x = l == null ? void 0 : l.data) != null && x.username && ((R = l == null ? void 0 : l.data) != null && R.custom_id) ? (T(), W("div", bo, G((M = l == null ? void 0 : l.data) == null ? void 0 : M.custom_id), 1)) : te("", !0)
897
883
  ])
898
884
  ];
899
885
  }),
@@ -908,7 +894,7 @@ const be = {
908
894
  ]);
909
895
  };
910
896
  }
911
- }), To = /* @__PURE__ */ Ee($o, [["__scopeId", "data-v-dfa56d62"]]), wo = { class: "kong-ui-consumer-group-entity-config-card" }, Po = /* @__PURE__ */ _e({
897
+ }), Go = /* @__PURE__ */ $e(Co, [["__scopeId", "data-v-dfa56d62"]]), ko = { class: "kong-ui-consumer-group-entity-config-card" }, Ao = /* @__PURE__ */ ye({
912
898
  __name: "ConsumerGroupConfigCard",
913
899
  props: {
914
900
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -935,7 +921,7 @@ const be = {
935
921
  },
936
922
  emits: ["loading", "fetch:error", "fetch:success"],
937
923
  setup(e) {
938
- const L = e, { i18n: { t: u } } = be.useI18n(), s = I(() => X.form[L.config.app].edit), g = _({
924
+ const O = e, { i18n: { t: u } } = he.useI18n(), s = I(() => X.form[O.config.app].edit), g = _({
939
925
  id: {},
940
926
  name: {},
941
927
  created_at: {},
@@ -944,24 +930,24 @@ const be = {
944
930
  tooltip: u("consumer_groups.form.fields.tags.tooltip")
945
931
  }
946
932
  });
947
- return (l, n) => ($(), j("div", wo, [
948
- y(r(ao), {
933
+ return (i, n) => (T(), W("div", ko, [
934
+ f(t(to), {
949
935
  config: e.config,
950
936
  "config-card-doc": e.configCardDoc,
951
937
  "config-schema": g.value,
952
938
  "data-key": "consumer_group",
953
- "entity-type": r(Ve).ConsumerGroup,
939
+ "entity-type": t(Fe).ConsumerGroup,
954
940
  "fetch-url": s.value,
955
941
  "hide-title": e.hideTitle,
956
- "onFetch:error": n[0] || (n[0] = (w) => l.$emit("fetch:error", w)),
957
- "onFetch:success": n[1] || (n[1] = (w) => l.$emit("fetch:success", w)),
958
- onLoading: n[2] || (n[2] = (w) => l.$emit("loading", w))
942
+ "onFetch:error": n[0] || (n[0] = ($) => i.$emit("fetch:error", $)),
943
+ "onFetch:success": n[1] || (n[1] = ($) => i.$emit("fetch:success", $)),
944
+ onLoading: n[2] || (n[2] = ($) => i.$emit("loading", $))
959
945
  }, null, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
960
946
  ]));
961
947
  }
962
948
  });
963
949
  export {
964
- Po as ConsumerGroupConfigCard,
965
- To as ConsumerGroupForm,
966
- So as ConsumerGroupList
950
+ Ao as ConsumerGroupConfigCard,
951
+ Go as ConsumerGroupForm,
952
+ Mo as ConsumerGroupList
967
953
  };