@leverege/imaginarium-ui 1.9.2 → 1.9.3

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,15 +1,15 @@
1
- import { P as Mt, N as Dt } from "./PluginTypes-D14LkV6u.js";
2
- import { M as Ft, u as be, P as qt } from "./MarkdownPageDoc-IGkRhxWs.js";
3
- import { jsx as e, jsxs as n, Fragment as ze } from "react/jsx-runtime";
4
- import { useState as R, useMemo as q, useEffect as Qe, Fragment as yt } from "react";
5
- import { u as oe, B as E, C as Ae, e as Me, c as ce } from "./Card-DbOhP3-w.js";
6
- import { useQueryClient as de, useMutation as _, useQuery as ae } from "@tanstack/react-query";
7
- import { X as Ne, Loader2 as Ve, Save as bt, Plus as je, Ban as Be, RotateCcw as zt, AlertTriangle as ye, Check as Nt, ChevronDown as ue, ChevronRight as he, Send as jt, Circle as Bt, ArrowLeft as Le, RefreshCw as vt, ListChecks as Lt, BarChart2 as Jt, Pencil as Qt, Trash2 as wt, Bot as Vt } from "lucide-react";
8
- import { Config as Ue } from "@leverege/plugin";
1
+ import { P as Mt, N as Ft } from "./PluginTypes-D14LkV6u.js";
2
+ import { M as qt, u as fe, P as zt } from "./MarkdownPageDoc-IGkRhxWs.js";
3
+ import { jsx as e, jsxs as n, Fragment as Pe } from "react/jsx-runtime";
4
+ import { useState as R, useMemo as J, useEffect as Ue, Fragment as bt } from "react";
5
+ import { u as se, B as $, C as De, e as Me, c as ce } from "./Card-DbOhP3-w.js";
6
+ import { useQueryClient as ae, useMutation as H, useQuery as le } from "@tanstack/react-query";
7
+ import { X as ge, Loader2 as ze, Save as Nt, Copy as vt, Plus as Je, Trash2 as He, ArrowRight as jt, Ban as Le, RotateCcw as Bt, AlertTriangle as Se, Check as wt, ChevronDown as he, ChevronRight as pe, Send as Jt, Circle as Lt, ArrowLeft as Qe, RefreshCw as Ct, ListChecks as Qt, BarChart2 as Vt, Pencil as Ut, Bot as Ht } from "lucide-react";
8
+ import { Config as je } from "@leverege/plugin";
9
9
  import { u as te } from "./ImaginariumApiContext-BScpog6-.js";
10
- import { D as ve, a as we, b as ke, c as Ce, d as Te, L as le, I as ge, e as Pe } from "./Label-DAcriHxc.js";
11
- import { T as Ut, a as Ht, c as _t, b as Yt } from "./Tooltip-B1T4_ZuM.js";
12
- const Wt = Ft.create({
10
+ import { D as xe, a as ye, b as be, c as Ne, d as ve, L as ne, I as ue, e as we } from "./Label-DAcriHxc.js";
11
+ import { T as _t, a as Yt, c as Wt, b as Gt } from "./Tooltip-B1T4_ZuM.js";
12
+ const Xt = qt.create({
13
13
  path: "/imp",
14
14
  markdown: `# imp
15
15
 
@@ -124,144 +124,243 @@ Lists all permanently-ignored items for the selected origin cluster. Removing a
124
124
  After removing an ignore, refreshing an existing release draft will bring the item back.
125
125
  `
126
126
  });
127
- function Gt({ open: t, onOpenChange: s, onCreated: i }) {
128
- const a = Ue.get("Release", "apiPath", "/releases"), { toast: r } = oe(), { fetchJson: d } = te(), l = de(), { configs: m } = be(), [h, b] = R(""), [x, c] = R(""), [p, P] = R(""), [M, D] = R([]), Q = ["imaginarium", "releases", a], U = () => {
129
- b(""), c(""), P(""), D([]);
130
- }, j = q(
131
- () => m.filter((g) => g.id !== p),
132
- [m, p]
133
- ), Y = (g) => {
134
- P(g), D((w) => w.filter((V) => V !== g));
135
- }, B = (g) => {
136
- D(
137
- (w) => w.includes(g) ? w.filter((V) => V !== g) : [...w, g]
127
+ function Zt({ open: t, onOpenChange: s, onCreated: a }) {
128
+ const i = je.get("Release", "apiPath", "/releases"), { toast: r } = se(), { fetchJson: d } = te(), l = ae(), { configs: c } = fe(), [h, N] = R(""), [y, m] = R(""), [p, S] = R(""), [q, M] = R([]), B = ["imaginarium", "releases", i], b = () => {
129
+ N(""), m(""), S(""), M([]);
130
+ }, P = J(
131
+ () => c.filter((x) => x.id !== p),
132
+ [c, p]
133
+ ), L = (x) => {
134
+ S(x), M((k) => k.filter((_) => _ !== x));
135
+ }, z = (x) => {
136
+ M(
137
+ (k) => k.includes(x) ? k.filter((_) => _ !== x) : [...k, x]
138
138
  );
139
- }, k = _({
139
+ }, f = H({
140
140
  mutationFn: async () => {
141
- const g = await d(a, {
141
+ const x = await d(i, {
142
142
  method: "POST",
143
143
  body: JSON.stringify({
144
144
  name: h.trim(),
145
- description: x.trim() || null,
145
+ description: y.trim() || null,
146
146
  originConfigId: p,
147
- targetConfigIds: M
147
+ targetConfigIds: q
148
148
  })
149
149
  });
150
- return await d(`${a}/${g.id}/snapshot-from-compare`, {
150
+ return await d(`${i}/${x.id}/snapshot-from-compare`, {
151
151
  method: "POST",
152
152
  body: JSON.stringify({})
153
- }), g;
153
+ }), x;
154
154
  },
155
- onSuccess: (g) => {
156
- l.invalidateQueries({ queryKey: Q }), r({ title: "Success", description: "Release created and snapshotted" }), s(!1), U(), i(g.id);
155
+ onSuccess: (x) => {
156
+ l.invalidateQueries({ queryKey: B }), r({ title: "Success", description: "Release created and snapshotted" }), s(!1), b(), a(x.id);
157
157
  },
158
- onError: (g) => {
159
- r({ title: "Error", description: g.message, variant: "destructive" });
158
+ onError: (x) => {
159
+ r({ title: "Error", description: x.message, variant: "destructive" });
160
160
  },
161
161
  // Refetch regardless of outcome: if create succeeds but snapshot fails, the
162
162
  // new release would otherwise be orphaned and missing from the list.
163
163
  onSettled: () => {
164
- l.invalidateQueries({ queryKey: Q });
164
+ l.invalidateQueries({ queryKey: B });
165
165
  }
166
- }), C = (g) => {
167
- g || U(), s(g);
168
- }, $ = !!(h.trim() && p && M.length > 0);
169
- return /* @__PURE__ */ e(ve, { open: t, onOpenChange: C, children: /* @__PURE__ */ n(we, { children: [
170
- /* @__PURE__ */ n(ke, { children: [
171
- /* @__PURE__ */ e(Ce, { children: "New Release" }),
172
- /* @__PURE__ */ e(Te, { children: "Create a release from an origin cluster and snapshot the diff against its targets." })
166
+ }), T = (x) => {
167
+ x || b(), s(x);
168
+ }, I = !!(h.trim() && p && q.length > 0);
169
+ return /* @__PURE__ */ e(xe, { open: t, onOpenChange: T, children: /* @__PURE__ */ n(ye, { children: [
170
+ /* @__PURE__ */ n(be, { children: [
171
+ /* @__PURE__ */ e(Ne, { children: "New Release" }),
172
+ /* @__PURE__ */ e(ve, { children: "Create a release from an origin cluster and snapshot the diff against its targets." })
173
173
  ] }),
174
174
  /* @__PURE__ */ n("div", { className: "space-y-4 py-4", children: [
175
175
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
176
- /* @__PURE__ */ e(le, { htmlFor: "release-name", children: "Name" }),
176
+ /* @__PURE__ */ e(ne, { htmlFor: "release-name", children: "Name" }),
177
177
  /* @__PURE__ */ e(
178
- ge,
178
+ ue,
179
179
  {
180
180
  id: "release-name",
181
181
  value: h,
182
- onChange: (g) => b(g.target.value),
182
+ onChange: (x) => N(x.target.value),
183
183
  placeholder: "2026.05 Release"
184
184
  }
185
185
  )
186
186
  ] }),
187
187
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
188
- /* @__PURE__ */ e(le, { htmlFor: "release-description", children: "Description (Optional)" }),
188
+ /* @__PURE__ */ e(ne, { htmlFor: "release-description", children: "Description (Optional)" }),
189
189
  /* @__PURE__ */ e(
190
- ge,
190
+ ue,
191
191
  {
192
192
  id: "release-description",
193
- value: x,
194
- onChange: (g) => c(g.target.value),
193
+ value: y,
194
+ onChange: (x) => m(x.target.value),
195
195
  placeholder: "What this release contains"
196
196
  }
197
197
  )
198
198
  ] }),
199
199
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
200
- /* @__PURE__ */ e(le, { htmlFor: "release-origin", children: "Origin Cluster" }),
200
+ /* @__PURE__ */ e(ne, { htmlFor: "release-origin", children: "Origin Cluster" }),
201
201
  /* @__PURE__ */ n(
202
202
  "select",
203
203
  {
204
204
  id: "release-origin",
205
205
  value: p,
206
- onChange: (g) => Y(g.target.value),
206
+ onChange: (x) => L(x.target.value),
207
207
  className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
208
208
  children: [
209
209
  /* @__PURE__ */ e("option", { value: "", children: "Select origin…" }),
210
- m.map((g) => /* @__PURE__ */ e("option", { value: g.id, children: g.displayName }, g.id))
210
+ c.map((x) => /* @__PURE__ */ e("option", { value: x.id, children: x.displayName }, x.id))
211
211
  ]
212
212
  }
213
213
  )
214
214
  ] }),
215
215
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
216
- /* @__PURE__ */ e(le, { children: "Target Clusters" }),
217
- j.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-1 rounded-md border border-input p-2 max-h-48 overflow-y-auto", children: j.map((g) => /* @__PURE__ */ n("label", { className: "flex items-center gap-2 text-sm cursor-pointer", children: [
216
+ /* @__PURE__ */ e(ne, { children: "Target Clusters" }),
217
+ P.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-1 rounded-md border border-input p-2 max-h-48 overflow-y-auto", children: P.map((x) => /* @__PURE__ */ n("label", { className: "flex items-center gap-2 text-sm cursor-pointer", children: [
218
218
  /* @__PURE__ */ e(
219
219
  "input",
220
220
  {
221
221
  type: "checkbox",
222
- checked: M.includes(g.id),
223
- onChange: () => B(g.id)
222
+ checked: q.includes(x.id),
223
+ onChange: () => z(x.id)
224
224
  }
225
225
  ),
226
- g.displayName
227
- ] }, g.id)) }) : /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: p ? "No other clusters available as targets." : "Select an origin first." })
226
+ x.displayName
227
+ ] }, x.id)) }) : /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: p ? "No other clusters available as targets." : "Select an origin first." })
228
228
  ] })
229
229
  ] }),
230
- /* @__PURE__ */ n(Pe, { children: [
231
- /* @__PURE__ */ n(E, { variant: "outline", onClick: () => C(!1), disabled: k.isPending, children: [
232
- /* @__PURE__ */ e(Ne, { className: "w-4 h-4 mr-2" }),
230
+ /* @__PURE__ */ n(we, { children: [
231
+ /* @__PURE__ */ n($, { variant: "outline", onClick: () => T(!1), disabled: f.isPending, children: [
232
+ /* @__PURE__ */ e(ge, { className: "w-4 h-4 mr-2" }),
233
233
  "Cancel"
234
234
  ] }),
235
- /* @__PURE__ */ e(E, { onClick: () => k.mutate(), disabled: !$ || k.isPending, children: k.isPending ? /* @__PURE__ */ n(ze, { children: [
236
- /* @__PURE__ */ e(Ve, { className: "w-4 h-4 mr-2 animate-spin" }),
235
+ /* @__PURE__ */ e($, { onClick: () => f.mutate(), disabled: !I || f.isPending, children: f.isPending ? /* @__PURE__ */ n(Pe, { children: [
236
+ /* @__PURE__ */ e(ze, { className: "w-4 h-4 mr-2 animate-spin" }),
237
237
  "Snapshotting…"
238
- ] }) : /* @__PURE__ */ n(ze, { children: [
239
- /* @__PURE__ */ e(bt, { className: "w-4 h-4 mr-2" }),
238
+ ] }) : /* @__PURE__ */ n(Pe, { children: [
239
+ /* @__PURE__ */ e(Nt, { className: "w-4 h-4 mr-2" }),
240
240
  "Create & snapshot"
241
241
  ] }) })
242
242
  ] })
243
243
  ] }) });
244
244
  }
245
+ function en({ open: t, onOpenChange: s, release: a, onDuplicated: i }) {
246
+ const r = je.get("Release", "apiPath", "/releases"), { toast: d } = se(), { fetchJson: l } = te(), c = ae(), { configs: h } = fe(), N = ["imaginarium", "releases", r], [y, m] = R(`Copy of ${a.name}`), [p, S] = R([]), q = new Set(
247
+ (a.targetConfigIds ?? []).filter((f) => f !== a.originConfigId)
248
+ ), M = h.filter((f) => f.id !== a.originConfigId), B = (f) => {
249
+ S(
250
+ (T) => T.includes(f) ? T.filter((I) => I !== f) : [...T, f]
251
+ );
252
+ }, b = () => {
253
+ m(`Copy of ${a.name}`), S([]);
254
+ }, P = H({
255
+ mutationFn: async () => {
256
+ const f = await l(`${r}/${a.id}/duplicate`, {
257
+ method: "POST",
258
+ body: JSON.stringify({
259
+ name: y.trim(),
260
+ targetConfigIds: p
261
+ })
262
+ });
263
+ return await l(`${r}/${f.id}/snapshot-from-compare`, {
264
+ method: "POST",
265
+ body: JSON.stringify({})
266
+ }), f;
267
+ },
268
+ onSuccess: (f) => {
269
+ c.invalidateQueries({ queryKey: N }), d({ title: "Success", description: "Release duplicated and snapshotted" }), s(!1), b(), i(f.id);
270
+ },
271
+ onError: (f) => {
272
+ d({ title: "Error", description: f.message, variant: "destructive" });
273
+ },
274
+ // Refetch regardless of outcome: if duplicate succeeds but snapshot fails, the
275
+ // new release would otherwise be orphaned and missing from the list.
276
+ onSettled: () => {
277
+ c.invalidateQueries({ queryKey: N });
278
+ }
279
+ }), L = (f) => {
280
+ f || b(), s(f);
281
+ }, z = !!(y.trim() && p.length > 0);
282
+ return /* @__PURE__ */ e(xe, { open: t, onOpenChange: L, children: /* @__PURE__ */ n(ye, { children: [
283
+ /* @__PURE__ */ n(be, { children: [
284
+ /* @__PURE__ */ e(Ne, { children: "Duplicate Release" }),
285
+ /* @__PURE__ */ n(ve, { children: [
286
+ 'Copy all include/exclude decisions from "',
287
+ a.name,
288
+ '" into a new release.'
289
+ ] })
290
+ ] }),
291
+ /* @__PURE__ */ n("div", { className: "space-y-4 py-4", children: [
292
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
293
+ /* @__PURE__ */ e(ne, { htmlFor: "dup-release-name", children: "Name" }),
294
+ /* @__PURE__ */ e(
295
+ ue,
296
+ {
297
+ id: "dup-release-name",
298
+ value: y,
299
+ onChange: (f) => m(f.target.value)
300
+ }
301
+ )
302
+ ] }),
303
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
304
+ /* @__PURE__ */ e(ne, { children: "Target Clusters" }),
305
+ M.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-1 rounded-md border border-input p-2 max-h-48 overflow-y-auto", children: M.map((f) => /* @__PURE__ */ n("label", { className: "flex items-center gap-2 text-sm cursor-pointer", children: [
306
+ /* @__PURE__ */ e(
307
+ "input",
308
+ {
309
+ type: "checkbox",
310
+ checked: p.includes(f.id),
311
+ onChange: () => B(f.id)
312
+ }
313
+ ),
314
+ f.displayName,
315
+ q.has(f.id) ? /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: " (original destination)" }) : null
316
+ ] }, f.id)) }) : /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "No other clusters available." })
317
+ ] })
318
+ ] }),
319
+ /* @__PURE__ */ n(we, { children: [
320
+ /* @__PURE__ */ n($, { variant: "outline", onClick: () => L(!1), disabled: P.isPending, children: [
321
+ /* @__PURE__ */ e(ge, { className: "w-4 h-4 mr-2" }),
322
+ "Cancel"
323
+ ] }),
324
+ /* @__PURE__ */ e($, { onClick: () => P.mutate(), disabled: !z || P.isPending, children: P.isPending ? /* @__PURE__ */ n(Pe, { children: [
325
+ /* @__PURE__ */ e(ze, { className: "w-4 h-4 mr-2 animate-spin" }),
326
+ "Duplicating…"
327
+ ] }) : /* @__PURE__ */ n(Pe, { children: [
328
+ /* @__PURE__ */ e(vt, { className: "w-4 h-4 mr-2" }),
329
+ "Duplicate & snapshot"
330
+ ] }) })
331
+ ] })
332
+ ] }) });
333
+ }
245
334
  function kt({ status: t }) {
246
335
  return /* @__PURE__ */ e("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium border ${t === "pushed" ? "bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 border-emerald-500/30" : "bg-muted text-muted-foreground border-border"}`, children: t });
247
336
  }
248
- function Xt({ onOpen: t }) {
249
- const s = Ue.get("Release", "apiPath", "/releases"), { fetchJson: i } = te(), { configs: a } = be(), [r, d] = R(!1), l = ["imaginarium", "releases", s], { data: m, isLoading: h } = ae({
250
- queryKey: l,
337
+ function tn({ onOpen: t }) {
338
+ const s = je.get("Release", "apiPath", "/releases"), { toast: a } = se(), { fetchJson: i } = te(), { configs: r } = fe(), d = ae(), [l, c] = R(!1), [h, N] = R(null), y = ["imaginarium", "releases", s], { data: m, isLoading: p } = le({
339
+ queryKey: y,
251
340
  queryFn: async () => {
252
- const c = await i(s);
253
- return [...Array.isArray(c) ? c : (c == null ? void 0 : c.items) ?? []].sort((P, M) => (M.createdAt ?? "").localeCompare(P.createdAt ?? ""));
341
+ const b = await i(s);
342
+ return [...Array.isArray(b) ? b : (b == null ? void 0 : b.items) ?? []].sort((L, z) => (z.createdAt ?? "").localeCompare(L.createdAt ?? ""));
254
343
  }
255
- }), b = q(() => {
256
- const c = /* @__PURE__ */ new Map();
257
- return a.forEach((p) => c.set(String(p.id), p.displayName)), c;
258
- }, [a]), x = (c) => b.get(c) ?? c;
344
+ }), S = J(() => {
345
+ const b = /* @__PURE__ */ new Map();
346
+ return r.forEach((P) => b.set(String(P.id), P.displayName)), b;
347
+ }, [r]), q = (b) => S.get(b) ?? b, M = H({
348
+ mutationFn: (b) => i(`${s}/${b}`, { method: "DELETE" }),
349
+ onSuccess: () => {
350
+ d.invalidateQueries({ queryKey: y }), a({ title: "Release deleted" });
351
+ },
352
+ onError: (b) => {
353
+ a({ title: "Error", description: b.message, variant: "destructive" });
354
+ }
355
+ }), B = (b, P) => {
356
+ b.stopPropagation(), window.confirm(`Delete "${P.name}"? This cannot be undone.`) && M.mutate(P.id);
357
+ };
259
358
  return /* @__PURE__ */ n("div", { className: "space-y-4", children: [
260
- /* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ n(E, { onClick: () => d(!0), children: [
261
- /* @__PURE__ */ e(je, { className: "w-4 h-4 mr-2" }),
359
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ n($, { onClick: () => c(!0), children: [
360
+ /* @__PURE__ */ e(Je, { className: "w-4 h-4 mr-2" }),
262
361
  "New Release"
263
362
  ] }) }),
264
- h ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground", children: "Loading…" }) : m && m.length > 0 ? /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Me, { className: "p-0", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
363
+ p ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground", children: "Loading…" }) : m && m.length > 0 ? /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(Me, { className: "p-0", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
265
364
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b text-left text-muted-foreground", children: [
266
365
  /* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Name" }),
267
366
  /* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Origin" }),
@@ -271,67 +370,104 @@ function Xt({ onOpen: t }) {
271
370
  /* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Pushed" }),
272
371
  /* @__PURE__ */ e("th", { className: "p-3 font-medium" })
273
372
  ] }) }),
274
- /* @__PURE__ */ e("tbody", { children: m.map((c) => /* @__PURE__ */ n(
373
+ /* @__PURE__ */ e("tbody", { children: m.map((b) => /* @__PURE__ */ n(
275
374
  "tr",
276
375
  {
277
376
  className: "border-b last:border-0 cursor-pointer hover:bg-muted/50",
278
- onClick: () => t(c.id),
377
+ onClick: () => t(b.id),
279
378
  children: [
280
379
  /* @__PURE__ */ n("td", { className: "p-3", children: [
281
- /* @__PURE__ */ e("div", { className: "font-medium", children: c.name }),
282
- c.description ? /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: c.description }) : null
380
+ /* @__PURE__ */ e("div", { className: "font-medium", children: b.name }),
381
+ b.description ? /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: b.description }) : null
283
382
  ] }),
284
- /* @__PURE__ */ e("td", { className: "p-3", children: x(c.originConfigId) }),
285
- /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: (c.targetConfigIds ?? []).map((p) => /* @__PURE__ */ e(
383
+ /* @__PURE__ */ e("td", { className: "p-3", children: q(b.originConfigId) }),
384
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: (b.targetConfigIds ?? []).map((P) => /* @__PURE__ */ e(
286
385
  "span",
287
386
  {
288
387
  className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs",
289
- children: x(p)
388
+ children: q(P)
290
389
  },
291
- p
390
+ P
292
391
  )) }) }),
293
- /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(kt, { status: c.status }) }),
294
- /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: c.snapshotAt ? new Date(c.snapshotAt).toLocaleString() : "—" }),
295
- /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: c.pushedAt ? new Date(c.pushedAt).toLocaleString() : "—" }),
296
- /* @__PURE__ */ e("td", { className: "p-3 text-right", children: /* @__PURE__ */ e(
297
- E,
298
- {
299
- variant: "ghost",
300
- size: "sm",
301
- onClick: (p) => {
302
- p.stopPropagation(), t(c.id);
303
- },
304
- children: "Open →"
305
- }
306
- ) })
392
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(kt, { status: b.status }) }),
393
+ /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: b.snapshotAt ? new Date(b.snapshotAt).toLocaleString() : "—" }),
394
+ /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: b.pushedAt ? new Date(b.pushedAt).toLocaleString() : "—" }),
395
+ /* @__PURE__ */ n("td", { className: "p-3 text-right whitespace-nowrap", children: [
396
+ b.status === "draft" ? /* @__PURE__ */ e(
397
+ $,
398
+ {
399
+ variant: "ghost",
400
+ size: "sm",
401
+ onClick: (P) => B(P, b),
402
+ title: "Delete draft",
403
+ disabled: M.isPending,
404
+ children: /* @__PURE__ */ e(He, { className: "w-4 h-4 text-destructive" })
405
+ }
406
+ ) : null,
407
+ /* @__PURE__ */ e(
408
+ $,
409
+ {
410
+ variant: "ghost",
411
+ size: "sm",
412
+ onClick: (P) => {
413
+ P.stopPropagation(), N(b);
414
+ },
415
+ title: "Duplicate",
416
+ children: /* @__PURE__ */ e(vt, { className: "w-4 h-4" })
417
+ }
418
+ ),
419
+ /* @__PURE__ */ e(
420
+ $,
421
+ {
422
+ variant: "ghost",
423
+ size: "sm",
424
+ onClick: (P) => {
425
+ P.stopPropagation(), t(b.id);
426
+ },
427
+ title: "Open",
428
+ children: /* @__PURE__ */ e(jt, { className: "w-4 h-4" })
429
+ }
430
+ )
431
+ ] })
307
432
  ]
308
433
  },
309
- c.id
434
+ b.id
310
435
  )) })
311
- ] }) }) }) : /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ n(Me, { className: "py-12 text-center", children: [
436
+ ] }) }) }) : /* @__PURE__ */ e(De, { children: /* @__PURE__ */ n(Me, { className: "py-12 text-center", children: [
312
437
  /* @__PURE__ */ e("p", { className: "text-muted-foreground mb-4", children: "No releases yet" }),
313
- /* @__PURE__ */ n(E, { onClick: () => d(!0), children: [
314
- /* @__PURE__ */ e(je, { className: "w-4 h-4 mr-2" }),
438
+ /* @__PURE__ */ n($, { onClick: () => c(!0), children: [
439
+ /* @__PURE__ */ e(Je, { className: "w-4 h-4 mr-2" }),
315
440
  "Create Your First Release"
316
441
  ] })
317
442
  ] }) }),
318
443
  /* @__PURE__ */ e(
319
- Gt,
444
+ Zt,
320
445
  {
321
- open: r,
322
- onOpenChange: d,
446
+ open: l,
447
+ onOpenChange: c,
323
448
  onCreated: t
324
449
  }
325
- )
450
+ ),
451
+ h ? /* @__PURE__ */ e(
452
+ en,
453
+ {
454
+ open: !!h,
455
+ onOpenChange: (b) => {
456
+ b || N(null);
457
+ },
458
+ release: h,
459
+ onDuplicated: t
460
+ }
461
+ ) : null
326
462
  ] });
327
463
  }
328
- function Zt({
464
+ function nn({
329
465
  originName: t,
330
466
  className: s
331
467
  }) {
332
- const i = t ? `Skipped in your last release from ${t}.` : "Skipped in your last release.";
333
- return /* @__PURE__ */ e(Ut, { children: /* @__PURE__ */ n(Ht, { children: [
334
- /* @__PURE__ */ e(_t, { asChild: !0, children: /* @__PURE__ */ e(
468
+ const a = t ? `Skipped in your last release from ${t}.` : "Skipped in your last release.";
469
+ return /* @__PURE__ */ e(_t, { children: /* @__PURE__ */ n(Yt, { children: [
470
+ /* @__PURE__ */ e(Wt, { asChild: !0, children: /* @__PURE__ */ e(
335
471
  "span",
336
472
  {
337
473
  className: ce(
@@ -342,10 +478,10 @@ function Zt({
342
478
  children: "previously skipped"
343
479
  }
344
480
  ) }),
345
- /* @__PURE__ */ e(Yt, { side: "top", children: i })
481
+ /* @__PURE__ */ e(Gt, { side: "top", children: a })
346
482
  ] }) });
347
483
  }
348
- function en({ className: t }) {
484
+ function sn({ className: t }) {
349
485
  return /* @__PURE__ */ e(
350
486
  "span",
351
487
  {
@@ -358,75 +494,75 @@ function en({ className: t }) {
358
494
  }
359
495
  );
360
496
  }
361
- function tn({
497
+ function an({
362
498
  ignoreRule: t,
363
499
  createPayload: s,
364
- apiPath: i = "/release-ignores",
365
- onChange: a,
500
+ apiPath: a = "/release-ignores",
501
+ onChange: i,
366
502
  className: r
367
503
  }) {
368
- const { toast: d } = oe(), { fetchJson: l } = te(), m = de(), [h, b] = R(!1), x = !!t, c = () => {
369
- m.invalidateQueries({ queryKey: ["imaginarium", "release-ignores"] }), a == null || a();
370
- }, p = _({
371
- mutationFn: () => l(i, {
504
+ const { toast: d } = se(), { fetchJson: l } = te(), c = ae(), [h, N] = R(!1), y = !!t, m = () => {
505
+ c.invalidateQueries({ queryKey: ["imaginarium", "release-ignores"] }), i == null || i();
506
+ }, p = H({
507
+ mutationFn: () => l(a, {
372
508
  method: "POST",
373
509
  body: JSON.stringify(s)
374
510
  }),
375
511
  onSuccess: () => {
376
- d({ title: "Item ignored", description: "Will be excluded from all future snapshots." }), b(!1), c();
512
+ d({ title: "Item ignored", description: "Will be excluded from all future snapshots." }), N(!1), m();
377
513
  },
378
- onError: (D) => {
379
- d({ title: "Error", description: D.message, variant: "destructive" });
514
+ onError: (M) => {
515
+ d({ title: "Error", description: M.message, variant: "destructive" });
380
516
  }
381
- }), P = _({
382
- mutationFn: () => l(`${i}/${t.id}`, { method: "DELETE" }),
517
+ }), S = H({
518
+ mutationFn: () => l(`${a}/${t.id}`, { method: "DELETE" }),
383
519
  onSuccess: () => {
384
- d({ title: "Item un-ignored", description: "Will appear normally in future snapshots." }), c();
520
+ d({ title: "Item un-ignored", description: "Will appear normally in future snapshots." }), m();
385
521
  },
386
- onError: (D) => {
387
- d({ title: "Error", description: D.message, variant: "destructive" });
522
+ onError: (M) => {
523
+ d({ title: "Error", description: M.message, variant: "destructive" });
388
524
  }
389
- }), M = p.isPending || P.isPending;
390
- return /* @__PURE__ */ n(ze, { children: [
525
+ }), q = p.isPending || S.isPending;
526
+ return /* @__PURE__ */ n(Pe, { children: [
391
527
  /* @__PURE__ */ e(
392
- E,
528
+ $,
393
529
  {
394
530
  variant: "ghost",
395
531
  size: "icon",
396
- title: x ? "Remove from ignore list" : "Ignore this item",
397
- disabled: M,
398
- onClick: () => x ? P.mutate() : b(!0),
399
- className: ce(x && "text-red-500 hover:text-red-500 dark:text-red-400 dark:hover:text-red-400", r),
400
- children: /* @__PURE__ */ e(Be, {})
532
+ title: y ? "Remove from ignore list" : "Ignore this item",
533
+ disabled: q,
534
+ onClick: () => y ? S.mutate() : N(!0),
535
+ className: ce(y && "text-red-500 hover:text-red-500 dark:text-red-400 dark:hover:text-red-400", r),
536
+ children: /* @__PURE__ */ e(Le, {})
401
537
  }
402
538
  ),
403
- /* @__PURE__ */ e(ve, { open: h, onOpenChange: b, children: /* @__PURE__ */ n(we, { children: [
404
- /* @__PURE__ */ n(ke, { children: [
405
- /* @__PURE__ */ e(Ce, { children: "Ignore this item?" }),
406
- /* @__PURE__ */ n(Te, { children: [
539
+ /* @__PURE__ */ e(xe, { open: h, onOpenChange: N, children: /* @__PURE__ */ n(ye, { children: [
540
+ /* @__PURE__ */ n(be, { children: [
541
+ /* @__PURE__ */ e(Ne, { children: "Ignore this item?" }),
542
+ /* @__PURE__ */ n(ve, { children: [
407
543
  "Ignoring excludes this item from ",
408
544
  /* @__PURE__ */ e("strong", { children: "this and all future releases" }),
409
545
  " for this origin cluster — it will never be pushed to any destination. You can un-ignore it later from the Ignored tab."
410
546
  ] })
411
547
  ] }),
412
- /* @__PURE__ */ n(Pe, { children: [
548
+ /* @__PURE__ */ n(we, { children: [
413
549
  /* @__PURE__ */ e(
414
- E,
550
+ $,
415
551
  {
416
552
  variant: "outline",
417
- onClick: () => b(!1),
553
+ onClick: () => N(!1),
418
554
  disabled: p.isPending,
419
555
  children: "Cancel"
420
556
  }
421
557
  ),
422
558
  /* @__PURE__ */ n(
423
- E,
559
+ $,
424
560
  {
425
561
  variant: "destructive",
426
562
  onClick: () => p.mutate(),
427
563
  disabled: p.isPending,
428
564
  children: [
429
- /* @__PURE__ */ e(Be, { className: "w-4 h-4 mr-2" }),
565
+ /* @__PURE__ */ e(Le, { className: "w-4 h-4 mr-2" }),
430
566
  "Ignore item"
431
567
  ]
432
568
  }
@@ -435,109 +571,109 @@ function tn({
435
571
  ] }) })
436
572
  ] });
437
573
  }
438
- function nn({
574
+ function rn({
439
575
  releaseId: t,
440
576
  apiPath: s = "/releases",
441
- onReset: i
577
+ onReset: a
442
578
  }) {
443
- const { toast: a } = oe(), { fetchJson: r } = te(), d = de(), l = _({
579
+ const { toast: i } = se(), { fetchJson: r } = te(), d = ae(), l = H({
444
580
  mutationFn: () => r(`${s}/${t}/reset-exclusions`, {
445
581
  method: "POST"
446
582
  }),
447
- onSuccess: (m) => {
448
- d.invalidateQueries({ queryKey: ["imaginarium", "release-items", t] }), a({
583
+ onSuccess: (c) => {
584
+ d.invalidateQueries({ queryKey: ["imaginarium", "release-items", t] }), i({
449
585
  title: "Exclusions reset",
450
- description: `${m.reset} item${m.reset === 1 ? "" : "s"} re-enabled.`
451
- }), i == null || i(m.reset);
586
+ description: `${c.reset} item${c.reset === 1 ? "" : "s"} re-enabled.`
587
+ }), a == null || a(c.reset);
452
588
  },
453
- onError: (m) => {
454
- a({ title: "Error", description: m.message, variant: "destructive" });
589
+ onError: (c) => {
590
+ i({ title: "Error", description: c.message, variant: "destructive" });
455
591
  }
456
592
  });
457
593
  return /* @__PURE__ */ n(
458
- E,
594
+ $,
459
595
  {
460
596
  variant: "outline",
461
597
  size: "sm",
462
598
  onClick: () => l.mutate(),
463
599
  disabled: l.isPending,
464
600
  children: [
465
- /* @__PURE__ */ e(zt, {}),
601
+ /* @__PURE__ */ e(Bt, {}),
466
602
  l.isPending ? "Resetting…" : "Reset exclusions"
467
603
  ]
468
604
  }
469
605
  );
470
606
  }
471
- function De({ label: t, value: s, highlightLines: i }) {
607
+ function Fe({ label: t, value: s, highlightLines: a }) {
472
608
  return /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-col", children: [
473
609
  /* @__PURE__ */ e("div", { className: "mb-1 text-xs font-medium text-muted-foreground", children: t }),
474
- /* @__PURE__ */ e("pre", { className: "flex-1 overflow-auto rounded border bg-muted/30 p-3 text-xs", children: i === void 0 ? s === void 0 ? "null" : JSON.stringify(s, null, 2) : (s === void 0 ? "null" : JSON.stringify(s, null, 2)).split(`
475
- `).map((a, r) => (
610
+ /* @__PURE__ */ e("pre", { className: "flex-1 overflow-auto rounded border bg-muted/30 p-3 text-xs", children: a === void 0 ? s === void 0 ? "null" : JSON.stringify(s, null, 2) : (s === void 0 ? "null" : JSON.stringify(s, null, 2)).split(`
611
+ `).map((i, r) => (
476
612
  // eslint-disable-next-line react/no-array-index-key
477
613
  /* @__PURE__ */ e(
478
614
  "div",
479
615
  {
480
- className: i[r] ? "bg-yellow-200/70 text-yellow-950 dark:bg-yellow-400/20 dark:text-yellow-100" : void 0,
481
- children: a === "" ? " " : a
616
+ className: a[r] ? "bg-yellow-200/70 text-yellow-950 dark:bg-yellow-400/20 dark:text-yellow-100" : void 0,
617
+ children: i === "" ? " " : i
482
618
  },
483
619
  r
484
620
  )
485
621
  )) })
486
622
  ] });
487
623
  }
488
- function st(t) {
624
+ function at(t) {
489
625
  return t === void 0 ? "null" : JSON.stringify(t, null, 2);
490
626
  }
491
- function Ct(t, s, i) {
492
- let a = st(t);
493
- if (i && i.length > 0)
494
- for (const { replace: p, with: P } of i)
495
- p && (a = a.split(p).join(P));
496
- const r = a.split(`
497
- `), d = st(s).split(`
498
- `), l = r.length, m = d.length, h = Array.from({ length: l + 1 }, () => new Array(m + 1).fill(0));
627
+ function Tt(t, s, a) {
628
+ let i = at(t);
629
+ if (a && a.length > 0)
630
+ for (const { replace: p, with: S } of a)
631
+ p && (i = i.split(p).join(S));
632
+ const r = i.split(`
633
+ `), d = at(s).split(`
634
+ `), l = r.length, c = d.length, h = Array.from({ length: l + 1 }, () => new Array(c + 1).fill(0));
499
635
  for (let p = l - 1; p >= 0; p -= 1)
500
- for (let P = m - 1; P >= 0; P -= 1)
501
- h[p][P] = r[p] === d[P] ? h[p + 1][P + 1] + 1 : Math.max(h[p + 1][P], h[p][P + 1]);
502
- const b = new Array(l).fill(!0);
503
- let x = 0, c = 0;
504
- for (; x < l && c < m; )
505
- r[x] === d[c] ? (b[x] = !1, x += 1, c += 1) : h[x + 1][c] >= h[x][c + 1] ? x += 1 : c += 1;
506
- return b;
636
+ for (let S = c - 1; S >= 0; S -= 1)
637
+ h[p][S] = r[p] === d[S] ? h[p + 1][S + 1] + 1 : Math.max(h[p + 1][S], h[p][S + 1]);
638
+ const N = new Array(l).fill(!0);
639
+ let y = 0, m = 0;
640
+ for (; y < l && m < c; )
641
+ r[y] === d[m] ? (N[y] = !1, y += 1, m += 1) : h[y + 1][m] >= h[y][m + 1] ? y += 1 : m += 1;
642
+ return N;
507
643
  }
508
- function Oe({
644
+ function Ie({
509
645
  title: t,
510
646
  values: s,
511
- excluded: i,
512
- editable: a,
647
+ excluded: a,
648
+ editable: i,
513
649
  onToggle: r,
514
650
  formatLabel: d
515
651
  }) {
516
- const [l, m] = R(i.length > 0);
517
- return Qe(() => {
518
- i.length > 0 && m(!0);
519
- }, [i.length]), /* @__PURE__ */ n("div", { className: "border-b p-2", children: [
652
+ const [l, c] = R(a.length > 0);
653
+ return Ue(() => {
654
+ a.length > 0 && c(!0);
655
+ }, [a.length]), /* @__PURE__ */ n("div", { className: "border-b p-2", children: [
520
656
  /* @__PURE__ */ n(
521
657
  "button",
522
658
  {
523
659
  type: "button",
524
660
  className: "flex w-full items-center justify-between gap-2",
525
- onClick: () => m((h) => !h),
661
+ onClick: () => c((h) => !h),
526
662
  "aria-expanded": l,
527
663
  children: [
528
664
  /* @__PURE__ */ n("span", { className: "flex items-center gap-1 text-xs font-medium text-muted-foreground", children: [
529
- l ? /* @__PURE__ */ e(ue, { size: 12 }) : /* @__PURE__ */ e(he, { size: 12 }),
665
+ l ? /* @__PURE__ */ e(he, { size: 12 }) : /* @__PURE__ */ e(pe, { size: 12 }),
530
666
  t,
531
667
  " (",
532
- i.length,
668
+ a.length,
533
669
  ")"
534
670
  ] }),
535
- a ? null : /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: "read-only" })
671
+ i ? null : /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: "read-only" })
536
672
  ]
537
673
  }
538
674
  ),
539
675
  l ? /* @__PURE__ */ e("div", { className: "mt-1 flex flex-col gap-1", children: s.map((h) => {
540
- const b = !i.includes(h);
676
+ const N = !a.includes(h);
541
677
  return /* @__PURE__ */ n(
542
678
  "label",
543
679
  {
@@ -548,12 +684,12 @@ function Oe({
548
684
  {
549
685
  type: "checkbox",
550
686
  className: "mt-0.5 shrink-0",
551
- checked: b,
552
- disabled: !a,
553
- onChange: (x) => r == null ? void 0 : r(h, x.target.checked)
687
+ checked: N,
688
+ disabled: !i,
689
+ onChange: (y) => r == null ? void 0 : r(h, y.target.checked)
554
690
  }
555
691
  ),
556
- /* @__PURE__ */ e("span", { className: `min-w-0 break-all font-mono ${b ? "" : "text-muted-foreground line-through"}`, children: d ? d(h) : h })
692
+ /* @__PURE__ */ e("span", { className: `min-w-0 break-all font-mono ${N ? "" : "text-muted-foreground line-through"}`, children: d ? d(h) : h })
557
693
  ]
558
694
  },
559
695
  h
@@ -561,39 +697,39 @@ function Oe({
561
697
  }) }) : null
562
698
  ] });
563
699
  }
564
- function sn({
700
+ function ln({
565
701
  item: t,
566
702
  targets: s,
567
- onClose: i,
568
- unmetDependencyNames: a = [],
703
+ onClose: a,
704
+ unmetDependencyNames: i = [],
569
705
  tags: r = [],
570
706
  excludedTags: d = [],
571
707
  editable: l = !0,
572
- onToggleTag: m,
708
+ onToggleTag: c,
573
709
  metadataKeys: h = [],
574
- excludedMetadataKeys: b = [],
575
- onToggleMetadataKey: x,
576
- i18nPaths: c = [],
710
+ excludedMetadataKeys: N = [],
711
+ onToggleMetadataKey: y,
712
+ i18nPaths: m = [],
577
713
  excludedI18nPaths: p = [],
578
- onToggleI18nPath: P,
579
- permissionKeys: M = [],
580
- excludedPermissions: D = [],
581
- onTogglePermission: Q,
582
- formatPermissionLabel: U,
583
- replacementMaps: j
714
+ onToggleI18nPath: S,
715
+ permissionKeys: q = [],
716
+ excludedPermissions: M = [],
717
+ onTogglePermission: B,
718
+ formatPermissionLabel: b,
719
+ replacementMaps: P
584
720
  }) {
585
- var X, f, F, J;
586
- const Y = ((X = s[0]) == null ? void 0 : X.id) ?? null, [B, k] = R(Y);
587
- Qe(() => {
588
- var A;
589
- k(((A = s[0]) == null ? void 0 : A.id) ?? null);
721
+ var X, g, j, U;
722
+ const L = ((X = s[0]) == null ? void 0 : X.id) ?? null, [z, f] = R(L);
723
+ Ue(() => {
724
+ var F;
725
+ f(((F = s[0]) == null ? void 0 : F.id) ?? null);
590
726
  }, [t == null ? void 0 : t.id]);
591
- const C = s.find((A) => A.id === B) ?? s[0] ?? null, $ = (f = t == null ? void 0 : t.diff) == null ? void 0 : f.byTarget, g = $ != null, w = g ? $[(C == null ? void 0 : C.id) ?? ""] : (F = t == null ? void 0 : t.diff) == null ? void 0 : F.target, V = g && C != null && !(C.id in $), L = q(
727
+ const T = s.find((F) => F.id === z) ?? s[0] ?? null, I = (g = t == null ? void 0 : t.diff) == null ? void 0 : g.byTarget, x = I != null, k = x ? I[(T == null ? void 0 : T.id) ?? ""] : (j = t == null ? void 0 : t.diff) == null ? void 0 : j.target, _ = x && T != null && !(T.id in I), V = J(
592
728
  () => {
593
- var A;
594
- return V ? void 0 : Ct((A = t == null ? void 0 : t.diff) == null ? void 0 : A.origin, w, j == null ? void 0 : j[(C == null ? void 0 : C.id) ?? ""]);
729
+ var F;
730
+ return _ ? void 0 : Tt((F = t == null ? void 0 : t.diff) == null ? void 0 : F.origin, k, P == null ? void 0 : P[(T == null ? void 0 : T.id) ?? ""]);
595
731
  },
596
- [t, w, V, j, C == null ? void 0 : C.id]
732
+ [t, k, _, P, T == null ? void 0 : T.id]
597
733
  );
598
734
  return t ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col rounded-md border bg-background", children: [
599
735
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b p-3", children: [
@@ -601,84 +737,84 @@ function sn({
601
737
  /* @__PURE__ */ e("div", { className: "truncate font-medium", children: t.itemName }),
602
738
  /* @__PURE__ */ e("div", { className: "font-mono text-xs text-muted-foreground", children: t.itemType })
603
739
  ] }),
604
- /* @__PURE__ */ e(E, { variant: "ghost", size: "icon", title: "Close", onClick: i, children: /* @__PURE__ */ e(Ne, {}) })
740
+ /* @__PURE__ */ e($, { variant: "ghost", size: "icon", title: "Close", onClick: a, children: /* @__PURE__ */ e(ge, {}) })
605
741
  ] }),
606
- a.length > 0 ? /* @__PURE__ */ n("div", { className: "flex items-start gap-2 border-b bg-amber-50 p-2 text-xs text-amber-700 dark:bg-amber-500/10 dark:text-amber-300", children: [
607
- /* @__PURE__ */ e(ye, { size: 14, className: "mt-0.5 shrink-0 text-amber-600 dark:text-amber-400" }),
742
+ i.length > 0 ? /* @__PURE__ */ n("div", { className: "flex items-start gap-2 border-b bg-amber-50 p-2 text-xs text-amber-700 dark:bg-amber-500/10 dark:text-amber-300", children: [
743
+ /* @__PURE__ */ e(Se, { size: 14, className: "mt-0.5 shrink-0 text-amber-600 dark:text-amber-400" }),
608
744
  /* @__PURE__ */ n("span", { children: [
609
745
  "Depends on excluded items: ",
610
- a.join(", "),
746
+ i.join(", "),
611
747
  ". Push will fail for this item until they're included."
612
748
  ] })
613
749
  ] }) : null,
614
750
  r.length > 0 ? /* @__PURE__ */ e(
615
- Oe,
751
+ Ie,
616
752
  {
617
753
  title: "Tag Overrides",
618
754
  values: r,
619
755
  excluded: d,
620
756
  editable: l,
621
- onToggle: m
757
+ onToggle: c
622
758
  }
623
759
  ) : null,
624
760
  h.length > 0 ? /* @__PURE__ */ e(
625
- Oe,
761
+ Ie,
626
762
  {
627
763
  title: "Metadata Overrides",
628
764
  values: h,
629
- excluded: b,
765
+ excluded: N,
630
766
  editable: l,
631
- onToggle: x
767
+ onToggle: y
632
768
  }
633
769
  ) : null,
634
- c.length > 0 ? /* @__PURE__ */ e(
635
- Oe,
770
+ m.length > 0 ? /* @__PURE__ */ e(
771
+ Ie,
636
772
  {
637
773
  title: "Translation Overrides",
638
- values: c,
774
+ values: m,
639
775
  excluded: p,
640
776
  editable: l,
641
- onToggle: P
777
+ onToggle: S
642
778
  }
643
779
  ) : null,
644
- M.length > 0 ? /* @__PURE__ */ e(
645
- Oe,
780
+ q.length > 0 ? /* @__PURE__ */ e(
781
+ Ie,
646
782
  {
647
783
  title: "Permission Overrides",
648
- values: M,
649
- excluded: D,
784
+ values: q,
785
+ excluded: M,
650
786
  editable: l,
651
- onToggle: Q,
652
- formatLabel: U
787
+ onToggle: B,
788
+ formatLabel: b
653
789
  }
654
790
  ) : null,
655
- s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 border-b p-2", children: s.map((A) => {
656
- const H = g && !(A.id in $);
791
+ s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 border-b p-2", children: s.map((F) => {
792
+ const Y = x && !(F.id in I);
657
793
  return /* @__PURE__ */ n(
658
794
  "button",
659
795
  {
660
796
  type: "button",
661
- onClick: () => k(A.id),
662
- className: `inline-flex items-center gap-1 rounded px-2 py-1 text-xs ${A.id === (C == null ? void 0 : C.id) ? "bg-muted font-medium" : "hover:bg-muted/50"}`,
797
+ onClick: () => f(F.id),
798
+ className: `inline-flex items-center gap-1 rounded px-2 py-1 text-xs ${F.id === (T == null ? void 0 : T.id) ? "bg-muted font-medium" : "hover:bg-muted/50"}`,
663
799
  children: [
664
- H ? /* @__PURE__ */ e(Nt, { size: 12, className: "text-green-600" }) : /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-red-500", "aria-hidden": !0 }),
665
- A.name
800
+ Y ? /* @__PURE__ */ e(wt, { size: 12, className: "text-green-600" }) : /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-red-500", "aria-hidden": !0 }),
801
+ F.name
666
802
  ]
667
803
  },
668
- A.id
804
+ F.id
669
805
  );
670
806
  }) }) : null,
671
807
  /* @__PURE__ */ n("div", { className: "flex flex-1 gap-3 overflow-auto p-3", children: [
672
- /* @__PURE__ */ e(De, { label: "Origin", value: (J = t.diff) == null ? void 0 : J.origin, highlightLines: L }),
673
- V ? /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 items-center justify-center rounded border bg-muted/30 p-3 text-xs text-muted-foreground", children: [
808
+ /* @__PURE__ */ e(Fe, { label: "Origin", value: (U = t.diff) == null ? void 0 : U.origin, highlightLines: V }),
809
+ _ ? /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 items-center justify-center rounded border bg-muted/30 p-3 text-xs text-muted-foreground", children: [
674
810
  "Matches ",
675
- C == null ? void 0 : C.name,
811
+ T == null ? void 0 : T.name,
676
812
  " — no differences."
677
- ] }) : /* @__PURE__ */ e(De, { label: (C == null ? void 0 : C.name) ?? "Target", value: w })
813
+ ] }) : /* @__PURE__ */ e(Fe, { label: (T == null ? void 0 : T.name) ?? "Target", value: k })
678
814
  ] })
679
815
  ] }) : null;
680
816
  }
681
- const at = [
817
+ const it = [
682
818
  "blueprint",
683
819
  "system",
684
820
  "network",
@@ -700,83 +836,83 @@ const at = [
700
836
  "script"
701
837
  // Project
702
838
  ];
703
- function Fe(t) {
704
- const s = at.indexOf(t);
705
- return s === -1 ? at.length : s;
839
+ function qe(t) {
840
+ const s = it.indexOf(t);
841
+ return s === -1 ? it.length : s;
706
842
  }
707
- function Je(t, s) {
708
- const i = Fe(t) - Fe(s);
709
- return i !== 0 ? i : t.localeCompare(s);
843
+ function Ve(t, s) {
844
+ const a = qe(t) - qe(s);
845
+ return a !== 0 ? a : t.localeCompare(s);
710
846
  }
711
- const Re = {
847
+ const Ae = {
712
848
  create: "text-emerald-600",
713
849
  update: "text-amber-600",
714
850
  remove: "text-destructive"
715
851
  };
716
- function it(t) {
852
+ function rt(t) {
717
853
  const s = t.indexOf(":");
718
854
  return s >= 0 ? { type: t.slice(0, s), name: t.slice(s + 1) } : { type: "", name: t };
719
855
  }
720
- function an(t) {
721
- const s = /* @__PURE__ */ new Map(), i = (a, r, d) => {
722
- let l = s.get(a);
723
- return l || (l = { key: a, type: r, name: d, children: [] }, s.set(a, l)), l;
856
+ function on(t) {
857
+ const s = /* @__PURE__ */ new Map(), a = (i, r, d) => {
858
+ let l = s.get(i);
859
+ return l || (l = { key: i, type: r, name: d, children: [] }, s.set(i, l)), l;
724
860
  };
725
- for (const a of t)
726
- if (a.parentKey) {
727
- const r = it(a.parentKey);
728
- i(a.parentKey, r.type, r.name).children.push(a);
861
+ for (const i of t)
862
+ if (i.parentKey) {
863
+ const r = rt(i.parentKey);
864
+ a(i.parentKey, r.type, r.name).children.push(i);
729
865
  } else {
730
- const r = i(a.itemKey, a.itemType, a.itemName || it(a.itemKey).name);
731
- r.type = a.itemType, r.name = a.itemName || r.name, r.self = a;
866
+ const r = a(i.itemKey, i.itemType, i.itemName || rt(i.itemKey).name);
867
+ r.type = i.itemType, r.name = i.itemName || r.name, r.self = i;
732
868
  }
733
869
  return [...s.values()].sort(
734
- (a, r) => Fe(a.type) - Fe(r.type) || a.name.localeCompare(r.name)
870
+ (i, r) => qe(i.type) - qe(r.type) || i.name.localeCompare(r.name)
735
871
  );
736
872
  }
737
- function rn(t, s, i, a) {
873
+ function dn(t, s, a, i) {
738
874
  const { fetchJson: r } = te();
739
- return ae({
875
+ return le({
740
876
  queryKey: ["imaginarium", "release-push-preview", t, s],
741
- queryFn: () => r(`${i}/${t}/push-preview`, {
877
+ queryFn: () => r(`${a}/${t}/push-preview`, {
742
878
  method: "POST",
743
879
  body: JSON.stringify({ destConfigIds: s })
744
880
  }),
745
- enabled: a,
881
+ enabled: i,
746
882
  // The dialog recomputes on every open (see refetch-on-open), so don't also
747
883
  // auto-refetch on enable — that would double the (slow) compare.
748
884
  staleTime: 1 / 0,
749
885
  gcTime: 0
750
886
  });
751
887
  }
752
- function ln({ summary: t }) {
888
+ function cn({ summary: t }) {
753
889
  return /* @__PURE__ */ n("span", { className: "text-xs", children: [
754
- /* @__PURE__ */ n("span", { className: Re.create, children: [
890
+ /* @__PURE__ */ n("span", { className: Ae.create, children: [
755
891
  t.create,
756
892
  " create"
757
893
  ] }),
758
894
  " · ",
759
- /* @__PURE__ */ n("span", { className: Re.update, children: [
895
+ /* @__PURE__ */ n("span", { className: Ae.update, children: [
760
896
  t.update,
761
897
  " update"
762
898
  ] }),
763
899
  " · ",
764
- /* @__PURE__ */ n("span", { className: Re.remove, children: [
900
+ /* @__PURE__ */ n("span", { className: Ae.remove, children: [
765
901
  t.remove,
766
902
  " remove"
767
903
  ] })
768
904
  ] });
769
905
  }
770
- function rt({ action: t }) {
771
- return /* @__PURE__ */ e("span", { className: `font-mono text-xs uppercase ${Re[t] ?? ""}`, children: t });
906
+ function lt({ action: t }) {
907
+ return /* @__PURE__ */ e("span", { className: `font-mono text-xs uppercase ${Ae[t] ?? ""}`, children: t });
772
908
  }
773
- function on() {
909
+ function mn() {
774
910
  return /* @__PURE__ */ e("span", { className: "font-mono text-xs uppercase text-muted-foreground", children: "no_update" });
775
911
  }
776
- function dn({ preview: t, loading: s, error: i, onSelectItem: a }) {
912
+ function un({ preview: t, loading: s, error: a, onSelectItem: i }) {
777
913
  if (s)
778
914
  return /* @__PURE__ */ n("p", { className: "mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground", children: [
779
- /* @__PURE__ */ e(Ve, { className: "h-3 w-3 animate-spin" }),
915
+ /* @__PURE__ */ e(ze, { className: "h-3 w-3 animate-spin" }),
780
916
  " Computing changes…"
781
917
  ] });
782
918
  if (t != null && t.error)
@@ -784,54 +920,54 @@ function dn({ preview: t, loading: s, error: i, onSelectItem: a }) {
784
920
  "Couldn’t compute changes: ",
785
921
  t.error
786
922
  ] });
787
- if (i && !t)
923
+ if (a && !t)
788
924
  return /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-destructive", children: "Couldn’t compute changes for this target." });
789
925
  if (!t || !t.summary)
790
926
  return null;
791
927
  if (t.summary.total === 0)
792
928
  return /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-muted-foreground", children: "No changes — already up to date." });
793
- const r = an(t.items ?? []);
929
+ const r = on(t.items ?? []);
794
930
  return /* @__PURE__ */ n("div", { className: "mt-1", children: [
795
- /* @__PURE__ */ e(ln, { summary: t.summary }),
931
+ /* @__PURE__ */ e(cn, { summary: t.summary }),
796
932
  /* @__PURE__ */ e("div", { className: "mt-2 max-h-[55vh] space-y-3 overflow-auto border-t pt-2", children: r.map((d) => /* @__PURE__ */ n("div", { children: [
797
933
  /* @__PURE__ */ n("div", { className: "flex items-baseline gap-2", children: [
798
- d.self ? /* @__PURE__ */ e(rt, { action: d.self.action }) : /* @__PURE__ */ e(on, {}),
799
- d.self && a ? /* @__PURE__ */ e(
934
+ d.self ? /* @__PURE__ */ e(lt, { action: d.self.action }) : /* @__PURE__ */ e(mn, {}),
935
+ d.self && i ? /* @__PURE__ */ e(
800
936
  "button",
801
937
  {
802
938
  type: "button",
803
939
  className: "text-sm font-medium hover:underline",
804
- onClick: () => a(d.self),
940
+ onClick: () => i(d.self),
805
941
  children: d.name
806
942
  }
807
943
  ) : /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: d.name }),
808
944
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: d.type })
809
945
  ] }),
810
- d.children.length > 0 ? /* @__PURE__ */ e("ul", { className: "ml-4 mt-0.5 space-y-0.5 border-l pl-3", children: d.children.map((l, m) => /* @__PURE__ */ n("li", { className: "text-xs", children: [
811
- /* @__PURE__ */ e(rt, { action: l.action }),
946
+ d.children.length > 0 ? /* @__PURE__ */ e("ul", { className: "ml-4 mt-0.5 space-y-0.5 border-l pl-3", children: d.children.map((l, c) => /* @__PURE__ */ n("li", { className: "text-xs", children: [
947
+ /* @__PURE__ */ e(lt, { action: l.action }),
812
948
  " ",
813
- a ? /* @__PURE__ */ e("button", { type: "button", className: "hover:underline", onClick: () => a(l), children: l.itemName || l.itemKey }) : /* @__PURE__ */ e("span", { children: l.itemName || l.itemKey }),
949
+ i ? /* @__PURE__ */ e("button", { type: "button", className: "hover:underline", onClick: () => i(l), children: l.itemName || l.itemKey }) : /* @__PURE__ */ e("span", { children: l.itemName || l.itemKey }),
814
950
  l.itemType !== "attribute" ? /* @__PURE__ */ n("span", { className: "text-muted-foreground", children: [
815
951
  " (",
816
952
  l.itemType,
817
953
  ")"
818
954
  ] }) : null
819
- ] }, `${l.itemKey}-${m}`)) }) : null
955
+ ] }, `${l.itemKey}-${c}`)) }) : null
820
956
  ] }, d.key)) })
821
957
  ] });
822
958
  }
823
- function Tt({
959
+ function Pt({
824
960
  releaseId: t,
825
961
  destConfigId: s,
826
- name: i,
827
- apiPath: a = "/releases",
962
+ name: a,
963
+ apiPath: i = "/releases",
828
964
  onSelectItem: r,
829
965
  headerRight: d,
830
966
  footer: l,
831
- defaultOpen: m = !1
967
+ defaultOpen: c = !1
832
968
  }) {
833
- var P, M, D, Q;
834
- const [h, b] = R(m), x = q(() => [s], [s]), c = rn(t, x, a, h), p = ((M = (P = c.data) == null ? void 0 : P.previews) == null ? void 0 : M.find((U) => U.destConfigId === s)) ?? ((Q = (D = c.data) == null ? void 0 : D.previews) == null ? void 0 : Q[0]);
969
+ var S, q, M, B;
970
+ const [h, N] = R(c), y = J(() => [s], [s]), m = dn(t, y, i, h), p = ((q = (S = m.data) == null ? void 0 : S.previews) == null ? void 0 : q.find((b) => b.destConfigId === s)) ?? ((B = (M = m.data) == null ? void 0 : M.previews) == null ? void 0 : B[0]);
835
971
  return /* @__PURE__ */ n("div", { className: "rounded border", children: [
836
972
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-3 py-2", children: [
837
973
  /* @__PURE__ */ n(
@@ -839,10 +975,10 @@ function Tt({
839
975
  {
840
976
  type: "button",
841
977
  className: "flex min-w-0 items-center gap-1 text-sm font-medium",
842
- onClick: () => b((U) => !U),
978
+ onClick: () => N((b) => !b),
843
979
  children: [
844
- h ? /* @__PURE__ */ e(ue, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ e(he, { className: "h-4 w-4 shrink-0" }),
845
- /* @__PURE__ */ e("span", { className: "truncate", children: i })
980
+ h ? /* @__PURE__ */ e(he, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ e(pe, { className: "h-4 w-4 shrink-0" }),
981
+ /* @__PURE__ */ e("span", { className: "truncate", children: a })
846
982
  ]
847
983
  }
848
984
  ),
@@ -850,11 +986,11 @@ function Tt({
850
986
  ] }),
851
987
  h ? /* @__PURE__ */ n("div", { className: "border-t px-3 py-2", children: [
852
988
  /* @__PURE__ */ e(
853
- dn,
989
+ un,
854
990
  {
855
991
  preview: p,
856
- loading: c.isFetching,
857
- error: c.isError,
992
+ loading: m.isFetching,
993
+ error: m.isError,
858
994
  onSelectItem: r
859
995
  }
860
996
  ),
@@ -862,21 +998,21 @@ function Tt({
862
998
  ] }) : null
863
999
  ] });
864
1000
  }
865
- function cn({ state: t }) {
1001
+ function hn({ state: t }) {
866
1002
  switch (t.status) {
867
1003
  case "pushing":
868
1004
  return /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 text-sm text-muted-foreground", children: [
869
- /* @__PURE__ */ e(Ve, { className: "h-4 w-4 animate-spin" }),
1005
+ /* @__PURE__ */ e(ze, { className: "h-4 w-4 animate-spin" }),
870
1006
  "Pushing…"
871
1007
  ] });
872
1008
  case "success":
873
1009
  return /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 text-sm text-emerald-600", children: [
874
- /* @__PURE__ */ e(Nt, { className: "h-4 w-4" }),
1010
+ /* @__PURE__ */ e(wt, { className: "h-4 w-4" }),
875
1011
  "Success"
876
1012
  ] });
877
1013
  case "partial":
878
1014
  return /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 text-sm text-amber-600", children: [
879
- /* @__PURE__ */ e(ye, { className: "h-4 w-4" }),
1015
+ /* @__PURE__ */ e(Se, { className: "h-4 w-4" }),
880
1016
  "Partial — ",
881
1017
  t.failed ?? 0,
882
1018
  " failed"
@@ -888,120 +1024,120 @@ function cn({ state: t }) {
888
1024
  className: "inline-flex items-center gap-1 text-sm text-destructive",
889
1025
  title: t.error,
890
1026
  children: [
891
- /* @__PURE__ */ e(Ne, { className: "h-4 w-4" }),
1027
+ /* @__PURE__ */ e(ge, { className: "h-4 w-4" }),
892
1028
  "Failed"
893
1029
  ]
894
1030
  }
895
1031
  );
896
1032
  default:
897
1033
  return /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 text-sm text-muted-foreground", children: [
898
- /* @__PURE__ */ e(Bt, { className: "h-3 w-3" }),
1034
+ /* @__PURE__ */ e(Lt, { className: "h-3 w-3" }),
899
1035
  "Pending"
900
1036
  ] });
901
1037
  }
902
1038
  }
903
- function mn({
1039
+ function pn({
904
1040
  open: t,
905
1041
  onOpenChange: s,
906
- releaseId: i,
907
- targetConfigIds: a,
1042
+ releaseId: a,
1043
+ targetConfigIds: i,
908
1044
  targetNames: r,
909
1045
  apiPath: d = "/releases",
910
1046
  onComplete: l,
911
- dependencyWarnings: m = []
1047
+ dependencyWarnings: c = []
912
1048
  }) {
913
- const { toast: h } = oe(), { fetchJson: b } = te(), x = de(), [c, p] = R(!1), [P, M] = R({}), [D, Q] = R(!1), U = (k) => (r == null ? void 0 : r[k]) ?? k, j = (k, C) => M(($) => ({ ...$, [k]: C })), Y = async () => {
914
- p(!0), Q(!1), M(Object.fromEntries(a.map(($) => [$, { status: "idle" }])));
915
- let k = 0, C = 0;
916
- for (const $ of a) {
917
- j($, { status: "pushing" });
1049
+ const { toast: h } = se(), { fetchJson: N } = te(), y = ae(), [m, p] = R(!1), [S, q] = R({}), [M, B] = R(!1), b = (f) => (r == null ? void 0 : r[f]) ?? f, P = (f, T) => q((I) => ({ ...I, [f]: T })), L = async () => {
1050
+ p(!0), B(!1), q(Object.fromEntries(i.map((I) => [I, { status: "idle" }])));
1051
+ let f = 0, T = 0;
1052
+ for (const I of i) {
1053
+ P(I, { status: "pushing" });
918
1054
  try {
919
- const g = await b(`${d}/${i}/push`, {
1055
+ const x = await N(`${d}/${a}/push`, {
920
1056
  method: "POST",
921
- body: JSON.stringify({ destConfigId: $ })
922
- }), w = (g.results ?? []).filter((V) => !V.ok);
923
- g.status === "success" ? (k += 1, j($, { status: "success" })) : g.status === "partial" ? (C += 1, j($, { status: "partial", failed: w.length, failures: w })) : (C += 1, j($, { status: "failed", failures: w }));
924
- } catch (g) {
925
- C += 1;
926
- const w = g instanceof Error ? g.message : String(g);
927
- j($, { status: "failed", error: w });
1057
+ body: JSON.stringify({ destConfigId: I })
1058
+ }), k = (x.results ?? []).filter((_) => !_.ok);
1059
+ x.status === "success" ? (f += 1, P(I, { status: "success" })) : x.status === "partial" ? (T += 1, P(I, { status: "partial", failed: k.length, failures: k })) : (T += 1, P(I, { status: "failed", failures: k }));
1060
+ } catch (x) {
1061
+ T += 1;
1062
+ const k = x instanceof Error ? x.message : String(x);
1063
+ P(I, { status: "failed", error: k });
928
1064
  }
929
1065
  }
930
- x.invalidateQueries({ queryKey: ["imaginarium", "releases"] }), x.invalidateQueries({ queryKey: ["imaginarium", "release", i] }), x.invalidateQueries({ queryKey: ["imaginarium", "release-items", i] }), x.invalidateQueries({ queryKey: ["imaginarium", "release-pushes", i] }), x.invalidateQueries({ queryKey: ["imaginarium", "release-push-preview", i] }), h(C === 0 ? { title: "Push complete", description: `Pushed to ${k} target${k === 1 ? "" : "s"}.` } : {
1066
+ y.invalidateQueries({ queryKey: ["imaginarium", "releases"] }), y.invalidateQueries({ queryKey: ["imaginarium", "release", a] }), y.invalidateQueries({ queryKey: ["imaginarium", "release-items", a] }), y.invalidateQueries({ queryKey: ["imaginarium", "release-pushes", a] }), y.invalidateQueries({ queryKey: ["imaginarium", "release-push-preview", a] }), h(T === 0 ? { title: "Push complete", description: `Pushed to ${f} target${f === 1 ? "" : "s"}.` } : {
931
1067
  title: "Push finished with errors",
932
- description: `${C} target${C === 1 ? "" : "s"} did not fully succeed.`,
1068
+ description: `${T} target${T === 1 ? "" : "s"} did not fully succeed.`,
933
1069
  variant: "destructive"
934
- }), p(!1), Q(!0), l == null || l();
935
- }, B = (k) => {
936
- c || (k || (M({}), Q(!1)), s(k));
1070
+ }), p(!1), B(!0), l == null || l();
1071
+ }, z = (f) => {
1072
+ m || (f || (q({}), B(!1)), s(f));
937
1073
  };
938
- return /* @__PURE__ */ e(ve, { open: t, onOpenChange: B, children: /* @__PURE__ */ n(we, { className: "max-w-2xl", children: [
939
- /* @__PURE__ */ n(ke, { children: [
940
- /* @__PURE__ */ e(Ce, { children: "Push release" }),
941
- /* @__PURE__ */ e(Te, { children: "Pushes the included items to each target cluster, one at a time. Each target re-compares against the latest origin before applying." })
1074
+ return /* @__PURE__ */ e(xe, { open: t, onOpenChange: z, children: /* @__PURE__ */ n(ye, { className: "max-w-2xl", children: [
1075
+ /* @__PURE__ */ n(be, { children: [
1076
+ /* @__PURE__ */ e(Ne, { children: "Push release" }),
1077
+ /* @__PURE__ */ e(ve, { children: "Pushes the included items to each target cluster, one at a time. Each target re-compares against the latest origin before applying." })
942
1078
  ] }),
943
- m.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-1 rounded border border-amber-200 bg-amber-50 p-3 text-xs text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300", children: [
1079
+ c.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-1 rounded border border-amber-200 bg-amber-50 p-3 text-xs text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300", children: [
944
1080
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 font-medium", children: [
945
- /* @__PURE__ */ e(ye, { className: "h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400" }),
946
- m.length,
1081
+ /* @__PURE__ */ e(Se, { className: "h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400" }),
1082
+ c.length,
947
1083
  " item",
948
- m.length === 1 ? "" : "s",
1084
+ c.length === 1 ? "" : "s",
949
1085
  " reference excluded dependencies"
950
1086
  ] }),
951
- /* @__PURE__ */ e("ul", { className: "list-disc space-y-0.5 pl-8", children: m.map((k) => /* @__PURE__ */ n("li", { children: [
952
- k.itemName,
1087
+ /* @__PURE__ */ e("ul", { className: "list-disc space-y-0.5 pl-8", children: c.map((f) => /* @__PURE__ */ n("li", { children: [
1088
+ f.itemName,
953
1089
  " → ",
954
- k.missing.join(", ")
955
- ] }, k.itemName)) }),
1090
+ f.missing.join(", ")
1091
+ ] }, f.itemName)) }),
956
1092
  /* @__PURE__ */ e("p", { className: "pl-8 text-amber-600", children: "Push may fail for these items. You can proceed anyway." })
957
1093
  ] }) : null,
958
- /* @__PURE__ */ e("div", { className: "max-h-[60vh] space-y-2 overflow-y-auto py-2", children: a.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "This release has no targets." }) : a.map((k) => {
959
- const C = P[k] ?? { status: "idle" }, $ = C.failures ?? [];
1094
+ /* @__PURE__ */ e("div", { className: "max-h-[60vh] space-y-2 overflow-y-auto py-2", children: i.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "This release has no targets." }) : i.map((f) => {
1095
+ const T = S[f] ?? { status: "idle" }, I = T.failures ?? [];
960
1096
  return /* @__PURE__ */ e(
961
- Tt,
1097
+ Pt,
962
1098
  {
963
- releaseId: i,
964
- destConfigId: k,
965
- name: U(k),
1099
+ releaseId: a,
1100
+ destConfigId: f,
1101
+ name: b(f),
966
1102
  apiPath: d,
967
- headerRight: /* @__PURE__ */ e(cn, { state: C }),
968
- footer: $.length > 0 ? /* @__PURE__ */ e("ul", { className: "mt-2 max-h-48 space-y-1 overflow-auto border-t pt-2 text-xs", children: $.map((g, w) => /* @__PURE__ */ n("li", { className: "text-destructive", children: [
1103
+ headerRight: /* @__PURE__ */ e(hn, { state: T }),
1104
+ footer: I.length > 0 ? /* @__PURE__ */ e("ul", { className: "mt-2 max-h-48 space-y-1 overflow-auto border-t pt-2 text-xs", children: I.map((x, k) => /* @__PURE__ */ n("li", { className: "text-destructive", children: [
969
1105
  /* @__PURE__ */ n("span", { className: "font-mono", children: [
970
- g.action ? `${g.action} ` : "",
971
- g.itemKey ?? "item"
1106
+ x.action ? `${x.action} ` : "",
1107
+ x.itemKey ?? "item"
972
1108
  ] }),
973
- g.error ? /* @__PURE__ */ n("span", { className: "text-muted-foreground", children: [
1109
+ x.error ? /* @__PURE__ */ n("span", { className: "text-muted-foreground", children: [
974
1110
  " — ",
975
- g.error
1111
+ x.error
976
1112
  ] }) : null
977
- ] }, `${g.itemKey ?? "item"}-${w}`)) }) : null
1113
+ ] }, `${x.itemKey ?? "item"}-${k}`)) }) : null
978
1114
  },
979
- k
1115
+ f
980
1116
  );
981
1117
  }) }),
982
- /* @__PURE__ */ n(Pe, { children: [
983
- /* @__PURE__ */ e(E, { variant: "outline", onClick: () => B(!1), disabled: c, children: "Close" }),
1118
+ /* @__PURE__ */ n(we, { children: [
1119
+ /* @__PURE__ */ e($, { variant: "outline", onClick: () => z(!1), disabled: m, children: "Close" }),
984
1120
  /* @__PURE__ */ n(
985
- E,
1121
+ $,
986
1122
  {
987
1123
  variant: "destructive",
988
- onClick: Y,
989
- disabled: c || D || a.length === 0,
1124
+ onClick: L,
1125
+ disabled: m || M || i.length === 0,
990
1126
  children: [
991
- /* @__PURE__ */ e(jt, { className: "w-4 h-4 mr-2" }),
992
- c ? "Pushing…" : "Confirm push"
1127
+ /* @__PURE__ */ e(Jt, { className: "w-4 h-4 mr-2" }),
1128
+ m ? "Pushing…" : "Confirm push"
993
1129
  ]
994
1130
  }
995
1131
  )
996
1132
  ] })
997
1133
  ] }) });
998
1134
  }
999
- function Pt({ item: t, onClose: s }) {
1000
- var a, r;
1001
- const i = q(
1135
+ function St({ item: t, onClose: s }) {
1136
+ var i, r;
1137
+ const a = J(
1002
1138
  () => {
1003
1139
  var d, l;
1004
- return Ct((d = t == null ? void 0 : t.diff) == null ? void 0 : d.origin, (l = t == null ? void 0 : t.diff) == null ? void 0 : l.target);
1140
+ return Tt((d = t == null ? void 0 : t.diff) == null ? void 0 : d.origin, (l = t == null ? void 0 : t.diff) == null ? void 0 : l.target);
1005
1141
  },
1006
1142
  [t]
1007
1143
  );
@@ -1011,85 +1147,85 @@ function Pt({ item: t, onClose: s }) {
1011
1147
  /* @__PURE__ */ e("div", { className: "truncate font-medium", children: t.itemName }),
1012
1148
  /* @__PURE__ */ e("div", { className: "font-mono text-xs text-muted-foreground", children: t.itemType })
1013
1149
  ] }),
1014
- /* @__PURE__ */ e(E, { variant: "ghost", size: "icon", title: "Close", onClick: s, children: /* @__PURE__ */ e(Ne, {}) })
1150
+ /* @__PURE__ */ e($, { variant: "ghost", size: "icon", title: "Close", onClick: s, children: /* @__PURE__ */ e(ge, {}) })
1015
1151
  ] }),
1016
1152
  /* @__PURE__ */ n("div", { className: "flex flex-1 gap-3 overflow-auto p-3", children: [
1017
- /* @__PURE__ */ e(De, { label: "Origin", value: (a = t.diff) == null ? void 0 : a.origin, highlightLines: i }),
1018
- /* @__PURE__ */ e(De, { label: "Target", value: (r = t.diff) == null ? void 0 : r.target })
1153
+ /* @__PURE__ */ e(Fe, { label: "Origin", value: (i = t.diff) == null ? void 0 : i.origin, highlightLines: a }),
1154
+ /* @__PURE__ */ e(Fe, { label: "Target", value: (r = t.diff) == null ? void 0 : r.target })
1019
1155
  ] })
1020
1156
  ] }) : null;
1021
1157
  }
1022
- function un(t) {
1158
+ function fn(t) {
1023
1159
  return {
1024
1160
  itemName: t.itemName,
1025
1161
  itemType: t.itemType,
1026
1162
  diff: { origin: t.origin, target: t.target }
1027
1163
  };
1028
1164
  }
1029
- function hn({
1165
+ function gn({
1030
1166
  open: t,
1031
1167
  onOpenChange: s,
1032
- releaseId: i,
1033
- targetConfigIds: a,
1168
+ releaseId: a,
1169
+ targetConfigIds: i,
1034
1170
  targetNames: r,
1035
1171
  apiPath: d = "/releases"
1036
1172
  }) {
1037
- const [l, m] = R(null), h = (x) => (r == null ? void 0 : r[x]) ?? x, b = (x) => {
1038
- x || m(null), s(x);
1173
+ const [l, c] = R(null), h = (y) => (r == null ? void 0 : r[y]) ?? y, N = (y) => {
1174
+ y || c(null), s(y);
1039
1175
  };
1040
- return /* @__PURE__ */ e(ve, { open: t, onOpenChange: b, children: /* @__PURE__ */ n(we, { className: "max-w-4xl", children: [
1041
- /* @__PURE__ */ n(ke, { children: [
1042
- /* @__PURE__ */ e(Ce, { children: "Changes to push" }),
1043
- /* @__PURE__ */ e(Te, { children: "Expand a target to compute and see exactly what it would receive, from a dry run of the push. Nothing is applied." })
1176
+ return /* @__PURE__ */ e(xe, { open: t, onOpenChange: N, children: /* @__PURE__ */ n(ye, { className: "max-w-4xl", children: [
1177
+ /* @__PURE__ */ n(be, { children: [
1178
+ /* @__PURE__ */ e(Ne, { children: "Changes to push" }),
1179
+ /* @__PURE__ */ e(ve, { children: "Expand a target to compute and see exactly what it would receive, from a dry run of the push. Nothing is applied." })
1044
1180
  ] }),
1045
- /* @__PURE__ */ e("div", { className: l ? "hidden" : "min-w-0 max-h-[70vh] space-y-2 overflow-y-auto py-2", children: a.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "This release has no targets." }) : a.map((x) => /* @__PURE__ */ e(
1046
- Tt,
1181
+ /* @__PURE__ */ e("div", { className: l ? "hidden" : "min-w-0 max-h-[70vh] space-y-2 overflow-y-auto py-2", children: i.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "This release has no targets." }) : i.map((y) => /* @__PURE__ */ e(
1182
+ Pt,
1047
1183
  {
1048
- releaseId: i,
1049
- destConfigId: x,
1050
- name: h(x),
1184
+ releaseId: a,
1185
+ destConfigId: y,
1186
+ name: h(y),
1051
1187
  apiPath: d,
1052
- onSelectItem: m
1188
+ onSelectItem: c
1053
1189
  },
1054
- x
1190
+ y
1055
1191
  )) }),
1056
1192
  l ? /* @__PURE__ */ n("div", { className: "min-w-0 space-y-2", children: [
1057
- /* @__PURE__ */ n(E, { variant: "ghost", size: "sm", onClick: () => m(null), children: [
1058
- /* @__PURE__ */ e(Le, {}),
1193
+ /* @__PURE__ */ n($, { variant: "ghost", size: "sm", onClick: () => c(null), children: [
1194
+ /* @__PURE__ */ e(Qe, {}),
1059
1195
  " Back to changes"
1060
1196
  ] }),
1061
- /* @__PURE__ */ e("div", { className: "h-[60vh] min-w-0", children: /* @__PURE__ */ e(Pt, { item: un(l), onClose: () => m(null) }) })
1197
+ /* @__PURE__ */ e("div", { className: "h-[60vh] min-w-0", children: /* @__PURE__ */ e(St, { item: fn(l), onClose: () => c(null) }) })
1062
1198
  ] }) : null,
1063
- /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(E, { variant: "outline", onClick: () => b(!1), children: "Close" }) })
1199
+ /* @__PURE__ */ e(we, { children: /* @__PURE__ */ e($, { variant: "outline", onClick: () => N(!1), children: "Close" }) })
1064
1200
  ] }) });
1065
1201
  }
1066
- function pn(t) {
1202
+ function xn(t) {
1067
1203
  var s;
1068
- return (((s = t.diff) == null ? void 0 : s.versions) ?? []).filter((i) => !i.existsOnTarget);
1204
+ return (((s = t.diff) == null ? void 0 : s.versions) ?? []).filter((a) => !a.existsOnTarget);
1069
1205
  }
1070
- function fn({ item: t, disabled: s, onChange: i }) {
1206
+ function yn({ item: t, disabled: s, onChange: a }) {
1071
1207
  var r;
1072
- const a = ((r = t.diff) == null ? void 0 : r.versions) ?? [];
1208
+ const i = ((r = t.diff) == null ? void 0 : r.versions) ?? [];
1073
1209
  return /* @__PURE__ */ n(
1074
1210
  "select",
1075
1211
  {
1076
1212
  value: t.selectedVersion ?? "",
1077
1213
  disabled: s,
1078
1214
  onClick: (d) => d.stopPropagation(),
1079
- onChange: (d) => i(d.target.value),
1215
+ onChange: (d) => a(d.target.value),
1080
1216
  className: "h-7 rounded-md border border-input bg-background px-2 py-0.5 text-xs disabled:cursor-not-allowed disabled:opacity-50",
1081
1217
  "aria-label": "Rule version",
1082
1218
  children: [
1083
1219
  /* @__PURE__ */ e("option", { value: "", disabled: !0, children: "Select a version" }),
1084
- a.map((d) => {
1085
- const l = String(d.version), m = d.existsOnTarget ? `v${d.version} — already on target` : `v${d.version}${d.isPublished ? " (published)" : ""}`;
1086
- return /* @__PURE__ */ e("option", { value: l, disabled: d.existsOnTarget, children: m }, l);
1220
+ i.map((d) => {
1221
+ const l = String(d.version), c = d.existsOnTarget ? `v${d.version} — already on target` : `v${d.version}${d.isPublished ? " (published)" : ""}`;
1222
+ return /* @__PURE__ */ e("option", { value: l, disabled: d.existsOnTarget, children: c }, l);
1087
1223
  })
1088
1224
  ]
1089
1225
  }
1090
1226
  );
1091
1227
  }
1092
- const gn = {
1228
+ const bn = {
1093
1229
  blueprint: "bg-blue-100 text-blue-700 dark:bg-blue-500/15 dark:text-blue-300",
1094
1230
  rule: "bg-orange-100 text-orange-700 dark:bg-orange-500/15 dark:text-orange-300",
1095
1231
  messageRoute: "bg-teal-100 text-teal-700 dark:bg-teal-500/15 dark:text-teal-300",
@@ -1108,15 +1244,15 @@ const gn = {
1108
1244
  enumValue: "bg-violet-100 text-violet-700 dark:bg-violet-500/15 dark:text-violet-300",
1109
1245
  project: "bg-fuchsia-50 text-fuchsia-800 dark:bg-fuchsia-500/15 dark:text-fuchsia-300"
1110
1246
  };
1111
- function xe({ type: t }) {
1112
- const s = gn[t] ?? "bg-muted text-muted-foreground";
1247
+ function Te({ type: t }) {
1248
+ const s = bn[t] ?? "bg-muted text-muted-foreground";
1113
1249
  return /* @__PURE__ */ e("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs font-semibold ${s}`, children: t });
1114
1250
  }
1115
- function lt({ checked: t, onChange: s, disabled: i = !1 }) {
1251
+ function ot({ checked: t, onChange: s, disabled: a = !1 }) {
1116
1252
  return /* @__PURE__ */ n(
1117
1253
  "label",
1118
1254
  {
1119
- className: `relative inline-block h-[18px] w-8 shrink-0 ${i ? "cursor-not-allowed opacity-40" : "cursor-pointer"}`,
1255
+ className: `relative inline-block h-[18px] w-8 shrink-0 ${a ? "cursor-not-allowed opacity-40" : "cursor-pointer"}`,
1120
1256
  children: [
1121
1257
  /* @__PURE__ */ e(
1122
1258
  "input",
@@ -1124,8 +1260,8 @@ function lt({ checked: t, onChange: s, disabled: i = !1 }) {
1124
1260
  type: "checkbox",
1125
1261
  className: "peer sr-only",
1126
1262
  checked: t,
1127
- disabled: i,
1128
- onChange: (a) => s(a.target.checked)
1263
+ disabled: a,
1264
+ onChange: (i) => s(i.target.checked)
1129
1265
  }
1130
1266
  ),
1131
1267
  /* @__PURE__ */ e("span", { className: "absolute inset-0 rounded-full bg-input transition-colors peer-checked:bg-primary" }),
@@ -1134,43 +1270,43 @@ function lt({ checked: t, onChange: s, disabled: i = !1 }) {
1134
1270
  }
1135
1271
  );
1136
1272
  }
1137
- function xn(t) {
1273
+ function Nn(t) {
1138
1274
  const s = /* @__PURE__ */ new Map();
1139
- for (const a of t) {
1140
- const r = s.get(a.destConfigId);
1141
- (!r || a.createdAt > r.createdAt) && s.set(a.destConfigId, a);
1275
+ for (const i of t) {
1276
+ const r = s.get(i.destConfigId);
1277
+ (!r || i.createdAt > r.createdAt) && s.set(i.destConfigId, i);
1142
1278
  }
1143
- const i = /* @__PURE__ */ new Map();
1144
- for (const a of s.values())
1145
- for (const r of a.results ?? []) {
1279
+ const a = /* @__PURE__ */ new Map();
1280
+ for (const i of s.values())
1281
+ for (const r of i.results ?? []) {
1146
1282
  if (!r.itemKey)
1147
1283
  continue;
1148
- let d = i.get(r.itemKey);
1149
- d || (d = /* @__PURE__ */ new Map(), i.set(r.itemKey, d)), d.set(a.destConfigId, { ok: r.ok, error: r.error });
1284
+ let d = a.get(r.itemKey);
1285
+ d || (d = /* @__PURE__ */ new Map(), a.set(r.itemKey, d)), d.set(i.destConfigId, { ok: r.ok, error: r.error });
1150
1286
  }
1151
- return i;
1287
+ return a;
1152
1288
  }
1153
- function yn(t, s, i) {
1154
- var a;
1155
- return (a = t.get(s)) == null ? void 0 : a.get(i);
1289
+ function vn(t, s, a) {
1290
+ var i;
1291
+ return (i = t.get(s)) == null ? void 0 : i.get(a);
1156
1292
  }
1157
- function Xn(t, s) {
1158
- return t.filter((i) => !(s.type !== "all" && i.itemType !== s.type || s.included === "enabled" && (!i.included || i.ignored) || s.included === "disabled" && i.included && !i.ignored));
1293
+ function ts(t, s) {
1294
+ return t.filter((a) => !(s.type !== "all" && a.itemType !== s.type || s.included === "enabled" && (!a.included || a.ignored) || s.included === "disabled" && a.included && !a.ignored));
1159
1295
  }
1160
- function bn(t) {
1296
+ function wn(t) {
1161
1297
  const s = {};
1162
- for (const i of t)
1163
- s[i.itemType] = (s[i.itemType] ?? 0) + 1;
1298
+ for (const a of t)
1299
+ s[a.itemType] = (s[a.itemType] ?? 0) + 1;
1164
1300
  return s;
1165
1301
  }
1166
- function Nn(t) {
1167
- const s = t.indexOf(":"), i = s >= 0 ? t.slice(0, s) : t, a = s >= 0 ? t.slice(s + 1) : t;
1302
+ function Cn(t) {
1303
+ const s = t.indexOf(":"), a = s >= 0 ? t.slice(0, s) : t, i = s >= 0 ? t.slice(s + 1) : t;
1168
1304
  return {
1169
1305
  id: "",
1170
1306
  releaseId: "",
1171
1307
  itemKey: t,
1172
- itemType: i,
1173
- itemName: a,
1308
+ itemType: a,
1309
+ itemName: i,
1174
1310
  parentKey: null,
1175
1311
  selectedVersion: null,
1176
1312
  status: "updated",
@@ -1182,112 +1318,112 @@ function Nn(t) {
1182
1318
  updatedAt: ""
1183
1319
  };
1184
1320
  }
1185
- function vn(t) {
1321
+ function kn(t) {
1186
1322
  var d;
1187
1323
  const s = new Set(
1188
1324
  t.filter((l) => !l.parentKey).map((l) => l.itemKey)
1189
- ), i = [], a = /* @__PURE__ */ new Map();
1325
+ ), a = [], i = /* @__PURE__ */ new Map();
1190
1326
  for (const l of t) {
1191
1327
  if (l.parentKey)
1192
1328
  continue;
1193
- const m = { item: l, children: [] };
1194
- i.push(m), a.set(l.itemKey, m);
1329
+ const c = { item: l, children: [] };
1330
+ a.push(c), i.set(l.itemKey, c);
1195
1331
  }
1196
1332
  const r = /* @__PURE__ */ new Map();
1197
1333
  for (const l of t) {
1198
1334
  if (!l.parentKey)
1199
1335
  continue;
1200
1336
  if (s.has(l.parentKey)) {
1201
- (d = a.get(l.parentKey)) == null || d.children.push(l);
1337
+ (d = i.get(l.parentKey)) == null || d.children.push(l);
1202
1338
  continue;
1203
1339
  }
1204
- let m = r.get(l.parentKey);
1205
- m || (m = { item: Nn(l.parentKey), children: [], synthetic: !0 }, r.set(l.parentKey, m), i.push(m)), m.children.push(l);
1340
+ let c = r.get(l.parentKey);
1341
+ c || (c = { item: Cn(l.parentKey), children: [], synthetic: !0 }, r.set(l.parentKey, c), a.push(c)), c.children.push(l);
1206
1342
  }
1207
- return i;
1343
+ return a;
1208
1344
  }
1209
- function wn(t) {
1210
- const s = t.indexOf(":"), i = s >= 0 ? t.slice(0, s) : t, a = s >= 0 ? t.slice(s + 1) : t;
1211
- return { itemKey: t, itemType: i, itemName: a, parentKey: null, cells: {} };
1345
+ function Tn(t) {
1346
+ const s = t.indexOf(":"), a = s >= 0 ? t.slice(0, s) : t, i = s >= 0 ? t.slice(s + 1) : t;
1347
+ return { itemKey: t, itemType: a, itemName: i, parentKey: null, cells: {} };
1212
1348
  }
1213
- function kn(t) {
1349
+ function Pn(t) {
1214
1350
  var d;
1215
1351
  const s = new Set(
1216
1352
  t.filter((l) => !l.parentKey).map((l) => l.itemKey)
1217
- ), i = [], a = /* @__PURE__ */ new Map();
1353
+ ), a = [], i = /* @__PURE__ */ new Map();
1218
1354
  for (const l of t) {
1219
1355
  if (l.parentKey)
1220
1356
  continue;
1221
- const m = { row: l, children: [] };
1222
- i.push(m), a.set(l.itemKey, m);
1357
+ const c = { row: l, children: [] };
1358
+ a.push(c), i.set(l.itemKey, c);
1223
1359
  }
1224
1360
  const r = /* @__PURE__ */ new Map();
1225
1361
  for (const l of t) {
1226
1362
  if (!l.parentKey)
1227
1363
  continue;
1228
1364
  if (s.has(l.parentKey)) {
1229
- (d = a.get(l.parentKey)) == null || d.children.push(l);
1365
+ (d = i.get(l.parentKey)) == null || d.children.push(l);
1230
1366
  continue;
1231
1367
  }
1232
- let m = r.get(l.parentKey);
1233
- m || (m = { row: wn(l.parentKey), children: [], synthetic: !0 }, r.set(l.parentKey, m), i.push(m)), m.children.push(l);
1368
+ let c = r.get(l.parentKey);
1369
+ c || (c = { row: Tn(l.parentKey), children: [], synthetic: !0 }, r.set(l.parentKey, c), a.push(c)), c.children.push(l);
1234
1370
  }
1235
- return i;
1371
+ return a;
1236
1372
  }
1237
- function Cn(t) {
1373
+ function Sn(t) {
1238
1374
  let s = 0;
1239
- for (const i of t.children)
1240
- i.included && !i.ignored && (s += 1);
1375
+ for (const a of t.children)
1376
+ a.included && !a.ignored && (s += 1);
1241
1377
  return { included: s, total: t.children.length };
1242
1378
  }
1243
- function Tn(t) {
1244
- var a, r;
1379
+ function En(t) {
1380
+ var i, r;
1245
1381
  const s = [];
1246
1382
  for (const d of t) {
1247
1383
  if (d.status !== "new")
1248
1384
  continue;
1249
- const l = (a = d.diff) == null ? void 0 : a.origin, m = l == null ? void 0 : l.id;
1250
- if (typeof m == "string" && m && s.push({ token: m, depKey: d.itemKey }), d.itemType === "enum") {
1385
+ const l = (i = d.diff) == null ? void 0 : i.origin, c = l == null ? void 0 : l.id;
1386
+ if (typeof c == "string" && c && s.push({ token: c, depKey: d.itemKey }), d.itemType === "enum") {
1251
1387
  const h = l == null ? void 0 : l.type;
1252
1388
  typeof h == "string" && h && s.push({ token: h, depKey: d.itemKey });
1253
1389
  }
1254
1390
  }
1255
- const i = /* @__PURE__ */ new Map();
1391
+ const a = /* @__PURE__ */ new Map();
1256
1392
  for (const d of t) {
1257
- const l = /* @__PURE__ */ new Set(), m = JSON.stringify(((r = d.diff) == null ? void 0 : r.origin) ?? null);
1258
- for (const { token: h, depKey: b } of s)
1259
- b !== d.itemKey && m.includes(h) && l.add(b);
1260
- i.set(d.itemKey, l);
1393
+ const l = /* @__PURE__ */ new Set(), c = JSON.stringify(((r = d.diff) == null ? void 0 : r.origin) ?? null);
1394
+ for (const { token: h, depKey: N } of s)
1395
+ N !== d.itemKey && c.includes(h) && l.add(N);
1396
+ a.set(d.itemKey, l);
1261
1397
  }
1262
- return i;
1398
+ return a;
1263
1399
  }
1264
- function Ie(t, s, i) {
1265
- const a = s.get(t.itemKey);
1266
- if (!a || a.size === 0)
1400
+ function Re(t, s, a) {
1401
+ const i = s.get(t.itemKey);
1402
+ if (!i || i.size === 0)
1267
1403
  return [];
1268
1404
  const r = [];
1269
- for (const d of a) {
1270
- const l = i.get(d);
1405
+ for (const d of i) {
1406
+ const l = a.get(d);
1271
1407
  l && l.status === "new" && (!l.included || l.ignored) && r.push(l);
1272
1408
  }
1273
1409
  return r;
1274
1410
  }
1275
- function Pn(t) {
1411
+ function $n(t) {
1276
1412
  return t.tags + t.metadataKeys + t.i18nPaths + t.permissions;
1277
1413
  }
1278
- function Sn(t) {
1414
+ function Kn(t) {
1279
1415
  const s = [];
1280
1416
  return t.tags > 0 && s.push(`${t.tags} tag${t.tags === 1 ? "" : "s"}`), t.metadataKeys > 0 && s.push(`${t.metadataKeys} metadata key${t.metadataKeys === 1 ? "" : "s"}`), t.i18nPaths > 0 && s.push(`${t.i18nPaths} translation${t.i18nPaths === 1 ? "" : "s"}`), t.permissions > 0 && s.push(`${t.permissions} permission${t.permissions === 1 ? "" : "s"}`), s.length === 0 ? "" : `${s.join(", ")} excluded from push`;
1281
1417
  }
1282
- const Kn = [
1418
+ const On = [
1283
1419
  { value: "all", label: "All" },
1284
1420
  { value: "enabled", label: "Enabled" },
1285
1421
  { value: "disabled", label: "Disabled" }
1286
1422
  ];
1287
- function ot(t, s) {
1423
+ function dt(t, s) {
1288
1424
  return s === "all" ? !0 : s === "enabled" ? t.included && !t.ignored : !t.included || t.ignored;
1289
1425
  }
1290
- function dt({ status: t }) {
1426
+ function ct({ status: t }) {
1291
1427
  return /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium border bg-muted text-muted-foreground border-border", children: t });
1292
1428
  }
1293
1429
  function Z(t) {
@@ -1296,285 +1432,285 @@ function Z(t) {
1296
1432
  if (typeof t == "string" && t.length > 0)
1297
1433
  try {
1298
1434
  const s = JSON.parse(t);
1299
- return Array.isArray(s) ? s.filter((i) => typeof i == "string") : [];
1435
+ return Array.isArray(s) ? s.filter((a) => typeof a == "string") : [];
1300
1436
  } catch {
1301
1437
  return [];
1302
1438
  }
1303
1439
  return [];
1304
1440
  }
1305
- function ct({ item: t }) {
1441
+ function mt({ item: t }) {
1306
1442
  const s = {
1307
1443
  tags: Z(t.excludedTags).length,
1308
1444
  metadataKeys: Z(t.excludedMetadataKeys).length,
1309
1445
  i18nPaths: Z(t.excludedI18nPaths).length,
1310
1446
  permissions: Z(t.excludedPermissions).length
1311
- }, i = Pn(s);
1312
- return i <= 0 ? null : /* @__PURE__ */ n(
1447
+ }, a = $n(s);
1448
+ return a <= 0 ? null : /* @__PURE__ */ n(
1313
1449
  "span",
1314
1450
  {
1315
- title: Sn(s),
1451
+ title: Kn(s),
1316
1452
  className: "inline-flex items-center rounded px-1.5 py-0.5 text-xs bg-red-100 text-red-700 dark:bg-red-500/15 dark:text-red-300",
1317
1453
  children: [
1318
- i,
1454
+ a,
1319
1455
  " manual override",
1320
- i === 1 ? "" : "s"
1456
+ a === 1 ? "" : "s"
1321
1457
  ]
1322
1458
  }
1323
1459
  );
1324
1460
  }
1325
- function mt({
1461
+ function ut({
1326
1462
  item: t,
1327
1463
  targetConfigIds: s,
1328
- results: i,
1329
- pushedDests: a,
1464
+ results: a,
1465
+ pushedDests: i,
1330
1466
  displayName: r
1331
1467
  }) {
1332
- const d = t.included && !t.ignored, l = s.filter((m) => a.has(m)).map((m) => ({ id: m, result: yn(i, t.itemKey, m) })).filter((m) => m.result != null || d);
1333
- return l.length === 0 ? null : /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-end gap-1", children: l.map(({ id: m, result: h }) => {
1334
- const b = h ? h.ok ? "bg-green-100 text-green-700 dark:bg-green-500/15 dark:text-green-300" : "bg-red-100 text-red-700 dark:bg-red-500/15 dark:text-red-300" : "bg-muted text-muted-foreground", x = h ? h.ok ? "✓" : "✗" : "=", c = h ? h.ok ? void 0 : h.error : "No change — already in sync";
1468
+ const d = t.included && !t.ignored, l = s.filter((c) => i.has(c)).map((c) => ({ id: c, result: vn(a, t.itemKey, c) })).filter((c) => c.result != null || d);
1469
+ return l.length === 0 ? null : /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-end gap-1", children: l.map(({ id: c, result: h }) => {
1470
+ const N = h ? h.ok ? "bg-green-100 text-green-700 dark:bg-green-500/15 dark:text-green-300" : "bg-red-100 text-red-700 dark:bg-red-500/15 dark:text-red-300" : "bg-muted text-muted-foreground", y = h ? h.ok ? "✓" : "✗" : "=", m = h ? h.ok ? void 0 : h.error : "No change — already in sync";
1335
1471
  return /* @__PURE__ */ n(
1336
1472
  "span",
1337
1473
  {
1338
- title: c,
1339
- className: `inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-semibold ${b}`,
1474
+ title: m,
1475
+ className: `inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] font-semibold ${N}`,
1340
1476
  children: [
1341
- r(m),
1477
+ r(c),
1342
1478
  " ",
1343
- x
1479
+ y
1344
1480
  ]
1345
1481
  },
1346
- m
1482
+ c
1347
1483
  );
1348
1484
  }) });
1349
1485
  }
1350
- function En({ releaseId: t, onBack: s }) {
1351
- var Ye, We, Ge;
1352
- const i = Ue.get("Release", "apiPath", "/releases"), { toast: a } = oe(), { fetchJson: r } = te(), { configs: d } = be(), l = de(), [m, h] = R("all"), [b, x] = R("all"), [c, p] = R(null), [P, M] = R(!1), [D, Q] = R(!1), [U, j] = R(() => /* @__PURE__ */ new Set()), Y = (o) => j((v) => {
1353
- const u = new Set(v);
1486
+ function In({ releaseId: t, onBack: s }) {
1487
+ var We, Ge, Xe;
1488
+ const a = je.get("Release", "apiPath", "/releases"), { toast: i } = se(), { fetchJson: r } = te(), { configs: d } = fe(), l = ae(), [c, h] = R("all"), [N, y] = R("all"), [m, p] = R(null), [S, q] = R(!1), [M, B] = R(!1), [b, P] = R(() => /* @__PURE__ */ new Set()), L = (o) => P((C) => {
1489
+ const u = new Set(C);
1354
1490
  return u.has(o) ? u.delete(o) : u.add(o), u;
1355
- }), B = ["imaginarium", "release", t], k = ["imaginarium", "release-items", t], C = ["imaginarium", "release-pushes", t], $ = ["imaginarium", "release-push-preview", t], g = () => {
1356
- l.invalidateQueries({ queryKey: k }), l.invalidateQueries({ queryKey: $ });
1357
- }, { data: w, isLoading: V } = ae({
1358
- queryKey: B,
1359
- queryFn: () => r(`${i}/${t}`)
1360
- }), { data: L, isLoading: X } = ae({
1361
- queryKey: k,
1491
+ }), z = ["imaginarium", "release", t], f = ["imaginarium", "release-items", t], T = ["imaginarium", "release-pushes", t], I = ["imaginarium", "release-push-preview", t], x = () => {
1492
+ l.invalidateQueries({ queryKey: f }), l.invalidateQueries({ queryKey: I });
1493
+ }, { data: k, isLoading: _ } = le({
1494
+ queryKey: z,
1495
+ queryFn: () => r(`${a}/${t}`)
1496
+ }), { data: V, isLoading: X } = le({
1497
+ queryKey: f,
1362
1498
  queryFn: async () => {
1363
- const o = await r(`${i}/${t}/items`);
1499
+ const o = await r(`${a}/${t}/items`);
1364
1500
  return Array.isArray(o) ? o : (o == null ? void 0 : o.items) ?? [];
1365
1501
  }
1366
- }), { data: f } = ae({
1367
- queryKey: C,
1502
+ }), { data: g } = le({
1503
+ queryKey: T,
1368
1504
  queryFn: async () => {
1369
- const o = await r(`${i}/${t}/pushes`);
1505
+ const o = await r(`${a}/${t}/pushes`);
1370
1506
  return Array.isArray(o) ? o : (o == null ? void 0 : o.items) ?? [];
1371
1507
  }
1372
- }), F = q(() => xn(f ?? []), [f]), J = q(
1373
- () => new Set((f ?? []).map((o) => o.destConfigId)),
1374
- [f]
1375
- ), A = (f ?? []).length > 0, H = q(() => (w == null ? void 0 : w.targetConfigIds) ?? [], [w]), z = q(() => {
1508
+ }), j = J(() => Nn(g ?? []), [g]), U = J(
1509
+ () => new Set((g ?? []).map((o) => o.destConfigId)),
1510
+ [g]
1511
+ ), F = (g ?? []).length > 0, Y = J(() => (k == null ? void 0 : k.targetConfigIds) ?? [], [k]), Q = J(() => {
1376
1512
  const o = /* @__PURE__ */ new Map();
1377
- return d.forEach((v) => o.set(String(v.id), v.displayName)), o;
1378
- }, [d]), y = (o) => z.get(o) ?? o, O = q(() => vn(L ?? []), [L]), T = q(() => O.map((o) => o.item), [O]), ee = q(() => Tn(L ?? []), [L]), ne = q(
1379
- () => new Map((L ?? []).map((o) => [o.itemKey, o])),
1380
- [L]
1381
- ), pe = (o) => {
1513
+ return d.forEach((C) => o.set(String(C.id), C.displayName)), o;
1514
+ }, [d]), v = (o) => Q.get(o) ?? o, A = J(() => kn(V ?? []), [V]), E = J(() => A.map((o) => o.item), [A]), ee = J(() => En(V ?? []), [V]), ie = J(
1515
+ () => new Map((V ?? []).map((o) => [o.itemKey, o])),
1516
+ [V]
1517
+ ), Ce = (o) => {
1382
1518
  var u;
1383
- let v;
1519
+ let C;
1384
1520
  if (o.parentKey) {
1385
- const I = (u = ne.get(o.parentKey)) == null ? void 0 : u.itemName, S = o.parentKey.indexOf(":");
1386
- v = I ?? (S >= 0 ? o.parentKey.slice(S + 1) : void 0);
1521
+ const D = (u = ie.get(o.parentKey)) == null ? void 0 : u.itemName, K = o.parentKey.indexOf(":");
1522
+ C = D ?? (K >= 0 ? o.parentKey.slice(K + 1) : void 0);
1387
1523
  }
1388
- return `${v ? v + " " : ""}${o.itemType} "${o.itemName}"`;
1389
- }, G = q(() => {
1390
- var v, u;
1524
+ return `${C ? C + " " : ""}${o.itemType} "${o.itemName}"`;
1525
+ }, G = J(() => {
1526
+ var C, u;
1391
1527
  const o = /* @__PURE__ */ new Map();
1392
- for (const I of L ?? []) {
1393
- const S = (u = (v = I.diff) == null ? void 0 : v.origin) == null ? void 0 : u.id;
1394
- typeof S == "string" && S && o.set(S, I.itemName);
1528
+ for (const D of V ?? []) {
1529
+ const K = (u = (C = D.diff) == null ? void 0 : C.origin) == null ? void 0 : u.id;
1530
+ typeof K == "string" && K && o.set(K, D.itemName);
1395
1531
  }
1396
1532
  return o;
1397
- }, [L]), me = q(
1398
- () => (L ?? []).filter((o) => o.included && !o.ignored).map((o) => ({
1533
+ }, [V]), me = J(
1534
+ () => (V ?? []).filter((o) => o.included && !o.ignored).map((o) => ({
1399
1535
  itemName: o.itemName,
1400
- missing: Ie(o, ee, ne).map(pe)
1536
+ missing: Re(o, ee, ie).map(Ce)
1401
1537
  })).filter((o) => o.missing.length > 0),
1402
1538
  // eslint-disable-next-line react-hooks/exhaustive-deps
1403
- [L, ee, ne]
1404
- ), qe = q(() => bn(T), [T]), St = q(() => Object.keys(qe).sort(Je), [qe]), He = q(() => O.filter((o) => m === "all" || o.item.itemType === m).map((o) => {
1405
- const v = b === "all" ? o.children : o.children.filter((u) => ot(u, b));
1406
- return { node: o, renderChildren: v };
1539
+ [V, ee, ie]
1540
+ ), Be = J(() => wn(E), [E]), Et = J(() => Object.keys(Be).sort(Ve), [Be]), _e = J(() => A.filter((o) => c === "all" || o.item.itemType === c).map((o) => {
1541
+ const C = N === "all" ? o.children : o.children.filter((u) => dt(u, N));
1542
+ return { node: o, renderChildren: C };
1407
1543
  }).filter(
1408
- ({ node: o, renderChildren: v }) => b === "all" || ot(o.item, b) || v.length > 0
1409
- ).sort((o, v) => {
1410
- const u = Je(o.node.item.itemType, v.node.item.itemType);
1411
- return u !== 0 ? u : o.node.item.itemName.localeCompare(v.node.item.itemName);
1412
- }), [O, m, b]), Se = _({
1413
- mutationFn: () => r(`${i}/${t}/refresh`, { method: "POST" }),
1544
+ ({ node: o, renderChildren: C }) => N === "all" || dt(o.item, N) || C.length > 0
1545
+ ).sort((o, C) => {
1546
+ const u = Ve(o.node.item.itemType, C.node.item.itemType);
1547
+ return u !== 0 ? u : o.node.item.itemName.localeCompare(C.node.item.itemName);
1548
+ }), [A, c, N]), Ee = H({
1549
+ mutationFn: () => r(`${a}/${t}/refresh`, { method: "POST" }),
1414
1550
  onSuccess: () => {
1415
- g(), a({ title: "Snapshot refreshed", description: "Items re-computed from origin." });
1551
+ x(), i({ title: "Snapshot refreshed", description: "Items re-computed from origin." });
1416
1552
  },
1417
1553
  onError: (o) => {
1418
- a({ title: "Error", description: o.message, variant: "destructive" });
1554
+ i({ title: "Error", description: o.message, variant: "destructive" });
1419
1555
  }
1420
- }), Ke = _({
1421
- mutationFn: ({ itemId: o, included: v }) => r(`${i}/${t}/items/${o}`, {
1556
+ }), $e = H({
1557
+ mutationFn: ({ itemId: o, included: C }) => r(`${a}/${t}/items/${o}`, {
1422
1558
  method: "PATCH",
1423
- body: JSON.stringify({ included: v })
1559
+ body: JSON.stringify({ included: C })
1424
1560
  }),
1425
1561
  onSuccess: () => {
1426
- g();
1562
+ x();
1427
1563
  },
1428
1564
  onError: (o) => {
1429
- a({ title: "Error", description: o.message, variant: "destructive" });
1565
+ i({ title: "Error", description: o.message, variant: "destructive" });
1430
1566
  }
1431
- }), _e = _({
1432
- mutationFn: ({ itemId: o, selectedVersion: v }) => r(`${i}/${t}/items/${o}`, {
1567
+ }), Ye = H({
1568
+ mutationFn: ({ itemId: o, selectedVersion: C }) => r(`${a}/${t}/items/${o}`, {
1433
1569
  method: "PATCH",
1434
- body: JSON.stringify({ selectedVersion: v })
1570
+ body: JSON.stringify({ selectedVersion: C })
1435
1571
  }),
1436
1572
  onSuccess: () => {
1437
- g();
1573
+ x();
1438
1574
  },
1439
1575
  onError: (o) => {
1440
- a({ title: "Error", description: o.message, variant: "destructive" });
1576
+ i({ title: "Error", description: o.message, variant: "destructive" });
1441
1577
  }
1442
- }), Ee = (o) => ({
1443
- mutationFn: ({ itemId: v, value: u }) => r(`${i}/${t}/items/${v}`, {
1578
+ }), Ke = (o) => ({
1579
+ mutationFn: ({ itemId: C, value: u }) => r(`${a}/${t}/items/${C}`, {
1444
1580
  method: "PATCH",
1445
1581
  body: JSON.stringify({ [o]: u })
1446
1582
  }),
1447
- onMutate: async ({ itemId: v, value: u }) => {
1448
- await l.cancelQueries({ queryKey: k });
1449
- const I = l.getQueryData(k);
1583
+ onMutate: async ({ itemId: C, value: u }) => {
1584
+ await l.cancelQueries({ queryKey: f });
1585
+ const D = l.getQueryData(f);
1450
1586
  return l.setQueryData(
1451
- k,
1452
- (S) => (S ?? []).map((ie) => ie.id === v ? { ...ie, [o]: u } : ie)
1453
- ), { prev: I };
1587
+ f,
1588
+ (K) => (K ?? []).map((oe) => oe.id === C ? { ...oe, [o]: u } : oe)
1589
+ ), { prev: D };
1454
1590
  },
1455
- onError: (v, u, I) => {
1456
- I != null && I.prev && l.setQueryData(k, I.prev), a({ title: "Error", description: v.message, variant: "destructive" });
1591
+ onError: (C, u, D) => {
1592
+ D != null && D.prev && l.setQueryData(f, D.prev), i({ title: "Error", description: C.message, variant: "destructive" });
1457
1593
  },
1458
1594
  onSettled: () => {
1459
- g();
1595
+ x();
1460
1596
  }
1461
- }), Kt = _(Ee("excludedTags")), Et = _(Ee("excludedMetadataKeys")), $t = _(Ee("excludedI18nPaths")), Ot = _(Ee("excludedPermissions")), se = (w == null ? void 0 : w.status) === "pushed", N = c ? ne.get(c.itemKey) ?? c : null;
1462
- return V ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" }) : w ? /* @__PURE__ */ n("div", { className: "space-y-4", children: [
1463
- se && /* @__PURE__ */ e("div", { className: "bg-muted text-muted-foreground rounded-md px-3 py-2 text-sm", children: "This release was pushed and is read-only." }),
1597
+ }), $t = H(Ke("excludedTags")), Kt = H(Ke("excludedMetadataKeys")), Ot = H(Ke("excludedI18nPaths")), It = H(Ke("excludedPermissions")), re = (k == null ? void 0 : k.status) === "pushed", w = m ? ie.get(m.itemKey) ?? m : null;
1598
+ return _ ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" }) : k ? /* @__PURE__ */ n("div", { className: "space-y-4", children: [
1599
+ re && /* @__PURE__ */ e("div", { className: "bg-muted text-muted-foreground rounded-md px-3 py-2 text-sm", children: "This release was pushed and is read-only." }),
1464
1600
  /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1465
1601
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
1466
1602
  /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
1467
- /* @__PURE__ */ n(E, { variant: "ghost", size: "sm", onClick: s, children: [
1468
- /* @__PURE__ */ e(Le, {}),
1603
+ /* @__PURE__ */ n($, { variant: "ghost", size: "sm", onClick: s, children: [
1604
+ /* @__PURE__ */ e(Qe, {}),
1469
1605
  "Back"
1470
1606
  ] }),
1471
- /* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children: w.name }),
1472
- /* @__PURE__ */ e(kt, { status: w.status })
1607
+ /* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children: k.name }),
1608
+ /* @__PURE__ */ e(kt, { status: k.status })
1473
1609
  ] }),
1474
1610
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1475
- !se && /* @__PURE__ */ e(
1476
- nn,
1611
+ !re && /* @__PURE__ */ e(
1612
+ rn,
1477
1613
  {
1478
1614
  releaseId: t,
1479
- apiPath: i,
1480
- onReset: g
1615
+ apiPath: a,
1616
+ onReset: x
1481
1617
  }
1482
1618
  ),
1483
1619
  /* @__PURE__ */ n(
1484
- E,
1620
+ $,
1485
1621
  {
1486
1622
  variant: "outline",
1487
1623
  size: "sm",
1488
- onClick: () => Se.mutate(),
1489
- disabled: se || Se.isPending,
1624
+ onClick: () => Ee.mutate(),
1625
+ disabled: re || Ee.isPending,
1490
1626
  children: [
1491
- /* @__PURE__ */ e(vt, {}),
1492
- Se.isPending ? "Refreshing…" : "Refresh"
1627
+ /* @__PURE__ */ e(Ct, {}),
1628
+ Ee.isPending ? "Refreshing…" : "Refresh"
1493
1629
  ]
1494
1630
  }
1495
1631
  ),
1496
1632
  /* @__PURE__ */ n(
1497
- E,
1633
+ $,
1498
1634
  {
1499
1635
  variant: "outline",
1500
1636
  size: "sm",
1501
- onClick: () => Q(!0),
1502
- disabled: (w.targetConfigIds ?? []).length === 0,
1637
+ onClick: () => B(!0),
1638
+ disabled: (k.targetConfigIds ?? []).length === 0,
1503
1639
  children: [
1504
- /* @__PURE__ */ e(Lt, {}),
1640
+ /* @__PURE__ */ e(Qt, {}),
1505
1641
  "Preview changes"
1506
1642
  ]
1507
1643
  }
1508
1644
  ),
1509
- se ? /* @__PURE__ */ e(E, { size: "sm", disabled: !0, children: "Pushed ✓" }) : /* @__PURE__ */ e(
1510
- E,
1645
+ re ? /* @__PURE__ */ e($, { size: "sm", disabled: !0, children: "Pushed ✓" }) : /* @__PURE__ */ e(
1646
+ $,
1511
1647
  {
1512
1648
  size: "sm",
1513
- onClick: () => M(!0),
1514
- disabled: (w.targetConfigIds ?? []).length === 0,
1649
+ onClick: () => q(!0),
1650
+ disabled: (k.targetConfigIds ?? []).length === 0,
1515
1651
  children: "Push"
1516
1652
  }
1517
1653
  )
1518
1654
  ] })
1519
1655
  ] }),
1520
1656
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2 text-sm text-muted-foreground", children: [
1521
- /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs", children: y(w.originConfigId) }),
1657
+ /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs", children: v(k.originConfigId) }),
1522
1658
  /* @__PURE__ */ e("span", { children: "→" }),
1523
- (w.targetConfigIds ?? []).map((o) => /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs", children: y(o) }, o)),
1659
+ (k.targetConfigIds ?? []).map((o) => /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded bg-muted px-1.5 py-0.5 text-xs", children: v(o) }, o)),
1524
1660
  /* @__PURE__ */ n("span", { className: "ml-2", children: [
1525
1661
  "Snapshot: ",
1526
- w.snapshotAt ? new Date(w.snapshotAt).toLocaleString() : "—"
1662
+ k.snapshotAt ? new Date(k.snapshotAt).toLocaleString() : "—"
1527
1663
  ] }),
1528
1664
  /* @__PURE__ */ n("span", { children: [
1529
1665
  "Pushed: ",
1530
- w.pushedAt ? new Date(w.pushedAt).toLocaleString() : "—"
1666
+ k.pushedAt ? new Date(k.pushedAt).toLocaleString() : "—"
1531
1667
  ] })
1532
1668
  ] })
1533
1669
  ] }),
1534
1670
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1535
1671
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1", children: [
1536
1672
  /* @__PURE__ */ n(
1537
- E,
1673
+ $,
1538
1674
  {
1539
- variant: m === "all" ? "secondary" : "ghost",
1675
+ variant: c === "all" ? "secondary" : "ghost",
1540
1676
  size: "sm",
1541
1677
  onClick: () => h("all"),
1542
1678
  children: [
1543
1679
  "All types (",
1544
- T.length,
1680
+ E.length,
1545
1681
  ")"
1546
1682
  ]
1547
1683
  }
1548
1684
  ),
1549
- St.map((o) => /* @__PURE__ */ n(
1550
- E,
1685
+ Et.map((o) => /* @__PURE__ */ n(
1686
+ $,
1551
1687
  {
1552
- variant: m === o ? "secondary" : "ghost",
1688
+ variant: c === o ? "secondary" : "ghost",
1553
1689
  size: "sm",
1554
1690
  onClick: () => h(o),
1555
1691
  children: [
1556
1692
  o,
1557
1693
  " (",
1558
- qe[o],
1694
+ Be[o],
1559
1695
  ")"
1560
1696
  ]
1561
1697
  },
1562
1698
  o
1563
1699
  ))
1564
1700
  ] }),
1565
- /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1", children: Kn.map((o) => /* @__PURE__ */ e(
1566
- E,
1701
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1", children: On.map((o) => /* @__PURE__ */ e(
1702
+ $,
1567
1703
  {
1568
- variant: b === o.value ? "secondary" : "outline",
1704
+ variant: N === o.value ? "secondary" : "outline",
1569
1705
  size: "sm",
1570
- onClick: () => x(o.value),
1706
+ onClick: () => y(o.value),
1571
1707
  children: o.label
1572
1708
  },
1573
1709
  o.value
1574
1710
  )) })
1575
1711
  ] }),
1576
1712
  /* @__PURE__ */ n("div", { className: "flex gap-4", children: [
1577
- /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: X ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading items…" }) : He.length === 0 ? /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Me, { className: "py-12 text-center text-muted-foreground", children: T.length === 0 ? "No items in this release yet." : "No items match the current filters." }) }) : /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Me, { className: "p-0", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
1713
+ /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: X ? /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading items…" }) : _e.length === 0 ? /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(Me, { className: "py-12 text-center text-muted-foreground", children: E.length === 0 ? "No items in this release yet." : "No items match the current filters." }) }) : /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(Me, { className: "p-0", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
1578
1714
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b text-left text-muted-foreground", children: [
1579
1715
  /* @__PURE__ */ e("th", { className: "p-3 font-medium w-10", children: "Inc." }),
1580
1716
  /* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Type" }),
@@ -1582,36 +1718,36 @@ function En({ releaseId: t, onBack: s }) {
1582
1718
  /* @__PURE__ */ e("th", { className: "p-3 font-medium", children: "Status" }),
1583
1719
  /* @__PURE__ */ e("th", { className: "p-3 font-medium" })
1584
1720
  ] }) }),
1585
- /* @__PURE__ */ e("tbody", { children: He.map(({ node: o, renderChildren: v }) => {
1586
- var nt;
1587
- const u = o.item, I = v.length > 0, S = U.has(u.itemKey) || b !== "all", ie = U.has(u.itemKey), re = Cn(o), Xe = ((nt = u.diff) == null ? void 0 : nt.versions) ?? [], fe = u.itemType === "rule" && Xe.length > 0, Ze = Xe.some((K) => K.isPublished), It = fe ? pn(u) : [], et = fe && !Ze, tt = fe && Ze && It.length === 0, $e = et || tt, Rt = fe && !$e && u.selectedVersion == null;
1588
- return /* @__PURE__ */ n(yt, { children: [
1721
+ /* @__PURE__ */ e("tbody", { children: _e.map(({ node: o, renderChildren: C }) => {
1722
+ var st;
1723
+ const u = o.item, D = C.length > 0, K = b.has(u.itemKey) || N !== "all", oe = b.has(u.itemKey), de = Sn(o), Ze = ((st = u.diff) == null ? void 0 : st.versions) ?? [], ke = u.itemType === "rule" && Ze.length > 0, et = Ze.some((O) => O.isPublished), Rt = ke ? xn(u) : [], tt = ke && !et, nt = ke && et && Rt.length === 0, Oe = tt || nt, At = ke && !Oe && u.selectedVersion == null;
1724
+ return /* @__PURE__ */ n(bt, { children: [
1589
1725
  o.synthetic ? /* @__PURE__ */ n(
1590
1726
  "tr",
1591
1727
  {
1592
1728
  className: "border-b last:border-0 cursor-pointer hover:bg-muted/50",
1593
- onClick: () => Y(u.itemKey),
1729
+ onClick: () => L(u.itemKey),
1594
1730
  children: [
1595
1731
  /* @__PURE__ */ e("td", { className: "p-3" }),
1596
- /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(xe, { type: u.itemType }) }),
1732
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(Te, { type: u.itemType }) }),
1597
1733
  /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1598
1734
  /* @__PURE__ */ e(
1599
1735
  "button",
1600
1736
  {
1601
1737
  type: "button",
1602
1738
  className: "text-muted-foreground hover:text-foreground",
1603
- onClick: (K) => {
1604
- K.stopPropagation(), Y(u.itemKey);
1739
+ onClick: (O) => {
1740
+ O.stopPropagation(), L(u.itemKey);
1605
1741
  },
1606
- "aria-label": ie ? "Collapse" : "Expand",
1607
- children: ie ? /* @__PURE__ */ e(ue, { size: 14 }) : /* @__PURE__ */ e(he, { size: 14 })
1742
+ "aria-label": oe ? "Collapse" : "Expand",
1743
+ children: oe ? /* @__PURE__ */ e(he, { size: 14 }) : /* @__PURE__ */ e(pe, { size: 14 })
1608
1744
  }
1609
1745
  ),
1610
1746
  /* @__PURE__ */ e("span", { className: "font-medium", children: u.itemName }),
1611
- /* @__PURE__ */ n("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs ${re.included < re.total ? "bg-amber-100 text-amber-700 font-medium dark:bg-amber-500/15 dark:text-amber-300" : "bg-muted text-muted-foreground"}`, children: [
1612
- re.included,
1747
+ /* @__PURE__ */ n("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs ${de.included < de.total ? "bg-amber-100 text-amber-700 font-medium dark:bg-amber-500/15 dark:text-amber-300" : "bg-muted text-muted-foreground"}`, children: [
1748
+ de.included,
1613
1749
  "/",
1614
- re.total,
1750
+ de.total,
1615
1751
  " changes included"
1616
1752
  ] })
1617
1753
  ] }) }),
@@ -1622,85 +1758,85 @@ function En({ releaseId: t, onBack: s }) {
1622
1758
  ) : /* @__PURE__ */ n(
1623
1759
  "tr",
1624
1760
  {
1625
- className: `border-b last:border-0 cursor-pointer hover:bg-muted/50 ${(c == null ? void 0 : c.id) === u.id ? "bg-muted/50" : ""} ${$e ? "opacity-60" : ""}`,
1761
+ className: `border-b last:border-0 cursor-pointer hover:bg-muted/50 ${(m == null ? void 0 : m.id) === u.id ? "bg-muted/50" : ""} ${Oe ? "opacity-60" : ""}`,
1626
1762
  onClick: () => p(u),
1627
1763
  children: [
1628
- /* @__PURE__ */ e("td", { className: "p-3", onClick: (K) => K.stopPropagation(), children: /* @__PURE__ */ e(
1629
- lt,
1764
+ /* @__PURE__ */ e("td", { className: "p-3", onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ e(
1765
+ ot,
1630
1766
  {
1631
1767
  checked: u.included,
1632
- disabled: u.ignored || Ke.isPending || se || $e,
1633
- onChange: (K) => Ke.mutate({ itemId: u.id, included: K })
1768
+ disabled: u.ignored || $e.isPending || re || Oe,
1769
+ onChange: (O) => $e.mutate({ itemId: u.id, included: O })
1634
1770
  }
1635
1771
  ) }),
1636
- /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(xe, { type: u.itemType }) }),
1772
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(Te, { type: u.itemType }) }),
1637
1773
  /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1638
- I ? /* @__PURE__ */ e(
1774
+ D ? /* @__PURE__ */ e(
1639
1775
  "button",
1640
1776
  {
1641
1777
  type: "button",
1642
1778
  className: "text-muted-foreground hover:text-foreground",
1643
- onClick: (K) => {
1644
- K.stopPropagation(), Y(u.itemKey);
1779
+ onClick: (O) => {
1780
+ O.stopPropagation(), L(u.itemKey);
1645
1781
  },
1646
- "aria-label": ie ? "Collapse" : "Expand",
1647
- children: ie ? /* @__PURE__ */ e(ue, { size: 14 }) : /* @__PURE__ */ e(he, { size: 14 })
1782
+ "aria-label": oe ? "Collapse" : "Expand",
1783
+ children: oe ? /* @__PURE__ */ e(he, { size: 14 }) : /* @__PURE__ */ e(pe, { size: 14 })
1648
1784
  }
1649
1785
  ) : null,
1650
1786
  /* @__PURE__ */ e("span", { className: "font-medium", children: u.itemName }),
1651
1787
  (() => {
1652
1788
  if (!u.included || u.ignored)
1653
1789
  return null;
1654
- const K = Ie(u, ee, ne);
1655
- return K.length === 0 ? null : /* @__PURE__ */ e("span", { title: `Depends on excluded: ${K.map((W) => W.itemName).join(", ")}`, children: /* @__PURE__ */ e(ye, { size: 14, className: "shrink-0 text-amber-600" }) });
1790
+ const O = Re(u, ee, ie);
1791
+ return O.length === 0 ? null : /* @__PURE__ */ e("span", { title: `Depends on excluded: ${O.map((W) => W.itemName).join(", ")}`, children: /* @__PURE__ */ e(Se, { size: 14, className: "shrink-0 text-amber-600" }) });
1656
1792
  })(),
1657
- /* @__PURE__ */ e(ct, { item: u }),
1658
- I ? /* @__PURE__ */ n("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs ${re.included < re.total ? "bg-amber-100 text-amber-700 font-medium dark:bg-amber-500/15 dark:text-amber-300" : "bg-muted text-muted-foreground"}`, children: [
1659
- re.included,
1793
+ /* @__PURE__ */ e(mt, { item: u }),
1794
+ D ? /* @__PURE__ */ n("span", { className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs ${de.included < de.total ? "bg-amber-100 text-amber-700 font-medium dark:bg-amber-500/15 dark:text-amber-300" : "bg-muted text-muted-foreground"}`, children: [
1795
+ de.included,
1660
1796
  "/",
1661
- re.total,
1797
+ de.total,
1662
1798
  " changes included"
1663
1799
  ] }) : null,
1664
- u.carriedOver ? /* @__PURE__ */ e(Zt, { originName: y(w.originConfigId) }) : null,
1665
- u.ignored ? /* @__PURE__ */ e(en, {}) : null,
1666
- fe && !$e ? /* @__PURE__ */ e("span", { onClick: (K) => K.stopPropagation(), children: /* @__PURE__ */ e(
1667
- fn,
1800
+ u.carriedOver ? /* @__PURE__ */ e(nn, { originName: v(k.originConfigId) }) : null,
1801
+ u.ignored ? /* @__PURE__ */ e(sn, {}) : null,
1802
+ ke && !Oe ? /* @__PURE__ */ e("span", { onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ e(
1803
+ yn,
1668
1804
  {
1669
1805
  item: u,
1670
- disabled: se || _e.isPending,
1671
- onChange: (K) => _e.mutate({ itemId: u.id, selectedVersion: K })
1806
+ disabled: re || Ye.isPending,
1807
+ onChange: (O) => Ye.mutate({ itemId: u.id, selectedVersion: O })
1672
1808
  }
1673
1809
  ) }) : null,
1674
- et ? /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Rules without a published version cannot be pushed" }) : null,
1675
- tt ? /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Nothing to push — all versions exist on target" }) : null,
1676
- Rt ? /* @__PURE__ */ e("span", { className: "text-xs text-amber-600", children: "Pushable version not selected" }) : null
1810
+ tt ? /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Rules without a published version cannot be pushed" }) : null,
1811
+ nt ? /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Nothing to push — all versions exist on target" }) : null,
1812
+ At ? /* @__PURE__ */ e("span", { className: "text-xs text-amber-600", children: "Pushable version not selected" }) : null
1677
1813
  ] }) }),
1678
- /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(dt, { status: u.status }) }),
1679
- /* @__PURE__ */ e("td", { className: "p-3 text-right", onClick: (K) => K.stopPropagation(), children: /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2", children: [
1680
- A ? /* @__PURE__ */ e(
1681
- mt,
1814
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(ct, { status: u.status }) }),
1815
+ /* @__PURE__ */ e("td", { className: "p-3 text-right", onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2", children: [
1816
+ F ? /* @__PURE__ */ e(
1817
+ ut,
1682
1818
  {
1683
1819
  item: u,
1684
- targetConfigIds: H,
1685
- results: F,
1686
- pushedDests: J,
1687
- displayName: y
1820
+ targetConfigIds: Y,
1821
+ results: j,
1822
+ pushedDests: U,
1823
+ displayName: v
1688
1824
  }
1689
1825
  ) : null,
1690
- !u.ignored && !se && /* @__PURE__ */ e(
1691
- tn,
1826
+ !u.ignored && !re && /* @__PURE__ */ e(
1827
+ an,
1692
1828
  {
1693
1829
  createPayload: {
1694
- originConfigId: w.originConfigId,
1830
+ originConfigId: k.originConfigId,
1695
1831
  itemKey: u.itemKey,
1696
1832
  itemType: u.itemType,
1697
1833
  itemName: u.itemName
1698
1834
  },
1699
1835
  onChange: () => {
1700
1836
  l.setQueryData(
1701
- k,
1702
- (K) => (K ?? []).map((W) => W.id === u.id ? { ...W, ignored: !0, included: !1 } : W)
1703
- ), Se.mutate();
1837
+ f,
1838
+ (O) => (O ?? []).map((W) => W.id === u.id ? { ...W, ignored: !0, included: !1 } : W)
1839
+ ), Ee.mutate();
1704
1840
  }
1705
1841
  }
1706
1842
  )
@@ -1708,156 +1844,156 @@ function En({ releaseId: t, onBack: s }) {
1708
1844
  ]
1709
1845
  }
1710
1846
  ),
1711
- I && S ? v.map((K) => /* @__PURE__ */ n(
1847
+ D && K ? C.map((O) => /* @__PURE__ */ n(
1712
1848
  "tr",
1713
1849
  {
1714
- className: `border-b last:border-0 cursor-pointer hover:bg-muted/50 ${(c == null ? void 0 : c.id) === K.id ? "bg-muted/50" : ""}`,
1715
- onClick: () => p(K),
1850
+ className: `border-b last:border-0 cursor-pointer hover:bg-muted/50 ${(m == null ? void 0 : m.id) === O.id ? "bg-muted/50" : ""}`,
1851
+ onClick: () => p(O),
1716
1852
  children: [
1717
1853
  /* @__PURE__ */ e("td", { className: "p-3 pl-8", onClick: (W) => W.stopPropagation(), children: /* @__PURE__ */ e(
1718
- lt,
1854
+ ot,
1719
1855
  {
1720
- checked: K.included,
1721
- disabled: K.ignored || Ke.isPending || se,
1722
- onChange: (W) => Ke.mutate({ itemId: K.id, included: W })
1856
+ checked: O.included,
1857
+ disabled: O.ignored || $e.isPending || re,
1858
+ onChange: (W) => $e.mutate({ itemId: O.id, included: W })
1723
1859
  }
1724
1860
  ) }),
1725
- /* @__PURE__ */ e("td", { className: "p-3 pl-8", children: /* @__PURE__ */ e(xe, { type: K.itemType }) }),
1861
+ /* @__PURE__ */ e("td", { className: "p-3 pl-8", children: /* @__PURE__ */ e(Te, { type: O.itemType }) }),
1726
1862
  /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1727
- /* @__PURE__ */ e("span", { className: "font-medium", children: K.itemName }),
1863
+ /* @__PURE__ */ e("span", { className: "font-medium", children: O.itemName }),
1728
1864
  (() => {
1729
- if (!K.included || K.ignored)
1865
+ if (!O.included || O.ignored)
1730
1866
  return null;
1731
- const W = Ie(K, ee, ne);
1732
- return W.length === 0 ? null : /* @__PURE__ */ e("span", { title: `Depends on excluded: ${W.map((At) => At.itemName).join(", ")}`, children: /* @__PURE__ */ e(ye, { size: 14, className: "shrink-0 text-amber-600" }) });
1867
+ const W = Re(O, ee, ie);
1868
+ return W.length === 0 ? null : /* @__PURE__ */ e("span", { title: `Depends on excluded: ${W.map((Dt) => Dt.itemName).join(", ")}`, children: /* @__PURE__ */ e(Se, { size: 14, className: "shrink-0 text-amber-600" }) });
1733
1869
  })(),
1734
- /* @__PURE__ */ e(ct, { item: K })
1870
+ /* @__PURE__ */ e(mt, { item: O })
1735
1871
  ] }) }),
1736
- /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(dt, { status: K.status }) }),
1737
- /* @__PURE__ */ e("td", { className: "p-3 text-right", onClick: (W) => W.stopPropagation(), children: A ? /* @__PURE__ */ e(
1738
- mt,
1872
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(ct, { status: O.status }) }),
1873
+ /* @__PURE__ */ e("td", { className: "p-3 text-right", onClick: (W) => W.stopPropagation(), children: F ? /* @__PURE__ */ e(
1874
+ ut,
1739
1875
  {
1740
- item: K,
1741
- targetConfigIds: H,
1742
- results: F,
1743
- pushedDests: J,
1744
- displayName: y
1876
+ item: O,
1877
+ targetConfigIds: Y,
1878
+ results: j,
1879
+ pushedDests: U,
1880
+ displayName: v
1745
1881
  }
1746
1882
  ) : null })
1747
1883
  ]
1748
1884
  },
1749
- K.id
1885
+ O.id
1750
1886
  )) : null
1751
1887
  ] }, o.synthetic ? u.itemKey : u.id);
1752
1888
  }) })
1753
1889
  ] }) }) }) }),
1754
- c ? /* @__PURE__ */ e("div", { className: "w-[28rem] shrink-0 self-start sticky top-4 max-h-[calc(100vh-2rem)] overflow-auto", children: /* @__PURE__ */ e(
1755
- sn,
1890
+ m ? /* @__PURE__ */ e("div", { className: "w-[28rem] shrink-0 self-start sticky top-4 max-h-[calc(100vh-2rem)] overflow-auto", children: /* @__PURE__ */ e(
1891
+ ln,
1756
1892
  {
1757
- item: N,
1758
- targets: (w.targetConfigIds ?? []).map((o) => ({ id: o, name: y(o) })),
1893
+ item: w,
1894
+ targets: (k.targetConfigIds ?? []).map((o) => ({ id: o, name: v(o) })),
1759
1895
  onClose: () => p(null),
1760
- unmetDependencyNames: N && N.included && !N.ignored ? Ie(N, ee, ne).map(pe) : [],
1761
- tags: Array.isArray((We = (Ye = N == null ? void 0 : N.diff) == null ? void 0 : Ye.origin) == null ? void 0 : We.tags) ? ((Ge = N == null ? void 0 : N.diff) == null ? void 0 : Ge.origin).tags ?? [] : [],
1762
- excludedTags: Z(N == null ? void 0 : N.excludedTags),
1896
+ unmetDependencyNames: w && w.included && !w.ignored ? Re(w, ee, ie).map(Ce) : [],
1897
+ tags: Array.isArray((Ge = (We = w == null ? void 0 : w.diff) == null ? void 0 : We.origin) == null ? void 0 : Ge.tags) ? ((Xe = w == null ? void 0 : w.diff) == null ? void 0 : Xe.origin).tags ?? [] : [],
1898
+ excludedTags: Z(w == null ? void 0 : w.excludedTags),
1763
1899
  metadataKeys: (() => {
1764
- var v, u;
1765
- const o = (u = (v = N == null ? void 0 : N.diff) == null ? void 0 : v.origin) == null ? void 0 : u.metadata;
1900
+ var C, u;
1901
+ const o = (u = (C = w == null ? void 0 : w.diff) == null ? void 0 : C.origin) == null ? void 0 : u.metadata;
1766
1902
  return o != null && typeof o == "object" && !Array.isArray(o) ? Object.keys(o) : [];
1767
1903
  })(),
1768
- excludedMetadataKeys: Z(N == null ? void 0 : N.excludedMetadataKeys),
1904
+ excludedMetadataKeys: Z(w == null ? void 0 : w.excludedMetadataKeys),
1769
1905
  i18nPaths: (() => {
1770
- var u, I;
1771
- const o = (I = (u = N == null ? void 0 : N.diff) == null ? void 0 : u.origin) == null ? void 0 : I.i18n;
1906
+ var u, D;
1907
+ const o = (D = (u = w == null ? void 0 : w.diff) == null ? void 0 : u.origin) == null ? void 0 : D.i18n;
1772
1908
  if (!Array.isArray(o))
1773
1909
  return [];
1774
- const v = o.map((S) => S == null ? void 0 : S.path).filter((S) => typeof S == "string");
1775
- return Array.from(new Set(v));
1910
+ const C = o.map((K) => K == null ? void 0 : K.path).filter((K) => typeof K == "string");
1911
+ return Array.from(new Set(C));
1776
1912
  })(),
1777
- excludedI18nPaths: Z(N == null ? void 0 : N.excludedI18nPaths),
1913
+ excludedI18nPaths: Z(w == null ? void 0 : w.excludedI18nPaths),
1778
1914
  permissionKeys: (() => {
1779
- var u, I;
1780
- if ((N == null ? void 0 : N.itemType) !== "role")
1915
+ var u, D;
1916
+ if ((w == null ? void 0 : w.itemType) !== "role")
1781
1917
  return [];
1782
- const o = (I = (u = N == null ? void 0 : N.diff) == null ? void 0 : u.origin) == null ? void 0 : I.permissions;
1918
+ const o = (D = (u = w == null ? void 0 : w.diff) == null ? void 0 : u.origin) == null ? void 0 : D.permissions;
1783
1919
  if (!Array.isArray(o))
1784
1920
  return [];
1785
- const v = o.map((S) => `${(S == null ? void 0 : S.module) ?? ""}/${(S == null ? void 0 : S.name) ?? (S == null ? void 0 : S.id) ?? ""}`).filter((S) => S !== "/");
1786
- return Array.from(new Set(v));
1921
+ const C = o.map((K) => `${(K == null ? void 0 : K.module) ?? ""}/${(K == null ? void 0 : K.name) ?? (K == null ? void 0 : K.id) ?? ""}`).filter((K) => K !== "/");
1922
+ return Array.from(new Set(C));
1787
1923
  })(),
1788
- excludedPermissions: Z(N == null ? void 0 : N.excludedPermissions),
1789
- formatPermissionLabel: (o) => o.split(/([/.])/).map((v) => {
1790
- var u, I;
1791
- return ((I = (u = N == null ? void 0 : N.diff) == null ? void 0 : u.nameMap) == null ? void 0 : I[v]) ?? G.get(v) ?? v;
1924
+ excludedPermissions: Z(w == null ? void 0 : w.excludedPermissions),
1925
+ formatPermissionLabel: (o) => o.split(/([/.])/).map((C) => {
1926
+ var u, D;
1927
+ return ((D = (u = w == null ? void 0 : w.diff) == null ? void 0 : u.nameMap) == null ? void 0 : D[C]) ?? G.get(C) ?? C;
1792
1928
  }).join(""),
1793
- replacementMaps: w.replacementMaps ?? void 0,
1794
- editable: !se,
1795
- onToggleTag: (o, v) => {
1796
- if (!N)
1929
+ replacementMaps: k.replacementMaps ?? void 0,
1930
+ editable: !re,
1931
+ onToggleTag: (o, C) => {
1932
+ if (!w)
1797
1933
  return;
1798
- const u = Z(N.excludedTags), I = v ? u.filter((S) => S !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
1799
- Kt.mutate({ itemId: N.id, value: I });
1934
+ const u = Z(w.excludedTags), D = C ? u.filter((K) => K !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
1935
+ $t.mutate({ itemId: w.id, value: D });
1800
1936
  },
1801
- onToggleMetadataKey: (o, v) => {
1802
- if (!N)
1937
+ onToggleMetadataKey: (o, C) => {
1938
+ if (!w)
1803
1939
  return;
1804
- const u = Z(N.excludedMetadataKeys), I = v ? u.filter((S) => S !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
1805
- Et.mutate({ itemId: N.id, value: I });
1940
+ const u = Z(w.excludedMetadataKeys), D = C ? u.filter((K) => K !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
1941
+ Kt.mutate({ itemId: w.id, value: D });
1806
1942
  },
1807
- onToggleI18nPath: (o, v) => {
1808
- if (!N)
1943
+ onToggleI18nPath: (o, C) => {
1944
+ if (!w)
1809
1945
  return;
1810
- const u = Z(N.excludedI18nPaths), I = v ? u.filter((S) => S !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
1811
- $t.mutate({ itemId: N.id, value: I });
1946
+ const u = Z(w.excludedI18nPaths), D = C ? u.filter((K) => K !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
1947
+ Ot.mutate({ itemId: w.id, value: D });
1812
1948
  },
1813
- onTogglePermission: (o, v) => {
1814
- if (!N)
1949
+ onTogglePermission: (o, C) => {
1950
+ if (!w)
1815
1951
  return;
1816
- const u = Z(N.excludedPermissions), I = v ? u.filter((S) => S !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
1817
- Ot.mutate({ itemId: N.id, value: I });
1952
+ const u = Z(w.excludedPermissions), D = C ? u.filter((K) => K !== o) : Array.from(/* @__PURE__ */ new Set([...u, o]));
1953
+ It.mutate({ itemId: w.id, value: D });
1818
1954
  }
1819
1955
  }
1820
1956
  ) }) : null
1821
1957
  ] }),
1822
1958
  /* @__PURE__ */ e(
1823
- mn,
1959
+ pn,
1824
1960
  {
1825
- open: P,
1826
- onOpenChange: M,
1961
+ open: S,
1962
+ onOpenChange: q,
1827
1963
  releaseId: t,
1828
- apiPath: i,
1829
- targetConfigIds: H,
1964
+ apiPath: a,
1965
+ targetConfigIds: Y,
1830
1966
  targetNames: Object.fromEntries(
1831
- (w.targetConfigIds ?? []).map((o) => [o, y(o)])
1967
+ (k.targetConfigIds ?? []).map((o) => [o, v(o)])
1832
1968
  ),
1833
1969
  dependencyWarnings: me
1834
1970
  }
1835
1971
  ),
1836
1972
  /* @__PURE__ */ e(
1837
- hn,
1973
+ gn,
1838
1974
  {
1839
- open: D,
1840
- onOpenChange: Q,
1975
+ open: M,
1976
+ onOpenChange: B,
1841
1977
  releaseId: t,
1842
- apiPath: i,
1843
- targetConfigIds: H,
1978
+ apiPath: a,
1979
+ targetConfigIds: Y,
1844
1980
  targetNames: Object.fromEntries(
1845
- (w.targetConfigIds ?? []).map((o) => [o, y(o)])
1981
+ (k.targetConfigIds ?? []).map((o) => [o, v(o)])
1846
1982
  )
1847
1983
  }
1848
1984
  )
1849
1985
  ] }) : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
1850
- /* @__PURE__ */ n(E, { variant: "ghost", size: "sm", onClick: s, children: [
1851
- /* @__PURE__ */ e(Le, {}),
1986
+ /* @__PURE__ */ n($, { variant: "ghost", size: "sm", onClick: s, children: [
1987
+ /* @__PURE__ */ e(Qe, {}),
1852
1988
  "Back"
1853
1989
  ] }),
1854
1990
  /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "Release not found." })
1855
1991
  ] });
1856
1992
  }
1857
- function ut({ value: t, onChange: s, configs: i, label: a }) {
1858
- const r = `cluster-select-${a.toLowerCase().replace(/\s+/g, "-")}`;
1993
+ function ht({ value: t, onChange: s, configs: a, label: i }) {
1994
+ const r = `cluster-select-${i.toLowerCase().replace(/\s+/g, "-")}`;
1859
1995
  return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
1860
- /* @__PURE__ */ e(le, { htmlFor: r, children: a }),
1996
+ /* @__PURE__ */ e(ne, { htmlFor: r, children: i }),
1861
1997
  /* @__PURE__ */ n(
1862
1998
  "select",
1863
1999
  {
@@ -1867,13 +2003,13 @@ function ut({ value: t, onChange: s, configs: i, label: a }) {
1867
2003
  className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
1868
2004
  children: [
1869
2005
  /* @__PURE__ */ e("option", { value: "", children: "Select cluster…" }),
1870
- i.map((d) => /* @__PURE__ */ e("option", { value: d.id, children: d.displayName }, d.id))
2006
+ a.map((d) => /* @__PURE__ */ e("option", { value: d.id, children: d.displayName }, d.id))
1871
2007
  ]
1872
2008
  }
1873
2009
  )
1874
2010
  ] });
1875
2011
  }
1876
- const ht = {
2012
+ const pt = {
1877
2013
  match: { symbol: "✓", className: "text-muted-foreground", label: "Match" },
1878
2014
  diff: { symbol: "≠", className: "text-red-500 dark:text-red-400 font-semibold", label: "Diff" },
1879
2015
  translated: { symbol: "≈", className: "text-blue-600 dark:text-blue-400 font-semibold", label: "Translated" },
@@ -1881,124 +2017,124 @@ const ht = {
1881
2017
  extra: { symbol: "+", className: "text-amber-600 font-semibold", label: "Extra" },
1882
2018
  skip: { symbol: "—", className: "text-muted-foreground/50", label: "Ignored" }
1883
2019
  };
1884
- function pt({
2020
+ function ft({
1885
2021
  state: t,
1886
2022
  onClick: s,
1887
- active: i
2023
+ active: a
1888
2024
  }) {
1889
- const a = ht[t] ?? ht.match, r = t !== "match" && t !== "skip" && !!s;
2025
+ const i = pt[t] ?? pt.match, r = t !== "match" && t !== "skip" && !!s;
1890
2026
  return /* @__PURE__ */ e(
1891
2027
  "button",
1892
2028
  {
1893
2029
  type: "button",
1894
2030
  onClick: r ? s : void 0,
1895
2031
  disabled: !r,
1896
- title: a.label,
2032
+ title: i.label,
1897
2033
  className: ce(
1898
2034
  "w-full text-center text-sm py-1 rounded",
1899
- a.className,
2035
+ i.className,
1900
2036
  r && "hover:bg-muted cursor-pointer",
1901
2037
  !r && "cursor-default",
1902
- i && "bg-muted ring-1 ring-ring"
2038
+ a && "bg-muted ring-1 ring-ring"
1903
2039
  ),
1904
- children: a.symbol
2040
+ children: i.symbol
1905
2041
  }
1906
2042
  );
1907
2043
  }
1908
- function $n({ stats: t, destConfigIds: s }) {
1909
- return /* @__PURE__ */ e("div", { className: "flex gap-6 text-xs text-muted-foreground py-2 px-1", children: s.map((i) => {
1910
- const a = t[i];
1911
- if (!a)
2044
+ function Rn({ stats: t, destConfigIds: s }) {
2045
+ return /* @__PURE__ */ e("div", { className: "flex gap-6 text-xs text-muted-foreground py-2 px-1", children: s.map((a) => {
2046
+ const i = t[a];
2047
+ if (!i)
1912
2048
  return null;
1913
- const r = a.match + a.diff + a.missing + a.extra;
2049
+ const r = i.match + i.diff + i.missing + i.extra;
1914
2050
  return /* @__PURE__ */ n("span", { children: [
1915
2051
  /* @__PURE__ */ n("span", { className: "font-mono font-medium", children: [
1916
- a.match,
2052
+ i.match,
1917
2053
  "/",
1918
2054
  r
1919
2055
  ] }),
1920
2056
  " match",
1921
- a.diff > 0 && /* @__PURE__ */ n("span", { className: "text-destructive ml-2", children: [
1922
- a.diff,
2057
+ i.diff > 0 && /* @__PURE__ */ n("span", { className: "text-destructive ml-2", children: [
2058
+ i.diff,
1923
2059
  " diff"
1924
2060
  ] }),
1925
- a.missing > 0 && /* @__PURE__ */ n("span", { className: "text-destructive ml-2", children: [
1926
- a.missing,
2061
+ i.missing > 0 && /* @__PURE__ */ n("span", { className: "text-destructive ml-2", children: [
2062
+ i.missing,
1927
2063
  " missing"
1928
2064
  ] }),
1929
- a.extra > 0 && /* @__PURE__ */ n("span", { className: "text-amber-600 ml-2", children: [
1930
- a.extra,
2065
+ i.extra > 0 && /* @__PURE__ */ n("span", { className: "text-amber-600 ml-2", children: [
2066
+ i.extra,
1931
2067
  " extra"
1932
2068
  ] })
1933
- ] }, i);
2069
+ ] }, a);
1934
2070
  }) });
1935
2071
  }
1936
- function ft(t) {
2072
+ function gt(t) {
1937
2073
  return Object.values(t.cells).some((s) => s === "diff" || s === "missing" || s === "extra");
1938
2074
  }
1939
- function On({
2075
+ function An({
1940
2076
  originConfigId: t,
1941
2077
  destConfigIds: s,
1942
- apiPath: i = "/release-status"
2078
+ apiPath: a = "/release-status"
1943
2079
  }) {
1944
- const { toast: a } = oe(), { fetchJson: r } = te(), { configs: d } = be(), l = de(), [m, h] = R("issues"), [b, x] = R(!1), [c, p] = R(null), [P, M] = R(/* @__PURE__ */ new Set()), [D, Q] = R(() => /* @__PURE__ */ new Set()), U = (y) => Q((O) => {
1945
- const T = new Set(O);
1946
- return T.has(y) ? T.delete(y) : T.add(y), T;
1947
- }), j = q(() => {
1948
- const y = /* @__PURE__ */ new Map();
1949
- return d.forEach((O) => y.set(O.id, O.displayName)), y;
1950
- }, [d]), Y = (y) => j.get(y) ?? y, B = s.filter((y) => !P.has(y)), k = new URLSearchParams();
1951
- k.set("originConfigId", t), B.forEach((y) => k.append("destConfigIds[]", y));
1952
- const C = ["imaginarium", "release-status", t, B], { data: $, isLoading: g, isError: w } = ae({
1953
- queryKey: C,
1954
- queryFn: () => r(`${i}?${k.toString()}`),
1955
- enabled: B.length > 0
1956
- }), V = _({
1957
- mutationFn: () => r(`${i}/refresh`, {
2080
+ const { toast: i } = se(), { fetchJson: r } = te(), { configs: d } = fe(), l = ae(), [c, h] = R("issues"), [N, y] = R(!1), [m, p] = R(null), [S, q] = R(/* @__PURE__ */ new Set()), [M, B] = R(() => /* @__PURE__ */ new Set()), b = (v) => B((A) => {
2081
+ const E = new Set(A);
2082
+ return E.has(v) ? E.delete(v) : E.add(v), E;
2083
+ }), P = J(() => {
2084
+ const v = /* @__PURE__ */ new Map();
2085
+ return d.forEach((A) => v.set(A.id, A.displayName)), v;
2086
+ }, [d]), L = (v) => P.get(v) ?? v, z = s.filter((v) => !S.has(v)), f = new URLSearchParams();
2087
+ f.set("originConfigId", t), z.forEach((v) => f.append("destConfigIds[]", v));
2088
+ const T = ["imaginarium", "release-status", t, z], { data: I, isLoading: x, isError: k } = le({
2089
+ queryKey: T,
2090
+ queryFn: () => r(`${a}?${f.toString()}`),
2091
+ enabled: z.length > 0
2092
+ }), _ = H({
2093
+ mutationFn: () => r(`${a}/refresh`, {
1958
2094
  method: "POST",
1959
- body: JSON.stringify({ originConfigId: t, destConfigIds: B })
2095
+ body: JSON.stringify({ originConfigId: t, destConfigIds: z })
1960
2096
  }),
1961
2097
  onSuccess: () => {
1962
- l.invalidateQueries({ queryKey: C }), a({ title: "Cache cleared", description: "Refreshing comparison data…" });
2098
+ l.invalidateQueries({ queryKey: T }), i({ title: "Cache cleared", description: "Refreshing comparison data…" });
1963
2099
  },
1964
- onError: (y) => {
1965
- a({ title: "Error", description: y.message, variant: "destructive" });
2100
+ onError: (v) => {
2101
+ i({ title: "Error", description: v.message, variant: "destructive" });
1966
2102
  }
1967
2103
  }), {
1968
- data: L,
2104
+ data: V,
1969
2105
  isLoading: X,
1970
- isError: f
1971
- } = ae({
1972
- queryKey: ["imaginarium", "release-status-diff", t, c == null ? void 0 : c.destConfigId, c == null ? void 0 : c.itemKey],
2106
+ isError: g
2107
+ } = le({
2108
+ queryKey: ["imaginarium", "release-status-diff", t, m == null ? void 0 : m.destConfigId, m == null ? void 0 : m.itemKey],
1973
2109
  queryFn: () => r(
1974
- `${i}/diff?originConfigId=${encodeURIComponent(t)}&destConfigId=${encodeURIComponent(c.destConfigId)}&itemKey=${encodeURIComponent(c.itemKey)}`
2110
+ `${a}/diff?originConfigId=${encodeURIComponent(t)}&destConfigId=${encodeURIComponent(m.destConfigId)}&itemKey=${encodeURIComponent(m.itemKey)}`
1975
2111
  ),
1976
- enabled: !!c
1977
- }), F = (y) => {
1978
- M((O) => {
1979
- const T = new Set(O);
1980
- return T.has(y) ? T.delete(y) : T.add(y), T;
2112
+ enabled: !!m
2113
+ }), j = (v) => {
2114
+ q((A) => {
2115
+ const E = new Set(A);
2116
+ return E.has(v) ? E.delete(v) : E.add(v), E;
1981
2117
  });
1982
- }, J = (y, O) => {
2118
+ }, U = (v, A) => {
1983
2119
  p(
1984
- (T) => (T == null ? void 0 : T.itemKey) === y && T.destConfigId === O ? null : { itemKey: y, destConfigId: O }
2120
+ (E) => (E == null ? void 0 : E.itemKey) === v && E.destConfigId === A ? null : { itemKey: v, destConfigId: A }
1985
2121
  );
1986
- }, A = ($ == null ? void 0 : $.rows) ?? [], H = ($ == null ? void 0 : $.stats) ?? {}, z = q(() => kn(A).map((O) => {
1987
- const T = m === "issues" ? O.children.filter(ft) : O.children;
1988
- return { node: O, renderChildren: T };
2122
+ }, F = (I == null ? void 0 : I.rows) ?? [], Y = (I == null ? void 0 : I.stats) ?? {}, Q = J(() => Pn(F).map((A) => {
2123
+ const E = c === "issues" ? A.children.filter(gt) : A.children;
2124
+ return { node: A, renderChildren: E };
1989
2125
  }).filter(
1990
- ({ node: O, renderChildren: T }) => m === "all" || ft(O.row) || T.length > 0
1991
- ).sort((O, T) => {
1992
- const ee = Je(O.node.row.itemType, T.node.row.itemType);
1993
- return ee !== 0 ? ee : O.node.row.itemName.localeCompare(T.node.row.itemName);
1994
- }), [A, m]);
2126
+ ({ node: A, renderChildren: E }) => c === "all" || gt(A.row) || E.length > 0
2127
+ ).sort((A, E) => {
2128
+ const ee = Ve(A.node.row.itemType, E.node.row.itemType);
2129
+ return ee !== 0 ? ee : A.node.row.itemName.localeCompare(E.node.row.itemName);
2130
+ }), [F, c]);
1995
2131
  return /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1996
2132
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2 flex-wrap", children: [
1997
2133
  /* @__PURE__ */ n("div", { className: "flex rounded-md border text-sm overflow-hidden", children: [
1998
2134
  /* @__PURE__ */ e(
1999
2135
  "button",
2000
2136
  {
2001
- className: ce("px-3 py-1.5", m === "issues" ? "bg-muted font-medium" : "hover:bg-muted/50"),
2137
+ className: ce("px-3 py-1.5", c === "issues" ? "bg-muted font-medium" : "hover:bg-muted/50"),
2002
2138
  onClick: () => h("issues"),
2003
2139
  children: "Issues only"
2004
2140
  }
@@ -2006,65 +2142,65 @@ function On({
2006
2142
  /* @__PURE__ */ e(
2007
2143
  "button",
2008
2144
  {
2009
- className: ce("px-3 py-1.5 border-l", m === "all" ? "bg-muted font-medium" : "hover:bg-muted/50"),
2145
+ className: ce("px-3 py-1.5 border-l", c === "all" ? "bg-muted font-medium" : "hover:bg-muted/50"),
2010
2146
  onClick: () => h("all"),
2011
2147
  children: "All"
2012
2148
  }
2013
2149
  )
2014
2150
  ] }),
2015
- /* @__PURE__ */ n(E, { variant: "ghost", size: "sm", onClick: () => x((y) => !y), children: [
2016
- /* @__PURE__ */ e(Jt, {}),
2151
+ /* @__PURE__ */ n($, { variant: "ghost", size: "sm", onClick: () => y((v) => !v), children: [
2152
+ /* @__PURE__ */ e(Vt, {}),
2017
2153
  "Stats"
2018
2154
  ] }),
2019
2155
  /* @__PURE__ */ n(
2020
- E,
2156
+ $,
2021
2157
  {
2022
2158
  variant: "ghost",
2023
2159
  size: "sm",
2024
- onClick: () => V.mutate(),
2025
- disabled: V.isPending,
2160
+ onClick: () => _.mutate(),
2161
+ disabled: _.isPending,
2026
2162
  children: [
2027
- /* @__PURE__ */ e(vt, { className: ce(V.isPending && "animate-spin") }),
2163
+ /* @__PURE__ */ e(Ct, { className: ce(_.isPending && "animate-spin") }),
2028
2164
  "Refresh"
2029
2165
  ]
2030
2166
  }
2031
2167
  ),
2032
- [...P].map((y) => /* @__PURE__ */ n(
2168
+ [...S].map((v) => /* @__PURE__ */ n(
2033
2169
  "button",
2034
2170
  {
2035
- onClick: () => F(y),
2171
+ onClick: () => j(v),
2036
2172
  className: "text-xs border rounded px-2 py-1 text-muted-foreground hover:bg-muted",
2037
2173
  children: [
2038
2174
  "+ ",
2039
- Y(y)
2175
+ L(v)
2040
2176
  ]
2041
2177
  },
2042
- y
2178
+ v
2043
2179
  ))
2044
2180
  ] }),
2045
- b && $ && /* @__PURE__ */ e($n, { stats: H, destConfigIds: B }),
2046
- g && /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" }),
2047
- w && /* @__PURE__ */ e("div", { className: "text-center text-destructive py-8", children: "Failed to load comparison data." }),
2048
- !g && !w && /* @__PURE__ */ n("div", { className: "flex gap-4", children: [
2181
+ N && I && /* @__PURE__ */ e(Rn, { stats: Y, destConfigIds: z }),
2182
+ x && /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" }),
2183
+ k && /* @__PURE__ */ e("div", { className: "text-center text-destructive py-8", children: "Failed to load comparison data." }),
2184
+ !x && !k && /* @__PURE__ */ n("div", { className: "flex gap-4", children: [
2049
2185
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1 rounded-md border overflow-auto max-h-[70vh]", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
2050
2186
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b bg-muted/50", children: [
2051
2187
  /* @__PURE__ */ e("th", { className: "sticky top-0 z-10 bg-muted px-4 py-2 text-left font-medium min-w-[200px]", children: "Item" }),
2052
- B.map((y) => /* @__PURE__ */ e("th", { className: "sticky top-0 z-10 bg-muted px-2 py-2 text-center font-medium min-w-[80px]", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-center gap-1", children: [
2053
- /* @__PURE__ */ e("span", { className: "truncate max-w-[120px]", title: Y(y), children: Y(y) }),
2188
+ z.map((v) => /* @__PURE__ */ e("th", { className: "sticky top-0 z-10 bg-muted px-2 py-2 text-center font-medium min-w-[80px]", children: /* @__PURE__ */ n("div", { className: "flex items-center justify-center gap-1", children: [
2189
+ /* @__PURE__ */ e("span", { className: "truncate max-w-[120px]", title: L(v), children: L(v) }),
2054
2190
  /* @__PURE__ */ e(
2055
2191
  "button",
2056
2192
  {
2057
2193
  className: "text-muted-foreground hover:text-foreground",
2058
- onClick: () => F(y),
2194
+ onClick: () => j(v),
2059
2195
  title: "Hide column",
2060
2196
  children: "×"
2061
2197
  }
2062
2198
  )
2063
- ] }) }, y))
2199
+ ] }) }, v))
2064
2200
  ] }) }),
2065
- /* @__PURE__ */ e("tbody", { children: z.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: B.length + 1, className: "text-center text-muted-foreground py-8", children: m === "issues" ? "No issues found — all clusters in sync." : "No items." }) }) : z.map(({ node: y, renderChildren: O }) => {
2066
- const T = y.row, ee = O.length > 0, ne = D.has(T.itemKey) || m === "issues", pe = D.has(T.itemKey);
2067
- return /* @__PURE__ */ n(yt, { children: [
2201
+ /* @__PURE__ */ e("tbody", { children: Q.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: z.length + 1, className: "text-center text-muted-foreground py-8", children: c === "issues" ? "No issues found — all clusters in sync." : "No items." }) }) : Q.map(({ node: v, renderChildren: A }) => {
2202
+ const E = v.row, ee = A.length > 0, ie = M.has(E.itemKey) || c === "issues", Ce = M.has(E.itemKey);
2203
+ return /* @__PURE__ */ n(bt, { children: [
2068
2204
  /* @__PURE__ */ n("tr", { className: "border-b last:border-0 hover:bg-muted/25", children: [
2069
2205
  /* @__PURE__ */ e("td", { className: "px-4 py-1.5", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2070
2206
  ee ? /* @__PURE__ */ e(
@@ -2072,47 +2208,47 @@ function On({
2072
2208
  {
2073
2209
  type: "button",
2074
2210
  className: "text-muted-foreground hover:text-foreground",
2075
- onClick: () => U(T.itemKey),
2076
- "aria-label": pe ? "Collapse" : "Expand",
2077
- children: pe ? /* @__PURE__ */ e(ue, { size: 14 }) : /* @__PURE__ */ e(he, { size: 14 })
2211
+ onClick: () => b(E.itemKey),
2212
+ "aria-label": Ce ? "Collapse" : "Expand",
2213
+ children: Ce ? /* @__PURE__ */ e(he, { size: 14 }) : /* @__PURE__ */ e(pe, { size: 14 })
2078
2214
  }
2079
2215
  ) : null,
2080
- /* @__PURE__ */ e("span", { className: "inline-flex align-middle", children: /* @__PURE__ */ e(xe, { type: T.itemType }) }),
2081
- /* @__PURE__ */ e("span", { className: "font-medium", children: T.itemName })
2216
+ /* @__PURE__ */ e("span", { className: "inline-flex align-middle", children: /* @__PURE__ */ e(Te, { type: E.itemType }) }),
2217
+ /* @__PURE__ */ e("span", { className: "font-medium", children: E.itemName })
2082
2218
  ] }) }),
2083
- B.map((G) => /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
2084
- pt,
2219
+ z.map((G) => /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
2220
+ ft,
2085
2221
  {
2086
- state: T.cells[G] ?? "match",
2087
- active: (c == null ? void 0 : c.itemKey) === T.itemKey && c.destConfigId === G,
2088
- onClick: () => J(T.itemKey, G)
2222
+ state: E.cells[G] ?? "match",
2223
+ active: (m == null ? void 0 : m.itemKey) === E.itemKey && m.destConfigId === G,
2224
+ onClick: () => U(E.itemKey, G)
2089
2225
  }
2090
2226
  ) }, G))
2091
2227
  ] }),
2092
- ee && ne ? O.map((G) => /* @__PURE__ */ n("tr", { className: "border-b last:border-0 hover:bg-muted/25", children: [
2228
+ ee && ie ? A.map((G) => /* @__PURE__ */ n("tr", { className: "border-b last:border-0 hover:bg-muted/25", children: [
2093
2229
  /* @__PURE__ */ e("td", { className: "px-4 py-1.5 pl-8", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
2094
- /* @__PURE__ */ e("span", { className: "inline-flex align-middle", children: /* @__PURE__ */ e(xe, { type: G.itemType }) }),
2230
+ /* @__PURE__ */ e("span", { className: "inline-flex align-middle", children: /* @__PURE__ */ e(Te, { type: G.itemType }) }),
2095
2231
  /* @__PURE__ */ e("span", { className: "font-medium", children: G.itemName })
2096
2232
  ] }) }),
2097
- B.map((me) => /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
2098
- pt,
2233
+ z.map((me) => /* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
2234
+ ft,
2099
2235
  {
2100
2236
  state: G.cells[me] ?? "match",
2101
- active: (c == null ? void 0 : c.itemKey) === G.itemKey && c.destConfigId === me,
2102
- onClick: () => J(G.itemKey, me)
2237
+ active: (m == null ? void 0 : m.itemKey) === G.itemKey && m.destConfigId === me,
2238
+ onClick: () => U(G.itemKey, me)
2103
2239
  }
2104
2240
  ) }, me))
2105
2241
  ] }, G.itemKey)) : null
2106
- ] }, T.itemKey);
2242
+ ] }, E.itemKey);
2107
2243
  }) })
2108
2244
  ] }) }),
2109
- c ? /* @__PURE__ */ e("div", { className: "w-[28rem] shrink-0 self-start sticky top-4 max-h-[calc(100vh-2rem)] overflow-auto", children: X ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center rounded-md border bg-background p-4 text-sm text-muted-foreground", children: "Loading diff…" }) : f || !L ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center rounded-md border bg-background p-4 text-sm text-muted-foreground", children: "No diff available." }) : /* @__PURE__ */ e(
2110
- Pt,
2245
+ m ? /* @__PURE__ */ e("div", { className: "w-[28rem] shrink-0 self-start sticky top-4 max-h-[calc(100vh-2rem)] overflow-auto", children: X ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center rounded-md border bg-background p-4 text-sm text-muted-foreground", children: "Loading diff…" }) : g || !V ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center rounded-md border bg-background p-4 text-sm text-muted-foreground", children: "No diff available." }) : /* @__PURE__ */ e(
2246
+ St,
2111
2247
  {
2112
2248
  item: {
2113
- itemName: L.itemName,
2114
- itemType: L.itemType,
2115
- diff: { origin: L.origin, target: L.target }
2249
+ itemName: V.itemName,
2250
+ itemType: V.itemType,
2251
+ diff: { origin: V.origin, target: V.target }
2116
2252
  },
2117
2253
  onClose: () => p(null)
2118
2254
  }
@@ -2120,122 +2256,122 @@ function On({
2120
2256
  ] })
2121
2257
  ] });
2122
2258
  }
2123
- const gt = (t) => ({
2259
+ const xt = (t) => ({
2124
2260
  name: "",
2125
2261
  description: "",
2126
2262
  values: Object.fromEntries(t.map((s) => [s, ""]))
2127
2263
  });
2128
- function In({
2264
+ function Dn({
2129
2265
  configIds: t,
2130
2266
  clusterNames: s = {},
2131
- apiPath: i = "/release-translations"
2267
+ apiPath: a = "/release-translations"
2132
2268
  }) {
2133
- const { toast: a } = oe(), { fetchJson: r } = te(), d = de(), [l, m] = R(!1), [h, b] = R(null), [x, c] = R(gt(t)), [p, P] = R(() => /* @__PURE__ */ new Set()), M = (f) => {
2134
- P((F) => {
2135
- const J = new Set(F);
2136
- return J.has(f) ? J.delete(f) : J.add(f), J;
2269
+ const { toast: i } = se(), { fetchJson: r } = te(), d = ae(), [l, c] = R(!1), [h, N] = R(null), [y, m] = R(xt(t)), [p, S] = R(() => /* @__PURE__ */ new Set()), q = (g) => {
2270
+ S((j) => {
2271
+ const U = new Set(j);
2272
+ return U.has(g) ? U.delete(g) : U.add(g), U;
2137
2273
  });
2138
- }, D = ["imaginarium", "release-translations"], { data: Q, isLoading: U } = ae({
2139
- queryKey: D,
2274
+ }, M = ["imaginarium", "release-translations"], { data: B, isLoading: b } = le({
2275
+ queryKey: M,
2140
2276
  queryFn: async () => {
2141
- const f = await r(i);
2142
- return (f == null ? void 0 : f.items) ?? [];
2277
+ const g = await r(a);
2278
+ return (g == null ? void 0 : g.items) ?? [];
2143
2279
  }
2144
- }), j = _({
2145
- mutationFn: async (f) => {
2146
- const F = await r(i, {
2280
+ }), P = H({
2281
+ mutationFn: async (g) => {
2282
+ const j = await r(a, {
2147
2283
  method: "POST",
2148
- body: JSON.stringify({ name: f.name.trim(), description: f.description.trim() || null })
2284
+ body: JSON.stringify({ name: g.name.trim(), description: g.description.trim() || null })
2149
2285
  });
2150
- await k(F.id, f.values);
2286
+ await f(j.id, g.values);
2151
2287
  },
2152
2288
  onSuccess: () => {
2153
- d.invalidateQueries({ queryKey: D }), a({ title: "Translation created" }), g();
2289
+ d.invalidateQueries({ queryKey: M }), i({ title: "Translation created" }), x();
2154
2290
  },
2155
- onError: (f) => a({ title: "Error", description: f.message, variant: "destructive" })
2156
- }), Y = _({
2157
- mutationFn: async (f) => {
2158
- await r(`${i}/${h.id}`, {
2291
+ onError: (g) => i({ title: "Error", description: g.message, variant: "destructive" })
2292
+ }), L = H({
2293
+ mutationFn: async (g) => {
2294
+ await r(`${a}/${h.id}`, {
2159
2295
  method: "PATCH",
2160
- body: JSON.stringify({ name: f.name.trim(), description: f.description.trim() || null })
2161
- }), await k(h.id, f.values);
2296
+ body: JSON.stringify({ name: g.name.trim(), description: g.description.trim() || null })
2297
+ }), await f(h.id, g.values);
2162
2298
  },
2163
2299
  onSuccess: () => {
2164
- d.invalidateQueries({ queryKey: D }), a({ title: "Translation updated" }), g();
2300
+ d.invalidateQueries({ queryKey: M }), i({ title: "Translation updated" }), x();
2165
2301
  },
2166
- onError: (f) => a({ title: "Error", description: f.message, variant: "destructive" })
2167
- }), B = _({
2168
- mutationFn: (f) => r(`${i}/${f}`, { method: "DELETE" }),
2302
+ onError: (g) => i({ title: "Error", description: g.message, variant: "destructive" })
2303
+ }), z = H({
2304
+ mutationFn: (g) => r(`${a}/${g}`, { method: "DELETE" }),
2169
2305
  onSuccess: () => {
2170
- d.invalidateQueries({ queryKey: D }), a({ title: "Translation deleted" });
2306
+ d.invalidateQueries({ queryKey: M }), i({ title: "Translation deleted" });
2171
2307
  },
2172
- onError: (f) => a({ title: "Error", description: f.message, variant: "destructive" })
2308
+ onError: (g) => i({ title: "Error", description: g.message, variant: "destructive" })
2173
2309
  });
2174
- async function k(f, F) {
2175
- var A;
2176
- const J = (h == null ? void 0 : h.values) ?? [];
2177
- for (const H of t) {
2178
- const z = (A = F[H]) == null ? void 0 : A.trim(), y = J.find((T) => T.configId === H), O = `${i}/${f}/values`;
2179
- y && z ? await r(`${O}/${y.id}`, {
2310
+ async function f(g, j) {
2311
+ var F;
2312
+ const U = (h == null ? void 0 : h.values) ?? [];
2313
+ for (const Y of t) {
2314
+ const Q = (F = j[Y]) == null ? void 0 : F.trim(), v = U.find((E) => E.configId === Y), A = `${a}/${g}/values`;
2315
+ v && Q ? await r(`${A}/${v.id}`, {
2180
2316
  method: "PATCH",
2181
- body: JSON.stringify({ value: z })
2182
- }) : y && !z ? await r(`${O}/${y.id}`, { method: "DELETE" }) : !y && z && await r(O, {
2317
+ body: JSON.stringify({ value: Q })
2318
+ }) : v && !Q ? await r(`${A}/${v.id}`, { method: "DELETE" }) : !v && Q && await r(A, {
2183
2319
  method: "POST",
2184
- body: JSON.stringify({ translationId: f, configId: H, value: z })
2320
+ body: JSON.stringify({ translationId: g, configId: Y, value: Q })
2185
2321
  });
2186
2322
  }
2187
2323
  }
2188
- const C = () => {
2189
- b(null), c(gt(t)), m(!0);
2190
- }, $ = (f) => {
2191
- b(f);
2192
- const F = f.values ?? [], J = Object.fromEntries(
2193
- t.map((A) => {
2194
- var H;
2195
- return [A, ((H = F.find((z) => z.configId === A)) == null ? void 0 : H.value) ?? ""];
2324
+ const T = () => {
2325
+ N(null), m(xt(t)), c(!0);
2326
+ }, I = (g) => {
2327
+ N(g);
2328
+ const j = g.values ?? [], U = Object.fromEntries(
2329
+ t.map((F) => {
2330
+ var Y;
2331
+ return [F, ((Y = j.find((Q) => Q.configId === F)) == null ? void 0 : Y.value) ?? ""];
2196
2332
  })
2197
2333
  );
2198
- c({ name: f.name, description: f.description ?? "", values: J }), m(!0);
2199
- }, g = () => {
2200
- m(!1), b(null);
2201
- }, w = () => {
2202
- h ? Y.mutate(x) : j.mutate(x);
2203
- }, V = j.isPending || Y.isPending, L = !!x.name.trim();
2204
- if (U)
2334
+ m({ name: g.name, description: g.description ?? "", values: U }), c(!0);
2335
+ }, x = () => {
2336
+ c(!1), N(null);
2337
+ }, k = () => {
2338
+ h ? L.mutate(y) : P.mutate(y);
2339
+ }, _ = P.isPending || L.isPending, V = !!y.name.trim();
2340
+ if (b)
2205
2341
  return /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" });
2206
- const X = [...Q ?? []].sort(
2207
- (f, F) => f.name.localeCompare(F.name, void 0, { sensitivity: "base" })
2342
+ const X = [...B ?? []].sort(
2343
+ (g, j) => g.name.localeCompare(j.name, void 0, { sensitivity: "base" })
2208
2344
  );
2209
2345
  return /* @__PURE__ */ n("div", { className: "space-y-4", children: [
2210
2346
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
2211
2347
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: X.length === 0 ? "No translation rules yet." : `${X.length} translation rule${X.length === 1 ? "" : "s"}.` }),
2212
- /* @__PURE__ */ n(E, { size: "sm", onClick: C, children: [
2213
- /* @__PURE__ */ e(je, {}),
2348
+ /* @__PURE__ */ n($, { size: "sm", onClick: T, children: [
2349
+ /* @__PURE__ */ e(Je, {}),
2214
2350
  "Add translation"
2215
2351
  ] })
2216
2352
  ] }),
2217
- X.length > 0 && /* @__PURE__ */ e("div", { className: "rounded-md border divide-y text-sm", children: X.map((f) => {
2218
- const F = p.has(f.id), J = f.values ?? [], A = (z) => {
2219
- var y;
2220
- return ((y = J.find((O) => O.configId === z)) == null ? void 0 : y.value) ?? "";
2221
- }, H = t.filter((z) => A(z)).length;
2353
+ X.length > 0 && /* @__PURE__ */ e("div", { className: "rounded-md border divide-y text-sm", children: X.map((g) => {
2354
+ const j = p.has(g.id), U = g.values ?? [], F = (Q) => {
2355
+ var v;
2356
+ return ((v = U.find((A) => A.configId === Q)) == null ? void 0 : v.value) ?? "";
2357
+ }, Y = t.filter((Q) => F(Q)).length;
2222
2358
  return /* @__PURE__ */ n("div", { children: [
2223
2359
  /* @__PURE__ */ n("div", { className: "flex items-center gap-3 px-4 py-2 hover:bg-muted/25", children: [
2224
2360
  /* @__PURE__ */ n(
2225
2361
  "button",
2226
2362
  {
2227
2363
  type: "button",
2228
- onClick: () => M(f.id),
2229
- "aria-expanded": F,
2364
+ onClick: () => q(g.id),
2365
+ "aria-expanded": j,
2230
2366
  className: "flex flex-1 min-w-0 items-center gap-3 text-left",
2231
2367
  children: [
2232
- F ? /* @__PURE__ */ e(ue, { className: "size-4 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ e(he, { className: "size-4 shrink-0 text-muted-foreground" }),
2368
+ j ? /* @__PURE__ */ e(he, { className: "size-4 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ e(pe, { className: "size-4 shrink-0 text-muted-foreground" }),
2233
2369
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
2234
- /* @__PURE__ */ e("div", { className: "font-medium", children: f.name }),
2235
- f.description && /* @__PURE__ */ e("div", { className: "truncate text-xs text-muted-foreground", children: f.description })
2370
+ /* @__PURE__ */ e("div", { className: "font-medium", children: g.name }),
2371
+ g.description && /* @__PURE__ */ e("div", { className: "truncate text-xs text-muted-foreground", children: g.description })
2236
2372
  ] }),
2237
2373
  /* @__PURE__ */ n("div", { className: "shrink-0 whitespace-nowrap text-xs text-muted-foreground", children: [
2238
- H,
2374
+ Y,
2239
2375
  " of ",
2240
2376
  t.length,
2241
2377
  " set"
@@ -2244,223 +2380,223 @@ function In({
2244
2380
  }
2245
2381
  ),
2246
2382
  /* @__PURE__ */ n("div", { className: "flex shrink-0 gap-1", children: [
2247
- /* @__PURE__ */ e(E, { variant: "ghost", size: "icon", onClick: () => $(f), children: /* @__PURE__ */ e(Qt, {}) }),
2383
+ /* @__PURE__ */ e($, { variant: "ghost", size: "icon", onClick: () => I(g), children: /* @__PURE__ */ e(Ut, {}) }),
2248
2384
  /* @__PURE__ */ e(
2249
- E,
2385
+ $,
2250
2386
  {
2251
2387
  variant: "ghost",
2252
2388
  size: "icon",
2253
2389
  onClick: () => {
2254
- window.confirm(`Delete translation "${f.name}"?`) && B.mutate(f.id);
2390
+ window.confirm(`Delete translation "${g.name}"?`) && z.mutate(g.id);
2255
2391
  },
2256
- children: /* @__PURE__ */ e(wt, {})
2392
+ children: /* @__PURE__ */ e(He, {})
2257
2393
  }
2258
2394
  )
2259
2395
  ] })
2260
2396
  ] }),
2261
- F && /* @__PURE__ */ e("div", { className: "space-y-1 px-4 pb-3 pl-11", children: t.map((z) => /* @__PURE__ */ n("div", { className: "grid grid-cols-[10rem_1fr] gap-2 text-xs", children: [
2262
- /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: s[z] ?? z }),
2263
- /* @__PURE__ */ e("span", { className: "break-all font-mono", children: A(z) || /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "—" }) })
2264
- ] }, z)) })
2265
- ] }, f.id);
2397
+ j && /* @__PURE__ */ e("div", { className: "space-y-1 px-4 pb-3 pl-11", children: t.map((Q) => /* @__PURE__ */ n("div", { className: "grid grid-cols-[10rem_1fr] gap-2 text-xs", children: [
2398
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: s[Q] ?? Q }),
2399
+ /* @__PURE__ */ e("span", { className: "break-all font-mono", children: F(Q) || /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "—" }) })
2400
+ ] }, Q)) })
2401
+ ] }, g.id);
2266
2402
  }) }),
2267
- /* @__PURE__ */ e(ve, { open: l, onOpenChange: m, children: /* @__PURE__ */ n(we, { className: "max-w-lg", children: [
2268
- /* @__PURE__ */ n(ke, { children: [
2269
- /* @__PURE__ */ e(Ce, { children: h ? `Edit ${h.name}` : "New Translation Rule" }),
2270
- /* @__PURE__ */ e(Te, { children: "Set the equivalent values for each cluster. Rules with values on only one side of a pair are silently skipped for that comparison." })
2403
+ /* @__PURE__ */ e(xe, { open: l, onOpenChange: c, children: /* @__PURE__ */ n(ye, { className: "max-w-lg", children: [
2404
+ /* @__PURE__ */ n(be, { children: [
2405
+ /* @__PURE__ */ e(Ne, { children: h ? `Edit ${h.name}` : "New Translation Rule" }),
2406
+ /* @__PURE__ */ e(ve, { children: "Set the equivalent values for each cluster. Rules with values on only one side of a pair are silently skipped for that comparison." })
2271
2407
  ] }),
2272
2408
  /* @__PURE__ */ n("div", { className: "space-y-4 py-2", children: [
2273
2409
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
2274
- /* @__PURE__ */ e(le, { htmlFor: "tr-name", children: "Name" }),
2410
+ /* @__PURE__ */ e(ne, { htmlFor: "tr-name", children: "Name" }),
2275
2411
  /* @__PURE__ */ e(
2276
- ge,
2412
+ ue,
2277
2413
  {
2278
2414
  id: "tr-name",
2279
- value: x.name,
2280
- onChange: (f) => c({ ...x, name: f.target.value }),
2415
+ value: y.name,
2416
+ onChange: (g) => m({ ...y, name: g.target.value }),
2281
2417
  placeholder: "key (ex. molten-url)"
2282
2418
  }
2283
2419
  )
2284
2420
  ] }),
2285
2421
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
2286
- /* @__PURE__ */ e(le, { htmlFor: "tr-desc", children: "Description (optional)" }),
2422
+ /* @__PURE__ */ e(ne, { htmlFor: "tr-desc", children: "Description (optional)" }),
2287
2423
  /* @__PURE__ */ e(
2288
- ge,
2424
+ ue,
2289
2425
  {
2290
2426
  id: "tr-desc",
2291
- value: x.description,
2292
- onChange: (f) => c({ ...x, description: f.target.value }),
2427
+ value: y.description,
2428
+ onChange: (g) => m({ ...y, description: g.target.value }),
2293
2429
  placeholder: "Explain what this value represents"
2294
2430
  }
2295
2431
  )
2296
2432
  ] }),
2297
2433
  /* @__PURE__ */ n("div", { className: "space-y-3 pt-1", children: [
2298
2434
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "Values per cluster" }),
2299
- t.map((f) => /* @__PURE__ */ n("div", { className: "space-y-1", children: [
2300
- /* @__PURE__ */ e(le, { htmlFor: `tr-val-${f}`, className: "text-xs text-muted-foreground", children: s[f] ?? f }),
2435
+ t.map((g) => /* @__PURE__ */ n("div", { className: "space-y-1", children: [
2436
+ /* @__PURE__ */ e(ne, { htmlFor: `tr-val-${g}`, className: "text-xs text-muted-foreground", children: s[g] ?? g }),
2301
2437
  /* @__PURE__ */ e(
2302
- ge,
2438
+ ue,
2303
2439
  {
2304
- id: `tr-val-${f}`,
2305
- value: x.values[f] ?? "",
2306
- onChange: (F) => c({
2307
- ...x,
2308
- values: { ...x.values, [f]: F.target.value }
2440
+ id: `tr-val-${g}`,
2441
+ value: y.values[g] ?? "",
2442
+ onChange: (j) => m({
2443
+ ...y,
2444
+ values: { ...y.values, [g]: j.target.value }
2309
2445
  }),
2310
2446
  placeholder: "Leave blank to remove",
2311
2447
  className: "font-mono text-xs"
2312
2448
  }
2313
2449
  )
2314
- ] }, f))
2450
+ ] }, g))
2315
2451
  ] })
2316
2452
  ] }),
2317
- /* @__PURE__ */ n(Pe, { children: [
2318
- /* @__PURE__ */ n(E, { variant: "outline", onClick: g, children: [
2319
- /* @__PURE__ */ e(Ne, {}),
2453
+ /* @__PURE__ */ n(we, { children: [
2454
+ /* @__PURE__ */ n($, { variant: "outline", onClick: x, children: [
2455
+ /* @__PURE__ */ e(ge, {}),
2320
2456
  "Cancel"
2321
2457
  ] }),
2322
- /* @__PURE__ */ n(E, { onClick: w, disabled: !L || V, children: [
2323
- /* @__PURE__ */ e(bt, {}),
2324
- V ? "Saving…" : "Save"
2458
+ /* @__PURE__ */ n($, { onClick: k, disabled: !V || _, children: [
2459
+ /* @__PURE__ */ e(Nt, {}),
2460
+ _ ? "Saving…" : "Save"
2325
2461
  ] })
2326
2462
  ] })
2327
2463
  ] }) })
2328
2464
  ] });
2329
2465
  }
2330
- function Rn({
2466
+ function Mn({
2331
2467
  originConfigId: t,
2332
2468
  apiPath: s = "/release-ignores"
2333
2469
  }) {
2334
- const { toast: i } = oe(), { fetchJson: a } = te(), r = de(), d = ["imaginarium", "release-ignores", t], { data: l, isLoading: m } = ae({
2470
+ const { toast: a } = se(), { fetchJson: i } = te(), r = ae(), d = ["imaginarium", "release-ignores", t], { data: l, isLoading: c } = le({
2335
2471
  queryKey: d,
2336
2472
  queryFn: async () => {
2337
- const p = await a(
2473
+ const p = await i(
2338
2474
  `${s}?where[originConfigId]=${encodeURIComponent(t)}`
2339
2475
  );
2340
2476
  return (p == null ? void 0 : p.items) ?? [];
2341
2477
  }
2342
- }), h = _({
2343
- mutationFn: (p) => a(`${s}/${p}`, { method: "DELETE" }),
2478
+ }), h = H({
2479
+ mutationFn: (p) => i(`${s}/${p}`, { method: "DELETE" }),
2344
2480
  onSuccess: () => {
2345
- r.invalidateQueries({ queryKey: d }), i({ title: "Item removed from ignore list" });
2481
+ r.invalidateQueries({ queryKey: d }), a({ title: "Item removed from ignore list" });
2346
2482
  },
2347
2483
  onError: (p) => {
2348
- i({ title: "Error", description: p.message, variant: "destructive" });
2484
+ a({ title: "Error", description: p.message, variant: "destructive" });
2349
2485
  }
2350
- }), b = _({
2351
- mutationFn: () => a(`${s}?originConfigId=${encodeURIComponent(t)}`, {
2486
+ }), N = H({
2487
+ mutationFn: () => i(`${s}?originConfigId=${encodeURIComponent(t)}`, {
2352
2488
  method: "DELETE"
2353
2489
  }),
2354
2490
  onSuccess: () => {
2355
- r.invalidateQueries({ queryKey: d }), i({ title: "All ignore rules cleared" });
2491
+ r.invalidateQueries({ queryKey: d }), a({ title: "All ignore rules cleared" });
2356
2492
  },
2357
2493
  onError: (p) => {
2358
- i({ title: "Error", description: p.message, variant: "destructive" });
2494
+ a({ title: "Error", description: p.message, variant: "destructive" });
2359
2495
  }
2360
- }), x = () => {
2361
- window.confirm("Remove all ignore rules for this cluster? Items will appear normally in future snapshots.") && b.mutate();
2496
+ }), y = () => {
2497
+ window.confirm("Remove all ignore rules for this cluster? Items will appear normally in future snapshots.") && N.mutate();
2362
2498
  };
2363
- if (m)
2499
+ if (c)
2364
2500
  return /* @__PURE__ */ e("div", { className: "text-center text-muted-foreground py-8", children: "Loading…" });
2365
- const c = l ?? [];
2501
+ const m = l ?? [];
2366
2502
  return /* @__PURE__ */ n("div", { className: "space-y-4", children: [
2367
2503
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
2368
- /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: c.length === 0 ? "No items are permanently ignored." : `${c.length} item${c.length === 1 ? "" : "s"} permanently ignored for this cluster.` }),
2369
- c.length > 0 && /* @__PURE__ */ n(
2370
- E,
2504
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: m.length === 0 ? "No items are permanently ignored." : `${m.length} item${m.length === 1 ? "" : "s"} permanently ignored for this cluster.` }),
2505
+ m.length > 0 && /* @__PURE__ */ n(
2506
+ $,
2371
2507
  {
2372
2508
  variant: "outline",
2373
2509
  size: "sm",
2374
- onClick: x,
2375
- disabled: b.isPending,
2510
+ onClick: y,
2511
+ disabled: N.isPending,
2376
2512
  children: [
2377
- /* @__PURE__ */ e(Be, {}),
2378
- b.isPending ? "Clearing…" : "Clear all"
2513
+ /* @__PURE__ */ e(Le, {}),
2514
+ N.isPending ? "Clearing…" : "Clear all"
2379
2515
  ]
2380
2516
  }
2381
2517
  )
2382
2518
  ] }),
2383
- c.length > 0 && /* @__PURE__ */ e("div", { className: "rounded-md border", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
2519
+ m.length > 0 && /* @__PURE__ */ e("div", { className: "rounded-md border", children: /* @__PURE__ */ n("table", { className: "w-full text-sm", children: [
2384
2520
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b bg-muted/50", children: [
2385
2521
  /* @__PURE__ */ e("th", { className: "px-4 py-2 text-left font-medium", children: "Type" }),
2386
2522
  /* @__PURE__ */ e("th", { className: "px-4 py-2 text-left font-medium", children: "Name" }),
2387
2523
  /* @__PURE__ */ e("th", { className: "px-4 py-2 text-left font-medium", children: "Reason" }),
2388
2524
  /* @__PURE__ */ e("th", { className: "px-4 py-2 text-right font-medium" })
2389
2525
  ] }) }),
2390
- /* @__PURE__ */ e("tbody", { children: c.map((p) => /* @__PURE__ */ n("tr", { className: "border-b last:border-0 hover:bg-muted/25", children: [
2526
+ /* @__PURE__ */ e("tbody", { children: m.map((p) => /* @__PURE__ */ n("tr", { className: "border-b last:border-0 hover:bg-muted/25", children: [
2391
2527
  /* @__PURE__ */ e("td", { className: "px-4 py-2 text-muted-foreground font-mono text-xs", children: p.itemType }),
2392
2528
  /* @__PURE__ */ e("td", { className: "px-4 py-2 font-medium", children: p.itemName }),
2393
2529
  /* @__PURE__ */ e("td", { className: "px-4 py-2 text-muted-foreground", children: p.reason ?? /* @__PURE__ */ e("span", { className: "italic text-xs", children: "—" }) }),
2394
2530
  /* @__PURE__ */ e("td", { className: "px-4 py-2 text-right", children: /* @__PURE__ */ e(
2395
- E,
2531
+ $,
2396
2532
  {
2397
2533
  variant: "ghost",
2398
2534
  size: "icon",
2399
2535
  title: "Remove from ignore list",
2400
2536
  onClick: () => h.mutate(p.id),
2401
2537
  disabled: h.isPending,
2402
- children: /* @__PURE__ */ e(wt, {})
2538
+ children: /* @__PURE__ */ e(He, {})
2403
2539
  }
2404
2540
  ) })
2405
2541
  ] }, p.id)) })
2406
2542
  ] }) })
2407
2543
  ] });
2408
2544
  }
2409
- function An(t, s) {
2545
+ function Fn(t, s) {
2410
2546
  return [...t].sort(
2411
- (i, a) => (s[i] ?? i).localeCompare(s[a] ?? a, void 0, { sensitivity: "base" })
2547
+ (a, i) => (s[a] ?? a).localeCompare(s[i] ?? i, void 0, { sensitivity: "base" })
2412
2548
  );
2413
2549
  }
2414
- const xt = ["dev", "stg", "prd"];
2415
- function Mn(t) {
2416
- const s = (t.tags ?? []).map((a) => a.toLowerCase()), i = xt.findIndex((a) => s.includes(a));
2417
- return i === -1 ? xt.length : i;
2550
+ const yt = ["dev", "stg", "prd"];
2551
+ function qn(t) {
2552
+ const s = (t.tags ?? []).map((i) => i.toLowerCase()), a = yt.findIndex((i) => s.includes(i));
2553
+ return a === -1 ? yt.length : a;
2418
2554
  }
2419
- function Dn(t) {
2420
- const s = Object.fromEntries(t.map((r) => [r.id, r.displayName])), i = /* @__PURE__ */ new Map();
2555
+ function zn(t) {
2556
+ const s = Object.fromEntries(t.map((r) => [r.id, r.displayName])), a = /* @__PURE__ */ new Map();
2421
2557
  for (const r of t) {
2422
- const d = Mn(r);
2423
- i.has(d) || i.set(d, []), i.get(d).push(r.id);
2558
+ const d = qn(r);
2559
+ a.has(d) || a.set(d, []), a.get(d).push(r.id);
2424
2560
  }
2425
- return [...i.keys()].sort((r, d) => r - d).flatMap((r) => An(i.get(r), s));
2561
+ return [...a.keys()].sort((r, d) => r - d).flatMap((r) => Fn(a.get(r), s));
2426
2562
  }
2427
- const Fn = [
2563
+ const jn = [
2428
2564
  { id: "releases", label: "Releases" },
2429
2565
  { id: "status", label: "Status" },
2430
2566
  { id: "translations", label: "Translations" },
2431
2567
  { id: "ignored", label: "Ignored" }
2432
2568
  ];
2433
- function qn() {
2434
- var c;
2435
- const [t, s] = R("releases"), [i, a] = R(null), { configs: r } = be(), [d, l] = R("");
2436
- Qe(() => {
2569
+ function Bn() {
2570
+ var m;
2571
+ const [t, s] = R("releases"), [a, i] = R(null), { configs: r } = fe(), [d, l] = R("");
2572
+ Ue(() => {
2437
2573
  !d && r.length > 0 && l(r[0].id);
2438
2574
  }, [d, r]);
2439
- const m = q(() => {
2575
+ const c = J(() => {
2440
2576
  const p = {};
2441
- return r.forEach((P) => {
2442
- p[P.id] = P.displayName;
2577
+ return r.forEach((S) => {
2578
+ p[S.id] = S.displayName;
2443
2579
  }), p;
2444
- }, [r]), h = d || ((c = r[0]) == null ? void 0 : c.id) || "", b = q(() => Dn(r), [r]), x = b.filter((p) => p !== h);
2580
+ }, [r]), h = d || ((m = r[0]) == null ? void 0 : m.id) || "", N = J(() => zn(r), [r]), y = N.filter((p) => p !== h);
2445
2581
  return /* @__PURE__ */ n("div", { className: "space-y-6", children: [
2446
2582
  /* @__PURE__ */ n("div", { children: [
2447
2583
  /* @__PURE__ */ e("h2", { className: "text-2xl font-semibold", children: "imp" }),
2448
2584
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Manage releases across clusters" })
2449
2585
  ] }),
2450
- /* @__PURE__ */ e("div", { className: "flex items-center gap-1 border-b pb-2", children: Fn.map(({ id: p, label: P }) => /* @__PURE__ */ e(
2451
- E,
2586
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1 border-b pb-2", children: jn.map(({ id: p, label: S }) => /* @__PURE__ */ e(
2587
+ $,
2452
2588
  {
2453
2589
  variant: t === p ? "secondary" : "ghost",
2454
2590
  size: "sm",
2455
2591
  onClick: () => s(p),
2456
- children: P
2592
+ children: S
2457
2593
  },
2458
2594
  p
2459
2595
  )) }),
2460
- t === "releases" && (i == null ? /* @__PURE__ */ e(Xt, { onOpen: a }) : /* @__PURE__ */ e(En, { releaseId: i, onBack: () => a(null) })),
2596
+ t === "releases" && (a == null ? /* @__PURE__ */ e(tn, { onOpen: i }) : /* @__PURE__ */ e(In, { releaseId: a, onBack: () => i(null) })),
2461
2597
  t === "status" && (r.length === 0 ? /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "No clusters configured." }) : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
2462
2598
  /* @__PURE__ */ e("div", { className: "max-w-xs", children: /* @__PURE__ */ e(
2463
- ut,
2599
+ ht,
2464
2600
  {
2465
2601
  label: "Reference",
2466
2602
  value: h,
@@ -2468,12 +2604,12 @@ function qn() {
2468
2604
  configs: r
2469
2605
  }
2470
2606
  ) }),
2471
- h ? /* @__PURE__ */ e(On, { originConfigId: h, destConfigIds: x }) : /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "Select a reference cluster." })
2607
+ h ? /* @__PURE__ */ e(An, { originConfigId: h, destConfigIds: y }) : /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "Select a reference cluster." })
2472
2608
  ] })),
2473
- t === "translations" && (r.length === 0 ? /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "No clusters configured." }) : /* @__PURE__ */ e(In, { configIds: b, clusterNames: m })),
2609
+ t === "translations" && (r.length === 0 ? /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "No clusters configured." }) : /* @__PURE__ */ e(Dn, { configIds: N, clusterNames: c })),
2474
2610
  t === "ignored" && (r.length === 0 ? /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "No clusters configured." }) : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
2475
2611
  /* @__PURE__ */ e("div", { className: "max-w-xs", children: /* @__PURE__ */ e(
2476
- ut,
2612
+ ht,
2477
2613
  {
2478
2614
  label: "Cluster",
2479
2615
  value: h,
@@ -2481,53 +2617,53 @@ function qn() {
2481
2617
  configs: r
2482
2618
  }
2483
2619
  ) }),
2484
- h ? /* @__PURE__ */ e(Rn, { originConfigId: h }) : /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "Select a cluster." })
2620
+ h ? /* @__PURE__ */ e(Mn, { originConfigId: h }) : /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: "Select a cluster." })
2485
2621
  ] }))
2486
2622
  ] });
2487
2623
  }
2488
- const zn = {
2624
+ const Jn = {
2489
2625
  id: "imaginarium.ui.ImpPage",
2490
2626
  path: "/imp",
2491
- element: qn
2492
- }, jn = {
2627
+ element: Bn
2628
+ }, Ln = {
2493
2629
  id: "imaginarium.ui.ImpNavItem",
2494
2630
  path: "/imp",
2495
2631
  label: "imp",
2496
- icon: Vt,
2632
+ icon: Ht,
2497
2633
  sort: 150
2498
- }, Zn = {
2634
+ }, ns = {
2499
2635
  install(t) {
2500
- t.addPlugin(Mt, zn), t.addPlugin(Dt, jn), qt.register(t, Wt);
2636
+ t.addPlugin(Mt, Jn), t.addPlugin(Ft, Ln), zt.register(t, Xt);
2501
2637
  }
2502
2638
  };
2503
2639
  export {
2504
- ut as C,
2505
- Pt as D,
2506
- xe as E,
2507
- tn as I,
2508
- Zt as P,
2509
- En as R,
2510
- On as S,
2511
- lt as T,
2512
- Gt as a,
2513
- en as b,
2514
- Rn as c,
2515
- mn as d,
2516
- sn as e,
2517
- Xt as f,
2518
- Zn as g,
2640
+ ht as C,
2641
+ St as D,
2642
+ Te as E,
2643
+ an as I,
2644
+ nn as P,
2645
+ In as R,
2646
+ An as S,
2647
+ ot as T,
2648
+ Zt as a,
2649
+ sn as b,
2650
+ Mn as c,
2651
+ pn as d,
2652
+ ln as e,
2653
+ tn as f,
2654
+ ns as g,
2519
2655
  kt as h,
2520
- qn as i,
2521
- nn as j,
2522
- In as k,
2523
- vn as l,
2524
- xn as m,
2525
- Tn as n,
2526
- Xn as o,
2527
- kn as p,
2528
- Cn as q,
2529
- yn as r,
2530
- bn as t,
2531
- Ie as u
2656
+ Bn as i,
2657
+ rn as j,
2658
+ Dn as k,
2659
+ kn as l,
2660
+ Nn as m,
2661
+ En as n,
2662
+ ts as o,
2663
+ Pn as p,
2664
+ Sn as q,
2665
+ vn as r,
2666
+ wn as t,
2667
+ Re as u
2532
2668
  };
2533
- //# sourceMappingURL=PluginSetup-DxxEPoTy.js.map
2669
+ //# sourceMappingURL=PluginSetup-B-KjdUGN.js.map