@cobaltcore-dev/aurora 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +141 -0
  3. package/dist/client/AuroraApp.d.ts +7 -0
  4. package/dist/client/AuthProvider-D-5Jpa6F.mjs +100 -0
  5. package/dist/client/AuthProvider-D-5Jpa6F.mjs.map +1 -0
  6. package/dist/client/ContentHeader-H8KGY3Wd.mjs +81 -0
  7. package/dist/client/ContentHeader-H8KGY3Wd.mjs.map +1 -0
  8. package/dist/client/DeleteFlavorModal-B98oiHWx.mjs +629 -0
  9. package/dist/client/DeleteFlavorModal-B98oiHWx.mjs.map +1 -0
  10. package/dist/client/EditSecurityGroupModal-wQVNIVg1.mjs +137 -0
  11. package/dist/client/EditSecurityGroupModal-wQVNIVg1.mjs.map +1 -0
  12. package/dist/client/FloatingIpActionModals-qu1NMI5a.mjs +417 -0
  13. package/dist/client/FloatingIpActionModals-qu1NMI5a.mjs.map +1 -0
  14. package/dist/client/ImageToastNotifications-wsQDNEh7.mjs +1267 -0
  15. package/dist/client/ImageToastNotifications-wsQDNEh7.mjs.map +1 -0
  16. package/dist/client/ListToolbar-CHlkZrpl.mjs +223 -0
  17. package/dist/client/ListToolbar-CHlkZrpl.mjs.map +1 -0
  18. package/dist/client/RouteError-BwgDIwJE.mjs +25 -0
  19. package/dist/client/RouteError-BwgDIwJE.mjs.map +1 -0
  20. package/dist/client/_auth-CsliQdkJ.mjs +11 -0
  21. package/dist/client/_auth-CsliQdkJ.mjs.map +1 -0
  22. package/dist/client/_flavorId-D_A53VYa.mjs +56 -0
  23. package/dist/client/_flavorId-D_A53VYa.mjs.map +1 -0
  24. package/dist/client/_flavorId-DbhYLFxY.mjs +190 -0
  25. package/dist/client/_flavorId-DbhYLFxY.mjs.map +1 -0
  26. package/dist/client/_floatingIpId-BGgftRBQ.mjs +21 -0
  27. package/dist/client/_floatingIpId-BGgftRBQ.mjs.map +1 -0
  28. package/dist/client/_floatingIpId-D5myuLFz.mjs +228 -0
  29. package/dist/client/_floatingIpId-D5myuLFz.mjs.map +1 -0
  30. package/dist/client/_imageId-BoHX155h.mjs +27 -0
  31. package/dist/client/_imageId-BoHX155h.mjs.map +1 -0
  32. package/dist/client/_imageId-CTa0c3Av.mjs +530 -0
  33. package/dist/client/_imageId-CTa0c3Av.mjs.map +1 -0
  34. package/dist/client/_pcaId-C7Lrv1H_.mjs +242 -0
  35. package/dist/client/_pcaId-C7Lrv1H_.mjs.map +1 -0
  36. package/dist/client/_pcaId-DBgz5V_9.mjs +21 -0
  37. package/dist/client/_pcaId-DBgz5V_9.mjs.map +1 -0
  38. package/dist/client/_projectId-B9fln31N.mjs +8 -0
  39. package/dist/client/_projectId-B9fln31N.mjs.map +1 -0
  40. package/dist/client/_projectId-Be1Erj68.mjs +300 -0
  41. package/dist/client/_projectId-Be1Erj68.mjs.map +1 -0
  42. package/dist/client/_projectId-C-E4NNgo.mjs +84 -0
  43. package/dist/client/_projectId-C-E4NNgo.mjs.map +1 -0
  44. package/dist/client/_projectId-INhedXor.mjs +26 -0
  45. package/dist/client/_projectId-INhedXor.mjs.map +1 -0
  46. package/dist/client/_securityGroupId-DQoRQ-yA.mjs +1647 -0
  47. package/dist/client/_securityGroupId-DQoRQ-yA.mjs.map +1 -0
  48. package/dist/client/_securityGroupId-ihjy8Lcd.mjs +21 -0
  49. package/dist/client/_securityGroupId-ihjy8Lcd.mjs.map +1 -0
  50. package/dist/client/about-oT6ccz8T.mjs +92 -0
  51. package/dist/client/about-oT6ccz8T.mjs.map +1 -0
  52. package/dist/client/aurora-D_NPTbo-.mjs +19 -0
  53. package/dist/client/aurora-D_NPTbo-.mjs.map +1 -0
  54. package/dist/client/build-eu9eg0zF.mjs +14619 -0
  55. package/dist/client/build-eu9eg0zF.mjs.map +1 -0
  56. package/dist/client/buildFilterParams-BDOIRDeD.mjs +15 -0
  57. package/dist/client/buildFilterParams-BDOIRDeD.mjs.map +1 -0
  58. package/dist/client/cn-C3laVXMm.mjs +10 -0
  59. package/dist/client/cn-C3laVXMm.mjs.map +1 -0
  60. package/dist/client/constants-ByHCdNsI.mjs +128 -0
  61. package/dist/client/constants-ByHCdNsI.mjs.map +1 -0
  62. package/dist/client/containers-B_ozmVlx.mjs +74 -0
  63. package/dist/client/containers-B_ozmVlx.mjs.map +1 -0
  64. package/dist/client/containers-Dx7TYruP.mjs +7 -0
  65. package/dist/client/containers-Dx7TYruP.mjs.map +1 -0
  66. package/dist/client/containers-rn_ntCJu.mjs +3029 -0
  67. package/dist/client/containers-rn_ntCJu.mjs.map +1 -0
  68. package/dist/client/flavors-CT4auvLO.mjs +565 -0
  69. package/dist/client/flavors-CT4auvLO.mjs.map +1 -0
  70. package/dist/client/flavors-DRZb9LJP.mjs +8 -0
  71. package/dist/client/flavors-DRZb9LJP.mjs.map +1 -0
  72. package/dist/client/flavors-DtgMd0Ii.mjs +12 -0
  73. package/dist/client/flavors-DtgMd0Ii.mjs.map +1 -0
  74. package/dist/client/floatingips-DG5cFJSZ.mjs +12 -0
  75. package/dist/client/floatingips-DG5cFJSZ.mjs.map +1 -0
  76. package/dist/client/floatingips-iCMR0ZiL.mjs +436 -0
  77. package/dist/client/floatingips-iCMR0ZiL.mjs.map +1 -0
  78. package/dist/client/formatBytes-GYujK0dP.mjs +38 -0
  79. package/dist/client/formatBytes-GYujK0dP.mjs.map +1 -0
  80. package/dist/client/helpers--JWXi40U.mjs +6 -0
  81. package/dist/client/helpers--JWXi40U.mjs.map +1 -0
  82. package/dist/client/hooks-s-I8vWww.mjs +2 -0
  83. package/dist/client/images-BTqRflJv2.mjs +1794 -0
  84. package/dist/client/images-BTqRflJv2.mjs.map +1 -0
  85. package/dist/client/images-DRTfx8k2.mjs +8 -0
  86. package/dist/client/images-DRTfx8k2.mjs.map +1 -0
  87. package/dist/client/images-xBfsjxkX.mjs +12 -0
  88. package/dist/client/images-xBfsjxkX.mjs.map +1 -0
  89. package/dist/client/index.d.ts +1 -0
  90. package/dist/client/index.js +1033 -0
  91. package/dist/client/index.js.map +1 -0
  92. package/dist/client/md-CI9FmfYv.mjs +390 -0
  93. package/dist/client/md-CI9FmfYv.mjs.map +1 -0
  94. package/dist/client/network-DFVVVNS5.mjs +8 -0
  95. package/dist/client/network-DFVVVNS5.mjs.map +1 -0
  96. package/dist/client/objects-CKk6cST_.mjs +4762 -0
  97. package/dist/client/objects-CKk6cST_.mjs.map +1 -0
  98. package/dist/client/objects-DkDKVSmQ.mjs +8 -0
  99. package/dist/client/objects-DkDKVSmQ.mjs.map +1 -0
  100. package/dist/client/objects-r_Vl31oj.mjs +80 -0
  101. package/dist/client/objects-r_Vl31oj.mjs.map +1 -0
  102. package/dist/client/overview-B7pXx6bt.mjs +173 -0
  103. package/dist/client/overview-B7pXx6bt.mjs.map +1 -0
  104. package/dist/client/overview-CKGLIu6W.mjs +12 -0
  105. package/dist/client/overview-CKGLIu6W.mjs.map +1 -0
  106. package/dist/client/overview-Ca8r3SAz.mjs +16 -0
  107. package/dist/client/overview-Ca8r3SAz.mjs.map +1 -0
  108. package/dist/client/overview-DkPM0Od5.mjs +12 -0
  109. package/dist/client/overview-DkPM0Od5.mjs.map +1 -0
  110. package/dist/client/overview-Dxm7Ef3X.mjs +12 -0
  111. package/dist/client/overview-Dxm7Ef3X.mjs.map +1 -0
  112. package/dist/client/overview-ag4Envez.mjs +16 -0
  113. package/dist/client/overview-ag4Envez.mjs.map +1 -0
  114. package/dist/client/pca-BGv7Mprl.mjs +12 -0
  115. package/dist/client/pca-BGv7Mprl.mjs.map +1 -0
  116. package/dist/client/pca-DpULpMu5.mjs +167 -0
  117. package/dist/client/pca-DpULpMu5.mjs.map +1 -0
  118. package/dist/client/projects-BuN69cxO.mjs +144 -0
  119. package/dist/client/projects-BuN69cxO.mjs.map +1 -0
  120. package/dist/client/projects-D1pP0XdA.mjs +12 -0
  121. package/dist/client/projects-D1pP0XdA.mjs.map +1 -0
  122. package/dist/client/projects-MbS1USl2.mjs +7 -0
  123. package/dist/client/projects-MbS1USl2.mjs.map +1 -0
  124. package/dist/client/projects-_Dfn6eQT.mjs +22 -0
  125. package/dist/client/projects-_Dfn6eQT.mjs.map +1 -0
  126. package/dist/client/securitygroups-DURjFfYK.mjs +12 -0
  127. package/dist/client/securitygroups-DURjFfYK.mjs.map +1 -0
  128. package/dist/client/securitygroups-KC2qvmH8.mjs +442 -0
  129. package/dist/client/securitygroups-KC2qvmH8.mjs.map +1 -0
  130. package/dist/client/trpcClient-BxguzNYF.mjs +57 -0
  131. package/dist/client/trpcClient-BxguzNYF.mjs.map +1 -0
  132. package/dist/client/useErrorTranslation-TZVwIAzq.mjs +83 -0
  133. package/dist/client/useErrorTranslation-TZVwIAzq.mjs.map +1 -0
  134. package/dist/client/useListWithFiltering-mMX_EfyI.mjs +32 -0
  135. package/dist/client/useListWithFiltering-mMX_EfyI.mjs.map +1 -0
  136. package/dist/client/useModal-Dg4CBeqL.mjs +12 -0
  137. package/dist/client/useModal-Dg4CBeqL.mjs.map +1 -0
  138. package/dist/client/useProjectId-BWaeJZOy.mjs +11 -0
  139. package/dist/client/useProjectId-BWaeJZOy.mjs.map +1 -0
  140. package/dist/server/index.d.ts +35 -0
  141. package/dist/server/index.js +36514 -0
  142. package/package.json +129 -0
@@ -0,0 +1,1267 @@
1
+ import { $ as e, D as t, H as n, I as r, N as i, Q as a, S as o, W as s, a as c, b as l, g as u, h as d, i as f, it as p, j as m, k as h, q as g, s as _, v } from "./build-eu9eg0zF.mjs";
2
+ import { r as y } from "./trpcClient-BxguzNYF.mjs";
3
+ import { n as b } from "./formatBytes-GYujK0dP.mjs";
4
+ import { t as x } from "./useProjectId-BWaeJZOy.mjs";
5
+ import "./hooks-s-I8vWww.mjs";
6
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
7
+ import { useEffect as T, useMemo as E, useState as D } from "react";
8
+ import { Trans as O, useLingui as k } from "@lingui/react";
9
+ //#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/SizeDisplay.tsx
10
+ function A({ size: e }) {
11
+ return e === void 0 ? /* @__PURE__ */ C("span", { children: "N/A" }) : /* @__PURE__ */ C("span", { children: b(e) });
12
+ }
13
+ //#endregion
14
+ //#region src/client/routes/_auth/projects/$projectId/compute/-constants/filters.ts
15
+ var j = {
16
+ PENDING: "pending",
17
+ ACCEPTED: "accepted",
18
+ REJECTED: "rejected",
19
+ ALL: "all"
20
+ }, M = {
21
+ QUEUED: "queued",
22
+ SAVING: "saving",
23
+ ACTIVE: "active",
24
+ DEACTIVATED: "deactivated",
25
+ KILLED: "killed",
26
+ DELETED: "deleted",
27
+ PENDING_DELETE: "pending_delete"
28
+ }, N = {
29
+ PUBLIC: "public",
30
+ PRIVATE: "private",
31
+ SHARED: "shared",
32
+ COMMUNITY: "community",
33
+ ALL: "all"
34
+ }, P = {
35
+ AMI: "ami",
36
+ ARI: "ari",
37
+ AKI: "aki",
38
+ VHD: "vhd",
39
+ VHDX: "vhdx",
40
+ VMDK: "vmdk",
41
+ RAW: "raw",
42
+ QCOW2: "qcow2",
43
+ VDI: "vdi",
44
+ ISO: "iso",
45
+ PLOOP: "ploop"
46
+ }, F = {
47
+ AMI: "ami",
48
+ ARI: "ari",
49
+ AKI: "aki",
50
+ BARE: "bare",
51
+ OVF: "ovf",
52
+ OVA: "ova",
53
+ DOCKER: "docker"
54
+ }, I = ({ memberId: t, imageId: n, errors: a, isLoading: o, onMemberIdChange: s, onSave: c, onCancel: l }) => {
55
+ let { i18n: d, _: f } = k();
56
+ return /* @__PURE__ */ w(r, { children: [
57
+ /* @__PURE__ */ C(i, {
58
+ className: "break-all",
59
+ children: n
60
+ }),
61
+ /* @__PURE__ */ C(i, {
62
+ className: "pl-0",
63
+ children: /* @__PURE__ */ C(e, {
64
+ value: t,
65
+ onChange: (e) => s(e.target.value),
66
+ placeholder: d._({ id: "TpGxnq" }),
67
+ errortext: a.memberId,
68
+ required: !0
69
+ })
70
+ }),
71
+ /* @__PURE__ */ C(i, {}),
72
+ /* @__PURE__ */ C(i, { children: /* @__PURE__ */ w(v, { children: [/* @__PURE__ */ C(u, {
73
+ icon: "check",
74
+ onClick: c,
75
+ variant: "primary",
76
+ title: d._({ id: "3Qn0me" }),
77
+ disabled: o
78
+ }), /* @__PURE__ */ C(u, {
79
+ icon: "cancel",
80
+ onClick: l,
81
+ title: d._({ id: "dEgA5A" }),
82
+ disabled: o
83
+ })] }) })
84
+ ] });
85
+ }, L = ({ member: e, isDeleting: t, onDelete: n, canDelete: a }) => {
86
+ let { i18n: o, _: c } = k(), [l, d] = D(!1);
87
+ T(() => {
88
+ if (l) {
89
+ let e = setTimeout(() => {
90
+ d(!1);
91
+ }, 3e3);
92
+ return () => clearTimeout(e);
93
+ }
94
+ }, [l]);
95
+ let f = () => {
96
+ d(!1), n();
97
+ };
98
+ return /* @__PURE__ */ w(r, { children: [
99
+ /* @__PURE__ */ C(i, {
100
+ className: "break-all",
101
+ children: e.image_id
102
+ }),
103
+ /* @__PURE__ */ C(i, {
104
+ className: "break-all",
105
+ children: e.member_id
106
+ }),
107
+ /* @__PURE__ */ C(i, {
108
+ className: `break-all text-theme-${((e) => {
109
+ switch (e) {
110
+ case j.PENDING: return "warning";
111
+ case j.ACCEPTED: return "success";
112
+ case j.REJECTED: return "danger";
113
+ default: return "default";
114
+ }
115
+ })(e.status)}`,
116
+ children: ((e) => {
117
+ switch (e) {
118
+ case j.PENDING: return o._({ id: "UbRKMZ" });
119
+ case j.ACCEPTED: return o._({ id: "bzMKg7" });
120
+ case j.REJECTED: return o._({ id: "ekCRTP" });
121
+ default: return e;
122
+ }
123
+ })(e.status)
124
+ }),
125
+ /* @__PURE__ */ C(i, { children: t ? /* @__PURE__ */ C(g, {
126
+ distribution: "center",
127
+ alignment: "center",
128
+ children: /* @__PURE__ */ C(s, { variant: "primary" })
129
+ }) : /* @__PURE__ */ C(g, {
130
+ distribution: "end",
131
+ alignment: "end",
132
+ children: (() => {
133
+ if (!a) return /* @__PURE__ */ C(S, {});
134
+ if (l) return /* @__PURE__ */ C(u, {
135
+ variant: "primary-danger",
136
+ onClick: f,
137
+ title: o._({ id: "n9jJG6" }),
138
+ "aria-label": o._({ id: "n9jJG6" }),
139
+ "data-testid": "confirm-removal",
140
+ disabled: t,
141
+ children: o._({ id: "t/YqKh" })
142
+ });
143
+ {
144
+ let n = e.member_id;
145
+ return /* @__PURE__ */ C(u, {
146
+ icon: "deleteForever",
147
+ onClick: () => d(!0),
148
+ title: o._({
149
+ id: "pebLmQ",
150
+ values: { memberIdDisplay: n }
151
+ }),
152
+ "aria-label": o._({
153
+ id: "pebLmQ",
154
+ values: { memberIdDisplay: n }
155
+ }),
156
+ "data-testid": `remove-${n}`,
157
+ disabled: t
158
+ });
159
+ }
160
+ })()
161
+ }) })
162
+ ] });
163
+ };
164
+ //#endregion
165
+ //#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/ImageMembersTable.tsx
166
+ function R() {
167
+ return /* @__PURE__ */ C(r, { children: /* @__PURE__ */ C(i, {
168
+ colSpan: 4,
169
+ children: /* @__PURE__ */ C(g, {
170
+ distribution: "center",
171
+ alignment: "center",
172
+ children: /* @__PURE__ */ C(s, { variant: "primary" })
173
+ })
174
+ }) });
175
+ }
176
+ var z = ({ image: e, imageMembers: t, isMembersLoading: n, canAdd: a, canRemove: o, isAddingMember: s, setIsAddingMember: c, setMessage: d, projectId: f }) => {
177
+ let { i18n: m, _ } = k(), v = y.useUtils(), [b, x] = D(""), [T, E] = D({}), [O, A] = D(/* @__PURE__ */ new Set()), j = y.compute.createImageMember.useMutation({ onSuccess: () => {
178
+ v.compute.listImageMembers.invalidate({
179
+ project_id: f,
180
+ imageId: e.id
181
+ });
182
+ } }), M = y.compute.deleteImageMember.useMutation({ onSuccess: () => {
183
+ v.compute.listImageMembers.invalidate({
184
+ project_id: f,
185
+ imageId: e.id
186
+ });
187
+ } }), N = e.visibility === "public", P = !t || t.length === 0, F = j.isPending || M.isPending, z = () => {
188
+ let e = b.trim(), n = {};
189
+ return e ? t?.some((t) => t.member_id === e) && (n.memberId = m._({ id: "jyqLKs" })) : n.memberId = m._({ id: "S5CUKP" }), E(n), Object.keys(n).length === 0;
190
+ }, B = () => {
191
+ x(""), E({});
192
+ }, V = async () => {
193
+ if (!z()) {
194
+ d({
195
+ text: m._({ id: "CBFSfX" }),
196
+ type: "error"
197
+ });
198
+ return;
199
+ }
200
+ let t = b.trim();
201
+ try {
202
+ await j.mutateAsync({
203
+ project_id: f,
204
+ imageId: e.id,
205
+ member: t
206
+ }), d({
207
+ text: m._({
208
+ id: "Sgz1vJ",
209
+ values: { trimmedMemberId: t }
210
+ }),
211
+ type: "info"
212
+ }), B(), c(!1);
213
+ } catch (e) {
214
+ d({
215
+ text: e?.message || m._({ id: "9doWrf" }),
216
+ type: "error"
217
+ });
218
+ }
219
+ }, H = async (t) => {
220
+ A((e) => new Set(e).add(t));
221
+ try {
222
+ await M.mutateAsync({
223
+ project_id: f,
224
+ imageId: e.id,
225
+ memberId: t
226
+ }), d({
227
+ text: m._({
228
+ id: "4O2AH3",
229
+ values: { memberIdToRemove: t }
230
+ }),
231
+ type: "info"
232
+ });
233
+ } catch (e) {
234
+ d({
235
+ text: e?.message || m._({ id: "n46oLW" }) || m._({
236
+ id: "7T1fHv",
237
+ values: { memberIdToRemove: t }
238
+ }),
239
+ type: "error"
240
+ });
241
+ } finally {
242
+ A((e) => {
243
+ let n = new Set(e);
244
+ return n.delete(t), n;
245
+ });
246
+ }
247
+ };
248
+ return n ? /* @__PURE__ */ w(h, {
249
+ columns: 4,
250
+ children: [/* @__PURE__ */ w(r, { children: [
251
+ /* @__PURE__ */ C(p, { children: m._({ id: "vrPCbw" }) }),
252
+ /* @__PURE__ */ C(p, { children: m._({ id: "mSfwLL" }) }),
253
+ /* @__PURE__ */ C(p, { children: m._({ id: "uAQUqI" }) }),
254
+ /* @__PURE__ */ C(p, {})
255
+ ] }), /* @__PURE__ */ C(R, {})]
256
+ }) : N ? /* @__PURE__ */ C(l, {
257
+ text: m._({ id: "6H/Lg1" }),
258
+ variant: "info"
259
+ }) : /* @__PURE__ */ w(S, { children: [a && /* @__PURE__ */ C(g, {
260
+ direction: "horizontal",
261
+ className: "bg-theme-background-lvl-1 justify-end p-2",
262
+ children: /* @__PURE__ */ C(u, {
263
+ label: m._({ id: "VCM3KS" }),
264
+ "data-testid": "addMemberButton",
265
+ onClick: () => c(!0),
266
+ variant: "primary",
267
+ disabled: s
268
+ })
269
+ }), /* @__PURE__ */ w(h, {
270
+ columns: 4,
271
+ children: [
272
+ /* @__PURE__ */ w(r, { children: [
273
+ /* @__PURE__ */ C(p, { children: m._({ id: "vrPCbw" }) }),
274
+ /* @__PURE__ */ C(p, { children: m._({ id: "NRVSdy" }) }),
275
+ /* @__PURE__ */ C(p, { children: m._({ id: "uAQUqI" }) }),
276
+ /* @__PURE__ */ C(p, {})
277
+ ] }),
278
+ s && /* @__PURE__ */ C(I, {
279
+ memberId: b,
280
+ imageId: e.id,
281
+ errors: T,
282
+ isLoading: F,
283
+ onMemberIdChange: (e) => {
284
+ x(e), T.memberId && E((e) => ({
285
+ ...e,
286
+ memberId: void 0
287
+ }));
288
+ },
289
+ onSave: V,
290
+ onCancel: () => {
291
+ B(), c(!1), d(null);
292
+ }
293
+ }),
294
+ t?.map((e, t) => /* @__PURE__ */ C(L, {
295
+ member: e,
296
+ isDeleting: O.has(e.member_id),
297
+ onDelete: () => H(e.member_id),
298
+ canDelete: o
299
+ }, `${e.member_id}-${t}`)),
300
+ P && !s && /* @__PURE__ */ C(r, { children: /* @__PURE__ */ C(i, {
301
+ colSpan: 4,
302
+ className: "text-theme-default py-4 text-center",
303
+ children: m._({ id: "H7u085" })
304
+ }) })
305
+ ]
306
+ })] });
307
+ }, B = ({ image: r, isOpen: i, isLoading: c = !1, onClose: l, onSave: p }) => {
308
+ let { i18n: h, _: v } = k(), [y, b] = D({
309
+ name: r.name || "",
310
+ tags: r.tags || [],
311
+ visibility: r.visibility || N.PRIVATE,
312
+ protected: r.protected || !1,
313
+ min_disk: r.min_disk || 0,
314
+ min_ram: r.min_ram || 0
315
+ }), [x, S] = D(""), [T, E] = D({}), A = (e, t) => {
316
+ if (e.length !== t.length) return !1;
317
+ let n = [...e].sort(), r = [...t].sort();
318
+ return n.every((e, t) => e === r[t]);
319
+ }, j = r.name === y.name && A(r.tags || [], y.tags) && r.visibility === y.visibility && r.protected === y.protected && r.min_disk === y.min_disk && r.min_ram === y.min_ram, M = (e) => {
320
+ let { name: t, value: n, type: r, checked: i } = e.target;
321
+ b((e) => ({
322
+ ...e,
323
+ [t]: r === "checkbox" ? i : n
324
+ })), T[t] && E((e) => {
325
+ let n = { ...e };
326
+ return delete n[t], n;
327
+ });
328
+ }, P = (e, t) => {
329
+ b((n) => ({
330
+ ...n,
331
+ [e]: t
332
+ })), T[e] && E((t) => {
333
+ let n = { ...t };
334
+ return delete n[e], n;
335
+ });
336
+ }, F = (e, t) => {
337
+ let n = t === "" ? 0 : parseInt(t, 10);
338
+ isNaN(n) || (b((t) => ({
339
+ ...t,
340
+ [e]: n
341
+ })), T[e] && E((t) => {
342
+ let n = { ...t };
343
+ return delete n[e], n;
344
+ }));
345
+ }, I = (e) => {
346
+ S(e.target.value);
347
+ }, L = () => {
348
+ let e = x.trim();
349
+ if (e !== "") {
350
+ if (y.tags.includes(e)) {
351
+ S("");
352
+ return;
353
+ }
354
+ b((t) => ({
355
+ ...t,
356
+ tags: [...t.tags, e]
357
+ })), S("");
358
+ }
359
+ }, R = (e) => {
360
+ e.key === "Enter" && (e.preventDefault(), L());
361
+ }, z = (e) => {
362
+ b((t) => ({
363
+ ...t,
364
+ tags: t.tags.filter((t) => t !== e)
365
+ }));
366
+ }, B = () => {
367
+ let e = {};
368
+ return (!y.name || y.name.trim() === "") && (e.name = h._({ id: "wyIOMP" })), y.min_disk < 0 && (e.min_disk = h._({ id: "K3bUTE" })), y.min_ram < 0 && (e.min_ram = h._({ id: "PEGvy+" })), E(e), Object.keys(e).length === 0;
369
+ };
370
+ return /* @__PURE__ */ w(_, {
371
+ open: i,
372
+ onCancel: () => {
373
+ E({}), l();
374
+ },
375
+ size: "large",
376
+ title: h._({ id: "M5Epeo" }),
377
+ onConfirm: (e) => {
378
+ e.preventDefault(), B() && p({
379
+ ...r.name === y.name.trim() ? {} : { name: y.name.trim() },
380
+ ...A(r.tags || [], y.tags) ? {} : { tags: y.tags },
381
+ ...r.visibility === y.visibility ? {} : { visibility: y.visibility },
382
+ ...r.protected === y.protected ? {} : { protected: y.protected },
383
+ ...r.min_disk === y.min_disk ? {} : { min_disk: y.min_disk },
384
+ ...r.min_ram === y.min_ram ? {} : { min_ram: y.min_ram }
385
+ });
386
+ },
387
+ confirmButtonLabel: h._({ id: "IUwGEM" }),
388
+ cancelButtonLabel: h._({ id: "dEgA5A" }),
389
+ disableConfirmButton: c || j,
390
+ children: [c && /* @__PURE__ */ C(g, {
391
+ distribution: "center",
392
+ alignment: "center",
393
+ children: /* @__PURE__ */ C(s, { variant: "primary" })
394
+ }), !c && /* @__PURE__ */ w(t, { children: [/* @__PURE__ */ w(f, {
395
+ className: "mb-6",
396
+ children: [
397
+ /* @__PURE__ */ C(m, {
398
+ className: "mb-4",
399
+ children: /* @__PURE__ */ C(e, {
400
+ id: "name",
401
+ name: "name",
402
+ label: h._({ id: "ExLULX" }),
403
+ value: y.name,
404
+ onChange: M,
405
+ required: !0,
406
+ errortext: T.name
407
+ })
408
+ }),
409
+ /* @__PURE__ */ C(m, {
410
+ className: "my-6",
411
+ children: /* @__PURE__ */ w("div", {
412
+ className: "w-full",
413
+ children: [/* @__PURE__ */ w(g, {
414
+ gap: "2",
415
+ direction: "horizontal",
416
+ alignment: "start",
417
+ children: [/* @__PURE__ */ C("div", {
418
+ className: "flex-1",
419
+ children: /* @__PURE__ */ C(e, {
420
+ id: "tags",
421
+ name: "tags",
422
+ label: h._({ id: "OYHzN1" }),
423
+ value: x,
424
+ onChange: I,
425
+ onKeyDown: R,
426
+ helptext: h._({ id: "MOug+V" }),
427
+ placeholder: h._({ id: "y+KBOY" })
428
+ })
429
+ }), /* @__PURE__ */ C(u, {
430
+ variant: "primary",
431
+ onClick: L,
432
+ disabled: c || x.trim() === "",
433
+ children: /* @__PURE__ */ C(O, { id: "m16xKo" })
434
+ })]
435
+ }), y.tags.length > 0 && /* @__PURE__ */ C(g, {
436
+ gap: "2",
437
+ wrap: !0,
438
+ alignment: "center",
439
+ className: "mt-3",
440
+ children: y.tags.map((e) => /* @__PURE__ */ C(d, {
441
+ closeable: !0,
442
+ pillKey: "",
443
+ pillValue: e,
444
+ onClose: () => z(e)
445
+ }, e))
446
+ })]
447
+ })
448
+ }),
449
+ /* @__PURE__ */ C(m, {
450
+ className: "mb-4",
451
+ children: /* @__PURE__ */ w(o, {
452
+ id: "visibility",
453
+ name: "visibility",
454
+ label: h._({ id: "2q/Q7x" }),
455
+ value: y.visibility,
456
+ onChange: (e) => P("visibility", e),
457
+ children: [
458
+ /* @__PURE__ */ C(n, {
459
+ value: N.PUBLIC,
460
+ label: h._({ id: "7d1a0d" })
461
+ }),
462
+ /* @__PURE__ */ C(n, {
463
+ value: N.PRIVATE,
464
+ label: h._({ id: "zwBp5t" })
465
+ }),
466
+ /* @__PURE__ */ C(n, {
467
+ value: N.SHARED,
468
+ label: h._({ id: "0Gd0NU" })
469
+ }),
470
+ /* @__PURE__ */ C(n, {
471
+ value: N.COMMUNITY,
472
+ label: h._({ id: "chL5IG" })
473
+ })
474
+ ]
475
+ })
476
+ }),
477
+ /* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(a, {
478
+ id: "protected",
479
+ name: "protected",
480
+ label: h._({ id: "644xgx" }),
481
+ checked: y.protected,
482
+ onChange: M,
483
+ helptext: h._({ id: "lAsm87" })
484
+ }) })
485
+ ]
486
+ }), /* @__PURE__ */ w(f, {
487
+ className: "mb-6",
488
+ children: [/* @__PURE__ */ C(m, {
489
+ className: "mb-4",
490
+ children: /* @__PURE__ */ C(e, {
491
+ id: "min_disk",
492
+ name: "min_disk",
493
+ label: h._({ id: "tbwGSx" }),
494
+ type: "number",
495
+ value: String(y.min_disk),
496
+ onChange: (e) => F("min_disk", e.target.value),
497
+ helptext: h._({ id: "RFDYCD" }),
498
+ errortext: T.min_disk
499
+ })
500
+ }), /* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(e, {
501
+ id: "min_ram",
502
+ name: "min_ram",
503
+ label: h._({ id: "UYSopm" }),
504
+ type: "number",
505
+ value: String(y.min_ram),
506
+ onChange: (e) => F("min_ram", e.target.value),
507
+ helptext: h._({ id: "WErCZy" }),
508
+ errortext: T.min_ram
509
+ }) })]
510
+ })] })]
511
+ });
512
+ };
513
+ //#endregion
514
+ //#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/EditImageMetadataModal.tsx
515
+ function V(e) {
516
+ return e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e);
517
+ }
518
+ function H(e, t) {
519
+ return Object.entries(e).filter(([e]) => !t.has(e.toLowerCase())).map(([e, t]) => {
520
+ let n = V(t);
521
+ return {
522
+ key: e,
523
+ value: n,
524
+ isNew: !1,
525
+ isEditing: !1,
526
+ originalKey: e,
527
+ originalValue: n
528
+ };
529
+ });
530
+ }
531
+ function U({ isLoading: t, onClose: n, onSave: a, initialMetadata: o, excludedProperties: c }) {
532
+ let { i18n: l, _: d } = k(), [f, m] = D(o), [v, y] = D({}), [b, x] = D(!1), [S, E] = D(""), [O, A] = D(""), [j, M] = D(null);
533
+ T(() => {
534
+ if (j !== null) {
535
+ let e = setTimeout(() => M(null), 3e3);
536
+ return () => clearTimeout(e);
537
+ }
538
+ }, [j]);
539
+ let N = f.every((e) => !e.isNew && e.key === e.originalKey && e.value === e.originalValue) && o.length === f.length, P = (e, t, n) => {
540
+ let r = e?.trim().toLowerCase();
541
+ return r ? c.has(r) ? l._({ id: "n3eQzA" }) : f.some((e, i) => e.key.trim().toLowerCase() === r && i !== n && e.originalKey !== t) ? l._({ id: "i6/ygf" }) : null : l._({ id: "QV1ZPO" });
542
+ }, F = () => {
543
+ let e = P(S, void 0, f.length);
544
+ if (e) {
545
+ y({ newKey: e });
546
+ return;
547
+ }
548
+ if (!O.trim()) {
549
+ y({ newValue: l._({ id: "hXUWyd" }) });
550
+ return;
551
+ }
552
+ m([...f, {
553
+ key: S.trim(),
554
+ value: O.trim(),
555
+ isNew: !0,
556
+ isEditing: !1
557
+ }]), E(""), A(""), x(!1), y({});
558
+ }, I = () => {
559
+ E(""), A(""), x(!1), y({});
560
+ }, L = (e) => {
561
+ M(null), m(f.map((t, n) => n === e ? {
562
+ ...t,
563
+ isEditing: !0
564
+ } : {
565
+ ...t,
566
+ isEditing: !1
567
+ })), x(!1);
568
+ }, R = (e) => {
569
+ let t = f[e], n = P(t.key, t.originalKey, e);
570
+ if (n) {
571
+ y({ [`edit-${e}`]: n });
572
+ return;
573
+ }
574
+ if (!t.value.trim()) {
575
+ y({ [`edit-${e}`]: l._({ id: "hXUWyd" }) });
576
+ return;
577
+ }
578
+ m(f.map((t, n) => n === e ? {
579
+ ...t,
580
+ isEditing: !1,
581
+ key: t.key.trim(),
582
+ value: t.value.trim()
583
+ } : t)), y({});
584
+ }, z = (e) => {
585
+ m(f.map((t, n) => n === e ? {
586
+ ...t,
587
+ isEditing: !1,
588
+ key: t.originalKey ?? t.key,
589
+ value: t.originalValue ?? t.value
590
+ } : t)), y({});
591
+ }, B = (e) => {
592
+ m(f.filter((t, n) => n !== e)), M(null), y({});
593
+ }, V = (e, t) => {
594
+ m(f.map((n, r) => r === e ? {
595
+ ...n,
596
+ key: t
597
+ } : n)), v[`edit-${e}`] && y((t) => {
598
+ let n = { ...t };
599
+ return delete n[`edit-${e}`], n;
600
+ });
601
+ }, H = (e, t) => {
602
+ m(f.map((n, r) => r === e ? {
603
+ ...n,
604
+ value: t
605
+ } : n)), v[`edit-${e}`] && y((t) => {
606
+ let n = { ...t };
607
+ return delete n[`edit-${e}`], n;
608
+ });
609
+ };
610
+ return /* @__PURE__ */ w(_, {
611
+ open: !0,
612
+ onCancel: () => {
613
+ m(o), x(!1), E(""), A(""), y({}), n();
614
+ },
615
+ size: "large",
616
+ title: l._({ id: "yTtJTy" }),
617
+ onConfirm: async () => {
618
+ let e = {}, t = Object.fromEntries(o.filter((e) => !f.map((e) => e.originalKey).includes(e.originalKey) || !f.map((e) => e.key).includes(e.key)).map((e) => [e.key, null]));
619
+ f.filter((e) => e.isNew || e.value !== e.originalValue || e.key !== e.originalKey).forEach((t) => {
620
+ e[t.key] = t.value;
621
+ }), await a({
622
+ ...e,
623
+ ...t
624
+ }) && n();
625
+ },
626
+ confirmButtonLabel: l._({ id: "IUwGEM" }),
627
+ cancelButtonLabel: l._({ id: "dEgA5A" }),
628
+ disableConfirmButton: t || b || f.some((e) => e.isEditing) || N,
629
+ children: [t && /* @__PURE__ */ C(g, {
630
+ distribution: "center",
631
+ alignment: "center",
632
+ children: /* @__PURE__ */ C(s, { variant: "primary" })
633
+ }), !t && /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C(g, {
634
+ direction: "horizontal",
635
+ className: "jn:bg-theme-background-lvl-1 mb-4 justify-end p-2",
636
+ children: /* @__PURE__ */ C(u, {
637
+ label: l._({ id: "sWBLli" }),
638
+ onClick: () => x(!0),
639
+ variant: "primary",
640
+ disabled: b || f.some((e) => e.isEditing),
641
+ icon: "addCircle"
642
+ })
643
+ }), /* @__PURE__ */ w(h, {
644
+ columns: 3,
645
+ minContentColumns: [2],
646
+ className: "mb-6",
647
+ children: [
648
+ /* @__PURE__ */ w(r, { children: [
649
+ /* @__PURE__ */ C(p, { children: l._({ id: "T8N6oi" }) }),
650
+ /* @__PURE__ */ C(p, { children: l._({ id: "wMHvYH" }) }),
651
+ /* @__PURE__ */ C(p, {})
652
+ ] }),
653
+ b && /* @__PURE__ */ w(r, { children: [
654
+ /* @__PURE__ */ C(i, { children: /* @__PURE__ */ C(e, {
655
+ value: S,
656
+ onChange: (e) => {
657
+ E(e.target.value), v.newKey && y((e) => {
658
+ let t = { ...e };
659
+ return delete t.newKey, t;
660
+ });
661
+ },
662
+ placeholder: l._({ id: "x9AdZ8" }),
663
+ errortext: v.newKey,
664
+ autoFocus: !0
665
+ }) }),
666
+ /* @__PURE__ */ C(i, { children: /* @__PURE__ */ C(e, {
667
+ value: O,
668
+ onChange: (e) => {
669
+ A(e.target.value), v.newValue && y((e) => {
670
+ let t = { ...e };
671
+ return delete t.newValue, t;
672
+ });
673
+ },
674
+ placeholder: l._({ id: "wMHvYH" }),
675
+ errortext: v.newValue
676
+ }) }),
677
+ /* @__PURE__ */ C(i, { children: /* @__PURE__ */ w(g, {
678
+ direction: "horizontal",
679
+ gap: "2",
680
+ children: [/* @__PURE__ */ C(u, {
681
+ size: "small",
682
+ variant: "primary",
683
+ onClick: F,
684
+ icon: "check",
685
+ title: l._({ id: "tfDRzk" })
686
+ }), /* @__PURE__ */ C(u, {
687
+ size: "small",
688
+ variant: "subdued",
689
+ onClick: I,
690
+ icon: "close",
691
+ title: l._({ id: "bzSI52" })
692
+ })]
693
+ }) })
694
+ ] }),
695
+ f.map((t, n) => /* @__PURE__ */ w(r, { children: [
696
+ /* @__PURE__ */ C(i, { children: t.isEditing ? /* @__PURE__ */ C(e, {
697
+ value: t.key,
698
+ onChange: (e) => V(n, e.target.value),
699
+ errortext: v[`edit-${n}`]
700
+ }) : /* @__PURE__ */ C("span", {
701
+ className: "jn:text-theme-high block max-w-xs truncate font-mono",
702
+ title: t.key,
703
+ children: t.key
704
+ }) }),
705
+ /* @__PURE__ */ C(i, { children: t.isEditing ? /* @__PURE__ */ C(e, {
706
+ value: t.value,
707
+ onChange: (e) => H(n, e.target.value)
708
+ }) : /* @__PURE__ */ C("span", {
709
+ className: "jn:text-theme-default block max-w-md truncate",
710
+ title: t.value,
711
+ children: t.value
712
+ }) }),
713
+ /* @__PURE__ */ C(i, { children: t.isEditing ? /* @__PURE__ */ w(g, {
714
+ direction: "horizontal",
715
+ gap: "2",
716
+ children: [/* @__PURE__ */ C(u, {
717
+ size: "small",
718
+ variant: "primary",
719
+ onClick: () => R(n),
720
+ icon: "check",
721
+ title: l._({ id: "tfDRzk" })
722
+ }), /* @__PURE__ */ C(u, {
723
+ size: "small",
724
+ variant: "subdued",
725
+ onClick: () => z(n),
726
+ icon: "close",
727
+ title: l._({ id: "bzSI52" })
728
+ })]
729
+ }) : /* @__PURE__ */ w(g, {
730
+ direction: "horizontal",
731
+ gap: "2",
732
+ children: [j !== n && /* @__PURE__ */ C(u, {
733
+ size: "small",
734
+ variant: "subdued",
735
+ onClick: () => L(n),
736
+ icon: "edit",
737
+ "data-testid": `edit-${t.key}`,
738
+ title: l._({ id: "ePK91l" }),
739
+ disabled: b || f.some((e) => e.isEditing)
740
+ }), j === n ? /* @__PURE__ */ C(u, {
741
+ size: "small",
742
+ variant: "primary-danger",
743
+ onClick: () => B(n),
744
+ "data-testid": `confirm-delete-${t.key}`,
745
+ title: l._({ id: "cnGeoo" }),
746
+ disabled: b || f.some((e) => e.isEditing),
747
+ children: l._({ id: "cnGeoo" })
748
+ }) : /* @__PURE__ */ C(u, {
749
+ size: "small",
750
+ onClick: () => M(n),
751
+ icon: "deleteForever",
752
+ "data-testid": `delete-${t.key}`,
753
+ title: l._({ id: "cnGeoo" }),
754
+ disabled: b || f.some((e) => e.isEditing)
755
+ })]
756
+ }) })
757
+ ] }, `${t.originalKey}-${n}`)),
758
+ f.length === 0 && !b && /* @__PURE__ */ C(r, { children: /* @__PURE__ */ C(i, {
759
+ colSpan: 3,
760
+ className: "jn:text-theme-light py-8 text-center",
761
+ children: /* @__PURE__ */ C(g, {
762
+ alignment: "center",
763
+ children: /* @__PURE__ */ C("span", { children: l._({ id: "t1POAD" }) })
764
+ })
765
+ }) })
766
+ ]
767
+ })] })]
768
+ });
769
+ }
770
+ var W = ({ image: e, isOpen: t, isLoading: n = !1, onClose: r, onSave: i }) => {
771
+ let { i18n: a, _: o } = k(), c = x(), { data: l, isLoading: u, isError: d } = y.compute.getImageMetadataExcludedProperties.useQuery({ project_id: c }, { enabled: t }), f = E(() => new Set((l ?? []).map((e) => e.toLowerCase())), [l]), p = E(() => H(e, f), [
772
+ e.id,
773
+ e.updated_at,
774
+ f
775
+ ]);
776
+ return t ? u ? /* @__PURE__ */ C(_, {
777
+ open: !0,
778
+ onCancel: r,
779
+ size: "large",
780
+ title: a._({ id: "yTtJTy" }),
781
+ children: /* @__PURE__ */ C(g, {
782
+ distribution: "center",
783
+ alignment: "center",
784
+ children: /* @__PURE__ */ C(s, { variant: "primary" })
785
+ })
786
+ }) : d ? /* @__PURE__ */ C(_, {
787
+ open: !0,
788
+ onCancel: r,
789
+ size: "large",
790
+ title: a._({ id: "yTtJTy" }),
791
+ children: /* @__PURE__ */ C(g, {
792
+ distribution: "center",
793
+ alignment: "center",
794
+ children: /* @__PURE__ */ C("span", { children: a._({ id: "PYQUjU" }) })
795
+ })
796
+ }) : /* @__PURE__ */ C(U, {
797
+ isLoading: n,
798
+ onClose: r,
799
+ onSave: i,
800
+ initialMetadata: p,
801
+ excludedProperties: f
802
+ }, `${e.id}-${e.updated_at}-${f.size}`) : null;
803
+ }, G = ({ image: e, isOpen: t, isLoading: n, isDisabled: a, onClose: o, onDelete: d }) => {
804
+ if (!e) return null;
805
+ let { i18n: f, _: m } = k(), y = (t) => {
806
+ t.preventDefault(), d(e);
807
+ };
808
+ return /* @__PURE__ */ w(_, {
809
+ onCancel: o,
810
+ size: "small",
811
+ title: "Delete Image",
812
+ open: t,
813
+ modalFooter: /* @__PURE__ */ C(c, {
814
+ className: "flex justify-end",
815
+ children: /* @__PURE__ */ w(v, { children: [/* @__PURE__ */ C(u, {
816
+ variant: "default",
817
+ onClick: o,
818
+ children: /* @__PURE__ */ C(O, { id: "dEgA5A" })
819
+ }), /* @__PURE__ */ C(u, {
820
+ variant: "primary-danger",
821
+ onClick: (e) => {
822
+ y(e), o();
823
+ },
824
+ disabled: n || a,
825
+ "data-testid": "delete-image-button",
826
+ children: n ? /* @__PURE__ */ C(s, { size: "small" }) : /* @__PURE__ */ C(O, { id: "cnGeoo" })
827
+ })] })
828
+ }),
829
+ children: [n && /* @__PURE__ */ C(g, {
830
+ distribution: "center",
831
+ alignment: "center",
832
+ children: /* @__PURE__ */ C(s, { variant: "primary" })
833
+ }), !n && /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C(l, {
834
+ text: f._({ id: "2zceEg" }),
835
+ variant: "danger",
836
+ className: "mb-4"
837
+ }), e && /* @__PURE__ */ w(h, {
838
+ columns: 2,
839
+ children: [
840
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: f._({ id: "6YtxFj" }) }), /* @__PURE__ */ C(i, { children: e.name || f._({ id: "MEIAzV" }) })] }),
841
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: f._({ id: "dFb5Nt" }) }), /* @__PURE__ */ C(i, { children: e.id })] }),
842
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: f._({ id: "uAQUqI" }) }), /* @__PURE__ */ C(i, { children: e.status })] }),
843
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: f._({ id: "2q/Q7x" }) }), /* @__PURE__ */ C(i, { children: e.visibility })] }),
844
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: f._({ id: "Cj2Gtd" }) }), /* @__PURE__ */ C(i, { children: /* @__PURE__ */ C(A, { size: e.size }) })] }),
845
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: f._({ id: "NopYGU" }) }), /* @__PURE__ */ C(i, { children: e.disk_format || f._({ id: "fj5byd" }) })] }),
846
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: f._({ id: "d+F6q9" }) }), /* @__PURE__ */ C(i, { children: e.created_at ? new Date(e.created_at).toLocaleDateString() : f._({ id: "fj5byd" }) })] })
847
+ ]
848
+ })] })]
849
+ });
850
+ }, K = ({ image: e, isOpen: t, isLoading: n, onClose: a, onActivate: o }) => {
851
+ if (!e) return null;
852
+ let { i18n: c, _: l } = k();
853
+ return /* @__PURE__ */ w(_, {
854
+ onCancel: a,
855
+ size: "small",
856
+ title: c._({ id: "RSFkXF" }),
857
+ open: t,
858
+ onConfirm: (t) => {
859
+ t.preventDefault(), o(e);
860
+ },
861
+ confirmButtonLabel: c._({ id: "FQBaXG" }),
862
+ cancelButtonLabel: c._({ id: "dEgA5A" }),
863
+ disableConfirmButton: n,
864
+ children: [n && /* @__PURE__ */ C(g, {
865
+ distribution: "center",
866
+ alignment: "center",
867
+ children: /* @__PURE__ */ C(s, { variant: "primary" })
868
+ }), !n && /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
869
+ className: "mb-6",
870
+ children: /* @__PURE__ */ C(O, { id: "+NwLgN" })
871
+ }), /* @__PURE__ */ w(h, {
872
+ columns: 2,
873
+ children: [
874
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "6YtxFj" }) }), /* @__PURE__ */ C(i, { children: e.name || c._({ id: "MEIAzV" }) })] }),
875
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "dFb5Nt" }) }), /* @__PURE__ */ C(i, { children: e.id })] }),
876
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "uAQUqI" }) }), /* @__PURE__ */ C(i, { children: e.status })] }),
877
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "2q/Q7x" }) }), /* @__PURE__ */ C(i, { children: e.visibility })] }),
878
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "Cj2Gtd" }) }), /* @__PURE__ */ C(i, { children: /* @__PURE__ */ C(A, { size: e.size }) })] }),
879
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "NopYGU" }) }), /* @__PURE__ */ C(i, { children: e.disk_format || c._({ id: "fj5byd" }) })] }),
880
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "d+F6q9" }) }), /* @__PURE__ */ C(i, { children: (() => {
881
+ let t = new Date(e.created_at ?? "");
882
+ return isNaN(t.getTime()) ? c._({ id: "fj5byd" }) : t.toLocaleDateString();
883
+ })() })] })
884
+ ]
885
+ })] })]
886
+ });
887
+ }, q = ({ image: e, isOpen: t, isLoading: n, onClose: a, onDeactivate: o }) => {
888
+ if (!e) return null;
889
+ let { i18n: c, _: l } = k();
890
+ return /* @__PURE__ */ w(_, {
891
+ onCancel: a,
892
+ size: "small",
893
+ title: c._({ id: "hQr1Cr" }),
894
+ open: t,
895
+ onConfirm: (t) => {
896
+ t.preventDefault(), o(e);
897
+ },
898
+ confirmButtonLabel: c._({ id: "5y3O+A" }),
899
+ cancelButtonLabel: c._({ id: "dEgA5A" }),
900
+ disableConfirmButton: n,
901
+ children: [n && /* @__PURE__ */ C(g, {
902
+ distribution: "center",
903
+ alignment: "center",
904
+ children: /* @__PURE__ */ C(s, { variant: "primary" })
905
+ }), !n && /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
906
+ className: "mb-6",
907
+ children: /* @__PURE__ */ C(O, { id: "8TSI9h" })
908
+ }), /* @__PURE__ */ w(h, {
909
+ columns: 2,
910
+ children: [
911
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "6YtxFj" }) }), /* @__PURE__ */ C(i, { children: e.name || c._({ id: "MEIAzV" }) })] }),
912
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "dFb5Nt" }) }), /* @__PURE__ */ C(i, { children: e.id })] }),
913
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "uAQUqI" }) }), /* @__PURE__ */ C(i, { children: e.status })] }),
914
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "2q/Q7x" }) }), /* @__PURE__ */ C(i, { children: e.visibility })] }),
915
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "Cj2Gtd" }) }), /* @__PURE__ */ C(i, { children: /* @__PURE__ */ C(A, { size: e.size }) })] }),
916
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "NopYGU" }) }), /* @__PURE__ */ C(i, { children: e.disk_format || c._({ id: "fj5byd" }) })] }),
917
+ /* @__PURE__ */ w(r, { children: [/* @__PURE__ */ C(p, { children: c._({ id: "d+F6q9" }) }), /* @__PURE__ */ C(i, { children: (() => {
918
+ let t = new Date(e.created_at ?? "");
919
+ return isNaN(t.getTime()) ? c._({ id: "fj5byd" }) : t.toLocaleDateString();
920
+ })() })] })
921
+ ]
922
+ })] })]
923
+ });
924
+ };
925
+ //#endregion
926
+ //#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/NotificationText.tsx
927
+ function J({ title: e, description: t }) {
928
+ return /* @__PURE__ */ w(g, {
929
+ direction: "vertical",
930
+ gap: "1.5",
931
+ children: [/* @__PURE__ */ C("span", { children: e }), /* @__PURE__ */ C("span", {
932
+ className: "text-theme-light",
933
+ children: t
934
+ })]
935
+ });
936
+ }
937
+ //#endregion
938
+ //#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/ImageToastNotifications.tsx
939
+ var Y = (e, t) => ({
940
+ variant: "success",
941
+ children: /* @__PURE__ */ C(J, {
942
+ title: /* @__PURE__ */ C(O, { id: "bM1O3m" }),
943
+ description: /* @__PURE__ */ C(O, {
944
+ id: "hHL/wm",
945
+ values: { imageName: e }
946
+ })
947
+ }),
948
+ autoDismiss: !0,
949
+ autoDismissTimeout: t.autoDismissTimeout ?? 3e3,
950
+ onDismiss: t.onDismiss
951
+ }), X = (e, t, n) => ({
952
+ variant: "error",
953
+ children: /* @__PURE__ */ C(J, {
954
+ title: /* @__PURE__ */ C(O, { id: "9iz2XW" }),
955
+ description: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(O, {
956
+ id: "9SX0bO",
957
+ values: { imageName: e }
958
+ }), t] })
959
+ }),
960
+ autoDismiss: !0,
961
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
962
+ onDismiss: n.onDismiss
963
+ }), Z = (e, t) => ({
964
+ variant: "success",
965
+ children: /* @__PURE__ */ C(J, {
966
+ title: /* @__PURE__ */ C(O, { id: "bM1O3m" }),
967
+ description: /* @__PURE__ */ C(O, {
968
+ id: "8AriEH",
969
+ values: { imageName: e }
970
+ })
971
+ }),
972
+ autoDismiss: !0,
973
+ autoDismissTimeout: t.autoDismissTimeout ?? 3e3,
974
+ onDismiss: t.onDismiss
975
+ }), Q = (e, t, n) => ({
976
+ variant: "error",
977
+ children: /* @__PURE__ */ C(J, {
978
+ title: /* @__PURE__ */ C(O, { id: "lWTy+Y" }),
979
+ description: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(O, {
980
+ id: "jhU93c",
981
+ values: { imageName: e }
982
+ }), t] })
983
+ }),
984
+ autoDismiss: !0,
985
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
986
+ onDismiss: n.onDismiss
987
+ }), $ = (e, t, n) => ({
988
+ variant: "error",
989
+ children: /* @__PURE__ */ C(J, {
990
+ title: /* @__PURE__ */ C(O, { id: "AGXLLY" }),
991
+ description: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(O, {
992
+ id: "bRgFkJ",
993
+ values: { fileName: e }
994
+ }), t] })
995
+ }),
996
+ autoDismiss: !0,
997
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
998
+ onDismiss: n.onDismiss
999
+ }), ee = (e, t) => ({
1000
+ variant: "success",
1001
+ children: /* @__PURE__ */ C(J, {
1002
+ title: /* @__PURE__ */ C(O, { id: "bM1O3m" }),
1003
+ description: /* @__PURE__ */ C(O, {
1004
+ id: "S1iTXO",
1005
+ values: { imageName: e }
1006
+ })
1007
+ }),
1008
+ autoDismiss: !0,
1009
+ autoDismissTimeout: t.autoDismissTimeout ?? 3e3,
1010
+ onDismiss: t.onDismiss
1011
+ }), te = (e, t, n) => ({
1012
+ variant: "error",
1013
+ children: /* @__PURE__ */ C(J, {
1014
+ title: /* @__PURE__ */ C(O, { id: "o/VDOG" }),
1015
+ description: /* @__PURE__ */ C(O, {
1016
+ id: "c1uL4p",
1017
+ values: {
1018
+ imageId: e,
1019
+ message: t
1020
+ }
1021
+ })
1022
+ }),
1023
+ autoDismiss: !0,
1024
+ autoDismissTimeout: n.autoDismissTimeout ?? 3e3,
1025
+ onDismiss: n.onDismiss
1026
+ }), ne = (e, t) => ({
1027
+ variant: "success",
1028
+ children: /* @__PURE__ */ C(J, {
1029
+ title: /* @__PURE__ */ C(O, { id: "bM1O3m" }),
1030
+ description: /* @__PURE__ */ C(O, {
1031
+ id: "cj17eo",
1032
+ values: { imageName: e }
1033
+ })
1034
+ }),
1035
+ autoDismiss: !0,
1036
+ autoDismissTimeout: t.autoDismissTimeout ?? 3e3,
1037
+ onDismiss: t.onDismiss
1038
+ }), re = (e, t) => ({
1039
+ variant: "success",
1040
+ children: /* @__PURE__ */ C(J, {
1041
+ title: /* @__PURE__ */ C(O, { id: "bM1O3m" }),
1042
+ description: /* @__PURE__ */ C(O, {
1043
+ id: "ZcWMT1",
1044
+ values: { imageName: e }
1045
+ })
1046
+ }),
1047
+ autoDismiss: !0,
1048
+ autoDismissTimeout: t.autoDismissTimeout ?? 3e3,
1049
+ onDismiss: t.onDismiss
1050
+ }), ie = (e, t, n) => ({
1051
+ variant: "error",
1052
+ children: /* @__PURE__ */ C(J, {
1053
+ title: /* @__PURE__ */ C(O, { id: "tiflqy" }),
1054
+ description: /* @__PURE__ */ C(O, {
1055
+ id: "9dsDHD",
1056
+ values: {
1057
+ imageId: e,
1058
+ message: t
1059
+ }
1060
+ })
1061
+ }),
1062
+ autoDismiss: !0,
1063
+ autoDismissTimeout: n.autoDismissTimeout ?? 3e3,
1064
+ onDismiss: n.onDismiss
1065
+ }), ae = (e, t, n) => ({
1066
+ variant: "error",
1067
+ children: /* @__PURE__ */ C(J, {
1068
+ title: /* @__PURE__ */ C(O, { id: "BYH/2L" }),
1069
+ description: /* @__PURE__ */ C(O, {
1070
+ id: "S63NbU",
1071
+ values: {
1072
+ imageId: e,
1073
+ message: t
1074
+ }
1075
+ })
1076
+ }),
1077
+ autoDismiss: !0,
1078
+ autoDismissTimeout: n.autoDismissTimeout ?? 3e3,
1079
+ onDismiss: n.onDismiss
1080
+ }), oe = (e, t, n) => ({
1081
+ variant: "success",
1082
+ children: /* @__PURE__ */ C(J, {
1083
+ title: /* @__PURE__ */ C(O, { id: "CFMxC8" }),
1084
+ description: /* @__PURE__ */ C(O, {
1085
+ id: "T7mgdd",
1086
+ values: {
1087
+ successCount: e,
1088
+ totalCount: t
1089
+ }
1090
+ })
1091
+ }),
1092
+ autoDismiss: !0,
1093
+ autoDismissTimeout: n.autoDismissTimeout ?? 3e3,
1094
+ onDismiss: n.onDismiss
1095
+ }), se = (e, t, n) => ({
1096
+ variant: "error",
1097
+ children: /* @__PURE__ */ C(J, {
1098
+ title: /* @__PURE__ */ C(O, { id: "fIvd7X" }),
1099
+ description: /* @__PURE__ */ C(O, {
1100
+ id: "xNZKYy",
1101
+ values: {
1102
+ failedCount: e,
1103
+ totalCount: t
1104
+ }
1105
+ })
1106
+ }),
1107
+ autoDismiss: !0,
1108
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1109
+ onDismiss: n.onDismiss
1110
+ }), ce = (e, t, n) => ({
1111
+ variant: "warning",
1112
+ children: /* @__PURE__ */ C(J, {
1113
+ title: /* @__PURE__ */ C(O, { id: "Z5r9vC" }),
1114
+ description: /* @__PURE__ */ C(O, {
1115
+ id: "plnnns",
1116
+ values: {
1117
+ successCount: e,
1118
+ failedCount: t
1119
+ }
1120
+ })
1121
+ }),
1122
+ autoDismiss: !0,
1123
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1124
+ onDismiss: n.onDismiss
1125
+ }), le = (e, t, n) => ({
1126
+ variant: "success",
1127
+ children: /* @__PURE__ */ C(J, {
1128
+ title: /* @__PURE__ */ C(O, { id: "ryf/ee" }),
1129
+ description: /* @__PURE__ */ C(O, {
1130
+ id: "J9QcnV",
1131
+ values: {
1132
+ successCount: e,
1133
+ totalCount: t
1134
+ }
1135
+ })
1136
+ }),
1137
+ autoDismiss: !0,
1138
+ autoDismissTimeout: n.autoDismissTimeout ?? 3e3,
1139
+ onDismiss: n.onDismiss
1140
+ }), ue = (e, t, n) => ({
1141
+ variant: "error",
1142
+ children: /* @__PURE__ */ C(J, {
1143
+ title: /* @__PURE__ */ C(O, { id: "9njIiV" }),
1144
+ description: /* @__PURE__ */ C(O, {
1145
+ id: "R6u5CR",
1146
+ values: {
1147
+ failedCount: e,
1148
+ totalCount: t
1149
+ }
1150
+ })
1151
+ }),
1152
+ autoDismiss: !0,
1153
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1154
+ onDismiss: n.onDismiss
1155
+ }), de = (e, t, n) => ({
1156
+ variant: "warning",
1157
+ children: /* @__PURE__ */ C(J, {
1158
+ title: /* @__PURE__ */ C(O, { id: "YZmsaT" }),
1159
+ description: /* @__PURE__ */ C(O, {
1160
+ id: "GbKqnI",
1161
+ values: {
1162
+ successCount: e,
1163
+ failedCount: t
1164
+ }
1165
+ })
1166
+ }),
1167
+ autoDismiss: !0,
1168
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1169
+ onDismiss: n.onDismiss
1170
+ }), fe = (e, t, n) => ({
1171
+ variant: "success",
1172
+ children: /* @__PURE__ */ C(J, {
1173
+ title: /* @__PURE__ */ C(O, { id: "h8h6oz" }),
1174
+ description: /* @__PURE__ */ C(O, {
1175
+ id: "ZAy0zp",
1176
+ values: {
1177
+ successCount: e,
1178
+ totalCount: t
1179
+ }
1180
+ })
1181
+ }),
1182
+ autoDismiss: !0,
1183
+ autoDismissTimeout: n.autoDismissTimeout ?? 3e3,
1184
+ onDismiss: n.onDismiss
1185
+ }), pe = (e, t, n) => ({
1186
+ variant: "error",
1187
+ children: /* @__PURE__ */ C(J, {
1188
+ title: /* @__PURE__ */ C(O, { id: "fJpv9x" }),
1189
+ description: /* @__PURE__ */ C(O, {
1190
+ id: "quU9wK",
1191
+ values: {
1192
+ failedCount: e,
1193
+ totalCount: t
1194
+ }
1195
+ })
1196
+ }),
1197
+ autoDismiss: !0,
1198
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1199
+ onDismiss: n.onDismiss
1200
+ }), me = (e, t, n) => ({
1201
+ variant: "warning",
1202
+ children: /* @__PURE__ */ C(J, {
1203
+ title: /* @__PURE__ */ C(O, { id: "JfWCsP" }),
1204
+ description: /* @__PURE__ */ C(O, {
1205
+ id: "8t1+HU",
1206
+ values: {
1207
+ successCount: e,
1208
+ failedCount: t
1209
+ }
1210
+ })
1211
+ }),
1212
+ autoDismiss: !0,
1213
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1214
+ onDismiss: n.onDismiss
1215
+ }), he = (e, t) => ({
1216
+ variant: "info",
1217
+ children: /* @__PURE__ */ C(J, {
1218
+ title: /* @__PURE__ */ C(O, { id: "V66Jih" }),
1219
+ description: /* @__PURE__ */ C(O, {
1220
+ id: "Vmojta",
1221
+ values: { newStatus: e }
1222
+ })
1223
+ }),
1224
+ autoDismiss: !0,
1225
+ autoDismissTimeout: t.autoDismissTimeout ?? 5e3,
1226
+ onDismiss: t.onDismiss
1227
+ }), ge = (e, t) => ({
1228
+ variant: "error",
1229
+ children: /* @__PURE__ */ C(J, {
1230
+ title: /* @__PURE__ */ C(O, { id: "V66Jih" }),
1231
+ description: e || /* @__PURE__ */ C(O, { id: "QYiqYb" })
1232
+ }),
1233
+ autoDismiss: !0,
1234
+ autoDismissTimeout: t.autoDismissTimeout ?? 5e3,
1235
+ onDismiss: t.onDismiss
1236
+ }), _e = (e, t, n) => ({
1237
+ variant: "success",
1238
+ children: /* @__PURE__ */ C(J, {
1239
+ title: /* @__PURE__ */ C(O, { id: "OSlLnz" }),
1240
+ description: /* @__PURE__ */ C(O, {
1241
+ id: "CA8ZeT",
1242
+ values: {
1243
+ imageName: e,
1244
+ visibility: t
1245
+ }
1246
+ })
1247
+ }),
1248
+ autoDismiss: !0,
1249
+ autoDismissTimeout: n.autoDismissTimeout ?? 3e3,
1250
+ onDismiss: n.onDismiss
1251
+ }), ve = (e, t, n) => ({
1252
+ variant: "error",
1253
+ children: /* @__PURE__ */ C(J, {
1254
+ title: /* @__PURE__ */ C(O, { id: "aqagJH" }),
1255
+ description: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(O, {
1256
+ id: "hkjZ7P",
1257
+ values: { imageName: e }
1258
+ }), t] })
1259
+ }),
1260
+ autoDismiss: !0,
1261
+ autoDismissTimeout: n.autoDismissTimeout ?? 5e3,
1262
+ onDismiss: n.onDismiss
1263
+ });
1264
+ //#endregion
1265
+ export { z as A, ve as C, G as D, K as E, j as F, A as I, P as M, M as N, W as O, N as P, Y as S, q as T, ae as _, me as a, $ as b, ce as c, he as d, ne as f, re as g, Z as h, pe as i, F as j, B as k, oe as l, Q as m, de as n, fe as o, ie as p, le as r, se as s, ue as t, ge as u, te as v, _e as w, X as x, ee as y };
1266
+
1267
+ //# sourceMappingURL=ImageToastNotifications-wsQDNEh7.mjs.map